Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Stardust/Knowledge Base/API/JavaAPICookbook/Stardust Workflow Service in Action"

m (Suspending an activity)
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
== Introduction  ==
 
== Introduction  ==
  
In this article, we will explain the capabilities of Stardust Workflow Service in details with examples. It is assumed that you are familiar with the modeling the processes with Stardust. If not please read the product documentation here first.<br>If you are using the Stardust in embedded mode, then it is likely that you will have to use this service extensively. The Workflow Service is the heart of Stardust Engine. Its core features include:<br>
+
In this article, we will explain the capabilities of Stardust Workflow Service in details with examples. It is assumed that you are familiar with the modeling the processes with Stardust. If not please read the product documentation here first.<br>If you are using the Stardust in embedded mode, then it is likely that you will have to use this service extensively. The Workflow Service is the heart of Stardust Engine. Its core features include:<br>  
 +
 
 
*Starting a process  
 
*Starting a process  
*Executing an activities
+
*Executing an activities  
*Activating, delegating, suspending and aborting activities
+
*Activating, delegating, suspending and aborting activities  
 
*Accessing workflow data
 
*Accessing workflow data
  
== Example process model ==
+
== Example Process Model ==
 +
 
 +
We will use the following simple leave application process for this article.
  
We will use the following simple leave application process for this article.<br>&lt;process img goes here&gt;<br>
+
<br>&nbsp;[[Image:Stardust LeaveAppProcess2.jpg]]
  
 
== Prerequisite  ==
 
== Prerequisite  ==
Line 21: Line 24:
 
*We have a user with account, smith, associated with ‘Manager’ role.
 
*We have a user with account, smith, associated with ‘Manager’ role.
  
 +
<br>
  
== &nbsp;The workflow service operations ==
+
== &nbsp;The Workflow Service Operations ==
  
==== Starting a process ====
+
==== Starting a Process ====
  
The following code snippet shows how to start a process. You may execute this snippet, in this case, when user chooses to apply for the leave.<br>
+
The following code snippet shows how to start a process. You may execute this snippet, in this case, when user chooses to apply for the leave.<br><source lang="Java">
<source lang="Java">
+
 
String processID = "LeaveApplicationProcess";
 
String processID = "LeaveApplicationProcess";
 
Map<String, String> initData = new HashMap<String, String>();
 
Map<String, String> initData = new HashMap<String, String>();
Line 35: Line 38:
 
</source>  
 
</source>  
  
<br>Where;<br>
+
<br>Where;<br>  
*The first method parameter, processID, is ID of the process to be started. In the Stardust runtime there can be many different processes. A process is uniquely identified by the ID.
+
* The second parameter is contains the data to be passed for process being started. We will discuss this in details in a separate article ‘Handling In and Out Data with API’.
+
* The third Boolean parameter indicates whether to start a process in sync mode.
+
* If the process is successfully started, this method returns started process instance.
+
  
This operation will start the process and execute all non-interactive activities on the way. As soon as it encounters non-interactive activity, it will create that activity instance and suspends to its role work basket.<br>In our process, the first activity itself is a manual activity. Hence, the Stardust will create its instance and assign it to the ‘Employee’ role. The instance will be in the suspended state. Now, any user belonging to the Employee can activate and complete it.<br>
+
*The first method parameter, processID, is ID of the process to be started. In the Stardust runtime there can be many different processes. A process is uniquely identified by the ID.
 +
*The second parameter is contains the data to be passed for process being started. We will discuss this in details in a separate article ‘Handling In and Out Data with API’.
 +
*The third Boolean parameter indicates whether to start a process in sync mode.
 +
*If the process is successfully started, this method returns started process instance.
 +
 
 +
This operation will start the process and execute all non-interactive activities on the way. As soon as it encounters non-interactive activity, it will create that activity instance and suspends to its role work basket.<br>In our process, the first activity itself is a manual activity. Hence, the Stardust will create its instance and assign it to the ‘Employee’ role. The instance will be in the suspended state. Now, any user belonging to the Employee can activate and complete it.<br>  
  
 
&nbsp;  
 
&nbsp;  
  
==== Activating and completing an activity ====
+
==== Activating and completing an Activity ====
  
