How to reject a task like used pvm?

I was reading a blog of edorasware.
Flowable 6 introduces a clean and predictable execution model. There’s a one-to-one relationship between BPMN and the execution operations, so all the odd bits of code scattered around the PVM operations are no longer needed.
so,how to reject a task like used pvm?plz answer me ,im a newer for flowable.
我在edorasware 的博客上看到,flowable6.0 取消了pvm。那么我现在想要自由的控制流程状态,应该怎么去做呢?

Hi.

I’m not sure if I understand your question correctly.
What do you mean with ‘reject a task’.
Perhaps ‘unclaim a task’ (that was claimed)?
If so; that can be done with the Java API;

TaskService.unclaim(String taskId);

which is a shortcut for;

TaskService.claim(String taskId, String userId);

(Where userId is null for unclaim)

Regards,

Yvo

Hi .
i want to perform a specified task whick is different from the next task in sequence flow;In flowable 5,i can do this by using PVM to set next task dynamically;
As shown in the process,the normal execution steps are as follows:start->task1->task2->task3->end.But in the implementation of the task 3 ,user found some problems during the process that only resolved by re-execute task1.How can i do it to achieve my purpose? there none branch.

in flowable5 or activty ,i can use Pvm to reset process runing to task1. like this:
ActivityImpl currActivity = ((ProcessDefinitionImpl) definition)
.findActivity(currTask.getTaskDefinitionKey());
List nextTransitionList = currActivity
.getIncomingTransitions();
// 清除当前活动的出口
List oriPvmTransitionList = new ArrayList();
List pvmTransitionList = currActivity
.getOutgoingTransitions();
for (PvmTransition pvmTransition : pvmTransitionList) {
oriPvmTransitionList.add(pvmTransition);
}
pvmTransitionList.clear();

        // 建立新出口
        List<TransitionImpl> newTransitions = new ArrayList<TransitionImpl>();
        for (PvmTransition nextTransition : nextTransitionList) {
            PvmActivity nextActivity = nextTransition.getSource();
            ActivityImpl nextActivityImpl = ((ProcessDefinitionImpl) definition)
                    .findActivity(nextActivity.getId());
            TransitionImpl newTransition = currActivity
                    .createOutgoingTransition();
            newTransition.setDestination(nextActivityImpl);
            newTransitions.add(newTransition);
        }
        // 完成任务
        List<Task> tasks = taskService.createTaskQuery()
                .processInstanceId(instance.getId())
                .taskDefinitionKey(currTask.getTaskDefinitionKey()).list();
        for (Task task : tasks) {
            taskService.complete(task.getId(), variables);
            historyService.deleteHistoricTaskInstance(task.getId());
        }
        // 恢复方向
        for (TransitionImpl transitionImpl : newTransitions) {
            currActivity.getOutgoingTransitions().remove(transitionImpl);
        }
        for (PvmTransition pvmTransition : oriPvmTransitionList) {
            pvmTransitionList.add(pvmTransition);
        }

Hi .
i want to perform a specified task whick is different from the next task in sequence flow;In flowable 5,i can do this by using PVM to set next task dynamically;
As shown in the process,the normal execution steps are as follows:start->task1->task2->task3->end.But in the implementation of the task 3 ,user found some problems during the process that only resolved by re-execute task1.How can i do it to achieve my purpose? there none branch.

Why not use an exclusive gateway and have a sequence flow back to task 1 when the user finds a problem in task 3 (ie. set a variable when completing task 3 that is used for the expression on the sequence flow)?