plugin-module/modeler-plugin-code/client/bpmn-js-extension/executor/EventBasedExecutor.js
/**
 * Implements intercommunication events between different plugins/modules
 * @param eventBus
 * @constructor
 */
Implements intercommunication events between different plugins/modules
@param eventBus
@constructor
Implements intercommunication events between different plugins / modules @param eventBus @constructor
function EventBasedExecutor(eventBus) {
  const LANGUAGE_EXECUTOR_PORT = process.env.LANGUAGE_EXECUTOR_PORT || '12421';
  eventBus.on(RUN_CODE_EDITOR, (event, code, context) => {
    const groovyExecutor = new GroovyAPI(`http://localhost:${LANGUAGE_EXECUTOR_PORT}`);
    const base64 = encode(code);
    return groovyExecutor.executeGroovy({ code: base64, context: context });
  });
  eventBus.on(GET_DATA_TYPES, () => {
    return {
      dataTypes: DATA_TYPES
    };
  });
}
function EventBasedExecutor ( eventBus ) { const LANGUAGE_EXECUTOR_PORT = process . env . LANGUAGE_EXECUTOR_PORT || '12421' ; eventBus . on ( RUN_CODE_EDITOR , ( event , code , context ) => { const groovyExecutor = new GroovyAPI ( ` ${ LANGUAGE_EXECUTOR_PORT } ` ) ; const base64 = encode ( code ) ; return groovyExecutor . executeGroovy ( { code : base64 , context : context } ) ; } ) ; eventBus . on ( GET_DATA_TYPES , ( ) => { return { dataTypes : DATA_TYPES } ; } ) ; }
Implements intercommunication events between different plugins/modules
 @param eventBus
 @constructor
Implements intercommunication events between different plugins / modules @param eventBus @constructor
/**
   * Receives data from the UI. Encodes the code script and calls the LanguageExecutor (groovy) to run it in safe mode
   */ /**
   * Returns the DATA_TYPES available for context variables
   */