When an activity is created and assigned to a role, by default, it goes into suspended state. When a user belonging to the role chooses to work on the activity instance, it gets activated. So, you may say, activating an activity means choosing to work on it and the other way around. <br>The following code snippet shows how to activate and complete an activity instance in single operation.<br>
+
When an activity is created and assigned to a role, by default, it goes into suspended state. When a user belonging to the role chooses to work on the activity instance, it gets activated. So, you may say, activating an activity means choosing to work on it and the other way around. <br>The following code snippet shows how to activate and complete an activity instance in single operation.<br><source lang="Java">
<source lang="Java">
+
 
long activityInstanceOID = 401L;
 
long activityInstanceOID = 401L;
 
String context = null;
 
String context = null;
Line 54: Line 57:
 
int activateNextActivityFlag = WorkflowService.FLAG_ACTIVATE_NEXT_ACTIVITY_INSTANCE;
 
int activateNextActivityFlag = WorkflowService.FLAG_ACTIVATE_NEXT_ACTIVITY_INSTANCE;
 
ActivityCompletionLog activityCompletionLog = wfs.activateAndComplete(activityInstanceOID, context, outData,
 
ActivityCompletionLog activityCompletionLog = wfs.activateAndComplete(activityInstanceOID, context, outData,
                                                                                        activateNextActivityFlag);
+
activateNextActivityFlag);
+
</source>
+
</source> <br>Where;<br>  
<br>Where;<br>
+
 
*The first parameter, activityInstanceOID, is an OID of the activity which you want to activate and complete. I have hard-coded an activity OID. Normally, you will get this from user’s work-list or using query service or even may be cached by your embedding application.
+
*The first parameter, activityInstanceOID, is an OID of the activity which you want to activate and complete. I have hard-coded an activity OID. Normally, you will get this from user’s work-list or using query service or even may be cached by your embedding application.  
*Second parameter is the context on which data mapping will be performed. The value of null maps the data in ‘default’ context. We will see more on data mapping in separate section bellow.
+
*Second parameter is the context on which data mapping will be performed. The value of null maps the data in ‘default’ context. We will see more on data mapping in separate section bellow.  
*Third parameter is the process data that activity will change.
+
*Third parameter is the process data that activity will change.  
 
*The last parameter is a flag that indicates whether to activate the activity immediately after completing the current one.
 
*The last parameter is a flag that indicates whether to activate the activity immediately after completing the current one.
  
 
+
<br>Note that <big>activateAndComplete</big> method returns an instance of ActivityCompletionLog. This contains the completed activity and possibly, next activated activity details. The Stardust will activate the next activity only if the next interactive activity exists, and current user can activate it.  
Note that <big>activateAndComplete</big> method returns an instance of ActivityCompletionLog. This contains the completed activity and possibly, next activated activity details. The Stardust will activate the next activity only if the next interactive activity exists, and current user can activate it.
+
  
The following code snippet shows how to activate and then complete an activity instance in separate operations.
+
The following code snippet shows how to activate and then complete an activity instance in separate operations.  
  
 
<source lang="Java">
 
<source lang="Java">
 
ActivityInstance activityInstance = wfs.activate(activityInstanceOID);
 
ActivityInstance activityInstance = wfs.activate(activityInstanceOID);
 
ActivityCompletionLog activityCompletionLog = wfs.complete(activityInstance.getOID(), context, outData,  
 
ActivityCompletionLog activityCompletionLog = wfs.complete(activityInstance.getOID(), context, outData,  
                                                                activateNextActivityFlag);
+
activateNextActivityFlag);
</source>
+
</source>  
+
 
The following code snippet shows how to activate the next activity instance of the given process instance.
+
The following code snippet shows how to activate the next activity instance of the given process instance. <source lang="Java">
<source lang="Java">
+
 
ActivityInstance activityInstance = wfs.activateNextActivityInstanceForProcessInstance(startedProcess.getOID());
 
ActivityInstance activityInstance = wfs.activateNextActivityInstanceForProcessInstance(startedProcess.getOID());
</source>
+
</source>  
  
==== Aborting an activity ====
+
==== Aborting an Activity ====
  
Sometimes, you need to abort an activity and the process to which it belongs. This could be for reasons that this process instance is no more required for the business. <br>The following code snippet shows how to abort an activity and effectively complete process instance.<br>
+
Sometimes, you need to abort an activity and the process to which it belongs. This could be for reasons that this process instance is no more required for the business. <br>The following code snippet shows how to abort an activity and effectively complete process instance.<br><source lang="Java">
<source lang="Java">
+
ActivityInstance abortedActivityInstance = wfs.abortActivityInstance(activityInstanceOID);  
                ActivityInstance abortedActivityInstance = wfs.abortActivityInstance(activityInstanceOID);
