Profile picture for user Amol

Hi,



I wanted to use a custom attribute whose base type is Timestamp. But it seems after applying the value through script (Macro or Report) the attribute does not works like default Timestamp attributes, i.e. it does not converts the time to local time. Here is the testing i did,

My Location : India (GMT +5.30)

ARIS server : Chicago (GMT -6.00)



1. Created an attribute "Test" with base type "Point In Time | Constants.ABT_TIMESTAMP" which holds the value like e.g. "Feb 3, 2012 05:00:00 PM"

2. I wanted to set this attribute to a model with current time.

Suppose my current time is "Feb 3, 2012 05:00:00 PM IST (GMT +5.30)"

3. If I set the value using Macro, it sets the time in GMT 0.00. So the value of attribute becomes "Feb 3, 2012 11:30:00 AM", i.e. -5.30 from my current time, which means my current value was converted to GMT 0.00

var g_Attribute = Context.getArisMethod().UserDefinedAttributeTypeNum("9f67ef70-4e4e-11e1-65d5-005056863358");
var g_Model = Context.getSelectedModels()[0];
var g_LoginInfo = Context.getLoginInfo(g_Model);
Designer.setAttributePersistent(g_Model, g_Attribute, java.util.Date(), g_LoginInfo.getLoginLanguage());

So from my location i see the values

"Test" = "Feb 3, 2012 11:30:00 AM" (seen as GMT 0.00)

"Last Change" = "Feb 3, 2012 05:00:00 PM", (seen in local timezone GMT +5.30)

and if i go to server, and see the value it also shows

"Test" = "Feb 3, 2012 11:30:00 AM" (seen as GMT 0.00)

"Last Change" = "Feb 3, 2012 05:30:00 AM", (seen in server Timezone GMT -6.00)

4. If I set the value using Report (server side script). Report sets the value in server time zone ("Feb 3, 2012 05:30:00 AM") as report is server side script and it runs on server.

var g_Attribute = ArisData.ActiveFilter().UserDefinedAttributeTypeNum("9f67ef70-4e4e-11e1-65d5-005056863358");
var g_Model = ArisData.getSelectedModels()[0];
g_Model.Attribute(g_Attribute, Context.getSelectedLanguage()).setValue(new Date());

After setting the same value through report, I see the values from my location

"Test" = "Feb 3, 2012 5:30:00 AM" (seen as GMT -6.00)

"Last Change" = "Feb 3, 2012 05:00:00 PM" (seen as GMT +5.30)

If I go to server and see values

"Test" = "Feb 3, 2012 5:30:00 AM" (seen as GMT -6.00)

"Last Change" = "Feb 3, 2012 05:30:00 AM" (seen as GMT -6.00)

>

The problem here is, it never works like "Last Change" attribute (which shows the value in respective timezones), instead it seems to be a fixed "Text" value attribute

If I set the value through Macro it will set the value (Your current time or provided time - GMT constant), and if I set the value through Report it will set the value to (Server time). And then you see the value from any location it will show you the same value, instead of value specific to your timezone.

Can't we have an custom attribute with same behaviour like "Last Change" or "Time of Generation". Any help on this will be great. I am using ARIS Server 7.1 SR9.

 

Thanks & Regards,

Amol Patil

by Torsten Haase
Posted on Fri, 02/10/2012 - 13:30

Hi Amol,

there are only 3 time stamp attributes which are time-zone dependent:

AT_CREAT_TIME_STMP

AT_LAST_CHNG_2

AT_TIME_STAMP

For time-zone dependent attributes the report already adds/subtracts the time zone difference (using the client's time zone) before returning a value and before setting a value.

BR,

Torsten

 

0
by Amol Patil Author
Posted on Sat, 02/11/2012 - 16:10

Hi Torsten,

Then i think there is no way we can have more such attributes. Actually, timestamp / date / time attributes should always be timezone dependent. If they are not then there is no difference between text and those attributes data types.

The problem here is, if user has to see those custom attributes then the ARIS designer shows them in server timezone without GMT string, and user might not know the server timezone to do the conversion manually.

So, now I am using text attribute to store timestamp, in which I can store the timestamp with complete GMT string.

Thanks,

Amol Patil

0

Featured achievement

Question Solver
Share your expertise and have your answer accepted as best reply.
Recent Unlocks
  • CR
  • BH
  • Profile picture for user Ivan.Ivanov.softwareag.com
  • Profile picture for user mscheid
  • MS
  • PacMan

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock