ARIS - Q&A Session 9:00am CEST
Register
ARIS - Q&A Session 6:00pm CEST
Register
ARIS User Group Netherlands (AGNL)
Register

View all
Profile picture for user jennyj

Hi!

I am creating a script for making sure that the name of the model and one more attribute is always placed in the model, and at the same position.

But I can not find any functionality in the script API that will allow me to check wheter the attributes are already placed in the model. It seems to me like the report class AttrOcc (which would give me those functions) is only available for object attributes. Any one else who has had this problem, or solved it in any other way?

Greatful for any ideas!

by Jens Heylmann
Posted on Wed, 10/19/2011 - 18:03

Hi Jenny!

You're right that's tricky...but look at next example it may help you:

var textOccList = model.TextOccList();
	//check if new AttrOcc is already available
	if ( !isAttrOccAvailable( textOccList, newAttrTypeNum ) ) {
		//not available then do something.....
	}

	function isAttrOccAvailable( textOccList, attrtypenum ) {
		 for(var i = 0; i < textOccList.length; i++) {
			var textOcc = textOccList[i];
			var attrOccList = textOcc.AttrOccList();
			for( var p = 0; p < attrOccList.length; p++) {
				var attrOcc  = attrOccList[p];
			   
				var attrTypeNum = attrOcc.AttrDef( Context.getSelectedLanguage() ).getValue();
				if( attrTypeNum == attrtypenum ) {
					return true;    
				}                   
			}  
		 }
		return false;       
	}

 

0
by Jenny Franze Author
Posted on Thu, 10/20/2011 - 13:28

Hi Jens!

Thank you so much, it works like a charm! :-)

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
  • Profile picture for user freddy
  • Profile picture for user mikhubb
  • Profile picture for user harryratia
  • DC
  • ВА
  • 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