YD

Hello Community, I have encountered a problem by generation of the report. I have built a dialog box to let the user choose short or long version of report and then the report will be generated according to the version requirement. However, my report can not be generated every time after the dialog box jumps out. If I delete the dialog box there won't be any problem. Does anyone encounter the similar problem? Besides, I would also want to know if it's possible to build a dialog box without ok and cancel button? Thank you very much!

Here are the code to call the dialog and the generation of the report

function main() {   

    //Read active Databasename

    //Dialogs.MsgBox(g_mmodellist);

    var ofilter = ArisData.getActiveDatabase().ActiveFilter();

    //Dialogs.MsgBox(ofilter)

    g_nloc = Context.getSelectedLanguage();

    //selectedModelsStringList = ArisData.getSelectedModels();

    readActiveDatabaseName();  

    getprofilesfromconfig();

    

    //Show the dialog

    try {

    report_mask();

    }

    catch(err) {

    //tselectedprofile.sname = "SFS_2";

    }

   

    //Test-  

    readconfigfile();

    //readmodels()

   /* if (version == "short"){

        

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

            Dialogs.MsgBox("Choose short");

            model = selectedModelsStringList[i];

            

            for each (var lang in ArisData.getActiveDatabase().LanguageList()) { 

            executeReport(tselectedprofile.sreportguidshort, model, model.GUID()+"_"+lang.LocaleInfo().getLocale()+"_"+model.Attribute(AT_VERSION, -1).getValue()+"_"+model.Attribute(Constants.AT_NAME, lang.LocaleId()).getValue()+".pdf", Constants.OutputPDF, lang.LocaleId())      

       } }

    }*/

    

        if (version =="short"){

    Dialogs.MsgBox("Test1");

    for each (var model in ArisData.getSelectedModels() ) {

                for each (var lang in ArisData.getActiveDatabase().LanguageList()) { 

                    if (lang.isDefault()){ 

                    var GUID_number = tselectedprofile.sreportguidshort;

                    Dialogs.MsgBox("Test2");

                    executeReport(GUID_number, model, model.GUID()+"_"+lang.LocaleInfo().getLocale()+"_"+model.Attribute(AT_VERSION, -1).getValue()+"_"+model.Attribute(Constants.AT_NAME, lang.LocaleId()).getValue()+".pdf", Constants.OutputPDF, lang.LocaleId())

                    Dialogs.MsgBox("Test3");

                }}

    

    }

    

    }

        

    if (version =="long"){

        executeReportAttributeWithGUID(reportGUIDAttTypeNum, model, reportName, outputFormat, lang)

    }

    

   

}

 

Setting of my dialog box

function report_mask()

{

    

    var lreturn = 0; 

    

    var userdialog = Dialogs.createNewDialogTemplate(500, 200, "option box", "select_properties");

    userdialog.GroupBox(100, 50, 300, 100, "Version", "GroupBox");

    userdialog.PushButton(120, 100, 100, 20, "short","0_short");

    userdialog.PushButton(260, 100, 100, 20, "long","0_long");

   

    var dlg = Dialogs.createUserDialog(userdialog); 

    lreturn = __toLong(Dialogs.show( __currentDialog = dlg));

        

    if (lreturn != -1) {

        Context.setScriptError(Constants.ERR_CANCEL);

        return;

    }

}

function select_properties(dlgitem, action, suppvalue) {

    var __functionResult = false;

   

    var lselectedprofile = 0; 

    

    switch(action) {

        case 1:

        tselectedprofile = g_sprofiles[0];

        break;

        

        case 2:

        if (dlgitem == "0_short") {

            version = "short"

           // __functionResult = true;

        }else if(dlgitem == "0_long"){

            version = "long"

            //__functionResult = true;

        }

        

              

        break;

        case 3:

        break;

        case 4:

        break;

        case 5:

        rem(select_properties == true);

        // Leerlaufaktionen einholen fortfahren

        break;

        case 6:

        break;

    }

    

    return __functionResult;

}

 

 

by Kay Fischbach
Posted on Mon, 01/21/2019 - 12:54

Seeing this way of building a dialog, I'm glad I only started with dialogs with the new dialog method ("Dialogs.showDialog(...)"). If you are using an ARIS version capable of the new dialog method, maybe you could re-create your dialog with the new method? The methods you use are deprecated in my version of ARIS (10 SR3), maybe in yours too? Maybe that's what is causing the problem? The new method to build dialogs is more structured, with clear lifecycle phases of the dialog.

Take a look at the script documentation (from your ARIS Architect click the question mark in the top right corner, on the following website select "ARIS Script"). There in the left panel ("Contents") you want to select "ARIS Script" > "Methods for reports and semantic checks" > "Global objects" > "Dialogs object" > "DialogObject"). This should bring up an example script in the right panel for how to build and display a dialog with the new method.

 

Detached from whether or not you can use the new method, have you tried debugging your script? It would be interesting to see the value of the variable "version" when you make the decision between the short and the long version. This would allow you to differentiate between an error in your follow-up scripts, or in the dialog.

0
by Ye Ding Author
Posted on Mon, 02/11/2019 - 16:26

I think that's a problem to do with the old dialog method.

I have tried the new dialog method and it works.

Thank you very much for your reply!

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