Flowable-6.7.2 源码注释地址:https://github.com/solojin/flowable-6.7.2-annotated
CaseTaskActivityBehavior 案例任务活动行为
/**
* 案例任务活动行为
* 使用案例服务任务启动CMMN案例
*
* @author Tijs Rademakers
* @author Joram Barrez
*/
public class CaseTaskActivityBehavior extends AbstractBpmnActivityBehavior implements SubProcessActivityBehavior {
private static final Logger LOGGER = LoggerFactory.getLogger(CaseTaskActivityBehavior.class);
private static final long serialVersionUID = 1L;
@Override
public void execute(DelegateExecution execution) {
ExecutionEntity executionEntity = (ExecutionEntity) execution;
CaseServiceTask caseServiceTask = (CaseServiceTask) executionEntity.getCurrentFlowElement();
CommandContext commandContext = CommandContextUtil.getCommandContext();
ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);
ExecutionEntityManager executionEntityManager = CommandContextUtil.getExecutionEntityManager(commandContext);
ExpressionManager expressionManager = processEngineConfiguration.getExpressionManager();
CaseInstanceService caseInstanceService = processEngineConfiguration.getCaseInstanceService();
// 要使用case service任务,需要在流程引擎配置中提供CaseInstanceService实现
if (caseInstanceService == null) {
throw new FlowableException("To use the case service task a CaseInstanceService implementation needs to be available in the process engine configuration");
}
String businessKey = null;
if (!StringUtils.isEmpty(caseServiceTask.getBusinessKey())) {
Expression expression = expressionManager.createExpression(caseServic