package com.unis.flowable.server.service;



import org.flowable.engine.delegate.TaskListener;
import org.flowable.identitylink.api.IdentityLink;
import org.flowable.task.service.delegate.DelegateTask;
import org.springframework.stereotype.Service;

import java.util.*;


/**
 * @Auther:张新亮
 * @Date: 2019/7/23 0023 13:59
 * @Description:
 */

@SuppressWarnings("serial")
@Service("taskExpressionService")
public class TaskExpressionService implements TaskListener {

    @Override
    public void notify(DelegateTask delegateTask) {
        Set<IdentityLink> candidates=delegateTask.getCandidates();
        String candidateUser="";
        for (IdentityLink identityLink : candidates) {
            candidateUser=identityLink.getGroupId();
            System.out.println("获取下一节点的组任务=="+candidateUser);
        }
        //4：获取当前的活动
        delegateTask.addCandidateUser(candidateUser);
    }






}