AG

Hi All,

I am new in ARIS scripting.

Please help me on this report.

I created a report using the script wizard for eps type models. I need a report to display objects with visible relation in the model. In the picture below, the visible relations are marked with a red rectangle, objects with they should be displayed in the report. But the script displays objects with all relations. It takes a very long time to remove relations that are invisible on the model. How else can this issue be resolved?

Type and direction of the relationships to be returned:
Constants.EDGES_INOUT: Returns incoming and outgoing relationships
Constants.EDGES_IN: Only returns incoming (passive) relationships
Constants.EDGES_OUT: Only returns outgoing (active) relationships
Constants.EDGES_ASSIGN: Only returns assignment relationships. A link of this constant with EDGES_IN and EDGES_OUT via OR is possible. (Default: Link with EDGES_OUT).
Constants.EDGES_INOUTASSIGN (default): Returns incoming and outgoing relationships and assignment relationships. 

I know about it. All this type return all relationships, but I only need those visible on the model. 

I hope i will get good response from Aris Community .

Thanks in Advance.

                                                                                                                                                                                     

Script code:

function createSection1(p_output, p_aGroup)
{
    //produce one table sheet per section
    if(xlTableActive && isExcel()) {
        p_output.EndTable("", 100, "", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT, 0)
        xlTableActive=false
    }
    p_output.BeginSection(false, Constants.SECTION_DEFAULT)
    setupOutputObject( p_output ) //use defaults
    if( isExcel() ) {
        p_output.BeginTable(100, Constants.C_BLACK, Constants.C_TRANSPARENT,  Constants.FMT_LEFT | Constants.FMT_REPEAT_HEADER, 0)
        xlTableActive=true
    }
    static1_group(p_output, collect(p_aGroup))
    // createSection1 local functions:
    /**
     * @param {Output} p_output The output object
     * @param {Model[]} p_aModel 
    */
    function static1_group(p_output, p_aModel)
    {
        // repetition of queried data:
        for(var i=0; i<p_aModel.length; i++) {
            if( !isExcel() )
                p_output.BeginTable(100, RGB(0,0,0), Constants.C_TRANSPARENT,  Constants.FMT_LEFT, 0)
                p_output.TableRow()
                    p_output.ResetFrameStyle()
                    p_output.TableCell("", 25, getString("ID_DEFAULT_FONT"), 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT, 0)
                    p_output.TableCell("", 25, getString("ID_DEFAULT_FONT"), 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT, 0)
                    p_output.TableCell("", 25, getString("ID_DEFAULT_FONT"), 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT, 0)
                    p_output.TableCell("", 25, getString("ID_DEFAULT_FONT"), 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT, 0)
            if( !isExcel() )
                p_output.EndTable("", 100, getString("ID_DEFAULT_FONT"), 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT, 0)
            else
                p_output.TableRow()
            iteration_group(p_output, ArisData.sort(p_aModel[i].ObjDefListBySymbols([Constants.ST_FUNC]),Constants.AT_ID, nLocale))
        }
        ArisData.getActiveDatabase().clearCaches()

        // static1_group local functions:
            /**
             * @param {Output} p_output The output object
             * @param {ObjDef[]} p_aObjDef 
            */
            function iteration_group(p_output, p_aObjDef)
            {
                // repetition of queried data:
                for(var i1=0; i1<p_aObjDef.length; i1++) {
                    iteration_group1(p_output, p_aObjDef[i1].getConnectedObjs([Constants.OT_PERS_TYPE], Constants.EDGES_IN, null))
                }
                ArisData.getActiveDatabase().clearCaches()

                // iteration_group local functions:
                    /**
                     * @param {Output} p_output The output object
                     * @param {ObjDef[]} p_aObjDef1 
                    */
                    function iteration_group1(p_output, p_aObjDef1)
                    {
                        // repetition of queried data:
                        for(var i2=0; i2<p_aObjDef1.length; i2++) {
                            iteration_group2(p_output, p_aObjDef[i1].getConnectedObjs([Constants.OT_APPL_SYS], Constants.EDGES_INOUTASSIGN, null))
                        }
                        ArisData.getActiveDatabase().clearCaches()

                        // iteration_group1 local functions:
                            /**
                             * @param {Output} p_output The output object
                             * @param {ObjDef[]} p_aObjDef2 
                            */
                            function iteration_group2(p_output, p_aObjDef2)
                            {
                                // repetition of queried data:
                                for(var i3=0; i3<p_aObjDef2.length; i3++) {
                                    if( !isExcel() )
                                        p_output.BeginTable(100, RGB(0,0,0), Constants.C_TRANSPARENT,  Constants.FMT_LEFT, 0)
                                        p_output.TableRow()
                                            p_output.ResetFrameStyle()
                                            p_output.TableCell("", 25, getString("ID_DEFAULT_FONT"), 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0,  Constants.FMT_VTOP |  Constants.FMT_LEFT, 0)
                                        p_output.BeginParagraph( Constants.FMT_LEFT, 0.71, 0.71, 0, 0, 0)
                                        writeData(p_output, p_aModel[i].Name(nLocale))
                                        p_output.EndParagraph()
                                            p_output.TableCell("", 25, getString("ID_DEFAULT_FONT"), 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0,  Constants.FMT_VTOP |  Constants.FMT_LEFT, 0)
                                        p_output.BeginParagraph( Constants.FMT_LEFT, 0.71, 0.71, 0, 0, 0)
                                        writeData1(p_output, p_aObjDef[i1].Name(nLocale))
                                        p_output.EndParagraph()
                                            p_output.TableCell("", 25, getString("ID_DEFAULT_FONT"), 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0,  Constants.FMT_VTOP |  Constants.FMT_LEFT, 0)
                                        p_output.BeginParagraph( Constants.FMT_LEFT, 0.71, 0.71, 0, 0, 0)
                                        writeData2(p_output, p_aObjDef1[i2].Name(nLocale))
                                        p_output.EndParagraph()
                                            p_output.TableCell("", 25, getString("ID_DEFAULT_FONT"), 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0,  Constants.FMT_VTOP |  Constants.FMT_LEFT, 0)
                                        p_output.BeginParagraph( Constants.FMT_LEFT, 0.71, 0.71, 0, 0, 0)
                                        writeData3(p_output, p_aObjDef2[i3].Name(nLocale))
                                        p_output.EndParagraph()
                                    if( !isExcel() )
                                        p_output.EndTable("", 100, getString("ID_DEFAULT_FONT"), 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_LEFT, 0)
                                    else
                                        p_output.TableRow()
                                }
                                ArisData.getActiveDatabase().clearCaches()

                                // iteration_group2 local functions:
                                    /**
                                     * @param {Output} p_output The output object
                                     * @param {String } p_String
                                    */
                                    function writeData(p_output, p_String) {
                                        p_output.OutputLn(p_String, getString("ID_DEFAULT_FONT"), 11, RGB(0,0,0), Constants.C_TRANSPARENT,  Constants.FMT_LEFT, 0.71)
                                    }
                                    /**
                                     * @param {Output} p_output The output object
                                     * @param {String } p_String
                                    */
                                    function writeData1(p_output, p_String) {
                                        p_output.OutputLn(p_String, getString("ID_DEFAULT_FONT"), 11, RGB(0,0,0), Constants.C_TRANSPARENT,  Constants.FMT_LEFT, 0.71)
                                    }
                                    /**
                                     * @param {Output} p_output The output object
                                     * @param {String } p_String
                                    */
                                    function writeData2(p_output, p_String) {
                                        p_output.OutputLn(p_String, getString("ID_DEFAULT_FONT"), 11, RGB(0,0,0), Constants.C_TRANSPARENT,  Constants.FMT_LEFT, 0.71)
                                    }
                                    /**
                                     * @param {Output} p_output The output object
                                     * @param {String } p_String
                                    */
                                    function writeData3(p_output, p_String) {
                                        p_output.OutputLn(p_String, getString("ID_DEFAULT_FONT"), 11, RGB(0,0,0), Constants.C_TRANSPARENT,  Constants.FMT_LEFT, 0.71)
                                    }
                            }
                            
                    }
                    
            }
            
    }
    
    function collect(p_array){
        var result = new Array();
        for(var i=0; i<p_array.length; i++){
            result = result.concat(p_array[i].ModelList(false, [Constants.MT_EEPC]))
        }
        return ArisData.Unique(result)
    }
    p_output.EndSection()
}
 

by Robert Goldenbaum
Badge for 'Question Solver' achievement
Posted on Thu, 04/29/2021 - 09:40

Hi,

well, you have to be on the occurrence level. The marked relationships are those, that exist in THIS model - meaning on the occurrence level.

OcxnOccList = oObjOcc.CxnOccList()

Or .Cxns ( int nInOut, int nStructure )

Regards, Robert

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