define(["require", "exports", ".", "@process-engine/process_engine_contracts", "./start_event_handler", "./end_event_handler", "./exlusive_gateway_handler", "./service_task_handler", "./parallel_gateway_handler", "./error_boundary_event_handler"], function (require, exports, _1, process_engine_contracts_1, start_event_handler_1, end_event_handler_1, exlusive_gateway_handler_1, service_task_handler_1, parallel_gateway_handler_1, error_boundary_event_handler_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    class FlowNodeHandlerFactory {
        constructor(container, invoker, datastoreService) {
            this.container = container;
            this.invoker = invoker;
            this.datastoreService = datastoreService;
        }
        create(flowNodeTypeName) {
            switch (flowNodeTypeName) {
                case process_engine_contracts_1.BpmnType.startEvent:
                    return new start_event_handler_1.StartEventHandler();
                case process_engine_contracts_1.BpmnType.exclusiveGateway:
                    return new exlusive_gateway_handler_1.ExclusiveGatewayHandler();
                case process_engine_contracts_1.BpmnType.parallelGateway:
                    return new parallel_gateway_handler_1.ParallelGatewayHandler(this, this.datastoreService);
                case process_engine_contracts_1.BpmnType.serviceTask:
                    return new service_task_handler_1.ServiceTaskHandler(this.container, this.invoker);
                case process_engine_contracts_1.BpmnType.scriptTask:
                    return new error_boundary_event_handler_1.ErrorBoundaryEventHandler(new _1.ScriptTaskHandler());
                case process_engine_contracts_1.BpmnType.intermediateCatchEvent:
                    return new _1.IntermedtiateCatchEventHandler();
                case process_engine_contracts_1.BpmnType.endEvent:
                    return new end_event_handler_1.EndEventHandler();
                default:
                    throw Error(`Es konnte kein FlowNodeHandler für den FlowNodeType ${flowNodeTypeName} gefunden werden.`);
            }
        }
    }
    exports.FlowNodeHandlerFactory = FlowNodeHandlerFactory;
});

//# sourceMappingURL=flow_node_handler_factory.js.map
