I'm still trying to figure out how to solve this. I thought perhaps if there was a way of setting the workflow_principal_id but I don't have any idea what that is exactly. Anybody noticing anything wrong in my code?
"obtaining process variables of this task"?? What do you mean by this statement??
All process variables are accessible by all the tasks within a process instance.
If you are trying to access the process variables within your process, there is no need to use an ExecuteScript activity; Instead you can use SetValue.
If you still wish to use ExecuteScript, there is no need to instantiate ServiceClientFactory. Since your ExecuteScript activity is being run within the process context, you can just use the following statement to get the variable values:
String myVariableValue = patExecContext.getProcessDataStringValue("/process_data/Your_String_Variable");
List myList = patExecContext.getProcessDataListValue("/process_data/My_list_variable");
Is that make sense?
I should have specified that I want to do this from another process. With the code I provided, I should be able to retrieve variables from any process, granted that I have right to that process instance.
I apologize for not using the correct terminology, I get confused between a task and a process instance. A task is when a process instance gets assigned to a user, ie: when using an assign task activity?
Apparently this would be a bug in the version of the server that I am using.
Version: 8.2.1, GM
Patch Version: SP3
Service Pack Version: 8.2.3163.3.212556.2