+
 
</source>  
 
</source>  
 
  
The following code snippet shows how to indicate the scope of process abortion.
+
<br>The following code snippet shows how to indicate the scope of process abortion. <source lang="Java">
<source lang="Java">
+
AbortScope abortScope = AbortScope.SubHierarchy;
                AbortScope abortScope = AbortScope.SubHierarchy;
+
abortedActivityInstance = wfs.abortActivityInstance(activityInstanceOID, abortScope);
abortedActivityInstance = wfs.abortActivityInstance(activityInstanceOID, abortScope);
+
</source> Here, the AbortScope parameter value AbortScope.SubHierarchy indicates that;  
</source>  
+
 
Here, the AbortScope parameter value AbortScope.SubHierarchy indicates that;
+
*If the activity being aborted is a sub process, then the sub process and the sub process hierarchy will be aborted but the process continues as usual. That is, the process continues as if the sub process completed successfully though in reality is aborted.  
*If the activity being aborted is a sub process, then the sub process and the sub process hierarchy will be aborted but the process continues as usual. That is, the process continues as if the sub process completed successfully though in reality is aborted.
+
*If the activity being aborted is not a sub process, then only that activity is aborted and process continues as usual.
* If the activity being aborted is not a sub process, then only that activity is aborted and process continues as usual.
+
 
 +
Whereas, the value of AbortScope.RootHierarchy, indicates that;
  
Whereas, the value of AbortScope.RootHierarchy, indicates that;
 
 
*The process abortion is performed starting from the root process instance. All alive activities in the process hierarchy will be aborted.
 
*The process abortion is performed starting from the root process instance. All alive activities in the process hierarchy will be aborted.
  
==== Delegating an activity ====
+
==== Delegating an Activity ====
  
You may delegate an activity instance to a specific user, participant or default performer.
+
You may delegate an activity instance to a specific user, participant or default performer.  
+
 
The following code snippet shows how to delegate an activity to a specific user.
+
The following code snippet shows how to delegate an activity to a specific user. <source lang="Java">
<source lang="Java">
+
 
long userOID = 233L;  
 
long userOID = 233L;  
 
wfs.delegateToUser(activityInstanceOID, userOID);
 
wfs.delegateToUser(activityInstanceOID, userOID);
 
</source>  
 
</source>  
  
The following code snippet shows how to delegate an activity to a model participant.
+
The following code snippet shows how to delegate an activity to a model participant.  
  
 
<source lang="Java">
 
<source lang="Java">
Line 116: Line 114:
 
</source>  
 
</source>  
  
The following code snippet shows how to delegate an activity to the default performer.
+
The following code snippet shows how to delegate an activity to the default performer.  
  
 
<source lang="Java">
 
<source lang="Java">
 
wfs.delegateToDefaultPerformer(activityInstanceOID);
 
wfs.delegateToDefaultPerformer(activityInstanceOID);
</source>
+
</source>  
  
Where, you will get the details of user or participant by querying the Stardust runtime and choosing the appropriate the user or participant.
+
Where, you will get the details of user or participant by querying the Stardust runtime and choosing the appropriate the user or participant.  
  
==== <br>Suspending an activity ====
+
==== <br>Suspending an Activity ====
  
Sometimes, you may work on an activity halfway and need to stop your work for some reasons, then you can suspend the activity to either your own work basket, default performer, other participant or any other specific user.
+
Sometimes, you may work on an activity halfway and need to stop your work for some reasons, then you can suspend the activity to either your own work basket, default performer, other participant or any other specific user.  
  
Here is code snippet to suspend an activity to a model participant;
+
Here is code snippet to suspend an activity to a model participant; <source lang="Java">
<source lang="Java">
+
ContextData contextData = null;
+
 
Map<String, ?> outData =new HashMap<String, String>();
 
Map<String, ?> outData =new HashMap<String, String>();
 
String participantID = "Project";
 
String participantID = "Project";
 
wfs.suspendToParticipant(activityInstanceOID, participantID,context, outData);
 
