package org.springblade.flow.engine.custom.behavior.impl;

import lombok.extern.slf4j.Slf4j;
import org.flowable.bpmn.model.Activity;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior;
import org.flowable.engine.impl.bpmn.behavior.SequentialMultiInstanceBehavior;

/**
 * 此类不能注入到Spring容器中  因为行为类实现类不可以是单例的
 */
@Slf4j
public class CustomSequentialMultiInstanceBehavior extends
        SequentialMultiInstanceBehavior {

    public CustomSequentialMultiInstanceBehavior(Activity activity, AbstractBpmnActivityBehavior innerActivityBehavior) {
        super(activity, innerActivityBehavior);
    }

    @Override
    protected int createInstances(DelegateExecution execution) {
        log.info("创建多实例开始啦: {}  ", execution);
        return super.createInstances(execution);
    }

}
