PH
I'm just about to create an Aris report and need to check whether the symbol of a given object occurrence (the object type is ObjOcc) is equal to defined symbol-constant. There is an attribute constant called "Constants.AT_PEM_SYMBOL_EXCEPT", but unfortunately it doesn't deliver the expected value.

To make my question more clear, I'd like to add a fragment of the report script:

----------------------------------------------------------------------------------------------

for (var i=0;i<arrayOfObjOccs.length;i++)
{
     var objOccSymbol = arrayOfObjOccs[i].ObjDef().Attribute(Constants.AT_PEM_SYMOL_EXCEPT, nLocale).GetValue(false))
     if (objOccSymbol == Constants.ST_FUNC)
      {
         ...   //do something     
      }  //end if
} //next for

-----------------------------------------------------------------------------------------------

I'm unable to use the Model.getObjOccFilter() (or similar functions) because I explicitly need the the content of the Array in the sequence as it is.

  Does anybody know which attribute can be used to determine the symbol of objects or if there's any other possibility?   Thank you in advance for your help!
by Torsten Haase
Posted on Mon, 02/22/2010 - 10:22

Hi Mr. Hess,

it's much easier. The ObjOcc provides access to its symbol directly:

for (var i=0;i<arrayOfObjOccs.length;i++) 
{ 
  if (arrayOfObjOccs[i].getSymbol() == Constants.ST_FUNC) 
  { 
    ... //do something 
  } //end if 
} //next for

-----------------------------------------------------------------------------------------------

If you are not using default symbols but user-defined symbols, you use the method getSymbolGUID() instead of getSymbol().

0
by Philipp Hess Author
Posted on Tue, 02/23/2010 - 08:41

Good morning Mr. Haase

Thank your very much for your answer. You're absolutely right, of course - I see it much clearer now. The way I tried to do this would have implied that every occurrence of an object has the same symbol - what obviously isn't the case...

 

 

 

 

0
by Michael Hubbard
Posted on Tue, 01/12/2021 - 22:23

Wondering if you can help with a problem I am having. I have some very simple code (below) to report (Group or Model focus) Objects on Models including Model Path, Object Path, and Object Type which come from the ObjDefList. Where I am having a problem is I want to include the Object Symbol. I get the Symbols using the ObjOccList.

The problem is the Object Symbols are in a DIFFERENT ORDER than the Object Name and Type.

Is there are way to do this correctly? I have been doing a lot of searching and trying different things without success. Thanks.

var output = Context.createOutputObject();

main();

function main() {
    output.BeginTable(150, Constants.C_BLACK, Constants.C_WHITE, Constants.FMT_LEFT | Constants.FMT_ITALIC, 0);
    
    output.TableRow();
    output.TableCell("Model Path", 75, "Arial", 10, Constants.C_BLACK, Constants.C_LIGHT_BLUE, 0, Constants.FMT_LEFT | Constants.FMT_BOLD, 0);
    output.TableCell("Model Name", 25, "Arial", 10, Constants.C_BLACK, Constants.C_LIGHT_BLUE, 0, Constants.FMT_LEFT | Constants.FMT_BOLD, 0);
    output.TableCell("Object Path", 75, "Arial", 10, Constants.C_BLACK, Constants.C_LIGHT_BLUE, 0, Constants.FMT_LEFT | Constants.FMT_BOLD, 0);
    output.TableCell("Object Name", 50, "Arial", 10, Constants.C_BLACK, Constants.C_LIGHT_BLUE, 0, Constants.FMT_LEFT | Constants.FMT_BOLD, 0);
    output.TableCell("Object Type", 25, "Arial", 10, Constants.C_BLACK, Constants.C_LIGHT_BLUE, 0, Constants.FMT_LEFT | Constants.FMT_BOLD, 0);
    output.TableCell("Object Symbol", 25, "Arial", 10, Constants.C_BLACK, Constants.C_LIGHT_BLUE, 0, Constants.FMT_LEFT | Constants.FMT_BOLD, 0);
    
    var oModels = getRelevantModels();
    for(var x = 0; x < oModels.length; x++)
    {
        var groupPath = oModels[x].Group().Path(Context.getSelectedLanguage());
        var modelName = oModels[x].Name(Context.getSelectedLanguage());
        var cModel = oModels[x];                                                 // Current model   
        var aObjDefs = cModel.ObjDefList();                             // All object definitions that have occurrences in the model
        var ObjOcc = cModel.ObjOccList();                                        // Occurrences of All Object on model
        for (var j = 0; j < aObjDefs.length; j++)                                // Loop through the object definitions
        {
            var oObjDef = aObjDefs[j];                                                                          // Current object definition
            var sObjName = oObjDef.Name(Context.getSelectedLanguage());          // Name of current object
            var sObjPath = oObjDef.Group().Path(Context.getSelectedLanguage())   // Group/Path of current object
            var sObjType = oObjDef.Type()                                                               // Type of current object
            var sObjSym = ObjOcc.SymbolName()                                                  // Default Symbol of current object 
            output.TableRow();
            output.TableCell(groupPath.replace("Main group\\", ""), 75, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT, 0);
            output.TableCell(modelName, 25, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT, 0);
            output.TableCell(sObjPath, 75, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT, 0);
            output.TableCell(sObjName, 50, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT, 0);
            output.TableCell(sObjType, 25, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT, 0);
            output.TableCell(sObjSym, 25, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT, 0);
        } // for (var j...Object definitions
    }     // for (var x...Models
    
    output.EndTable("Model Object Occurrences", 100, "Arial", 10, Constants.C_BLACK, Constants.C_BLACK, 0, Constants.FMT_LEFT | Constants.FMT_ITALIC, 0);   
    output.WriteReport();
}

function getRelevantModels() {
    var selectedModels = ArisData.getSelectedModels();
    if (selectedModels.length == 0) {
        var selectedGroups = ArisData.getSelectedGroups();
        for (var i = 0; i < selectedGroups.length; i++) {
            var oRelevantModels = selectedGroups[i].ModelList(true);
            if (oRelevantModels.length > 0) {
                selectedModels = selectedModels.concat(oRelevantModels);
            }
        }
    }
    return selectedModels;
}
    
// Reads all Object Occurrences linked to these objects
// @param {Object} oObjectDefList The object definition list
//
function collectObjOccs(oObjectDefList){
    var result = new Array();
    for(var i=0; i<oObjectDefList.length; i++){
        result = result.concat(oObjectDefList[i].OccList())
    }
    return ArisData.Unique(result)
}

0
by M. Zschuckelt
Posted on Wed, 01/13/2021 - 08:24

var aObjDefs = cModel.ObjDefList();                             // All object definitions that have occurrences in the model
        var ObjOcc = cModel.ObjOccList();                                        // Occurrences of All Object on model
        for (var j = 0; j < aObjDefs.length; j++)                                // Loop through the object definitions
        {
            var oObjDef = aObjDefs[j];

At this point do not take the Occ-List of the model. Remember that some objects might have multiple Occs in the model.

var aObjOccs = oObjDef.OccListInModel(cModel);

Now you can iterate the Occs of the Object to find all Symbols of the object in the model. If you are lucky, it's always the same.

Your code comment suggests though, that you are looking for the default symbol of the object. That is not part of the Occ, but the objDef. You get it via

oObjDef.getDefaultSymbolNum();

Side note: You get better visibility, if you do not reply to 11-year-old posts, but create a new one.

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