Wed, 2023-09-27 16:00

Hi,
Do you have Processes and Functions with Numbers? More human readable than the Identifier?
We do, and this number is also following some hierarchical structure.
So, we have our own Attribute to store this information (formated like nn.nn.nn.nn). You think at the attribute called Structure ID (AT_STRUCTURE_ID)? We first too, but this is only for integer values, we needed a string. Thats the reason why we have a user defined attribute.
But guess what, to fill this attribute, you need a lot of time, you make a lot of faults, it's .....
So, how can this be supported?
Following, I try to explain our solution (seams to work, but is probably not very stable).
Chears,
Dominik
Conceptuatl Solution:
First of all, what is in our DB.
We use Models with Functions (wow ;-). Our Hierarchy is build with Value Chain Diagramms. The lowest level is an EPC Diagramm. Or Numbering is following the hierarchy:
Business Process (nn) contains
Business Cases (nn.nn) contains
Processes (nn.nn.nn) contains
Functions (nn.nn.nn.nn) and Events (nn.nn.nn.nn)
The process number is stored in a User Defined Attribute called structure-ID
Our idea:
In a model, you select a Function/Event, call a macro and this stores the next possible process number in respect of the hierarchy.
How to call the macro:
First of all, you need something, that is very quick to reach. This is a macro, directly placed in the menu bar.
1. create a new macro (e.g. process numbering), available for users
2. choose the context (unforunalty "no context", because we can not set the context to Object Occurances, only to Objects - and this will not work). So train the users, what has to be selected to let the macro run: functions or events
3. the content wil be user defined (for our script)
4. edit the script as described below
5. Configure the macros in the menu "Reporting", select the checkbox for the menus and choos an icon
You will find the icon in the menu-bar just after the "properties"-icon, within the reporting-section. If the icon is greyed, then the selection doesn't match. So, in our case, the icon should allways be there ;-)
6. Use the macro:
6.1 Open a model
6.2 Select the Object (Function or Event) to number
6.3 klick the Macro-Icon
6.4 Repete the steps 2 and 3 and dont forget to save the model at the end
The script in steps:
1. We need the selection
As we get only the SelectedObjOccs, it doesn't matter if the user has selected some other elements as the model or objects itself. But be aware, the user may also select some rules...
2. Only to avoid some error, we go only, if the selection has a least one Occurance
2a. When a user selects more than one object (what is possible), you are not shure, what is the right way to number the selected Occurances. So probably to something to avoid a selection of multiple Occurances and do a message-box
3. Do a call of a report. Because not all needed operations are available in macros, the main work is in a report-script.
So, "FIRM/08942870-cb5d-11e1-4c05-005056b57173" is the GUID of the Report-Script. When you have created your report, take your proper GUID from the report-properties
4. Very important, when the numbering is done, you don't see it in your model. So we have to refresh the model
This is very handy. That means, we refresh a model that is allready open (if not, we will never have a selected Occurance). And because we can only have a selection within the same model, it is enough to get the model from the first selection (selection[0]). This is why we check the length in the step 2.
Full script:
The Report:
First, we need a new report. Don't forget to copy the Identifier to the macro. You will see the Identifier on the first part of the report-properties. And make sure, that the user can't run the report directly. The report should open dialogs and must write the DB.
The context here is object (Function and Event), but this doesn't help for miss-selections as rules.
Actually, I have no idea to prevent running on rules. So the script runs, but does only increment the hwm (high water mark). Probably you have an easy idea? Let me know.
So, lets go directly to the script
1. What are the user defined attributes
We need two of them. One stores the process number in the object, the other stores the so called high water mark in the model. The hwm is the latest number used for numbering.
Please replace the Identifier of both attributes with your identifiers.
2. We need the current language setting to get the right value of the attributes later
3. We need the selection from the macro
The first line gets the data (an Array), the second sorts it. Be aware of the sort criteria
1. Name of the Object
2. ID of the Object
So, if you have selected more than one object, the numbering will be in order of the name, nothing else! Probably this is not what you want, so avoid to have more than one object in the selection (add this in the macro)
4. Lets run the selection
The action will be explained later, in the following parts, I explain to general functions we use.
Some useful functions to manipulate arrays:
This Function returns true, if an Element (aElement) may be found in an Array (aArray).
This Function usese the function above (!) and eliminates duplicity in an array. So every Element will only be once in the array
The Idea is taken from the communUtils.js - so thak you guys.
Lets continue the main work.
In our case, the hierarchy normaly (should) have allready a process number. So we need to add some numbers to it. The next step is, to get the process number from the parent, I call it the prefix.
This is done in a separate function we call later.
1. We need the Object Definition of the Object assigning the Model. We get the Model from the Occurance. Be aware that we get an Array.
2. We run trough the array and will wtore only the process number (as a string) from the parent in a new array
There can be really more than one object as parent. This is possible, when 2 Objects uses the same Model. In our environment, this is not usual and prevent by some other qs-reports. So the following work is a bit shaky.
3. Clean the array and remove duplicity (see the general function above)
4. If we have one Element in our array, I return this, else, I return 0 (this is the shaky part)
So, lets look at the whole function:
We come to the end, we build the action-part
1. We need some information: Prefix, the Model of the Occurance and the HWM of this Model
2. We have to do some consistency things as:
- be shure that hwm has at least 0 if not allready defined
- raise the hwm to the new value (build as incrementing a string-value)
- add a leading 0, because we want to have the numer 01 instead of 1
3. Finaly we
- set the new processnumber build from the prefix and the new hwm
- we "touch" the object, that gives a modification timestamp to the object
- we store the new hwm back to the model, to use it on the next run
This is it. store - run - enjoy and comment it here
Let us also know, if you have any correction or enhancement
Here you have the whole report script
Chears
Dominik
Hi, we faced the numbering problem for many years. The problem with automatic numbering is that it is almost impossible to do that automatically (at least not for our users...). What we have done is to create a Sort object (based on Technical Term) and link that to a Function. This object is used for sorting process steps in reports and we provide a library with a standard set of Sort objects (1, 1.1, 1.2, 2 and so on) for re-use. Because a Function can be re-used in other processs models the number is not the same in all models. In the models an occurrence of the Sort object can be used, so this problem is also avoided. Therefore we decided not to store it in an attribute. Besides that, users that generate a report may not have write priviliges. We faced issues with that in the past, when we used an attribute. So we decided to, besides automatic numbering, add manual numbering in process models.
Unfortunately this solution is a workaround. It would be better if all models in ARIS would contain such an object, so that sorting of objects (of any kind) is not a problem any more. I hope this can be solved in one of the next releases of ARIS.