wfs.suspendToParticipant(activityInstanceOID, participantID,context, outData);
</source>
+
</source>  
  
Here is code snippet to suspend an activity to the default performer;
+
Here is code snippet to suspend an activity to the default performer; <source lang="Java">
<source lang="Java">
+
 
wfs.suspendToDefaultPerformer(activityInstanceOID);
 
wfs.suspendToDefaultPerformer(activityInstanceOID);
</source>
+
</source>  
+
 
Here is code snippet to suspend an activity to a specific user;
+
Here is code snippet to suspend an activity to a specific user; <source lang="Java">
<source lang="Java">
+
 
wfs.suspendToUser(activityInstanceOID, userOID);
 
wfs.suspendToUser(activityInstanceOID, userOID);
</source>
+
</source>  
  
==== Fetching user work-list<br> ====
+
Where, you will get the details of user or participant by querying the Stardust runtime and choosing the appropriate the user or participant.
some text goes here
+
 
<source lang="Java">{...
+
==== Fetching the User Work List<br> ====
+
 
String processID = "LeaveApplicationProcess";
+
When a user logs into the system, generally you want to present then their work-list. A work-list is consists of activities assigned directly to the user and to roles that he belongs to.
Map<String, String> initData = new HashMap<String, String>();
+
 
boolean isSynchronous = true;
+
Here is the code snippet to fetch user’s private work-list;
ProcessInstance startedProcess = wfs.startProcess(processID, initData, isSynchronous);
+
 
+
<source lang="Java">
...
+
WorklistQuery privateWorkListQuery = WorklistQuery.findPrivateWorklist();
}
+
wfs.getWorklist(privateWorkListQuery);
 +
</source>
 +
 
 +
Here is the code snippet to fetch user’s complete work-list;
 +
 
 +
<source lang="Java">
 +
WorklistQuery completeWorklistQuery = WorklistQuery.findCompleteWorklist();
 +
wfs.getWorklist(completeWorklistQuery);
 +
</source>
 +
 
 +
==== Handling Process Data<br>  ====
 +
 
 +
In this section, we will see how to change the data during operations like completing and suspending an activity, fetching and updating the process data via data paths.
 +
 
 +
As per our leave application process above, suppose we are completing an ‘Apply Leave’ activity. We can see that this activity updates the following process data;
 +
 
 +
*from date
 +
*to date
 +
*reason for leave
 +
 
 +
The following code shows how to change the process data while completing the activity.
 +
 
 +
<source lang="Java">
 +
String processID = "LeaveApplicationProcess";
 +
Map<String, String> initData = new HashMap<String, String>();
 +
boolean isSynchronous = true;
 +
ProcessInstance startedProcess = wfs.startProcess(processID, initData, isSynchronous);
 +
 
 +
 
 +
String context=null;
 +
Map<String, String> outData =new HashMap<String, String>();
 +
int activateNextActivityFlag = WorkflowService.FLAG_ACTIVATE_NEXT_ACTIVITY_INSTANCE;
 +
 
 +
outData.put("FromDate", "19/05/2012");
 +
outData.put("ToDate", "30/05/2012");
 +
outData.put("LeaveReason", "I am going out to the Hawaii for holidays.");
 +
 
 +
ActivityInstance activityInstance = wfs.activateNextActivityInstanceForProcessInstance(startedProcess.getOID());
 +
ActivityCompletionLog activityCompletionLog = wfs.complete(activityInstance.getOID(), context, outData,
 +
activateNextActivityFlag);
 +
 
 +
</source>
 +
 
 +
The following code snippet shows how to fetch the data path representing the process data. For more information on data paths, refer to the Stardust product documentation.
 +
 
 +
<source lang="Java">
 +
long processInstanceOID = 783L;
 +
Object inDataPathValue = wfs.getInDataPath(processInstanceOID, "leaveReasonInDataPath");
 +
</source>
 +
 
 +
The following code snippet shows how to change the out data path value, effectively changing the referenced process data.
 +
 
 +
<source lang="Java">
 +
long processInstanceOID = 783L;
 +
wfs.setOutDataPath(processInstanceOID, "leaveReasonOutDataPath", "going to the Hawaii beach resort!");
 
</source>
 
</source>

Latest revision as of 10:41, 25 June 2013

Introduction

