WY

Hi Community,

I have met a problem when trying to filter object list by Last Change attribute and need your help.

The story is that user want to obtain all objects, like function, cluster/data model and position, which are modified after a specified date. To accomplish this, I plan to create a report which pops up a dialog box asking for the date and then uses this date to filter objects.

However, I found the data type of attribute Last Change(Attribute(Constants.AT_LAST_CHNG_2, nLocale)) is not Date(in javascript) and it doesn't provide method to convert it into Date type. After further study, I got the class of Last Change, AAttributeTimeStampDef.

Does any one know about class AAttributeTimeStampDef? Or know how to convert Last Change to Date?

Thanks in advance.

Regards,

Will

 

 

by Julien Letellier
Posted on Thu, 03/10/2011 - 11:47

Hi Will,

I had the same problem when I was trying to get the attribute "Constants.AT_REL_ON" of a model. I didn't find a solution so I wrote a function to convert the aris date format (which seems to be the german format, at least for me) into JavaScript Date type.

/**
 *  Converts the aris date format into a JavaScript Date type
 */ 
function parseArisDate(arisDate) {
    var newDate = new Date();
    if (arisDate.length() == 10 || arisDate.length() == 19) {
        newDate.setDate(arisDate.substr(0, 2));
        newDate.setMonth(arisDate.substr(3, 2) - 1);
        newDate.setYear(arisDate.substr(6, 4));
    }
    if (arisDate.length() == 19) {
        newDate.setHours(arisDate.substr(11, 2));
        newDate.setMinutes(arisDate.substr(14, 2));
        newDate.setSeconds(arisDate.substr(17, 2));
    }
    return newDate;
}

Hope this little helper is useful. 

0
by Loïc Corbasson
Posted on Thu, 03/24/2011 - 17:11

You can try

oObjDef.Attribute( nAttrTypeNum, g_nLoc ).MeasureValue();

to get a Date object.

 

Report classes AttrTimeDef, AttrTimeStampDef and AttrDateDef – Method MeasureValue

MeasureValue( boolean bRemoveLineBreaks )

Returns the value of the attribute as java.util.Date.

This method is also available in Business Publisher Report.

0
by Julien Letellier
Posted on Fri, 03/25/2011 - 08:42

Thank you! At least now we have some kind of object.

But I still can't convert it into a JavaScript Date object. I tried to parse it with Date.parse(...) but no luck.

0
by Eva Klein
Badge for 'Community Team' achievement
Posted on Fri, 03/25/2011 - 09:31

Hi Julien,

you can get the value of the "Last Change" Attribute (date and time) in this way:

var lastchange = oSelModel.Attribute(Constants.AT_LAST_CHNG_2, g_nLoc).getValue();

I hope this will help you.

Regards

Eva

0
by ravi kiran
Posted on Wed, 08/17/2011 - 10:43

In reply to by Gert_Deschuyteneer

hi eva

how I can get recent change model names

could u tell me

thnks

var g_nLoc = Context.getSelectedLanguage();
var oOutput = Context.createOutputObject(); 
var oSelGroups = ArisData.getSelectedGroups(); 

for(var i=0; i<oSelGroups.length; i++)
    {     var oModels = oSelGroups[i].ModelList(); 
    for(var j=0; j<oModels.length; j++)
    {     var oModel = oModels[j];  
      var description = oModel.Attribute(Constants.AT_DESC,g_nLoc);
        description.setValue("Under review – not yet approved");
     }
    } 

var dReviewError = new Date(); 

var lastchange = oSelModel.Attribute(Constants.AT_LAST_CHNG_2, g_nLoc).getValue();
  
dReview.setMonth(dReview.getMonth() + 24); 
if (dReview < dReviewError ) { 
    sReview = getString("TEXT_REVIEW_EXCEEDED"); 
}  

 

0
by ravi kiran
Posted on Thu, 08/18/2011 - 14:07

In reply to by Gert_Deschuyteneer

 

var g_nLoc= Context.getSelectedLanguage();
var oSelGroups = ArisData.getSelectedGroups(); 
 for(var i=0; i<oSelGroups.length; i++)
    {     var oModels = oSelGroups[i].ModelList(); 
    for(var j=0; j<oModels.length; j++)
    {     var oModel = oModels[j];  
      var description = oModel.Attribute(Constants.AT_DESC,g_nLoc);
        description.setValue("Under review – not yet approved");
      
     }
    } 

hi eva

 ok now i understood

if i changed 10 model descriptions

how can i display last change model names  list

your suggessions are very helpful for me

thanks

0
by Julien Letellier
Posted on Fri, 03/25/2011 - 10:44

Hi Eva,

getting the value of the attribute is not the problem.

I have a report that checks if the last release date of a model was more than 2 years ago, so I can set it for review. So I need to do something like this in JavaScript:

var dReviewError = new Date();

// dReview needs to be a date object, this won't work!
var dReview = oSelModel.Attribute(Constants.AT_REL_ON, g_nLoc).getValue();

dReview.setMonth(dReview.getMonth() + 24);
if (dReview < dReviewError ) {
    sReview = getString("TEXT_REVIEW_EXCEEDED");
}

I solved it using my conversion method above but I'm curious if ARIS provides a function for that.

0
by ravi kiran
Posted on Wed, 08/17/2011 - 09:02

hi julien  i am new of aris tool  i have to listing the name of models were changed

i think u have good idea  could u help me

thnks

 

0
by Uma Rathore
Posted on Thu, 07/10/2014 - 07:57

Hi All,

I am facing one issue while fetching "Last Change" attribute in using aris scripts,:

I am using "var lastchange = oSelModel.Attribute(Constants.AT_LAST_CHNG_2, g_nLoc).getValue();"

line to get the attribute value , I am getting all values correct like date, month, minutes, sec

but in hour value it is automatically reducing its value by 1. For example if last change was done

at 11 AM in report it is giving as 10 AM. I have checked all variable also no subtraction

logic I have implemented.

 

Can anyone help me.

 

 

0

Featured achievement

Rookie
Say hello to the ARIS Community! Personalize your community experience by following forums or tags, liking a post or uploading a profile picture.
Recent Unlocks

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