MK

Hi Guys

 

PFB the code i have written to get the color of the object

var aObjDefs = oModel.ObjDefList();        

 for (var j = 0; j < aObjDefs.length; j++) {           

 var oObjDef = aObjDefs[i]; 

var ObjColor=aObjDefs[i].getFillColor;

getFillColor doesnt return anything.Could you please tell me how to get the color of the object in

ARIS Report script.

 

Thanks and Regards

Manojna Kadiri

by Jens Heylmann
Posted on Tue, 06/26/2012 - 22:01

Hello Manojna Kadiri,

the class "ObjOcc" has the method "getFillColor". Your code using the object definitions calling "oModel.ObjDefList()". 

Try:

model.ObjOccList ( )

...to get the object occurence list from model.

Greetings,

Jens

0
by Manojna Kadiri Author
Posted on Tue, 06/26/2012 - 22:19

Hi Jens

 

Thanks for your reply.

 

If I have to compare the output of the function getFillColor to a color how do i do it.

 

for eg:

 

var ObjColor=oObjOcc.getFillColor;

if (ObjColor==Constants.C_BLACK)

{

    var k = k+1;

}

 

This doesnt seem to be working.Could you please tell me how to go about it

 

Thanks and Regards

Manojna Kadiri

0
by Ciska de Jager
Posted on Wed, 06/27/2012 - 06:13

Hi Manojna

First of all when you check for the fill color you declare k as a new variable, this might override your counts, also getFillColor should have () at the end, try this and see if it works:

var k =0;

..........

var ObjColor=oObjOcc.getFillColor();

if (ObjColor==Constants.C_BLACK)

{

  k = k+1;  // you can increment by using the following command as well: k++;

}

Ciska

0
by Manojna Kadiri Author
Posted on Wed, 06/27/2012 - 20:11

Thanks a lot Ciska

 

It worked!!!!

 

I have one more question.How do i get the name of the object pertaining to a particular color.

See my code below and suggest for any changes

for (var j = 0; j < aObjOcc.length; j++) {  

 var oObjDef = aObjDef[j];

 var oObjName=aObjDef[j].Name(nLocale);        

 var oObjOcc = aObjOcc[j];

  var ObjColor=oObjOcc.getFillColor();

if(ObjColor==Constants.C_BLACK)

{

     k++;

 

oOutput.OutputLn(oObjname, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT, 10);

}

 

But the above one doesnt give me the correct output.I want the name of the object at that condition when the color equals black becomes true

 

Thanks

Manojna Kadiri

0
by Ciska de Jager
Posted on Thu, 06/28/2012 - 06:21

Hi Manojna

for(var j=0; j<aObjOcc.length; j++) {      

  var oObjOcc = aObjOcc[j];

  var ObjColor = oObjOcc.getFillColor();

  if(ObjColor==Constants.C_BLACK) {

    k++;

    oOutput.OutputLn(oObjOcc[j].getObjDefName(nLocale), "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT, 10);

  }

}

It seems like you are getting confused with the for loop and j which belongs to that specific for loop, e.g var oObjDef = aObjDef[j]; In the for loop you are working through aObjOcc and not aObjDef. If you want to use the object definition of the object occurrence you refer to it as var oObjDef = aOcjOcc[j].ObjDef(); Keep in mind if you have a loop within a loop not to use the same variable - j in this example.

Ciska

 

0
by Manojna Kadiri Author
Posted on Thu, 06/28/2012 - 22:55

Thanks a lot Ciska

 

It is really helping me a lot as iam new to ARIS scripting and finding it difficult to get the correct methods for my requirement

 

Could you please tell me which method i need to use in Reports to get the attributes of the object.

I could get the method for getting model attributes but not object attributes.

 

Thanks once again

 

Manojna Kadiri

0
by Ciska de Jager
Posted on Fri, 06/29/2012 - 10:23

Hi Manojna

Getting the attributes of an object depends on the list you are working with.

If you use Object occurrences then the attribute will be referenced as:

ObjOcc.ObjDef().Attribute(Constants.AT_DESC,g_nloc).GetValue(true)

where Constants.AT_XXX refer to the standard attributes in aris. you will find that API name in the configuration.

If you are wokring with the defintion itself then the command will be:

Object.Attribute(Constants.AT_DESC,g_nloc).GetValue(true)

Object or ObjOcc will be the variable name you give.

Userdefined attribute is always best to declare them as a global variable in order to reference them via a variable name you give, if you will be using it more than once in the script. To decare a custom attribute:

var iCtrlClass = ArisData.ActiveFilter().UserDefinedAttributeTypeNum("GUID of the attribute");

and you can refer to this attribute

Object.Attribute(iCtrlClass,g_nloc).GetValue(true)

So in nutshell when using Object Occurrences

var g_nloc = Context.getSelectedLanguage();

var oObjOcc = ArisData.getSelectedModels()[0].ObjOccList();

for(var i=0; i<oObjOcc.length; i++){

  oOutput.OutputLn(oObjOcc[i].ObjDef().Name(g_nloc), "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT, 10);

  oOutput.OutputLn(oObjOcc[i].ObjDef().Attribute(Constants.AT_DESC, g_nloc).GetValue(true), "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT, 10);

}

When using the definition

var g_nloc = Context.getSelectedLanguage();

var oObjDefs = ArisData.getSelectedModels()[0].ObjDefList();

for(var i=0; i<oObjDefs.length; i++){

  oOutput.OutputLn(oObjDefs[i].Name(g_nloc), "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT, 10);

  oOutput.OutputLn(oObjDefs[i].Attribute(Constants.AT_DESC, g_nloc).GetValue(true), "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT, 10);

}

Hope it helps

Ciska

0
by Manojna Kadiri Author
Posted on Fri, 06/29/2012 - 22:49

Thanks a lot Ciska

You have become my ARIS scripting Guru.

Thanks once again

 

 

0
by Manojna Kadiri Author
Posted on Mon, 07/09/2012 - 18:48

In reply to by bassam_m

Hi Ciska

 

Could you please tell me how do I perform math operations on variables in reports and the methods available for the same.

Thanks and Regards

Manojna Kadiri

 

0
by Ciska de Jager
Posted on Tue, 07/10/2012 - 06:44

Hi Manojna

There is no specific math operations in ARIS, the basic javascript commands for math should all work within the ARIS script, best is to search internet for javascript math oeperations and work through some examples.

Ciska

0
by Manojna Kadiri Author
Posted on Fri, 07/13/2012 - 05:42

Hi Ciska

Thnaks a lot.I just wanted to know where can i get the help for various connection types available in ARIS.

Eg:I want to know what does "technically superior" actually mean.I dont find any help on the connection types available in ARIS.

The above relation holds good between Organisational units and Peron types etc...

I wanted to get the explanation of each connecting type to use them properly in the models.

 

Thanks and Regards

Manojna Kadiri

 

 

0
by Ciska de Jager
Posted on Fri, 07/13/2012 - 16:04

Hi,

Connection types are limited to the from and to objects. If you want more information about relationships, in ARIS, go to Help, Method help or in your ARIS installation directory or CD you will find a PDF file that contains explantion of objects, models, connection types, allowed connection types between objects and so forth.

Ciska

0
by Manojna Kadiri Author
Posted on Fri, 07/13/2012 - 22:06

Hi Ciska

Thanks a lot

 

I have one more question for you.

 

Can you tell me how can i get a list of sourceObjects for a particular target object in a report.

I mean i want the list of objects having a relation to a particular target object in a model.

 

In short how do i check if a particular relation exists between 2 objects ?Is there any method to check the same

The scenario is

Keeping the target Obj constant and looping over the sourceobjects i want to get the count of source objects that has a "belongs to" relation with the target Obj in a given model.

 

Thanks and Regards

Manojna kadiri

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