compress Customised audit rules for own module

1 year 6 months ago #4447 by ua138
Hello everyone,

Does anyone know if it is possible to create customised rules for a specific module in order to audit customised stereotype properties? For example, let us supose that I have my own stereotype:

<Stereotype name="CustomStereotype" metaclass="Class" is-hidden="false" label="%CustomStereotype.label" uid="b3ad2321-46a7-463a-ba7f-b60f82e40c37">
                <Icon path="res/icons/myicon_16.png"/>
                <Image path="res/icons/myicon_16.png"/>
                <TagTypes>
                    <TagType name="TagLowBound" uid="383a7f35-f28e-4089-b40c-12beb6be4f62" label="$CustomStereotype.properties.lowbound" parameter-card="1" is-hidden="false" is-signed="false"/>
                    <TagType name="TagUppBound" uid="d55233cf-043e-40fc-b273-dcd5c8dd6494" label="$CustomStereotype.properties.uppbound" parameter-card="1" is-hidden="false" is-signed="false"/>
                </TagTypes>
            </Stereotype>

As it can be observed, the stereotype of this example has two properties Low Bound and Upp Bound. Let us also supose that I want these properties to be always between 25 and 50. Meaning that if the user inserts a lower bound value that is lower than 25 or an upper bound value that is higher than 50, the model would be considered as incorrect.

To solve this problem, one can try to handle the model changes as suggested here . But when having many stereotypes and similar rules, it can be a really unpleasant and confusing experience for the user. I would like to know if it is possible to create my own rules, so that the user can see all the errors in the model, and solve them in a more elegant way. And if there is such a way, can someone kindly provide me some more information about how to do it?

As far as I have been able to find, there are some instructions on how to audit the elements. Neverhteless, I still cannot find some information on custom rules. I imagine there should be a class somewhere I could extend and customise, and then some way of adding it to the modelio rule services?

Thank you very much in advance.

Please Log in or Create an account to join the conversation.

1 year 6 months ago #4448 by pan
Hello ua138,

It is not possible to customize the audit rules for modules.

I think the best way would be for you to implement your own audit specific to your module.

Please Log in or Create an account to join the conversation.

9 months 1 week ago - 9 months 1 week ago #4875 by ua138
Hi pan,

How would you suggest I should create my own audit? Do the modelio module development libraries provide some sort of classes I can use? or is this something I would need to be creating from scratch?

Thank you for your help.

Please Log in or Create an account to join the conversation.

9 months 1 week ago #4877 by pan
Hi ua138,

Exactly you have to implement your own audit. It is not possible to extend the Modelio audit system.
Please note that it is possible to listen model modifications. Depending on these modifications, you can launch some model checks and launch your own audit. You can create your own audit tab

This page can help you for understanding the listener mechanism:
forge.modelio.org/projects/modelio3-modu...wiki/model_listening

Do you need more information?

Please Log in or Create an account to join the conversation.

8 months 3 weeks ago #4918 by ua138
Thanks for your response pan. Could you please give me a hint on how can I create a custom tab using a modelio module? I understand how can I do it with the property pages, but is it possible to add an additional tab?

Thanks again

Please Log in or Create an account to join the conversation.

8 months 3 weeks ago #4930 by pan
Hi ua138,

This page forge.modelio.org/projects/modelio3-modu...module_property_page explains how to create a property page. Instead of creating a class implementing IModulePropertyPage, you can create a class implementing IModulePropertyCustomPanel. As an exemple you can see ElementFormPropertyPanel which implements IModulePropertyCustomPanel.
IModulePropertyPage and IModulePropertyCustomPanel inherit from IModulePropertyPanel . So you can create a customized panel.

Please Log in or Create an account to join the conversation.

Moderators: tmachmaab
Time to create page: 0.046 seconds
^ Back to Top