Hi, I have a requirement, the flow is A->B->C. Suppose,the number candidates of B node is five. When the candidate of A node approve,it can assign the number of B node candidates,as if B1,B2,B3. The number is dynamic. When B1,B2,B3 approve at the same time,the flow can direct to the C node.
Then you need to use an expression for the assignment. Ie in your step B you reference an expression (could be a bean) that "calculated" the candidates for that step, dependening on the previous step.
I set an expression in step B,it calculates the candidates of step B dependening on the previous step, but only one candidate approve this step of B, whether other candidate can approve this step of B? I want other candidate can also approve this step of B,when they aprrove the step of B at the same time,the flow can direct to C.
If you model B as a simple user task with multiple candidates, the first candidate who completes the task, pushed the process forward to C. If any other candidate would complete the task at the same time, one of them will get success and all others will get an ActivitiOptimisticLockException. Offcourse, this only occurs when they do it at EXACTLY the same time. If the transaction of user1 (competing B) is already committed, the other users won't see the task anymore in the task-list. If they complete the task (eg. in case the task-id was cached in your app), they'll get an exception informing the task to complete was not found.
If you want to have task B to be available for multiple users, and only continue if ALL (or lets say, 50%) of users have completed the B task, use a multi-instance construction. This allows you to model a single user task in your process an have X number of instances at runtime which can be completed individually by the right assignee. After each task is completed, a "completionCondition" is evaluated which allows you to eg. go to C if 50% of all B-tasks are already complete. When moving to C, all remaning B-tasks are removed. See user guide for more info on this.