KM

Hi all,

ich have the problem that i wrote an report which reads all objects of my prozessmodell but ist dosent sort and filter and i don´t know what to do.

In detail: I have an prozessmodell and i only need the "Function" objects for my report and have to sort them subject to the Y-position.

Could somebody help me?

Here is my Code which reads the Objects.

 

function objects(){

          aObjDefs = oModel.ObjDefList();

          var sObjName;

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

                  var oObjDef = aObjDefs[j];             

                  sObjName = oObjDef.Name(nLocale); 

//                  if(oObjDef.AttrType == "Function"){

                    oOutput.TableRow();                    

                    oOutput.TableCell("Call " + sObjName, 50, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT | Constants.FMT_VTOP, 0);

//                  }

           }         

}

 

 

by Klein Mattes Author
Posted on Wed, 12/19/2012 - 08:41

Hallo Ms. Deepti Lad,

thank you for your answere.

I tryed as you said, but it didn´t work.

One point i finished.

I could now sort out all objects, which are no "Functions".

My new Code is:

var nLocale=Context.getSelectedLanguage();

var oOutput = Context.createOutputObject();

var aModels = ArisData.getSelectedModels();    

var oModel;

var aObjDefs = ArisData.getSelectedObjDefs();;   

function objects(){

          aObjDefs = oModel.ObjDefList();

          var sObjName;

          var type

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

                  var oObjDef = aObjDefs[j];             

                  sObjName = oObjDef.Name(nLocale);  

                  type = oObjDef.Type();

                  if(type == "Function"){

                    oOutput.TableRow();                    

                    oOutput.TableCell("Call " + sObjName, 50, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT | Constants.FMT_VTOP, 0);

           oOutput.TableCell("", 50, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT | Constants.FMT_VTOP, 0);

                  }

           }         

}

function main(){

    objects()

    oOutput.WriteReport();

}



main()

 

 





The only thing I need ist now to sort the "Functions" I get.

I know that it is "aObjDefs = ArisData.sort(aObjDefs, Constants.SORT_Y, nLocale);" but it  doesn´t work.

Could somebody tell me why?





Regards

Klein

 

0
by Jens Heylmann
Posted on Wed, 12/19/2012 - 10:24

Hello Klein,

to sort your objects with the y-position criterium, you have to use the occurences and not the definitions. Because only the occurences have the property "y-position".

e.g.

Instead of using 

var aObjDefs = oModel.ObjDefList();

use:

var aObjOccs = oModel.ObjOccList();

To sort: 

aSortedObjOccs = ArisData.sort(aObjOccs, Constants.SORT_Y, nLocale);

BTW:

To check if a object definition is a function use the object type number e.g. 

if( objDef.TypeNum() == Constants.OT_FUNC  ) {
        //do somthing with the function object  
 }

 

Regards,

Jens

 

0
by Klein Mattes Author
Posted on Thu, 12/20/2012 - 11:56

Hello Heylmann,

thank you very much for your help.

This is my solution:



function objects(){

          aObjOcc = oModel.ObjOccList();

          var aSortedObjOcc = ArisData.sort(aObjOcc, Constants.SORT_Y, Constants.SORT_X, nLocale);

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

                  var oObjDef = aSortedObjOcc[j];              

                  if(oObjDef.ObjDef ().Type() == "Function"){                  

                        oOutput.TableRow();                   

                     oOutput.TableCell("Call " + oObjDef.ObjDef().Name(nLocale), 50, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT | Constants.FMT_VTOP, 0);

                        oOutput.TableCell("", 50, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT | Constants.FMT_VTOP, 0);

                  }

           }         

}

0
by Rahul Nagar
Posted on Tue, 01/22/2013 - 08:26

Hi Klein,

 

Alternatively you can write your code as below.

 

function objects(){

          aObjOcc = oModel.ObjOccListFilter(Constants.OT_FUNC);

          var aSortedObjOcc = ArisData.sort(aObjOcc, Constants.SORT_Y, Constants.SORT_X, nLocale);

//        var aSortedObjOcc = ArisData.sort(aObjOcc, Constants.SORT_GEOMETRIC, nLocale);

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

                  var oObjDef = aSortedObjOcc[j];              

                 oOutput.TableRow();                   

                     oOutput.TableCell("Call " + oObjDef.ObjDef().Name(nLocale), 50, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT | Constants.FMT_VTOP, 0);

                        oOutput.TableCell("", 50, "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT | Constants.FMT_VTOP, 0);

           }         

}

 

By using 'ObjOccListFilter' you can specify the typenumber of the Function object and you will have the list of Function objects only and hence you can omit the check if the object type is 'Function'. 

Also, for sorting you can use Geometric sort, as specified on the commented line in the above code snippet.

 

Regards

Rahul

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