In this article, we will explain the capabilities of Stardust Workflow Service in details with examples. It is assumed that you are familiar with the modeling the processes with Stardust. If not please read the product documentation here first.
If you are using the Stardust in embedded mode, then it is likely that you will have to use this service extensively. The Workflow Service is the heart of Stardust Engine. Its core features include:

  • Starting a process
  • Executing an activities
  • Activating, delegating, suspending and aborting activities
  • Accessing workflow data

Example Process Model

We will use the following simple leave application process for this article.


 Stardust LeaveAppProcess2.jpg

Prerequisite

To reduce complexity, I assume following;

  •  The Stardust is being used in embedded mode and user interaction is performed via embedding application UI. That is, you may invoke methods like starting a process or completing an activity when user chooses a command or link, or when submitting a form in the application. The responsibility to collect required data from user or from given context belongs to the application.
  • We have reference to the initialized workflow service named, wfs.
  • The above mentioned process model is already deployed.
  • We have a user with account, john, associated with ‘Employee’ role.
  • We have a user with account, smith, associated with ‘Manager’ role.


 The Workflow Service Operations

Starting a Process

The following code snippet shows how to start a process. You may execute this snippet, in this case, when user chooses to apply for the leave.
String processID = "LeaveApplicationProcess";
Map<String, String> initData = new HashMap<String, String>();
boolean isSynchronous = true;
ProcessInstance startedProcess = wfs.startProcess(processID, initData, isSynchronous);


Where;

  • The first method parameter, processID, is ID of the process to be started. In the Stardust runtime there can be many different processes. A process is uniquely identified by the ID.
  • The second parameter is contains the data to be passed for process being started. We will discuss this in details in a separate article ‘Handling In and Out Data with API’.
  • The third Boolean parameter indicates whether to start a process in sync mode.
  • If the process is successfully started, this method returns started process instance.

This operation will start the process and execute all non-interactive activities on the way. As soon as it encounters non-interactive activity, it will create that activity instance and suspends to its role work basket.
In our process, the first activity itself is a manual activity. Hence, the Stardust will create its instance and assign it to the ‘Employee’ role. The instance will be in the suspended state. Now, any user belonging to the Employee can activate and complete it.

 

Activating and completing an Activity

When an activity is created and assigned to a role, by default, it goes into suspended state. When a user belonging to the role chooses to work on the activity instance, it gets activated. So, you may say, activating an activity means choosing to work on it and the other way around.
The following code snippet shows how to activate and complete an activity instance in single operation.
long activityInstanceOID = 401L;
String context = null;
Map<String, ?> outData = new HashMap<String, String>();
int activateNextActivityFlag = WorkflowService.FLAG_ACTIVATE_NEXT_ACTIVITY_INSTANCE;
ActivityCompletionLog activityCompletionLog = wfs.activateAndComplete(activityInstanceOID, context, outData,
 activateNextActivityFlag);

Where;
  • The first parameter, activityInstanceOID, is an OID of the activity which you want to activate and complete. I have hard-coded an activity OID. Normally, you will get this from user’s work-list or using query service or even may be cached by your embedding application.
  • Second parameter is the context on which data mapping will be performed. The value of null maps the data in ‘default’ context. We will see more on data mapping in separate section bellow.
  • Third parameter is the process data that activity will change.
  • The last parameter is a flag that indicates whether to activate the activity immediately after completing the current one.


Note that activateAndComplete method returns an instance of ActivityCompletionLog. This contains the completed activity and possibly, next activated activity details. The Stardust will activate the next activity only if the next interactive activity exists, and current user can activate it.

The following code snippet shows how to activate and then complete an activity instance in separate operations.

ActivityInstance activityInstance = wfs.activate(activityInstanceOID);
ActivityCompletionLog activityCompletionLog = wfs.complete(activityInstance.getOID(), context, outData, 
 activateNextActivityFlag);
The following code snippet shows how to activate the next activity instance of the given process instance.
ActivityInstance activityInstance = wfs.activateNextActivityInstanceForProcessInstance(startedProcess.getOID());

Aborting an Activity

Sometimes, you need to abort an activity and the process to which it belongs. This could be for reasons that this process instance is no more required for the business.
The following code snippet shows how to abort an activity and effectively complete process instance.
 ActivityInstance abortedActivityInstance = wfs.abortActivityInstance(activityInstanceOID);

