ScriptHandler

Contents

bpmn-server / ScriptHandler

Class: ScriptHandler

Table of contents

Constructors

Methods

Constructors

constructor

new ScriptHandler(): ScriptHandler

Returns

ScriptHandler

Methods

evaluateInputExpression

evaluateInputExpression(item, exp, dateFormat?): Promise<any>

  • these expression are strings with $
    • scenarios:
    • String =>as is
    • $javaScript =>evaulated
    • a , b , c =>array
    • dateString =>convert to date
    • Examples:
    • [‘T’, user1],
      [‘T’, $(appServices.test1(100))],
      [‘T’, $(appServices.getSupervisorUser('user1'))],
      [‘T’, abc,xyz,user group],
      [‘TD’, 2022-10-11],
    • appDelegate.scopeEval –>evaluateExpression
    • appDelegate.scopeJS –>executeScript

Parameters

Name Type Default value
item any undefined
exp any undefined
dateFormat boolean false

Returns

Promise<any>

Defined in

engine/ScriptHandler.ts:24


evaluateExpression

evaluateExpression(scope, expression): any

execute JavaScript expression , no need for $

Parameters

Name Type
scope any
expression any

Returns

any

Defined in

engine/ScriptHandler.ts:54


executeScript

executeScript(scope, script): Promise<any>

Parameters

Name Type
scope any
script any

Returns

Promise<any>

Defined in

engine/ScriptHandler.ts:87


getJSvars

getJSvars(scope): "n var data=this.data;n var input=this.input;n var output=this.output;n var appDelegate=this.execution.appDelegate;n var appServices=this.execution.servicesProvider;n var appUtils=appDelegate.appUtils;n var item=this; // for backward support onlyn " | "n var appDelegate=this.appDelegate;n var appServices=this.servicesProvider;n var appUtils=appDelegate.appUtils;n " | "n var item=this;n var data=this.data;n var input=this.input;n var output=this.output;n var appDelegate=this.token.execution.appDelegate;n var appServices=this.token.execution.servicesProvider;n var appUtils=appDelegate.appUtils;n "

Parameters

Name Type
scope any

Returns

"n var data=this.data;n var input=this.input;n var output=this.output;n var appDelegate=this.execution.appDelegate;n var appServices=this.execution.servicesProvider;n var appUtils=appDelegate.appUtils;n var item=this; // for backward support onlyn " | "n var appDelegate=this.appDelegate;n var appServices=this.servicesProvider;n var appUtils=appDelegate.appUtils;n " | "n var item=this;n var data=this.data;n var input=this.input;n var output=this.output;n var appDelegate=this.token.execution.appDelegate;n var appServices=this.token.execution.servicesProvider;n var appUtils=appDelegate.appUtils;n "

Defined in

engine/ScriptHandler.ts:128