Use information of the current task

<< Click to Display Table of Contents >>

Navigation:  Bizagi Studio > Process wizard > Business Rules > Business rules examples >

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:

 

Me.Task

 

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

 

CHelper74

 

 

The information available about the current task:

 

 

Property

Description

Name

Returns a String with the name of the current task.

DisplayName

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

EstimatedDuration

Retrieves the duration in minutes for the current task.

 

 

Example

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:

Me.Task.Name

 

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.

 

CHelper63

 

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.

 

CHelper62

 

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

 

 

CHelper64

 

 

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.