package com.ruoyi.flowable.oa;

import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.system.mapper.SysUserPostMapper;
import org.flowable.common.engine.impl.identity.Authentication;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.ExecutionListener;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component("CallPlanActivityExecutionListener")
public class CallPlanActivityExecutionListener implements ExecutionListener {
    @Override
    public void notify(DelegateExecution delegateExecution) {
        Map<String, Object> variables = delegateExecution.getVariables();
        Authentication.setAuthenticatedUserId(variables.get("planInitiator").toString());
        delegateExecution.setVariableLocal("approval", variables.get("planInitiator"));
    }
}
