Obtain Case object

<< Click to Display Table of Contents >>

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

Obtain Case object

Overview

Bizagi offers a function where you can obtain the case object without the need of context. To do so, use the following function, this will return an case object type with the information you need:

 

CHelper.getCaseById(CaseId)

 

The following attributes are needed:

CaseId: Case Id

 

You can perform the actions described on Get information from the current case on the returned object.

 

Example

On this example we'll be using the getCaseById function to obtain a Sub-Process's state.

 

To do so, we'll first obtain the list of Sub-Process Id's as an array and from those Id's we'll get each Sub-Process's state.

 

The expression would be as follows:

 

getProcessByID_01

 

The code shown in the image is:

var children = CHelper.getSubProcessesId(Me);
for(var i=0; i < children.Count;i++){
  var child = CHelper.getCaseById(children[i]);
  var childState = child.ProcessState;
  CHelper.trace("ChildrenState","Child process id " + child.Id +" state: " + childState);
}