Flowable-6.7.2 源码注释地址:https://github.com/solojin/flowable-6.7.2-annotated
/**
* 服务任务委托表达式活动行为
* {@link ActivityBehavior}当“delegateExpression”用于serviceTask时使用
*
* @author Joram Barrez
* @author Josh Long
* @author Slawomir Wojtasiak (Patch for ACT-1159)
* @author Falko Menge
*/
public class ServiceTaskDelegateExpressionActivityBehavior extends TaskActivityBehavior {
private static final long serialVersionUID = 1L;
protected String serviceTaskId;
protected Expression expression;
protected Expression skipExpression;
protected List<FieldDeclaration> fieldDeclarations;
protected List<MapExceptionEntry> mapExceptions;
protected boolean triggerable;
public ServiceTaskDelegateExpressionActivityBehavior(String serviceTaskId, Expression expression, Expression skipExpression,
List<FieldDeclaration> fieldDeclarations, List<MapExceptionEntry> mapExceptions, boolean triggerable) {
this.serviceTaskId = serviceTaskId;
this.expression = expression;
this.skipExpression = skipExpression;
this.fieldDeclarations = fieldDeclarations;
this.mapExceptions = mapExceptions;
this.triggerable = triggerable;
}
@Override
public void trigger(DelegateExecution execution, String signalName, Object signalData) {
Object delegate = DelegateExpressionUtil.resolveDelegateExpression(expression, execution, fieldDeclarations);
ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration();
boolean loggingSessionEnabled = processEngineConfiguration.isLoggingSessionEnabled();
if (triggerable && delegate instanceof TriggerableActivityBehavior) {
if (loggingSessionEnabled) {
// 使用委托触发服务任务
BpmnLoggingSessionUtil.addLoggingData(LoggingSessionConstants.TYPE_SERVICE_TASK_BEFORE_TRIGGER,
"Triggering service task with delegate " + delegate, execution);
}
((TriggerableActivityBehavior) delegate).trigger(execution, signalName, signalData);
if (loggingSessionEnabled) {
BpmnLoggingSessionUtil.addLoggingData(LoggingSessionConstants