To unassign a task in a connector of that task i need to be unassigned before releaseTask to all user again, but how i can do it without Bonita Portal, only in Studio.
Thanks before hand.
Pedro Grant.
To unassign a task in a connector of that task i need to be unassigned before releaseTask to all user again, but how i can do it without Bonita Portal, only in Studio.
Thanks before hand.
Pedro Grant.
public main(){
final HumanTaskInstance userTaskId = waitForUserTask(“Task Name”, processInstanceId);
ProcessRuntimeAPI.class.releaseUserTask(userTaskId)
}
*I don’t know why need to be in a public class, but worked.
Hi Pedro,
The method releaseUserTask is what you need for. You can execute it through Java call (http://documentation.bonitasoft.com/javadoc/api/7.2/index.html) or a REST Call (http://documentation.bonitasoft.com/bpm-api-849#humantask).
Not sure what you’re trying to do. As you describe your use case, I’m having difficulties picturing your use case.
You’re saying that you want to un assign the current task in a connector, but in Bonita a connector will either be executed at the task creation (Task not assigned), or at the task execution (task assigned but can’t be unassigned).
Could you provide more information about what you’re trying to achieve.
Cheers
Lio
Thanks for your reply Lio, I will explain better now:
Exist two tasks named: “Task View” and “Task Register”, When the taskUser do the first one, only information appears with “Cancel” and “Next” button. “Cancel” button returns to BonitaPortal with the TaskView available again(only when the previous taskUser cancel) and the “Task Register” same thing, it will rollback all TaskUser interation to that point. Resetting all tasks of that instance process. This two task converges to a service task with a connector depending of the taskUser boolean decision result.
I tried releaseUserTask, but it only when a task is (unclaim or unassign), in this case im trying to do is putting a Unassign tool of Bonita Management to a TaskUser Level Button. I will use releaseUserTask, but i need first this Unassign method to put in a state required for release.
Cheers,
Peter Grant
Its like a time machine, when the script activates, return to a point where anyone press “Do It” button from Bonita Portal.
Hi,
Thanks for the details. I’m still not sure if I understand the use case correctly. If you could share your process that might help.
In any case, the releaseUserTask method takes as input the id of an assigned task and un assign it. So it looks like exactly what you’re looking for.
Did you try to implement your use case using that method?
Cheers,
Lio
Hi,
My diagram:
https://drive.google.com/file/d/0B6kl3CrK1FrwVHVJNy1EOE9HdnM/view?usp=sharing
I tried using ReleaseUserTask, but after i read this line in Bonita Javadoc i stopped trying:
"
void releaseUserTask(long userTaskId)
throws ActivityInstanceNotFoundException,
UpdateException
Release a task (unclaim or unassign). After the operation, the task is in the pending task list.
Parameters:
userTaskId - The identifier of the user task."
I need to unclaim or unassign a task before to use this method. So… im my case. I need the user unassign his own task, if he want of course, for the anothers users, who maybe want to do this demand, have this oportunity.
But this Unassign tool, only Management level have in Bonita Portal. its needed put this bottom code in a RollBack service task connector.
Thanks Lio again
Cheers
Peter Grant.
Hi,
Thanks for the diagram, really interesting. I’m little bit surprised by the chosen design, where the process is supposed go after the Rollback task is done? It seems there is not output.
Regarding the releaseUserTask purpose, I think it’s actually only a matter of documentation. The method will unassign the task for you, this is the main purpose of the method. The task doesn’t need to be unassign before using it.
Cheers
Lio
Hi,
Lio, that rollback its only for return to bonita portal main page, i will put a service task named, Bonita Portal Return. it will do the job.
I will try again with releaseTaskUser and mantain contact.
Cheers
Peter Grant
Its working ^^, When finish, i will post the code.
Hi,
Not sure this line of code work, right? I think there is an issue on the name: ProcessRuntimeAPIimeAPI.class.releaseUserTask(userTaskId)
Cheers
its because when you use groovy editor and use Ctrl+ spacebar. that thing happens, duplicate last words.