LZ

Hello everybody,
I deal with a task to automatize export of some hundreds BPMN 2.0 Collaboration diagrams. I have tried with context option on a model in Aris ( Export -> Export BPMN diagram as a BPMN file...).
   This output is exactly what will be necessary, but such export is fine only for a few models. When I select more models and try to export it according this method one *.BPMN file (as a merge of all selected models) is created.
   I need output each model as a single *.BPMN file (for all selected models). If you know similar functionality, which could be done by one of Aris script reports, it will be good. (source code of "Export BPMN diagram as a BPMN file..." which I could modify will be pefect as well.. ) 

I tried output .xml files, but the structure within <AML> system is not sufficient.

I appreciate every answer/advice,

Thanks.

Libor

by Milan Slivka
Posted on Mon, 03/16/2020 - 05:26

Tested on ARIS Cloud Enterprise (10.0.11.0.1400208)

var oModelInterchange = Context.getComponent("ModelInterchange");
var aSelectedModels = ArisData.getSelectedModels()
for(var nSelectedModel=0;nSelectedModel<aSelectedModels.length;nSelectedModel++){
    var aModelValidationResults = oModelInterchange.validateBpmnDiagramForExport(aSelectedModels[nSelectedModel])
    if(aModelValidationResults.length==0){
        var oExportOptions = oModelInterchange.createExportOptions()

oExportOptions.setLocale(Context.getSelectedLanguage());
        oExportOptions.setModelsToExport(aSelectedModels[nSelectedModel])
            var oModelExportResult = oModelInterchange.startBpmnExport(oExportOptions)
            if(oModelExportResult.isSuccessful()){
                   Context.addOutputFile(aSelectedModels[nSelectedModel].Attribute(Constants.AT_NAME,Context.getSelectedLanguage()).GetValue(true)+".bpmn", oModelExportResult.getFileResult())
            }
    }
}

0
by Libor Zvalo Author
Posted on Mon, 03/16/2020 - 12:51

Thank you Milan for your answer!
I have checked Aris help for such functions you are presenting (in component "ModelInterchange"), great to have some explanations as well. I use a specially transformed EPCs (customized) -> to BPMNs, so I skipped validation part of BPMNs (which supplies BPMN semantic/notation checks, I will test validateBpmnDiagramForExport on selected models later).
My current code:

for (var iSI = 0; iSI < g_aoSelItems.length; iSI++) { 
     var oExportOptions = getExportOptions(xmlExportComp, g_aoSelItems[iSI], _nLoc);   //for each model 
     var sOutFileName   = getValidFilename(g_aoSelItems[iSI].Name(-1) + ".bpmn");      // clean file name from not allowed chars
     var oExportResult  = xmlExportComp.startBpmnExport(oExportOptions);
            
     if (oExportResult.isSuccessful()) {
         Context.addOutputFile(sOutFileName, oExportResult.getFileResult());
     }
            
}

When I compare the output of the report and standard context export result it looks similar, but in the report output, there are more attributes (tags) like "AT_CREATOR", "AT_CREAT_TIME_STMP", "AT_LAST_CHNG_2", "AT_LUSER". Nevertheles, it is ok.

(tested on Aris Architect 10.0.10.1.1447832)

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