Yannick,
The way we have it working is by means of JavaScript in BAW. I hope this an alternative.
In BAW 23.01 the System createDiscretionaryActivityWithProps method is added. (see https://www.ibm.com/docs/en/baw/23.x?topic=apis-javascript-api-in-processes-cases-service-flows)
With this method you can start a discretionaryActivity with the Activity Properties argument list you defined in the Activity.
The advantage of this method is that you can call it for all cases outside scope by using the caseId. Normally you can also use tw.system.currentProcessInstance.parentCase methods.
createDiscretionaryActivityWithProps(String caseId , String objectStoreName , String discretionaryActivityName , String[] activityPropertyNames , String[] activityPropertyValues , Boolean asAdministrator , String newActivityName);
An example
tw.local.caseId = "xyz"; // The ID of the case Instance found by a previous query
var activityPropertyNames = new tw.object.listOf.String(); // The list of property argument names
var activityPropertyValues = new tw.object.listOf.String(); // The list of property argument values
activityPropertyNames[0] = "HSC_Argument1";
activityPropertyValues[0] = "SomeValue"; // Single String value
tw.local.activityId = tw.system.createDiscretionaryActivityWithProps(tw.local.caseId, tw.env.TargetObjectStore, "HSC_MyActivity", activityPropertyNames, activityPropertyValues, false, "My Activity");
Please note that Activity Properties are only available for a discretionary "Activity with New Process" and not supported for a discretionary "Activity with Existing Process".
When you use "Activity with Existing Process" there is an option to pass the Internal Case properties to an external process.
IBM told us that this is by design and will be possibly changed in the future.
------------------------------
Henry Schenau
BAW Integration Specialist
Nationale-Nederlanden
------------------------------
Original Message:
Sent: Tue March 05, 2024 11:35 AM
From: Yannick Martin
Subject: Start discretionary task with properties
Hi,
there's a way to start a discretionary task through Case REST API (see URI /CASEREST/v1/case/{case folder id}/tasks).
How to start this task initializing some task's properties ? Or how to update the properties after the task creation ?
Thanks for help
Yannick
------------------------------
Yannick Martin
------------------------------