SO

Hi,

I want to create a EPC Row display model from a EPC model and place the functions against there respective work roles based on connection type in various swimlanes or rows.

 

Can any one suggest how this can be done or which particular functions can be used to add rows / swimlanes in a EPC row display model.

 

Thanks in advance.

by Torsten Haase
Posted on Thu, 03/27/2014 - 11:34

Hi Sunil,

you can either create a EPC Row model from scratch, create all lanes with the correct size and place the occs into it. (because report cannot create/move lanes if the model has any content). This is only the second best solution...

The best way would be to use model generation. Starting from an EPC, your code could look like the following:

function generateRowModel(oModel)
{
    var modelGeneration = Context.getComponent("ModelGeneration")
    if(modelGeneration!=null)
    {
        var options = modelGeneration.createModelGenerationOptions();
        options.setExpandModelDepth(0)
        options.setExpandModelDepthForProcesInterfaces(0)
        options.onlyCxnsWithOccs(true)
        options.multipleOccs(true)
        options.hideProcessInterfaces(false)
        
        var models = ArisData.createTypedArray(Constants.CID_MODEL)
        models.push(oModel)
        
        modelNewRowEPC = modelGeneration.generateModel(models, oModel.Name(g_nLoc),Constants.MT_EEPC_ROW, oModel.Group(), options)        
        if(modelNewRowEPC!=null)
        {
            modelNewRowEPC.setAttrOccHandling(Constants.ATTROCCHANDLING_BREAKATTR)        
            return modelNewRowEPC;
        }
    }
    return null; //model generation failed
}

BR, Torsten

0
by Sunil Oza Author
Posted on Thu, 04/03/2014 - 04:49

In reply to by thaase

Hi Torsten,
Thanks for reply. But i am using aris 7.1 and the method createTypedArray is not available in arisdatat for me.

Also if you can suggest how we can add objects and connections to the respective lanes.

For example. In an epc if a workrole has a is responsible for relationship with activity function we will create a lane with name of work role and connection type I.e. active name of connection.

All the work roles having same type of relationship will be placed in this lane only. Similarly for other work roles and connection combination.

Can you please suggests how this can be done.

Thanks in advance.
Sunil Oza

0
by Toven B
Posted on Mon, 04/07/2014 - 07:37

Hi Sunil,

Refer this code.

Create EPC and delete/create vertical, horizontal lanes.

 

function main() {
    var nLocale = Context.getSelectedLanguage();    // Selected database language
    var aGroups = ArisData.getSelectedGroups();     // Selected Group
    var sModelName = "Text EPC Row Display";        // EPC Model Name
    
    var result = createOrGetModel(aGroups[0], sModelName, Constants.MT_EEPC_ROW, nLocale);
}

function createOrGetModel(cGroup, sModelName, cModelTypeNumber, nLocale) {
    var aDatabase = ArisData.getActiveDatabase();
    var aSearchItem = aDatabase.createSearchItem(Constants.AT_NAME, nLocale, sModelName , Constants.SEARCH_CMP_EQUAL, false,  true) 
    var aModelList = cGroup.ModelList(false, [cModelTypeNumber], aSearchItem);
        
    var rModel = null;
    var aModel;
    
    // get existing model
    for (var i = 0; i< aModelList.length; i++){
        aModel = aModelList[i];
        if (aModel.Attribute(Constants.AT_NAME, nLocale).getValue() == sModelName) {
            rModel = aModel;
            break;
        }
    }

    // create model if same model is not existed.
    if (rModel == null) {
        rModel = cGroup.CreateModel(cModelTypeNumber, sModelName, nLocale);
        rModel.changeFlag(Constants.MODEL_RIGHT_ANGLED_CXNS, true);
        rModel.changeFlag(Constants.MODEL_HSYMBOL_OFF, false);
    }
    
    // Count swimlanes in Model
    var VLaneList = rModel.GetLanes(Constants.LANE_VERTICAL);
    var HLaneList = rModel.GetLanes(Constants.LANE_HORIZONTAL);
    
    // delete last vertical lane
    rModel.deleteLane(VLaneList[VLaneList.length-1]);
    // Add 2 vertical lanes 
    for(var i=0; i<2; i++) {
        // add Organization Elements/Application system Type Lane
        rModel.createLane(Constants.LT_ORGELEM_APPSYS, Constants.LANE_VERTICAL);
    }
    // delete horizontal lanes 
    for (var i=HLaneList.length; i>2; i--) {
        rModel.deleteLane(HLaneList[i-1]);
    }
    // add 2 horizontal lane
    for(var i=0; i<2; i++) {
        // add Carries out/Supports Type Lane 
        rModel.createLane(Constants.LT_EXEC_SUPP, Constants.LANE_HORIZONTAL);
    }    
//    if (rModel != null && rModel.IsValid()) 
//        resModel.setTemplate (getTemplateGUID(), true);
}

main();

 

BR, Toven

 

0
by Alexey Shmonov
Posted on Mon, 07/21/2014 - 17:06

Hi

 

Thanks for example!

I've read from help that for deleteLane model is supposed to be empty.

So, do you know any other way to delete empty horizontal lanes if there are some objects on model (not in these lanes)?

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