UNPKG

camunda-bpmn-js

Version:

Embeddable Camunda modeling distributions based on bpmn-js

32 lines (24 loc) 860 B
/** * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH * under one or more contributor license agreements. See the NOTICE file * distributed with this work for additional information regarding copyright * ownership. * * Camunda licenses this file to you under the MIT; you may not use this file * except in compliance with the MIT License. */ import { forEach } from 'min-dash'; import { ComposedCommandHandler } from './ComposedCommandHandler.js'; const HANDLERS = { 'external-resources.composed-command': ComposedCommandHandler }; export default function CommandInitializer(eventBus, commandStack) { eventBus.on('diagram.init', function() { forEach(HANDLERS, function(handler, id) { commandStack.registerHandler(id, handler); }); }); } CommandInitializer.$inject = [ 'eventBus', 'commandStack' ];