Profile picture for user ismail29033

Hi guys, I'm an ARIS scripting noob (bout a month) and I'm required to write a report for any EPC model that lists the objects in the model according to the order in which they occur in the model.



for example the desired output for this model:

 

if all I print is the Object name for each object, is this:

Approved app received from Vision

Update app on C2

Agent contact customer to take up product

interest rate monthly repayment calculated

Agents make customer offer

OR rule

PATH SPLIT

path1

NONE

path2

Customer Negotiate term limit

PATH UNIFIED

In-store Card Product

PATH SPLIT

path1

Product created on C2

Product data with new rates, flag sent to vision

path2

Preagreement updated and sent to printer?

=========================================================================





now when I read the objects in from the model using the method 'currentModel.DFSGetNextNode();' I might get that exact output, but as soon as I run the report on a different maybe more complicated model, I get the kind of output where as soon as one "path" splits into two more, the objects come in an unpredictable order.



can anyone tell me how I would go about reading the objects in in the order in which those arrows flow?



We've been stuck with this for a very long time now and since almost no1 on the internet (developers) discuss ARIS scripting I don't have access to a very broad spectrum of expertise online.

can anyone help me with this please?

 

by David Tse
Posted on Wed, 12/05/2012 - 21:01

Hey Abdul,

Rather than attempting to find and create the forks and joins I produced a report that goes through each path and displays those paths seperately. The only time a fork or join happens is when an event occurs so we know those are the pivotal points in a process map.

Here is the recursive code that goes through and finds all the available paths and adds those paths into an array.

//path is an array
//This function goes through all the nodes recursively, creating the path accordingly
function find_paths(model, curObjOcc, path)
{
    var children = model.GetSuccNodes(curObjOcc);
    var isCycle = false;
    
    for (var i=0;i<children.length;i++)
    {
        //We need to see if the children link back to a node that already exists in the path
        //This will remove the cycles that may exist
        for (j=0;j<path.length;j++)
        {
            if (path[j] == children[i])
                isCycle = true;
        }
    }
    
    if (children.length == 0 || isCycle)
    {
        //Push this completed path into all Paths
        var tmpPath = new Array()
        tmpPath = tmpPath.concat(path);
        allPaths.push(tmpPath);
        tmpPath = null;
        return;
    }
    for (var i=0;i<children.length;i++)
    {
        if (children[i] != curObjOcc && !isCycle)
        {
            path.push(children[i]);
            find_paths(model,children[i],path);
            path.pop(); //This pops out the children we added, since it's recursive should always be last one
        }
    }
}
0
by Abdul Ismail Author
Posted on Thu, 12/06/2012 - 08:56

Hi David,

how're you doing? thanks man! I've also got a recursive function, but I think there maybe something wrong with the function or how I'm working with those object outside of the function, I even have the same concepts/variable names as you!

Great minds...

I'll use this function and get back to you ;)

0
by Abdul Ismail Author
Posted on Thu, 12/06/2012 - 11:44

Hey David

thanks for that function man, really helped with the headache our guys have been sitting with for a while now, I just have to adapt it to the way the users want the output to be formatted in.



Thanks so much man, didn't have to do anything to that function, just create the global var allPaths, well done!

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