In this code,The API uses the method addProcessTaskInstance which takes the taskKey and the processinstancekey as input
I have written a seperate blogs to get the taskKey and getting the processInstance key
public void executeTask(String resourceName,String taskName,String userId){
try{
//pass the Task Key and thProcess instance key
moOperations.addProcessTaskInstance(taskKey(taskName,resourceName),getProcessInstKeyOfRes(resourceName,getUserKey(userId)));
System.out.println("executed");
}catch(Exception e){
}
}
I have written a seperate blogs to get the taskKey and getting the processInstance key
public void executeTask(String resourceName,String taskName,String userId){
try{
//pass the Task Key and thProcess instance key
moOperations.addProcessTaskInstance(taskKey(taskName,resourceName),getProcessInstKeyOfRes(resourceName,getUserKey(userId)));
System.out.println("executed");
}catch(Exception e){
}
}