Profile picture for user Nique

Hi

We have a lot of Function Allocation Diagram. And for now, we want to place an UD-Attribute on each function-occurance within these diagrams.

All around the report works fine. And now I have an occurcance. But how can I set the attributes displayed for that occurance?

 

Kind regards,

Dominik

by Ellen Gambrell Pelletier
Posted on Thu, 10/11/2012 - 18:19

Hi Dominik - Do you not want to use a template for this? You could create a template just for FADs that has the attribute placements you want and create a simple macro that would set and/or reapply the template every time a user opens a FAD to ensure that the attribute placements you want are shown.

0
by Dominik Jenzer Author
Posted on Mon, 10/15/2012 - 09:01

Hi Ellen,

Thanks for your tip. My manual work was something like this. And I have some strange effects.

I have the attribute placed in the template. When you create a new diagram, all works. When I open an old one, and reapply the template, the most of the settings were applyed. The Icon, the colors etc., but not the attribute placement. When I add the same object again, all is finde - but this is to much of work. So I like to do it by macro.

Or do I have somewhere else any missconfiguration?

0
by Ellen Gambrell Pelletier
Posted on Tue, 10/23/2012 - 18:36

Hi Dominik - sometimes you must clear the current template and then reapply it before it will show the attribute placement.



You could create a simple macro that runs when a model is opened and reapplies the template for you:

main();

function main() {
    var eventType = Context.getProperty("event.id");
    if (eventType == Constants.EVENTID_MODEL_OPENED) {
        var oModels = Context.getSelectedModels();
        for (var i in oModels) {
            var template = Designer.getTemplate(oModels[i]);
            if (template != null)
                Designer.applyTemplate(oModels[i], template);
        }
    }
    return;
}

If you want to use the template to add those attribute occurrences directly, you could do something like this:

main();

function main() {
    var attrType = Constants.AT_DESC;
    var assignedModel = null;
    var eventType = Context.getProperty("event.id");
    if (eventType == Constants.EVENTID_MODEL_OPENED) {
        var oModels = Context.getSelectedModels();
        for (var i in oModels) {
            var oObjOccs = Designer.getOccs(oModels[i]);
            for (var oi in oObjOccs) {
                var addAttrOcc = true;
                if (oObjOccs[oi].getItemKind() != Constants.CID_OBJOCC) {
                    addAttrOcc = false;
                } else {
                    var attrOccs = Designer.getAttrOccs(oModels[i], oObjOccs[oi]);
                    for (var ai in attrOccs) {
                        if (Designer.getAttrTypeNum(oModels[i], attrOccs[ai]) == attrType)
                            addAttrOcc = false;
                    }
                }
                if (addAttrOcc)
                    var newAttrOcc = Designer.createAttrOcc(oModels[i], oObjOccs[oi], Constants.ATTROCC_CENTERBOTTOM, attrType, Constants.ATTROCC_ALIGN_CENTER, Constants.ATTROCC_TEXT);
                var stop = 1;
            }
        }
    }
    return;
}

In this example, I am setting the Description attribute to the center bottom of the object. You would obviously need to change the attribute type, port, alignment, etc. accordingly.

- Ellen

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