confirmation step between two human tasks
This trick will work only that you have both 2 tasks on the same lane and next to each other:
In the first form:
1. create a variable say nextTaskList (External API) = http://host:port/bonita/API/bpm/humanTask?p=0&c=10&f=state=ready&f=user_id={{uid}}&f=caseId={{caseId}}&f=name={{your_next_task_name}}
2. create another variable to store the url of next task: nextTaskId (javascript) = /bonita/portal/homepage#?id={{nextTaskList[0].id}}&_p=performTask&_pf=1
3. set nextTaskId to "Target URL on success" in the submit button
I did some field test and found I missed out one piece: to assign the task to the current user. The interpolation in target url is working, but you will need some workaround to make the assignment work. Warning, there will be errors or warning in the browser console due to AngularJS evaluation cycle.
- First you need 2 buttons. One for submitting the form and the other for opening next form
- If you are starting a process, you won't have the caseId initially. Thus, for the first submit button, store the success result to a variable "case" (JSON). This is where the caseId returned as {caseId: 1234}
- If you are submitting a task, you already has the taskId. Then create a variable "case"(External API) = "../API/bpm/userTask/{{taskId}}
- For the TargetURL on success, leave it empty in the first button. This button serves only to submit and get caseId
- Add following variables to be used in second button. In case your process branches to more than 1 task, create each button using the different nextTaskName:
- assignTo(javascript): return {'assigned_id':$data.currentSession.user_id};
- currentSession(External API): ../API/system/session/unusedid
- nextTaskList (External API): ../API/bpm/activity?p=0&c=10&f=name={{nextTaskName}}&f=state=ready&rootCaseId={{case.caseId}}
- nextTaskId(javascript): return $data.nextTaskList[0].id
For second button, set the following:
- Label: Next Task: {{taskList[0].name}}
- Disable: "nextTaskId === undefined"
- Action: PUT
- URLToCall: ../API/bpm/humanTask/{{nextTaskId}}
- DataSentOnClick: assignedTo
TargetUrlOnSuccess: /bonita/portal/homepage#?id={{nextTaskId}}&_p=performTask&_pf=1
Then you will have second button enabled upon first button successfully submitted and the next task generated by the platform.
Comments
Any which way, this is an issue for Bonitasoft to fix, step to step automatically (when the same user) should be implemented as part of the basic software.
I cannot have 5 buttons on my screen depending on where I want to go next, I simply want to go to the next screen in the process even if gateways take me to different choices...
I'm hoping this will be included in version 7.2 which I've seen one mention of, though have no details of when it will be or what will be in it.
It has to be said, developing with 7.x has become much harder than in 6.x, even if more flexible...I'm still waiting on a single upload/download file widget as well...
regards
Agreed,
and I have both use cases, but a lot of it is Wizard Multi Forms that need an amount of processing between steps; accessing databases, computing elements and then creating the HTML Widgets for the next form in the wizard...
It's a dynamic wizard...
According to Studio there is no need for a confirmation message in the UI designer forms, because you define the navigation on success and on failure.
Confirmation messages are only relevant for 6.x, and as you say can be defeated by the link.
If you are seeing screens between forms are you sure it's a confirmation screen? There shouldn't be any...
regards
Comments
Thanks for the reply.
Perhaps I have not explained the problem properly. When submitting a form, it opens again portal Bonita. What I want is that the form of the next human task is opened. But it does not work interpolation in the "Target URL on success" . I created an issue: https://bonita.atlassian.net/browse/BBPMC-319
Excuse me for my bad english
Comments
That's good to know, now just for how to do this when there is a service task between the two Human Tasks...
many thanks Johnny_104
regards
Thank you very much Johnny_104. The problem is that does not work interpolation in "Target URL on success" of the submit button. My first attempts to solve the problem was on the line you suggest. Finding that did not work, I tried other paths until I opened the issue: https://bonita.atlassian.net/browse/BBPMC-319
I hope that in future versions the problem is resolved.
Sean McP, I suppose the solution in this case and in the case that after a human task exists more than one possible human task, would be redirected to a page that look outstanding human tasks of that person and that case and redirected to the form the task is pending. But for this, it is necessary that the interpolation in "Target URL on success" works correctly to pass the parameters user_id and case_id to the page. Again the same problem.
Thank you very much.