Search in sources :

Example 1 with SequenceFlowParseHandler

use of org.activiti.engine.impl.bpmn.parser.handler.SequenceFlowParseHandler in project Activiti by Activiti.

the class ProcessEngineConfigurationImpl method getDefaultBpmnParseHandlers.

public List<BpmnParseHandler> getDefaultBpmnParseHandlers() {
    // Alphabetic list of default parse handler classes
    List<BpmnParseHandler> bpmnParserHandlers = new ArrayList<BpmnParseHandler>();
    bpmnParserHandlers.add(new BoundaryEventParseHandler());
    bpmnParserHandlers.add(new BusinessRuleParseHandler());
    bpmnParserHandlers.add(new CallActivityParseHandler());
    bpmnParserHandlers.add(new CancelEventDefinitionParseHandler());
    bpmnParserHandlers.add(new CompensateEventDefinitionParseHandler());
    bpmnParserHandlers.add(new EndEventParseHandler());
    bpmnParserHandlers.add(new ErrorEventDefinitionParseHandler());
    bpmnParserHandlers.add(new EventBasedGatewayParseHandler());
    bpmnParserHandlers.add(new ExclusiveGatewayParseHandler());
    bpmnParserHandlers.add(new InclusiveGatewayParseHandler());
    bpmnParserHandlers.add(new IntermediateCatchEventParseHandler());
    bpmnParserHandlers.add(new IntermediateThrowEventParseHandler());
    bpmnParserHandlers.add(new ManualTaskParseHandler());
    bpmnParserHandlers.add(new MessageEventDefinitionParseHandler());
    bpmnParserHandlers.add(new ParallelGatewayParseHandler());
    bpmnParserHandlers.add(new ProcessParseHandler());
    bpmnParserHandlers.add(new ReceiveTaskParseHandler());
    bpmnParserHandlers.add(new ScriptTaskParseHandler());
    bpmnParserHandlers.add(new SendTaskParseHandler());
    bpmnParserHandlers.add(new SequenceFlowParseHandler());
    bpmnParserHandlers.add(new ServiceTaskParseHandler());
    bpmnParserHandlers.add(new SignalEventDefinitionParseHandler());
    bpmnParserHandlers.add(new StartEventParseHandler());
    bpmnParserHandlers.add(new SubProcessParseHandler());
    bpmnParserHandlers.add(new EventSubProcessParseHandler());
    bpmnParserHandlers.add(new AdhocSubProcessParseHandler());
    bpmnParserHandlers.add(new TaskParseHandler());
    bpmnParserHandlers.add(new TimerEventDefinitionParseHandler());
    bpmnParserHandlers.add(new TransactionParseHandler());
    bpmnParserHandlers.add(new UserTaskParseHandler());
    // Replace any default handler if the user wants to replace them
    if (customDefaultBpmnParseHandlers != null) {
        Map<Class<?>, BpmnParseHandler> customParseHandlerMap = new HashMap<Class<?>, BpmnParseHandler>();
        for (BpmnParseHandler bpmnParseHandler : customDefaultBpmnParseHandlers) {
            for (Class<?> handledType : bpmnParseHandler.getHandledTypes()) {
                customParseHandlerMap.put(handledType, bpmnParseHandler);
            }
        }
        for (int i = 0; i < bpmnParserHandlers.size(); i++) {
            // All the default handlers support only one type
            BpmnParseHandler defaultBpmnParseHandler = bpmnParserHandlers.get(i);
            if (defaultBpmnParseHandler.getHandledTypes().size() != 1) {
                StringBuilder supportedTypes = new StringBuilder();
                for (Class<?> type : defaultBpmnParseHandler.getHandledTypes()) {
                    supportedTypes.append(" ").append(type.getCanonicalName()).append(" ");
                }
                throw new ActivitiException("The default BPMN parse handlers should only support one type, but " + defaultBpmnParseHandler.getClass() + " supports " + supportedTypes.toString() + ". This is likely a programmatic error");
            } else {
                Class<?> handledType = defaultBpmnParseHandler.getHandledTypes().iterator().next();
                if (customParseHandlerMap.containsKey(handledType)) {
                    BpmnParseHandler newBpmnParseHandler = customParseHandlerMap.get(handledType);
                    log.info("Replacing default BpmnParseHandler " + defaultBpmnParseHandler.getClass().getName() + " with " + newBpmnParseHandler.getClass().getName());
                    bpmnParserHandlers.set(i, newBpmnParseHandler);
                }
            }
        }
    }
    return bpmnParserHandlers;
}
Also used : UserTaskParseHandler(org.activiti.engine.impl.bpmn.parser.handler.UserTaskParseHandler) ServiceTaskParseHandler(org.activiti.engine.impl.bpmn.parser.handler.ServiceTaskParseHandler) ReceiveTaskParseHandler(org.activiti.engine.impl.bpmn.parser.handler.ReceiveTaskParseHandler) TaskParseHandler(org.activiti.engine.impl.bpmn.parser.handler.TaskParseHandler) SendTaskParseHandler(org.activiti.engine.impl.bpmn.parser.handler.SendTaskParseHandler) ManualTaskParseHandler(org.activiti.engine.impl.bpmn.parser.handler.ManualTaskParseHandler) ScriptTaskParseHandler(org.activiti.engine.impl.bpmn.parser.handler.ScriptTaskParseHandler) ActivitiException(org.activiti.engine.ActivitiException) BusinessRuleParseHandler(org.activiti.engine.impl.bpmn.parser.handler.BusinessRuleParseHandler) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) BoundaryEventParseHandler(org.activiti.engine.impl.bpmn.parser.handler.BoundaryEventParseHandler) InclusiveGatewayParseHandler(org.activiti.engine.impl.bpmn.parser.handler.InclusiveGatewayParseHandler) ArrayList(java.util.ArrayList) AdhocSubProcessParseHandler(org.activiti.engine.impl.bpmn.parser.handler.AdhocSubProcessParseHandler) SubProcessParseHandler(org.activiti.engine.impl.bpmn.parser.handler.SubProcessParseHandler) EventSubProcessParseHandler(org.activiti.engine.impl.bpmn.parser.handler.EventSubProcessParseHandler) AdhocSubProcessParseHandler(org.activiti.engine.impl.bpmn.parser.handler.AdhocSubProcessParseHandler) ProcessParseHandler(org.activiti.engine.impl.bpmn.parser.handler.ProcessParseHandler) BpmnParseHandler(org.activiti.engine.parse.BpmnParseHandler) ServiceTaskParseHandler(org.activiti.engine.impl.bpmn.parser.handler.ServiceTaskParseHandler) EventBasedGatewayParseHandler(org.activiti.engine.impl.bpmn.parser.handler.EventBasedGatewayParseHandler) UserTaskParseHandler(org.activiti.engine.impl.bpmn.parser.handler.UserTaskParseHandler) MessageEventDefinitionParseHandler(org.activiti.engine.impl.bpmn.parser.handler.MessageEventDefinitionParseHandler) ScriptTaskParseHandler(org.activiti.engine.impl.bpmn.parser.handler.ScriptTaskParseHandler) SequenceFlowParseHandler(org.activiti.engine.impl.bpmn.parser.handler.SequenceFlowParseHandler) TimerEventDefinitionParseHandler(org.activiti.engine.impl.bpmn.parser.handler.TimerEventDefinitionParseHandler) SendTaskParseHandler(org.activiti.engine.impl.bpmn.parser.handler.SendTaskParseHandler) EventSubProcessParseHandler(org.activiti.engine.impl.bpmn.parser.handler.EventSubProcessParseHandler) EndEventParseHandler(org.activiti.engine.impl.bpmn.parser.handler.EndEventParseHandler) CancelEventDefinitionParseHandler(org.activiti.engine.impl.bpmn.parser.handler.CancelEventDefinitionParseHandler) StartEventParseHandler(org.activiti.engine.impl.bpmn.parser.handler.StartEventParseHandler) ErrorEventDefinitionParseHandler(org.activiti.engine.impl.bpmn.parser.handler.ErrorEventDefinitionParseHandler) SubProcessParseHandler(org.activiti.engine.impl.bpmn.parser.handler.SubProcessParseHandler) EventSubProcessParseHandler(org.activiti.engine.impl.bpmn.parser.handler.EventSubProcessParseHandler) AdhocSubProcessParseHandler(org.activiti.engine.impl.bpmn.parser.handler.AdhocSubProcessParseHandler) ManualTaskParseHandler(org.activiti.engine.impl.bpmn.parser.handler.ManualTaskParseHandler) CallActivityParseHandler(org.activiti.engine.impl.bpmn.parser.handler.CallActivityParseHandler) ParallelGatewayParseHandler(org.activiti.engine.impl.bpmn.parser.handler.ParallelGatewayParseHandler) IntermediateCatchEventParseHandler(org.activiti.engine.impl.bpmn.parser.handler.IntermediateCatchEventParseHandler) TransactionParseHandler(org.activiti.engine.impl.bpmn.parser.handler.TransactionParseHandler) CompensateEventDefinitionParseHandler(org.activiti.engine.impl.bpmn.parser.handler.CompensateEventDefinitionParseHandler) ExclusiveGatewayParseHandler(org.activiti.engine.impl.bpmn.parser.handler.ExclusiveGatewayParseHandler) ReceiveTaskParseHandler(org.activiti.engine.impl.bpmn.parser.handler.ReceiveTaskParseHandler) IntermediateThrowEventParseHandler(org.activiti.engine.impl.bpmn.parser.handler.IntermediateThrowEventParseHandler) SignalEventDefinitionParseHandler(org.activiti.engine.impl.bpmn.parser.handler.SignalEventDefinitionParseHandler)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 ActivitiException (org.activiti.engine.ActivitiException)1 AdhocSubProcessParseHandler (org.activiti.engine.impl.bpmn.parser.handler.AdhocSubProcessParseHandler)1 BoundaryEventParseHandler (org.activiti.engine.impl.bpmn.parser.handler.BoundaryEventParseHandler)1 BusinessRuleParseHandler (org.activiti.engine.impl.bpmn.parser.handler.BusinessRuleParseHandler)1 CallActivityParseHandler (org.activiti.engine.impl.bpmn.parser.handler.CallActivityParseHandler)1 CancelEventDefinitionParseHandler (org.activiti.engine.impl.bpmn.parser.handler.CancelEventDefinitionParseHandler)1 CompensateEventDefinitionParseHandler (org.activiti.engine.impl.bpmn.parser.handler.CompensateEventDefinitionParseHandler)1 EndEventParseHandler (org.activiti.engine.impl.bpmn.parser.handler.EndEventParseHandler)1 ErrorEventDefinitionParseHandler (org.activiti.engine.impl.bpmn.parser.handler.ErrorEventDefinitionParseHandler)1 EventBasedGatewayParseHandler (org.activiti.engine.impl.bpmn.parser.handler.EventBasedGatewayParseHandler)1 EventSubProcessParseHandler (org.activiti.engine.impl.bpmn.parser.handler.EventSubProcessParseHandler)1 ExclusiveGatewayParseHandler (org.activiti.engine.impl.bpmn.parser.handler.ExclusiveGatewayParseHandler)1 InclusiveGatewayParseHandler (org.activiti.engine.impl.bpmn.parser.handler.InclusiveGatewayParseHandler)1 IntermediateCatchEventParseHandler (org.activiti.engine.impl.bpmn.parser.handler.IntermediateCatchEventParseHandler)1 IntermediateThrowEventParseHandler (org.activiti.engine.impl.bpmn.parser.handler.IntermediateThrowEventParseHandler)1 ManualTaskParseHandler (org.activiti.engine.impl.bpmn.parser.handler.ManualTaskParseHandler)1 MessageEventDefinitionParseHandler (org.activiti.engine.impl.bpmn.parser.handler.MessageEventDefinitionParseHandler)1