How to allow user to identify next step user in BPM?

Hi,
I have proc defintion with several approval steps, each step have role defined.

Current flow is: proc started -> person who with next role claimTask, and then do needed.

I want change flow to while proc start, the start person choose the person of next step, the person who been chosen can directly do the action without claimtask.

Now, I modify the proc instance by removing “claimallowed”, and I can list the person for select, after click ok, error raise in ProcessRuntimeService.startProcess, that multiple actors found for same role. It’s true that there are multiple actor of the role, but the previous person can select one and only one person for next step, how to prevent the error in ProcessRuntimeService.startProcess to make BPM can choose the actor that previous person choose in the UI?

Thanks.

Hi Anjingjing,
U have a one proc instance or two.

Hi,
What do you mean by "procInstance“?

For one entity, I have two bpm$procInstance related to it, one is for normal(approved by several person) and another is for delete(mark entity as deleted after all person agreed).

My problem is for the normal one, I want user in step1 to pick the person who needs take action in step2.

Hi,
One of solutions is to create your own custom process form that will have a lookup field component for selecting a user. This form will create a new ProcActor instance with the selected User. An example how to register a custom process form can be found here: GitHub - cuba-labs/bpm-samples: A sample project with examples of BPM addon usage

Hi Max,
Thanks for your reply. Maybe I did not decribe my problem, I have the things you mentioned already:

  1. I have my custom process and form.
  2. I can provide list for user to select.
  3. I create one procActor.

But BPM raise error that “multiple actors found for same role”; my BPM process has “process Role” defined, the “process Role” may contain many users; so even I create one procActor, seems the BPM still tries to find matched user of the “process Role” I defined.

How to solve this? BTW I am using cuba6.6.4.

If you have a message “multiple actors found for same role”, this means that you actually have many proc actors for the task that doesn’t allow it. You may have multiple process actors only for the task that have a “Multi-instance type” property set to “Parallel” or “Sequential”, or this task must have a “Claim allowed” checkbox selected. In all other cases there must be only one ProcActor object related to the required process role.

Hi Max,
I have “Multi-instance type” set NONE, this is correct, right?

Then I need to check whether I truely have multiple procActors created, right?

Hi Max,
I manged to make it work, but there is a strange behavior, I am using BPM in cuba6.6.4.

My flow is like start->step1->step2, if step1 approve then flow goes to step2, if step2 reject then go to “modify” step; after modify, go to step1 again, step1 and step2 repeat approve or reject. there is no “claimallowed” in step2 and step1.

My test step is: start, then step1 approve, then step2 reject, modify, at this time, my ProcActor have below data:
step1 approve
step2 reject
modify restart
step1 [blank]

after step1 click “approve”, my code try to insert one new row for step2 to procActor, but it raise error of “multiple actors found for same role”, but I surely insert only one, problem could be the existing “step2 reject” row, right?

But the existing row “step1 approve” does not effect step1 approve the second time. It’s strange, could you help?