Use information of the current task

<< Click to Display Table of Contents >>

Navigation:  Bizagi Studio > Process wizard > Business Rules > Business Rules examples > User information and experience >

Use information of the current task

Bizagi provides several functions that allow you to find and manipulate information about the current task. This group of functions all start with the sentence:




This group of functions are available in Current task information category.




The information available about the current task:





Returns a String with the name of the current task.


Retrieves a String with the display name of the current task.


Retrieves the duration in minutes for the current task.



The following example will illustrate how to use these functions.


Obtain the name of the current task

The Name function retrieves a string with the name of the current task.


The function call has no arguments and has the following syntax:



In a Purchase Request process the requester should be able to know the status of the request at any moment. To provide this information, the process summary form includes an attribute called Status. This attribute must be updated each time the process moves to a different activity.


For example, if the request is in the Authorize request activity, the status should be In approval. Similarly, if the request is in the Quotations Sub-Process, the status should be Quoting products.




To update this status you would need to establish an expression at each activity. However, you can define a single reusable expression (invoked at each activity) that evaluates the current task and set a status accordingly.


In order to evaluate in which task the Process is you can use the Me.Task.Name function.


Create an expression as an on enter action in the Authorize request activity.




Use the Me.Task.Name function to obtain the name of the current task and define the corresponding status.




if (Me.Task.Name=="AuthorizeRequest")


<Process.Status>="In approval"


if (Me.Task.Name=="Quotations")


<Process.Status>="Quoting products"



Now go to the Quotations Sub-Process and reuse this expression as an on enter action.