All product information in wiki.bizagi.com is only valid for Bizagi BPM Suite 9.1.X.
For newer Bizagi BPM Suite versions (10.X and up) please visit the User Guide.
 

Function

From Business Process Management, BPM and Workflow Automation Wiki | BizAgi BPMS

Jump to: navigation, search

<keywords content="keywords">function, expression, business rule, library rule, create function, call function, return type, parameter, parameter list, custom functions, user interface functions, user functions, functions, tool functions</keywords>

Contents

User Interface Functions

Bizagi has the capability to create reusable functions in the projects. These functions receive parameters and are able to return a value. They are executed from the regular expressions (Expression Rules) used in Bizagi.

Bizagi also includes some predetermined functions that may be used from the expressions. For more information about them go to:


How to Create a User Interface Function

1.In the Bizagi menu, go to the Tools tab then click on the Functions button as presented below.



2.A window will pop up for the user to manage the functions created for the projects. In this window the user is going to be able to add, remove, or edit the functions that have been created. Click on the Add button to create a function.



A window will be available for the user to create the function.



Each of the fields in the figure above will have the following purpose :

Name: type in the name of the function. It can be up to 15 characters and should have no special characters, such as spaces, accents or symbols.

Suggestion: choose a name to represent the formula properly.

Display Name: enter the name you would like to appear on the lists from which selections are made to make associations (for instance, actions, conditional transitions).

Context Entity: the entity at the starting point from which the function is evaluated or executed.

Description: type in the information describing the function. This is done so that when you read the description, you will understand the objective of the rule.

Return Type: only enabled for Functions. It allows you to determine the type of data to be returned in the function, which can be an object, a whole number (int), a string, a decimal (double) and DateTime.

Parameter List: only enabled for Functions. When you click on this button, the List of Parameters window pops up.


Image:Bulletrojo.gif To add the parameters that are going to be received by the function click on Image:Business_Rules9_Image015.jpg



This is the screen that will appear:



To add new parameters to the list follow these steps:

1.Click on the New Parameter button, and a new row will appear to include the parameter's description

2.Type in the name for the variable in the Name field.

3.Type in the Description of the variable.

4.Select the type of data (Data Type) in the drop down list. It can be DateTime, decimal (double), whole (int), object (object), boolean (true or false) and string.

Note: In the execution rule editor, when calling on a function module in the selection form of the rule, the user can create a new rule using the link “Click here to create a new function”.



Image:Bulletrojo.gif Follow the instructions below to delete parameters:

1. Select the row of the variable you would like to delete.



2. Press the Delete key in your keyboard and click on Yes in the window that pops up.


Example of a User Interface Function

Example: To be able to facilitate the change and the administration of the policies of the Loan Request process, a Parametric entity was created containing the parameters used in the organization’s policies. For example, the amount requested for the loan that requires a Loan Analysis, Maximum expenses for women and men, etc.

There can be several Parameter entities. In this case, the Parameter with the loan limit value that requires authorization is in the Loan Parameter Entity. This entity has one attribute for each parameter, bearing in mind the data type.


This is how the parameter entity looks like in the web application:




This is how the parameter entity looks like in the data model:

Image:Business_Rules9_Image019.jpg


This is how the function should look like to complete the expected objective, together with the parameters needed.



This is the detail of what should be included inside the Expression Get given parameter value.


Image:Business_Rules9_Image021.jpg


Me can also be used in the functions. Me will enable the function to identify the case number that is being executed to get the information the function may require to complete its task. To do so, the Me is used as an object type parameter in the function and it is sent from the expression that calls on it. This parameter is created by default when you create parameters in the library rule.


How to Call on a User Interface Function

1. Once you have created the Function, create an Expression to call on it. Right click on the arrow and select Add Function. A window to fill the description will be available afterwards.



Right click on the function figure as shown below to display the list of options described below associated with this module:

Image:Bulletazul.gif Edit Description: Makes changes to the name given to the diagram.

Image:Bulletazul.gif Properties: Allows you to configure the function to be called on.

Image:Bulletazul.gif Remove: This option allows you to eliminate the entire module.



2.Right click on the Function and select Properties to configure its characteristics. The Function window will then appear.


3.The conditions of the module are defined in the window that is displayed; in the Select Function field, you will find a tree that classifies the functions. Go down to My Functions where the user will select the Function required.


4.In the parameters field, you will see the input parameters of the function. The user will have to set the value of each of the parameters.


5.To set the values, select the parameter (as illustrated in the figure) 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.



Image:Business_Rules9_Image025.jpg


6.Click on OK in the two windows to save the changes.


Example of a User Interface Function being called upon

Example: For the Loan Request process, a loan analysis is required when the amount requested by the Client exceeds the authorization limit value, which is 50 million, but this value is in the Loan Parameter entity in order to be easily administrated and modified. Therefore, a function was created to get the value of the Parameter by entering the Entity Name and the Parameter Name. This is the Function:



This is the detail of the expression Get given parameter value


Image:Business_Rules9_Image027.jpg


To verify whether or not the loan requires Authorization, an expression is created to compare the value requested to the limit value established as a parameter. The expression should return a true or false.


This is how the expression and its variable declaration window should look like. The variable that is created is going to be used to store the results of the Function.



This is how the function should be configured in its properties. Notice the values in each of the parameters are set, together with the Store result in variable.



This is how the boolean expression will look like to complete the objective and determine if the requested value for the loan is greater than the pre approved value and than the limit value parameter obtained in the function.


Image:Business_Rules9_Image030.jpg



Functions in Production

To guarantee the correct performance of all environments, once deployed Functions will not be available to delete or or change its parameters. Its code will remain editable if changes are required.


Related Information

<comments />