YS

Hello all!

I wanna copy all occurrences of objects from EPC to FAD, which TypeNum of icon is 39 (ST_SCRN) and which have a relationships with functions.

But my script has an error.

Tell me please how can I fix this error. May be I have to other function instead "createCopy"?

This is my code:



function f1(){

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

      var oModel = aModels[i];                 

      var aFuncObj = oModel.ObjOccListFilter(Constants.OT_FUNC);   

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

         if(aFuncObj[j].SymbolNum() == 335){                        // Take only functions which SymbolNum == 335 (ST_FUNC)

            var transListFunc = new Array;                         

            var transListFunc = aFuncObj[j].getConnectedObjOccs ( [ Constants.ST_SCRN],  Constants.EDGES_INOUT );

            if (transListFunc.length!=0){                                       

               var gr = GetOrCreateGroup(oModel, "Транзакции");              // Create group "Transactions"

               var fadModel = GetOrCreateModel(gr, aFuncObj[j].ObjDef().Name(1049), Constants.MT_FUNC_ALLOC_DGM); // Create FAD-model which names as function name which have transactions

               aFuncObj[j].ObjDef().CreateAssignment(fadModel);                     

               for( var t = 0; t < transListFunc.length; t++ ) {    // Iterate all transactions, which have relations aFuncObj[j]

                  //This I wanna use function, that copy objects to FAT

                  createCopy ( fadModel, transListFunc[t].OccList() );  // Error: "createCopy" is not defined

               }

            }

         }

      }

   }

}

 

by Yuriy Stolyarov Author
Posted on Mon, 12/17/2018 - 13:51

I've find the way to fix error and solved the problem:

function f1(){

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

      var oModel = aModels[i];                 

      var aFuncObj = oModel.ObjOccListFilter(Constants.OT_FUNC);

      var x = 100;

      var y = 300;   

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

         if(aFuncObj[j].SymbolNum() == 335){         // Take only functions which SymbolNum == 335 (ST_FUNC)

            var transListFunc = new Array;                         

            var transListFunc = aFuncObj[j].getConnectedObjOccs ( [ Constants.ST_SCRN],  Constants.EDGES_INOUT );

            if (transListFunc.length!=0){                                       

               var gr = GetOrCreateGroup(oModel, "Transactions");       // Create group "Transactions"

               var fadModel = GetOrCreateModel(gr, aFuncObj[j].ObjDef().Name(1049), Constants.MT_FUNC_ALLOC_DGM); 

               aFuncObj[j].ObjDef().CreateAssignment(fadModel);                     

               for( var t = 0; t < transListFunc.length; t++ ) {    // Iterate all transactions, which have relations aFuncObj[j]

                  fadModel.createObjOcc(Constants.ST_SCRN, transListFunc[t].ObjDef(), x, y); // <- FIXING

               }

            }

         }

      }

   }

}

 

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