If and Function Modules
From Business Process Management, BPM and Workflow Automation Wiki | BizAgi BPMS
<keywords content="keywords">module, functions, add if, add function, add library rule, how to add an if, how to add a function</keywords>
Contents |
If
This module offers the possibility to add the logic of selecting one of several paths by means of conditionals. The “else” path will always be established.
When this module is chosen, the diagrams corresponding to this expression appear. By default, one path and the Else path are added. More paths can be added by means of the options in the diagrams. The symbols corresponding to the module are illustrated below.
Two figures have options in this module; the Decision diamond and each of the Express Conditions. The following options appear when the user right clicks on the Decision diamond:
Add Condition: allows the user to add alternate paths.
Remove: allows the user to eliminate the entire module, including all the paths.
When the user right clicks on the Express conditions (i.e. the rounded rectangle), the drop down list presents the following options:
Properties: allows the user to edit the condition in the “Entity Expression” window that pops up.
Remove: allows the user to delete the path selected.
How to Add an If
1. Right click on the vertical line of the rule and select the Add If option.
2. Right click on the express condition of the If and select the Properties option to establish its characteristics. The Entity Expression window will then pop up.
3. The If conditions are defined in the Entity Expression window.
a. In the first field, select the object to be evaluated: The combo has the following options:
List of attributes of the Context Entity: allows the user to select any of the attributes in the Context Entity.
Click for further information about Context
Select Attribute: allows the user to select an attribute related to the Context Entity. If the user selects this option, the Select Item window will pop up with a tree for you to choose from.
Write Expression: allows the user to type in an expression directly. If the user chooses this option, a text box will open to the right of the combo for you to type it in.
Select from vocabulary: allows the user to select the “Get” definitions from the vocabulary used in the policies. If the user selects this option, the select item window will appear presenting all the GET definitions of the process selected.
b. If the user chose an attribute from the previous step, another combo will appear presenting several options depending on the type of attribute selected, including:
Attributes/Definitions |
Operators |
Numerical |
Equal, Different, Less Than, Less Than or Equal To, Greater Than, Greater Than or Equal To, Empty, Full. |
Text |
Equal, Different, Empty, Full, Contains, Does Not Contain, Starts With, Does Not Start With |
Boolean |
Empty, Full, Equal to Yes, Equal to No. |
c. If the selection requires the inclusion of another argument, another combo will appear offering the following options:
TypeNumber: Allows the user to enter a constant, only available for numerical attributes.
Type Text: Allows the user to type in a text, only available for string type attributes.
Type Date or Date and Time: Allows the user to enter a constant date or date and time, only available for date type attributes.
Select Field: When the user chooses this option, the Select Item window will pop up with a tree for you to select the attributes of the Context Entity and the attributes related to the Context Entity.
Click for further information about Context
List of Variables: Allows the user to select any of the variables declared in the Start module.
Select Entity Value: Allows the user to select the value of the attribute evaluated when using a parametric entity.
Select definition: allows you to select the “Get” definitions from the vocabulary used in the policies. If you select this option, the select item window will appear presenting all the GET definitions of the process selected.
4. If you need to add another condition, the And button allows you to include it by means of a logical operator "And" or "Or". In the event that the conditions have to be grouped together with parentheses, click on the Link button, which will nest the condition with the one preceding it. To delete conditions, click on the Delete button to eliminate them one at a time.
Example: In the Loan Request process, when the Client of the Request is under 18, the request will be denied. A message will be shown in the user interface to inform the client. |
Function
This module allows the usage of Bizagi functions and Functions created in each project in the rule. Right click on the diagram to display the list of options described below associated with this module:
Edit Description: Makes changes to the name given to the diagram.
Properties: Allows the user to establish the function that the user would like to call on.
Remove: This option allows the user to eliminate the entire module.
How to Add a Function
1. Right click on the vertical line of the rule and select the Add Function option; the Function-Description window will pop up for the user to name the Expression
2. Right click on the Function and select the Properties option to establish its characteristics. The Function window will then pop up.
3. The conditions of this module are defined in the Function window; in the Select Function field, the user will find a tree that classifies the functions. From this tree the user will be able to select the function he is looking for.
4. In the Parameters field, the user will enter the value of each of the parameters required by the function selected.
5. To enter the values, select the parameter and click on the Set Value button. At this point, a new window will pop up for the user to type in the value. It can be a fixed value or the value of an attribute provided that the context of the rule allows access to it.
6. Click on Accept or Apply as necessary.
Note: Remember that several functions can have the same name, but the parameters they require are different. To make sure, look at the description and the parameters shown respectively in the Description and Parameters fields. Remember that if you want to introduce a string type value directly, type it between quotation marks (“”). If the function returns a value, it can be stored in a variable indicated in the Store Result field in variable. Remember that the variable must be declared prior to use. |
Example: In the Loan Request process, a client is allowed to request a limited number of products to the bank. This number is a parameter and is created as a Constant Vocabulary. How ever, to evaluate if a client may continue with a case, the requested products must be evaluated against this number. Since the limit number is a vocabulary the function resolveVocabulary must be used. |
1. Create the vocabulary
2. The rule has the function that resolves the vocabulary and saves it in a variable, in the case, Number.
The list of the functions available in this module is presented here: