I need to move my Process Instance in a determined task to another task in my BPD, I tried to use the rest api complete to finish my Task and it works then I use the start activity rest api to start in my new task it works too but my bussines data is lost and my instance has an error.... does anyone have an idea?
Answer by AndrewPaier (2580) | Feb 13 at 10:13 AM
When you complete the task you have to provide the parameters that set the output values for the completed task. (see reference) If you aren't doing this it is likely the system is assuming the values were null and removing the current values. If the task already has the correct values, then you will need to use the 'Get Data' call to read those values and use them to assert the output values you want.
Since you didn't include any code I'm having to assume that you are calling the finish task without providing parameters. If that assumption is in error, then sharing a code snippet might help.
If all you want to do is move the token and not change the data values currently on the BPD then the "Move Token" api might be the better one for you to use.
-Andrew Paier
Answer by DoctorGarcia (1) | Feb 13 at 10:39 AM
Hi Andrew I'm not able to implement "Move token" because i'm not the administrator of the WAS and I can't do it. In other way you are rigth I am not sending the parameters because I have approximately 2200 variables and some of them are List then I don't know how I can send the JSON... I try to convert a Hash Map object to JSON and put the JSON as a variable but it throws me an error.
This is how I convert the map to JSON tw.local.listaKey = []; var Info = tw.system.findProcessInstanceByID(tw.local.idInstancia).businessData;
tw.local.listaKey = Info.keyArray(); var valueArray = Info.valueArray();
for(var i=0; i
The "get data" call in the REST API should provide you the data already in the format you are looking for. But now it looks like you are working server-side in the JS-API. Perhaps you should take a step back and explain the underlying use case as there may be a different way to accomplish what you need to do.
As a side note - If your service has 2200 variables that are outputs (we really only need to set outputs) it is likely there is a problem in the underlying approach. Granted it is too late to correct now, but this should be noted as technical debt somewhere. Handing around objects that are not specific to the task one is trying to accomplish adds needless complexity to a solution.
-Andrew Paier
How can I find stuck BPD process instances? 2 Answers
IBM BAW REST API integration with external system 1 Answer
Terminate vs. abort 2 Answers
NULL values in BPD_NAME in TASKS view 2 Answers