confirmation step between two human tasks

1
0
-1

In this link , ttoin gave the solution to avoid confirmation step between two human tasks for version 6.x.
How you could solve the same problem in version 7.x?

3 answers

1
+1
-1

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

Comments

Submitted by Sean McP on Tue, 10/13/2015 - 14:15

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

Submitted by etchegaray on Tue, 10/13/2015 - 16:51

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.

1
0
-1

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.

  1. First you need 2 buttons. One for submitting the form and the other for opening next form
  2. 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}
  3. If you are submitting a task, you already has the taskId. Then create a variable "case"(External API) = "../API/bpm/userTask/{{taskId}}
  4. For the TargetURL on success, leave it empty in the first button. This button serves only to submit and get caseId
  5. 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

Submitted by Sean McP on Wed, 11/11/2015 - 11:11

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

Submitted by johnny_104 on Wed, 11/11/2015 - 13:34

IMHO, this concept is not common BPMN design. This only applies to a specific use case when there is only 1 lane, only 1 next task, no sub-task, no services in between adjacent tasks. If there are multiple contracts to update, why not put it in the same form to update in the same task? A task should be contained within a single task boundary. A confirmation dialog box or a temporary save page maybe more important.

On the other hand, if you are referring to a multiple-forms (wizard) use case, I do agree it is handy if multiple forms can cache work-in-progress data, or allow optional contract submission. The former objective is to save partial dat for a long form before completing the task. The second objective is to allow optional contract to be submitted according to selection from previous form, which the current task submission requires to fill all the contracts.

Submitted by Sean McP on Wed, 11/11/2015 - 13:34

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...

1
0
-1

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

Submitted by etchegaray on Thu, 10/08/2015 - 21:50

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

Submitted by Sean McP on Tue, 11/10/2015 - 14:21

Hi Javier,

I've tried to download your process and I get a 404 error after clicking the first submit.

I've loaded (imported) the widget and form but what next.

thanks and regards
Seán

Notifications