The following code snippet shows how to indicate the scope of process abortion.
 AbortScope abortScope = AbortScope.SubHierarchy;
 abortedActivityInstance = wfs.abortActivityInstance(activityInstanceOID, abortScope);
Here, the AbortScope parameter value AbortScope.SubHierarchy indicates that;
  • If the activity being aborted is a sub process, then the sub process and the sub process hierarchy will be aborted but the process continues as usual. That is, the process continues as if the sub process completed successfully though in reality is aborted.
  • If the activity being aborted is not a sub process, then only that activity is aborted and process continues as usual.

Whereas, the value of AbortScope.RootHierarchy, indicates that;

  • The process abortion is performed starting from the root process instance. All alive activities in the process hierarchy will be aborted.

Delegating an Activity

You may delegate an activity instance to a specific user, participant or default performer.

The following code snippet shows how to delegate an activity to a specific user.
long userOID = 233L; 
wfs.delegateToUser(activityInstanceOID, userOID);

The following code snippet shows how to delegate an activity to a model participant.

String performerID = "Project";
wfs.delegateToParticipant(activityInstanceOID, performerID);

The following code snippet shows how to delegate an activity to the default performer.

wfs.delegateToDefaultPerformer(activityInstanceOID);

Where, you will get the details of user or participant by querying the Stardust runtime and choosing the appropriate the user or participant.


Suspending an Activity

Sometimes, you may work on an activity halfway and need to stop your work for some reasons, then you can suspend the activity to either your own work basket, default performer, other participant or any other specific user.

Here is code snippet to suspend an activity to a model participant;
Map<String, ?> outData =new HashMap<String, String>();
String participantID = "Project";
wfs.suspendToParticipant(activityInstanceOID, participantID,context, outData);
Here is code snippet to suspend an activity to the default performer;
wfs.suspendToDefaultPerformer(activityInstanceOID);
Here is code snippet to suspend an activity to a specific user;
wfs.suspendToUser(activityInstanceOID, userOID);

Where, you will get the details of user or participant by querying the Stardust runtime and choosing the appropriate the user or participant.

Fetching the User Work List

When a user logs into the system, generally you want to present then their work-list. A work-list is consists of activities assigned directly to the user and to roles that he belongs to.

Here is the code snippet to fetch user’s private work-list;

WorklistQuery privateWorkListQuery = WorklistQuery.findPrivateWorklist();
wfs.getWorklist(privateWorkListQuery);

Here is the code snippet to fetch user’s complete work-list;

WorklistQuery completeWorklistQuery = WorklistQuery.findCompleteWorklist();
wfs.getWorklist(completeWorklistQuery);

Handling Process Data

In this section, we will see how to change the data during operations like completing and suspending an activity, fetching and updating the process data via data paths.

As per our leave application process above, suppose we are completing an ‘Apply Leave’ activity. We can see that this activity updates the following process data;

  • from date
  • to date
  • reason for leave

The following code shows how to change the process data while completing the activity.

String processID = "LeaveApplicationProcess";
Map<String, String> initData = new HashMap<String, String>();
boolean isSynchronous = true;
ProcessInstance startedProcess = wfs.startProcess(processID, initData, isSynchronous);
 
 
String context=null;
Map<String, String> outData =new HashMap<String, String>();
int activateNextActivityFlag = WorkflowService.FLAG_ACTIVATE_NEXT_ACTIVITY_INSTANCE;
 
outData.put("FromDate", "19/05/2012");
outData.put("ToDate", "30/05/2012");
outData.put("LeaveReason", "I am going out to the Hawaii for holidays.");
 
ActivityInstance activityInstance = wfs.activateNextActivityInstanceForProcessInstance(startedProcess.getOID());
ActivityCompletionLog activityCompletionLog = wfs.complete(activityInstance.getOID(), context, outData, 
 activateNextActivityFlag);

The following code snippet shows how to fetch the data path representing the process data. For more information on data paths, refer to the Stardust product documentation.

long processInstanceOID = 783L;
Object inDataPathValue = wfs.getInDataPath(processInstanceOID, "leaveReasonInDataPath");

The following code snippet shows how to change the out data path value, effectively changing the referenced process data.

long processInstanceOID = 783L;
wfs.setOutDataPath(processInstanceOID, "leaveReasonOutDataPath", "going to the Hawaii beach resort!");

Back to the top