TS

I have been running a script for some time now on different version of ARIS. Recently I migrated to version 9.7/8 and the ARIS script return errors, which previously didn't occur. This is one example of the code I use. This function writes an image of a model to a local path on my client.

function pictureOfModel(oModel, size) {
   var pic = oModel.Graphic(false,false,g_nLoc);
   var myPath = Context.getSelectedPath();
   var sfileName = myPath + oModel.GUID() +  ".png";  //alternatives are GUID() or Name(g_nLoc) + "_" + size +
   ZipfileList.push(oModel.GUID() +  ".png");

//    pic.setZoom(size) // image improvement only(optional)
    if(!logInfo (oModel.Name(g_nLoc))){
     return false;
    }
    
    if(!pic.Save(sfileName)) {
        Dialogs.MsgBox("Could not save " + sfileName);
        return false;
    }
    
    return true;
}

The error I get looks like this:

 

Other errors I get are also from code that try to save to the local system. What is the strategy to save to local files in the ARIS 9.x software?

 

 

 

 

by Bharat Bajaj
Posted on Mon, 07/13/2015 - 08:22

Hello Toine,

Check if you have license to export the xml files. You will need access license to export the content as XML. 

Regards,

Bharat Bajaj

0
by Toine Schijvenaars Author
Posted on Tue, 07/14/2015 - 09:28

Hi Bharat,

I'm allowed to export to XML. I can use this feature using the ARIS client.

Regards,

Toine

0
by M. Zschuckelt
Posted on Tue, 07/14/2015 - 10:29

Hello Toine,

even, if you can use the feature in the ARIS client, if you don't have the "Access" license assigned to you, the result will be encrypted. You can use it to import to another ARIS database, but you cannot access its contents.

Regards, M. Zschuckelt

0
by M. Zschuckelt
Posted on Tue, 07/14/2015 - 10:44

Hello Toine,

on second thought: You are trying to export a model graphic as .png using the script. This should not be encrypted, since you can do that perfectly well in the client with any license and view it in any graphics program. So the flaw should be elsewhere.

Regards, M. Zschuckelt

0
by Torsten Haase
Posted on Wed, 07/15/2015 - 11:01

Hi Toine,

this has nothing to do with Access license or encryption.

Does this report run on a local installation? Only in this case you can be sure that the path returned by Context.getSelectedPath() really exists, because it's a client path and report are executed on the server. So this works only if both are running on the same machine.

Second: You should not use custom file operations in a ARIS 9 server environment. Context object/output object provide all file operations which should be used.

0
by Toine Schijvenaars Author
Posted on Tue, 07/21/2015 - 16:12

In reply to by thaase

Hi Torsten,

I indeed have a client installation. How do i use a context oject/output object in my code above? Do you have an example?

Kind regards,

Toine

0
by Toine Schijvenaars Author
Posted on Wed, 07/22/2015 - 23:01

In reply to by tschijv

I solved it eventually. Indeed by using the context output object. This did the trick

 

function pictureOfModel(oModel, size) {

   var pic = oModel.Graphic(false,false,g_nLoc);

   var sfileName = oModel.GUID() +  ".png";  //alternatives are GUID() or Name(g_nLoc) + "_" + size +

   var output =  Context.createOutputObject();

   ZipfileList.push(oModel.GUID() +  ".png");

//    pic.setZoom(size) // image improvement only(optional)

    if(!logInfo (oModel.Name(g_nLoc))){

     return false;

    }

    

    if(!pic.Save(output, sfileName)) {

        Dialogs.MsgBox("Could not save " + sfileName);

        return false;

    } else {

        Context.addOutputFileName(sfileName);

        Context.setSelectedFile(sfileName);

    }

    

    return true;

}

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