Members
(constant) backendServer
For explanation for the general server architecture, see: https://gitlab.com/dBPMS-PROCEED/proceed/-/wikis/MS/Architecture-Server-and-Desktop-App#ms-server-architecture
(constant) CONFIG_PROPERTIES
The property names of the machine values that are set/appended by the config.
(constant) processSockets
Contains process specific connections
(constant) PROPERTIES
Property names and corresponding cache timeouts in s.
Methods
(async) abortInstanceOnNetwork(definitionId, instanceId)
Sends request to abort process instance to all machines in the local network
Parameters:
Name | Type | Description |
---|---|---|
definitionId |
string | name of the file the process is stored in |
instanceId |
string | the id of the instance to abort |
activateDistribution()
Sets up callbacks that trigger distribution when certain events are encountered in the registered modeler
add(storeName, newElement) → {Boolean}
Function to add an element to the stores which store elements with ids (machines, processes, etc.) (NOT! config)
Does check if element with the same id is already in store
Parameters:
Name | Type | Description |
---|---|---|
storeName |
String | the name of the store we want to add to |
newElement |
Object | the object we want to add |
Returns:
- if adding was possible (don't add if element with same id exists)
- Type
- Boolean
addCallActivityReference(callActivityId, calledBpmn, calledProcessLocation)
Add meta information of the called bpmn process to the modeler bpmn where it's getting called from. This includes a custom namespace in the definitions part, an import element as first child of definitions and the calledElement attribute of the call activity bpmn element
Parameters:
Name | Type | Description |
---|---|---|
callActivityId |
String | The ID of the call activity bpmn element inside the rootBpmn |
calledBpmn |
String | The bpmn file of the called process |
calledProcessLocation |
String | The definitionId of the calledBpmn. |
- Source:
addConstraints(bpmnXML, processConstraints, taskConstraintMapping)
Adds process and task constraints as extension elements to XML after checking for inconsistencies
Parameters:
Name | Type | Description |
---|---|---|
bpmnXML |
||
processConstraints |
||
taskConstraintMapping |
- Source:
addConstraintsToElement(element, cons)
Adds the given constraints to the extensionElements of the given modeler element
Parameters:
Name | Type | Description |
---|---|---|
element |
Object | the modeler element we want to add the constraints to |
cons |
Object | the constraints we want to add |
- Source:
(async) addMachine(service)
Requests information for given service and adds the publishing machine to the list of known machines
Parameters:
Name | Type | Description |
---|---|---|
service |
Object |
addMachine(machine)
Handles machines that are added by the user
Parameters:
Name | Type | Description |
---|---|---|
machine |
Object | contains user defined information about the machine to add |
addMachineLogsSubscription(machineId)
Set flag that logs for a machine are requested
Parameters:
Name | Type | Description |
---|---|---|
machineId |
String | the machine for which logs are requested |
- Source:
addMachineSubscription(machineId)
Set flag that we want extended information for a specific machine
Parameters:
Name | Type | Description |
---|---|---|
machineId |
String | machine that more information is requested for |
- Source:
addProcess(bpmn) → {Object}
Handles adding a process, makes sure all necessary information gets parsed from bpmn
Parameters:
Name | Type | Description |
---|---|---|
bpmn |
String | the xml description of the process to create |
Returns:
- returns an object containing the intitial process information
- Type
- Object
anchorElement(fileName, objectContent)
Parameters:
Name | Type | Description |
---|---|---|
fileName |
String | name used to download file |
objectContent |
String | Object | content, either as Blob or objectURL DOMString |
applyExternalEvent(command, context)
Use some modules from the modeler to trigger similar events to the ones coming from other machines inside the local modeler
Parameters:
Name | Type | Description |
---|---|---|
command |
String | the event that is supposed to be applied |
context |
Object | information about the current state and the expected changes |
(async) applyModelingEvent(processDefinitionsId, type, context)
Queues up events to be applied and applies them in sequence if no other instance of the function is already running
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String | |
type |
String | the type of event to be applied |
context |
Object | information of the current state and the expected result of the event |
blockProcess(socketId, processDefinitionsId)
Stores the id of the socket wanting to block the process from being deleted inside the process object
Parameters:
Name | Type | Description |
---|---|---|
socketId |
String | |
processDefinitionsId |
String |
changeBackendConfig(newValues)
Merges proposed config changes into the backend config object, updates the store and emits an event if at least one entry was changed
Parameters:
Name | Type | Description |
---|---|---|
newValues |
Object | key value pairs of proposed config changes |
checkAvailability(machine) → {boolean}
Sends request checking if there is an engine running on the given machine
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
machine |
object |
Properties
|
- Source:
Returns:
- indicates if the machine is available or not
- Type
- boolean
(async) checkIfAvailable(machine)
Sends request to see if a machine is reachable and running an engine
Parameters:
Name | Type | Description |
---|---|---|
machine |
Object |
checkIfProcessExists(processDefinitionsId)
Throws if process with given id doesn't exist
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String |
computeHardConstraints(currentHardConstraints, userTaskHTML) → {Array.<Constraint>}
Compute the hard constraint mapping based on the current mapping (if present) and on the given user task html content.
Parameters:
Name | Type | Description |
---|---|---|
currentHardConstraints |
Array.<Constraint> | List of the current hard constraints |
userTaskHTML |
String | The html content of a given user task |
Returns:
The new computed hard constraints
- Type
- Array.<Constraint>
constraintsEquals(con1, con2) → {boolean}
Checks if the two given constraints have the name, the condition and all values in common
Parameters:
Name | Type | Description |
---|---|---|
con1 |
Constraint | |
con2 |
Constraint |
Returns:
Equality of the two constraints
- Type
- boolean
convertSemanticDescription(the)
Parameters:
Name | Type | Description |
---|---|---|
the |
object | capability description gotten from an engine in form of an object |
- Source:
Returns:
- the capability information as needed by the ms
deepEquals(a, b) → {Boolean}
Compares two values
normal comparison for fundamental data types (number, string etc) element wise comparison for objects and arrays recursive handling for nested objects and arrays
Parameters:
Name | Type | Description |
---|---|---|
a |
Any | some value |
b |
Any | some value |
Returns:
- if the two values are equal
- Type
- Boolean
deepEquals(a, b) → {Boolean}
Compares two values
normal comparison for fundamental data types (number, string etc) element wise comparison for objects and arrays recursive handling for nested objects and arrays
Parameters:
Name | Type | Description |
---|---|---|
a |
Any | some value |
b |
Any | some value |
Returns:
- if the two values are equal
- Type
- Boolean
deleteEnvProfile(id, type)
Removes the json file of the environment profile with the given id
Parameters:
Name | Type | Description |
---|---|---|
id |
String | the id of the environment profile |
type |
String | the type of the environment profile |
deleteProcess(id)
Deletes the directory for the process we want to remove
Parameters:
Name | Type | Description |
---|---|---|
id |
String |
deleteProcessUserTask(processDefinitionsId, userTaskFileName)
Removes a stored user task from disk
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String | |
userTaskFileName |
String |
deployProcess(machine, definitionId, bpmn)
Sends process definitionid and process bpmn to deploy process on engine
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
machine |
object | contains machine information Properties
|
|||||||||
definitionId |
string | name of the file the process is saved in |
|||||||||
bpmn |
string | the description of the process in xml |
- Source:
dontGetDeployments()
Deactivate request for deployment information in request loop
- Source:
(async) dynamicDeployment(process, bpmn)
Tries to find an optimal machine to deploy process to and sends all necessary process information on success
Parameters:
Name | Type | Description |
---|---|---|
process |
Object | an object containing inforamtion about the process to deploy |
bpmn |
String | the process description in xml |
emit(event, data)
Function to emit one event to the server without response alignment (ids).
Parameters:
Name | Type | Description |
---|---|---|
event |
string | The name of the event |
data |
any | The (raw) data to send |
(async) evaluateDynamicDeployment(engine, processInstanceId, processInfo, tokenId, from, to) → {dynamicDeploymentResult}
Uses the decider module to find the optimal next machine to continue execution of the current token
Parameters:
Name | Type | Description |
---|---|---|
engine |
object | instance of the engine class containing all information about the current process and its instances |
processInstanceId |
string | id of the specific instance the token is running in |
processInfo |
object | information about the running process |
tokenId |
string | the id of the token for which we have to decide where to execute it next |
from |
string | the previous executed element |
to |
string | the next element to be executed |
Returns:
holding information about continuation of execution
- Type
- dynamicDeploymentResult
(async) evaluateStaticDeployment(engine, nextActivity) → {staticDeploymentResult}
Evaluates if the next acitvity is supposed be executed on the current engine for static deployment
Parameters:
Name | Type | Description |
---|---|---|
engine |
object | instance of the engine class containing all information about the current process and its instances |
nextActivity |
object | information object about the activity that the token is supposed to be moved to |
Returns:
Result object that contains information about execution of next element
- Type
- staticDeploymentResult
exportSelectedProcesses(allProcesses, selectedProcesses, selectedOption)
Export selected processes to the selected format.
Parameters:
Name | Type | Description |
---|---|---|
allProcesses |
Array.<Object> | all known processes to search for referenced call activities |
selectedProcesses |
Array.<Object> | all processes that need to be exported |
selectedOption |
String | export format |
filterHTML(processInfo, imported) → {Array}
Function that filters the User Tasks HTML ids from the general process information object
Parameters:
Name | Type | Description |
---|---|---|
processInfo |
Object | contains all known information for a process |
imported |
Boolean | indicates if we want the HTML for the process or for the processes imported by the process |
Returns:
- array containing the ids for all User-Tasks we have HTML for
- Type
- Array
filterImportedProcesses(processInfo) → {Object}
Function that filters the imported process descripions from the general process information object
Parameters:
Name | Type | Description |
---|---|---|
processInfo |
Object | contains all known information for a process |
Returns:
- mapping from definitionId of imported process definition to actual definition
- Type
- Object
findMatchingMachineId(machine) → {String|undefined}
Goes through the known machines searching for a machine that matches the given machine in some way
Parameters:
Name | Type | Description |
---|---|---|
machine |
Object | the machine we want to find a matching machine for |
Returns:
the id of the matching machine in known (or undefined for no matching)
- Type
- String | undefined
flattenSubprocesses(process)
This method is a recursive method to get all n-level subprocesses within a process
Parameters:
Name | Type | Description |
---|---|---|
process |
Object | complete process with all supporting elements |
Returns:
Returns an array of all subprocesses with a process
(async) forwardDynamicInstance(engine, processInstanceId, tokenId, from, to, machine) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
engine |
object | instance of the engine class containing all information about the current process and its instances |
processInstanceId |
string | id of the specific instance the token is running in |
tokenId |
string | the id of the token for which we have to decide where to execute it next |
from |
string | the previous executed element |
to |
string | the next element to be executed |
machine |
object | machine to forward the instance to |
Returns:
- true if instance was successully forwarded, false if not
- Type
- boolean
(async) forwardHTML(ip, port, definitionId, imported)
Sends the html information for all user tasks to the next machine
Parameters:
Name | Type | Description |
---|---|---|
ip |
String | the ip of the next machine |
port |
Number | the port the engine is published on on the next machine |
definitionId |
String | the name of the file the process information is supposed to be stored under on the next machine |
imported |
Boolean | indicates if we want to send the HTML information for imported processes or just the ones for the main process |
(async) forwardImports(ip, port, definitionId)
Sends the process descriptions and user task data for all imported processes to the next machine
Parameters:
Name | Type | Description |
---|---|---|
ip |
String | the ip of the next machine |
port |
Number | the port the engine is published on on the next machine |
definitionId |
String | the name of the file the process information is supposed to be stored under on the next machine |
(async) forwardInstance(ip, port, definitionId, instanceId, instanceInfo)
Sends the necessary instance information and the signal to continue the process on the next machine
Parameters:
Name | Type | Description |
---|---|---|
ip |
String | the ip of the next machine |
port |
Number | the port the engine is published on on the next machine |
definitionId |
String | the name of the file the process information is supposed to be stored under on the next machine |
instanceId |
String | id of the instance we want to continue |
instanceInfo |
Object | the complete instance information that exists at this point |
(async) forwardProcess(ip, port, definitionId, bpmn)
Sends the process definition to the next machine
Parameters:
Name | Type | Description |
---|---|---|
ip |
String | the ip of the other machine |
port |
Number | the port the engine is published on on the other machine |
definitionId |
String | the name of the file the process is supposed to be stored under |
bpmn |
String | the process definition |
get(store)
Gets the value of the store with the given name
Parameters:
Name | Type | Description |
---|---|---|
store |
String | the name of the store we want to get |
getAllSubprocesses(allProcesses, currentProcess, includedProcesses)
recursive method to get all call activities and their subprocesses
Parameters:
Name | Type | Description |
---|---|---|
allProcesses |
Array.<Object> | all known processes to search for referenced call activities |
currentProcess |
Object | current selected process of the hierarchy |
includedProcesses |
Array.<Object> | container for the result |
getAppDataPath() → {String}
Returns the path where all the data for the MS is stored
should be:
Server: Production: same directory as server files Development: /path/to/appdata-directory/proceed-management-system-development Electron: Production: /path/to/appdata-directory/proceed-management-system Development: /path/to/appdata-directory/proceed-management-system-development
Returns:
- Type
- String
getBackendConfig() → {Object}
Returns the current config values
Returns:
the current config values
- Type
- Object
(async) getBPMN(processDefinitionsId)
Requests the bpmn xml for a specific process
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String |
getBPMN(processDefinitionsId) → {String}
Get the bpmn of a specific process as a string
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String |
Returns:
the process description
- Type
- String
getBPMNWithAssets(process, zipObject)
Get BPMN with Assets
Parameters:
Name | Type | Description |
---|---|---|
process |
Object | |
zipObject |
JSZip |
getCallActivityHandler(engine, Engine, instance)
Creates a callback that handles the execution of callActivities when one becomes active
Parameters:
Name | Type | Description |
---|---|---|
engine |
Object | proceed engine instance that contains the process information |
Engine |
Class | the process Execution class that we want to create a new Instance of to execute the callActivity process |
instance |
Object | the process instance the call activity was encountered in |
getCompleteMachineInformation(machine) → {Object|undefined}
Returns the updated information for a machine if the machine information changed (returns undefined if not)
Parameters:
Name | Type | Description |
---|---|---|
machine |
Object | the machine we want to request information for |
- Source:
Returns:
the updated object or undefined if there was no new information
- Type
- Object | undefined
getConfiguration(machineId) → {Object}
Requests and returns the configuration of the engine on another machine
Parameters:
Name | Type | Description |
---|---|---|
machineId |
String |
Returns:
- contains config values
- Type
- Object
getDefinitions(businessObject)
Returns the definitions object of the process
Parameters:
Name | Type | Description |
---|---|---|
businessObject |
Object | the businessObject of the root of the process |
- Source:
getDefinitions(businessObject)
Returns the definitions object of the process
Parameters:
Name | Type | Description |
---|---|---|
businessObject |
Object | the businessObject of the root of the process |
- Source:
getDefinitions(businessObject)
Returns the definitions object of the process
Parameters:
Name | Type | Description |
---|---|---|
businessObject |
Object | the businessObject of a process element |
- Source:
getDefinitionsIdForCallActivity(callActivityId) → {String|undefined}
Gets the id of the process definition of the process called in a callActivity
Parameters:
Name | Type | Description |
---|---|---|
callActivityId |
String |
- Source:
Returns:
- the id of the process definition of the called process
- Type
- String | undefined
getDeployedProcesses(machine) → {array}
Requests information about all deployed processes of a machine
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
machine |
object | contains machine information Properties
|
- Source:
Returns:
definitionIds of all processes deployed to the given machine
- Type
- array
getDeployedToMachines(processDefinitionsId)
Returns an array with all machines the process with the given id is deployed to
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String | the id of the deployed process |
getDeploymentBPMN(machine, definitionId) → {string}
Requests process bpmn of process with given id from given machine
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
machine |
object | contains machine information Properties
|
|||||||||
definitionId |
string | name of the file the process is saved in |
- Source:
Returns:
the process bpmn xml
- Type
- string
getDeployments()
Activates request for deployment information for all machines in request loop
- Source:
getElementConstraints(element) → {Object}
Returns a constraint object containing all the constraints of the given object
Parameters:
Name | Type | Description |
---|---|---|
element |
Object | the modeler element we want to know the constraints of |
- Source:
Returns:
- contains all constraints of the given element
- Type
- Object
getEnvFolder() → {String}
Find the path to the folder where the info about all Environment Profiles is stored
Returns:
- Type
- String
getEnvProfileJSON() → {String}
Get the json of an environment profile
Returns:
the environmentProfile json
- Type
- String
getEnvProfileName() → {String}
Find the path to the file where the info about an environment profile is stored
Returns:
- Type
- String
getFolder(id) → {String}
Find the path to the folder where the data of a specific process is stored
Parameters:
Name | Type | Description |
---|---|---|
id |
Returns:
- Type
- String
getImage(viewer, process, selectedOption, isMultiDownload)
Parameters:
Name | Type | Description |
---|---|---|
viewer |
* | |
process |
* | selected process to be exported |
selectedOption |
* | selected export format |
isMultiDownload |
* | check if export is single or multi process download |
getImported(process, zipObject, includeUserTasks)
add call activities to zip file add user tasks of call activities to zip file (optional)
Parameters:
Name | Type | Description |
---|---|---|
process |
Object | |
zipObject |
JSZip | |
includeUserTasks |
Boolean | includer user tasks of call activities or not (optional) |
getInstanceInformation(machine, definitionId, instanceId) → {object}
Request information about a certain process instance
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
machine |
object | contains machine information Properties
|
|||||||||
definitionId |
string | name of the file the process is saved in |
|||||||||
instanceId |
string | id of the specific instance |
- Source:
Returns:
instance information object
- Type
- object
getLogHandler(engine)
Creates a callback function that can be used to handle calls from the log stream of the neo engine
Parameters:
Name | Type | Description |
---|---|---|
engine |
Object | proceed engine instance that contains the process information |
getLogs(machineId) → {Object}
Requests and returns the logs of the engine on another machine
Parameters:
Name | Type | Description |
---|---|---|
machineId |
String |
Returns:
- Object containing logs for the engine and process execution
- Type
- Object
(async) getMachineInfo(ip, port)
Requests additional information about a machine
Parameters:
Name | Type | Description |
---|---|---|
ip |
String | the ip of the machine |
port |
Number | the port the engine is running on |
(async) getMachineInformation(machine) → {Object}
Gets some necessary information about the machine
Parameters:
Name | Type | Description |
---|---|---|
machine |
Object | contains machines network information to make request |
Returns:
- Object containing id, hostname and currentlyConnectedEnvironments
- Type
- Object
(async) getMachineInformationAndUpdate(machine)
Request information from a machine and update the local information on response
Parameters:
Name | Type | Description |
---|---|---|
machine |
Object | current information about the machine |
getMachineProperties(machineId, properties) → {Object}
Requests and returns the properties for the given machine, desired properties can be specified
Parameters:
Name | Type | Description |
---|---|---|
machineId |
String | |
properties |
Array | names of the desired properties |
Returns:
- object containing the requested properties and their values
- Type
- Object
getOnAbortedHandler(engine, instance)
Creates a callback function that can be used to handle calls from the onAborted hook of the neo engine
Parameters:
Name | Type | Description |
---|---|---|
engine |
Object | proceed engine instance that contains the process information |
instance |
Object | the process instance that ended |
getOnCallActivityInterruptedHandler(engine, instance)
Creates a callback function that can be used to handle calls from the onCallActivityInterrupted hook of the neo engine -> stop execution of call activity processs
Parameters:
Name | Type | Description |
---|---|---|
engine |
Object | proceed engine instance that contains the process information |
instance |
Object | the process instance the token is in |
getOnEndedHandler(engine, onEnded, instance)
Creates a callback function that can be used to handle calls from the onEnded hook of the neo engine
Parameters:
Name | Type | Description |
---|---|---|
engine |
Object | proceed engine instance that contains the process information |
onEnded |
function | function that is supposed to be called when instance ends |
instance |
Object | the process instance that ended |
getOnScriptTaskErrorHandler(engine, instance)
Creates a callback function that can be used to handle calls from the onScriptTaskError hook of the neo engine
Parameters:
Name | Type | Description |
---|---|---|
engine |
Object | proceed engine instance that contains the process information |
instance |
Object | the process instance the token is in |
getOnTokenEndedHandler(engine, onTokenEnded, instance)
Creates a callback function that can be used to handle calls from the onTokenEnded hook of the neo engine
Parameters:
Name | Type | Description |
---|---|---|
engine |
Object | proceed engine instance that contains the process information |
onTokenEnded |
function | function that is supposed to be called when the execution of a token ends |
instance |
Object | the process instance the token is in |
getOnUserTaskInterruptedHandler(engine, instance)
Creates a callback function that can be used to handle calls from the onUserTaskInterrupted hook of the neo engine
Parameters:
Name | Type | Description |
---|---|---|
engine |
Object | proceed engine instance that contains the process information |
instance |
Object | the process instance the token is in |
getParameterInfo(id, expandedList)
a function that parses information about the parameter from the list
Parameters:
Name | Type | Description |
---|---|---|
id |
string | id of the related parameter node |
expandedList |
object | list to search in |
- Source:
getPDF()
Get PDF file
getPNG()
Get PNG file
getProcessBpmn(processDefinitionsId) → {String}
Returns the process definition for the process with the given id
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String |
Returns:
- the process definition
- Type
- String
getProcesses() → {Array}
Returns all known processes in form of an array
Returns:
- array containing all known processes
- Type
- Array
getProcessesFolder() → {String}
Find the path to the folder where the info about all Processes is stored
Returns:
- Type
- String
(async) getProcessHierarchy(definitions) → {Array}
Computes a recursiv list of subprocesses (only global) for the given bpm file
Parameters:
Name | Type | Description |
---|---|---|
definitions |
string | Object | either the xml describing the process or the object parsed from a process xml |
Returns:
hierarchy list of subprocesses
- Type
- Array
(async) getProcessInfo(bpmn)
Parses all necessary information from a process description
Parameters:
Name | Type | Description |
---|---|---|
bpmn |
String | the xml process description |
getProcessInstances(machine, definitionId) → {array}
Requests information about all instances of process with given id
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
machine |
object | contains machine information Properties
|
|||||||||
definitionId |
string | name of the file the process is saved in |
- Source:
Returns:
array with information objects for each instance of the process
- Type
- array
getProcessUserTaskHtml(processDefinitionsId, taskFileName) → {String}
Returns the html for a specific user task in a process
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String | |
taskFileName |
String |
Returns:
- the html under the given fileName
- Type
- String
getProcessUserTasks(processDefinitionsId) → {Array}
Returns the filenames of html data for all user tasks in the given process
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String |
Returns:
- array containing the filenames of the htmls of all user tasks in the process
- Type
- Array
getProcessUserTasksHtml(processDefinitionsId) → {Object}
Return object mapping from user tasks fileNames to their html
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String |
Returns:
- contains the html for all user tasks in the process
- Type
- Object
getSingular(storeName) → {Strings}
Returns singular form of a stores name (machines => machine)
Parameters:
Name | Type | Description |
---|---|---|
storeName |
String | plural |
Returns:
- singular
- Type
- Strings
getStatus(machineId) → {Boolean}
Requests and returns information if the engine with the given id is running a proceed engine
Parameters:
Name | Type | Description |
---|---|---|
machineId |
String | the id of the machine we want to know the status of |
Returns:
- if the machine is running a proceed engine
- Type
- Boolean
getStore(storeName, defaultVal, noStorage)
Creates a new conf store that is used to store the current state of something
Parameters:
Name | Type | Description |
---|---|---|
storeName |
String | the name of the store referencing the thing we want to store |
defaultVal |
undefined | Object | Array | the default layout of the store that is used when creating it |
noStorage |
Boolean | used to signal if the store is supposed to be stored in the Storage subdirectory |
getSVG()
Get SVG file
getUniqueMappedMachineAddresses(machineMapping)
Function that given a machineMapping will return an array of unique machine addresses of machines in the mapping
Parameters:
Name | Type | Description |
---|---|---|
machineMapping |
object | the mapping that contains the machines we want to know the addresses of |
getUpdatedDeploymentInfo(machine) → {object|undefined}
Gets updated information about the processes deployed on the given machine
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
machine |
object |
Properties
|
- Source:
Returns:
- information about the processes deployed on the machine or undefined if nothing changed
- Type
- object | undefined
(async) getUpdatedDeployments()
Checks if there are deployments on the machine that are not known locally or vice versa and updates accordingly
- Source:
getUpdatedTaskConstraintMapping(currentTaskConstraints, userTaskHTML) → {TaskConstraintMapping}
Compute the task constraint mapping for a process based on the current mapping (if present) and on the given user task html content.
Parameters:
Name | Type | Description |
---|---|---|
currentTaskConstraints |
TaskConstraintMapping | The constraints which are currently applying for the process |
userTaskHTML |
String | The html content of a given user task |
Returns:
The new computed task constraint mapping
getUpdateInterval() → {Number}
Returns the time between two requests for machine information
- Source:
Returns:
the interval time
- Type
- Number
getUserTaskDir(id)
Find the user task directory for the given process
Parameters:
Name | Type | Description |
---|---|---|
id |
String |
getUserTaskHandler(engine, instance)
Creates a callback function that can be used to register to the userTask stream of the neo engine
Parameters:
Name | Type | Description |
---|---|---|
engine |
Object | proceed engine instance that contains the process information |
instance |
Object | the process instance the user task was encountered in |
getUserTaskHTML(processDefinitionsId, taskId)
Returns the html for a user task with the given id in a process
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String | |
taskId |
String |
getUserTaskHTML(machine, definitionId, userTaskId) → {string}
Gets HTML for user task with given id in process with given id
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
machine |
object | contains machine information Properties
|
|||||||||
definitionId |
string | name of the file the process is saved in |
|||||||||
userTaskId |
string | id of the user task |
- Source:
Returns:
the user task html
- Type
- string
getUserTaskIds(processDefinitionsId)
Returns the ids of all user tasks of the process with the given id
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String |
getUserTasksByProcess(process)
Parameters:
Name | Type | Description |
---|---|---|
process |
Object |
Returns:
- Returns usertasks for a process from the store
getUserTasksHTML(processDefinitionsId) → {Promise}
Returns the html for all user tasks in a process
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String |
Returns:
- Type
- Promise
getXmlByProcess(process)
Parameters:
Name | Type | Description |
---|---|---|
process |
Object |
Returns:
- Returns xml for a process from the store
init() → {Object}
Creates the initial config which is a merge of the user config and the default config
Returns:
the initial config
- Type
- Object
init()
initializes the process meta information objects
isImageInHtml(html) → {boolean}
Checks if a given html string contains images with a src attribute
Parameters:
Name | Type | Description |
---|---|---|
html |
String |
Returns:
Is true if there are images within
- Type
- boolean
isSubset(set, candidate) → {Boolean}
A function that checks if an object or array contains only the entries contained in some other array or object
the other object(|array) might contain additional entries
(set doesn't mean that the arrays can contain a value only once in this case)
Parameters:
Name | Type | Description |
---|---|---|
set |
Object | Array | the object or array we want to compare against |
candidate |
Object | Array | the object we want to check |
Throws:
Will throw an error if the two given values are not of the same type or if they are not of the specified type (null is also not allowed)
Returns:
if the candidate contains only elements of the original object
- Type
- Boolean
isSubset(set, candidate) → {Boolean}
A function that checks if an object or array contains only the entries contained in some other array or object
the other object(|array) might contain additional entries
(set doesn't mean that the arrays can contain a value only once in this case)
Parameters:
Name | Type | Description |
---|---|---|
set |
Object | Array | the object or array we want to compare against |
candidate |
Object | Array | the object we want to check |
Throws:
Will throw an error if the two given values are not of the same type or if they are not of the specified type (null is also not allowed)
Returns:
if the candidate contains only elements of the original object
- Type
- Boolean
listen(event, listener, once)
Function to receive events from the server without response alignment (ids).
Parameters:
Name | Type | Description |
---|---|---|
event |
string | The name of the event |
listener |
function | The listener function |
once |
boolean | Indicating if only one time listener |
mergeIntoObject(target, toMerge, deepMerge, noNewValues, typesafe) → {Object}
Function that allows overwriting entries in an object with values given in another object
Parameters:
Name | Type | Description |
---|---|---|
target |
Object | the object to merge into |
toMerge |
Object | the object containing the new values |
deepMerge |
Boolean | if nested objects are supposed to be merged recursively (else they are just overwritten) |
noNewValues |
Boolean | String | flag to disallow new entries being added to the target object ('strict' for error, true for silent ignore) |
typesafe |
Boolean | String | if entries are not allowed to change their type ('strict' for error, true for silent ignore) |
Returns:
object containing the values that were actually changed (some changes might be silently ignored due to flags)
- Type
- Object
mergeIntoObject(target, toMerge, deepMerge, noNewValues, typesafe) → {Object}
Function that allows overwriting entries in an object with values given in another object
Parameters:
Name | Type | Description |
---|---|---|
target |
Object | the object to merge into |
toMerge |
Object | the object containing the new values |
deepMerge |
Boolean | if nested objects are supposed to be merged recursively (else they are just overwritten) |
noNewValues |
Boolean | String | flag to disallow new entries being added to the target object ('strict' for error, true for silent ignore) |
typesafe |
Boolean | String | if entries are not allowed to change their type ('strict' for error, true for silent ignore) |
Returns:
object containing the values that were actually changed (some changes might be silently ignored due to flags)
- Type
- Object
observeProcess(processDefinitionsId)
Connects to process namespace and sets up handlers for server side events
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String |
parse(elementRegistry, elementFactory, bpmnFactory, command, context) → {object}
Transforms the serialized context back into a form that we can use to trigger an event similar to the original one
Parameters:
Name | Type | Description |
---|---|---|
elementRegistry |
object | gives us functions to get elements in the modeler (shapes, processes, sequence flows) |
elementFactory |
object | gives us functions to create modeler elements |
bpmnFactory |
object | gives us functions to create the businessObjects of modeler elements |
command |
object | the command we will execute |
context |
object | the serialized context |
Returns:
- the restored context
- Type
- object
pauseInstance()
Sends request to pause an instance of a process on a machine
pauseProcessInstance(machine, definitionId, instanceId)
Sends request to pause a certain process instance
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
machine |
object | contains machine information Properties
|
|||||||||
definitionId |
string | name of the file the process is saved in |
|||||||||
instanceId |
string | id of the specific instance |
- Source:
(async) pingDiscoveredMachines()
Periodically pings discovered machines to ensure that they didn't going offline without signal
(async) pollMachinesInformation()
Occasionally polls all machines for up to date informations
- Source:
prepareProcesses(allProcesses, selectedProcesses, selectedOption)
Retrieve every subprocess and subprocesses of call activities for the selected processes and their meta information, bpmn and user tasks
Parameters:
Name | Type | Description |
---|---|---|
allProcesses |
Array.<Object> | all known processes to search for referenced call activities |
selectedProcesses |
Array.<Object> | all processes that need to be exported |
selectedOption |
String | export format |
preSerialize(command, context) → {object}
Transforms the given context into a JSON serializable form this form contains everything to restore the information on another client to apply the event in the same way
Parameters:
Name | Type | Description |
---|---|---|
command |
string | the command that is supposed to be executed on another machine |
context |
object | the information needed to execute the command |
Returns:
- the transformed context
- Type
- object
readFileAsync(file)
Read File (Blob) with FileReader and resolve the returned promises once the file content is loaded
Parameters:
Name | Type | Description |
---|---|---|
file |
Blob | bpmn file |
readZipAsync(zipBlob)
Read zip files and searches for bpmn files and user tasks for each bpmn file
Parameters:
Name | Type | Description |
---|---|---|
zipBlob |
Blob | zip file containing several bpmn files |
(async) reEvaluateDynamicDeployment(engine, processInstanceId, processInfo, tokenId, from, to) → {dynamicDeploymentResult}
Reevaluate after timer expired to find the optimal next machine to continue execution of the current token
Parameters:
Name | Type | Description |
---|---|---|
engine |
object | instance of the engine class containing all information about the current process and its instances |
processInstanceId |
string | id of the specific instance the token is running in |
processInfo |
object | object with information about the executed process |
tokenId |
string | the id of the token for which we have to decide where to execute it next |
from |
string | the previous executed element |
to |
string | the next element to be executed |
Returns:
holding information about continuation of execution
- Type
- dynamicDeploymentResult
registerModeler(modeler)
Registers the modeler the events are supposed to be applied in with this module
Parameters:
Name | Type | Description |
---|---|---|
modeler |
Object | an instance of a bpmn-js modeler |
- Source:
registerModeler(modeler)
Registers the modeler for which we want to distribute and apply the events
Parameters:
Name | Type | Description |
---|---|---|
modeler |
Object | the modeler |
remove(storeName, elementId)
Function to remove an element from a store (store has to have property like with add)
Parameters:
Name | Type | Description |
---|---|---|
storeName |
String | name of the store we want to remove from |
elementId |
String | id of the element we want to remove |
removeCallActivityReference(callActivityId, noDistribution)
Remove the reference to the called process added in addCallActivityReference but remains the actual bpmn element
Parameters:
Name | Type | Description |
---|---|---|
callActivityId |
String | The ID of the bpmn element for which the meta information should be removed |
noDistribution |
Boolean | if this event should not be distributed to other machines |
- Source:
removeDeployment(processDefinitionsId)
Removes the deployment of the process with the given id from all currently connected machines
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String | the id of the deployed process |
removeDeployment(machine, definitionId)
Sends request to delete the deployment of process with given id
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
machine |
object | contains machine information Properties
|
|||||||||
definitionId |
string | name of the file the process is saved in |
- Source:
(async) removeDeploymentFromMachines(definitionId, machines)
Removes deployed process with corresponding definitionid from all given machines
Parameters:
Name | Type | Description |
---|---|---|
definitionId |
String | name of the file the process is stored under |
machines |
Array | contains information about all machines the process is supposed to be removed from |
removeExcessiveInformation(machineInfo) → {Object}
Returns an object that contains only the most vital information about an object that we would like to store
which is: id, host, port, hostname, name, optionalName
Parameters:
Name | Type | Description |
---|---|---|
machineInfo |
Object | a machine information object |
Returns:
- an object that contains a subset of the original object information
- Type
- Object
removeExcessiveInformation(processInfo)
Removes information from the meta data that would not be correct after a restart
Parameters:
Name | Type | Description |
---|---|---|
processInfo |
Object | the complete process meta information |
(async) removeMachine(service)
Removes machine which unpublished its service from the list of known machines
Parameters:
Name | Type | Description |
---|---|---|
service |
Object |
removeMachine(machineId)
Handles machines that are removed by the user
Parameters:
Name | Type | Description |
---|---|---|
machineId |
String | id of the machine to remove |
removeMachineLogsSubscription(machineId)
Remove flag so that logs for the machine are not requested anymore
Parameters:
Name | Type | Description |
---|---|---|
machineId |
String | the machine for which logs are not needed anymore |
- Source:
removeMachineSubscription(machineId)
Remove flag for extended information about a specific machine
Parameters:
Name | Type | Description |
---|---|---|
machineId |
String | machine for which extended information is not needed anymore |
- Source:
removeProcess(processDefinitionsId)
Removes an existing process
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String |
request(event, …data) → {Promise.<any>}
Function to send and receive exactly one event. It takes care of the response alignemnt using ids to match the async reponse from the server with the initial request.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
event |
string | The name of the event |
|
data |
any |
<repeatable> |
The (raw) data to send |
Returns:
The response from the server
- Type
- Promise.<any>
resumeInstance()
Sends request to resume an instance of a process on a machine
resumeProcessInstance(machine, definitionId, instanceId)
Sends request to resume a certain process instance
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
machine |
object | contains machine information Properties
|
|||||||||
definitionId |
string | name of the file the process is saved in |
|||||||||
instanceId |
string | id of the specific instance |
- Source:
saveEnvProfile(Id, type, environmentProfile)
Saves the json for a given environment profile
Parameters:
Name | Type | Description |
---|---|---|
Id |
String | the id of the environment profile |
type |
String | the type of the environment profile |
environmentProfile |
String | the environment profile json |
saveProcess(id, bpmn)
Saves the process bpmn of a process
Parameters:
Name | Type | Description |
---|---|---|
id |
String | the id of the process |
bpmn |
String | the process description |
saveScriptTaskJS(processDefinitionsId, taskId, js)
Saves the script for a scriptTask
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String | |
taskId |
String | |
js |
String |
saveUserTaskHTML(processDefinitionsId, taskId, html)
Saves the html of the a user task
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String | the id of the process that contains the user task |
taskId |
String | the id of the specific user task |
html |
String | the html data of the user task |
sendConfiguration(machineId, configuration)
Sends a configuration to an engine which it is supposed to use
Parameters:
Name | Type | Description |
---|---|---|
machineId |
String | |
configuration |
Object | object containing config values |
(async) sendImportedProcesses(process, bpmn, machineInfo, dynamic)
Checks the process for imported processes and sends them to the correct endpoint if there are any
Parameters:
Name | Type | Description |
---|---|---|
process |
* | |
bpmn |
* | |
machineInfo |
* | |
dynamic |
Boolean | if the process is deployed dynamically |
(async) sendUserTaskHTML(process, machineInfo, dynamic)
Sends user task html to all machines that need them
Parameters:
Name | Type | Description |
---|---|---|
process |
object | used to determine the endpoint we want to send the data to (actual process/importing process) |
machineInfo |
object | either a map mapping taskId to machine or a machine |
dynamic |
bool | indicates if the html is to be send to a singular machine or multiple ones |
sendUserTaskHTML(machine, definitionId, userTaskId, html)
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
machine |
object | contains machine information Properties
|
|||||||||
definitionId |
string | name of the file the process is saved in |
|||||||||
userTaskId |
string | id of the user task |
|||||||||
html |
string | the html of the user task |
- Source:
setPdfPropsAndValues()
create PDF with Properties and Values
setProcessDefinitionsId(pId)
Sets processDefinitionsId which is needed when distributing the event
Parameters:
Name | Type | Description |
---|---|---|
pId |
String | supposed id of the process insidethe modeler |
(async) settleRequest(request) → {object}
Waits for request to resolve or reject and returns the result and information if it succeded
Parameters:
Name | Type | Description |
---|---|---|
request |
promise | the request we await to resolve |
Returns:
object containing a result and a status member
- Type
- object
setUpdateInterval(newInterval)
Allows changing the time between two consecutive machine information requests
Parameters:
Name | Type | Description |
---|---|---|
newInterval |
Number | the new time between two requests (in seconds) |
- Source:
setupMachineInfoRequestHandlers(addListener)
Setup handlers for specific subscription requests from clients
Parameters:
Name | Type | Description |
---|---|---|
addListener |
function | allows setting callbacks for socket requests from clients |
startInstance(processDefinitionsId)
Starts an instance of the deployed process with the given id
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String | id of the deployed process |
Throws:
Will throw an error if starting the instance fails
startMachinePolling(socket)
Handles the request of a client for recurring updates about all machines
Parameters:
Name | Type | Description |
---|---|---|
socket |
Object | the requesting socker |
startPolling()
Activates a polling loop that requests information from all machines
- Source:
startProcessInstance(machine, definitionId, variables) → {string}
Sends request to start an instance of a process with process variables
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
machine |
object | contains machine information Properties
|
|||||||||
definitionId |
string | name of the file the process is saved in |
|||||||||
variables |
object | start values for process variables |
- Source:
Returns:
the id of the created isntance
- Type
- string
(async) staticDeployment(process, bpmn)
Sends process bpmn and user task html to all machines that were mapped to flowNodes in the process
Parameters:
Name | Type | Description |
---|---|---|
process |
Object | object containing all information about the process to deploy |
bpmn |
String | the process description in xml |
stopInstance()
Sends request to stop an instance of a process on a machine
(async) stopInstanceOnNetwork(definitionId, instanceId)
Sends request to stop process instance to all machines in the local network
Parameters:
Name | Type | Description |
---|---|---|
definitionId |
string | name of the file the process is stored in |
instanceId |
string | the id of the instance to stop |
stopMachinePolling(socket)
Removes a socket from the list of subscribed sockets and stops request for updates if no socket remains
Parameters:
Name | Type | Description |
---|---|---|
socket |
Object |
(async) stopObserving(processDefinitionsId)
Unregisters from process namespaces
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String |
stopPolling()
Deactivates the machine polling loop
- Source:
stopProcessInstance(machine, definitionId, instanceId)
Sends request to stop a certain process instance
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
machine |
object | contains machine information Properties
|
|||||||||
definitionId |
string | name of the file the process is saved in |
|||||||||
instanceId |
string | id of the specific instance |
- Source:
strikeMachine(machine)
Adds a strike for an unreachable discovered machine and removes it at the third strike
Parameters:
Name | Type | Description |
---|---|---|
machine |
Object | machine information object |
subscribeToMachine(machineId, socket)
Function that subscribes a client to updates of information about one machine
Parameters:
Name | Type | Description |
---|---|---|
machineId |
string | |
socket |
object | the connection to the client that wants the information |
subscribeToMachineLogs(machineId, socket)
Subscribes a client to the log stream of a machine
Parameters:
Name | Type | Description |
---|---|---|
machineId |
String | the machine that the client wants information for |
socket |
Object | the endpoint for the client that wants the information |
unblockProcess(socketId, processDefinitionsId)
Removes the id of the socket wanting to unblock the process from the process object
Parameters:
Name | Type | Description |
---|---|---|
socketId |
String | |
processDefinitionsId |
String |
unsubscribeFromAllLogs(socket)
Clears all log subscriptions of a client
Parameters:
Name | Type | Description |
---|---|---|
socket |
Object | the client that unsubscribes |
unsubscribeFromAllMachines(socket)
Clears all subscriptions of a client
Parameters:
Name | Type | Description |
---|---|---|
socket |
Object | the client that unsubscribes |
unsubscribeFromMachineLogs(machineId, socket)
Unsubscribes a client from the log stream of a machine
Parameters:
Name | Type | Description |
---|---|---|
machineId |
String | the machine the client doesn't want logs for anymore |
socket |
Object | the endpoint for the client that wants no logs anymore |
update(storeName, elementId, updatedInfo)
Function to update a single value inside one of the stores
Parameters:
Name | Type | Description |
---|---|---|
storeName |
String | the name of the store we want to update something in |
elementId |
String | the id of the element we want to update |
updatedInfo |
Object | the info we want to overwrite the current one with |
updateByIds(storeName, idUpdateMap, key:, value:)
Allows the manipulation of specific objects in the given store BEWARE: Don't use this on the config store
Parameters:
Name | Type | Description |
---|---|---|
storeName |
string | |
idUpdateMap |
object | object with key value pairs |
key: |
string | the id of the object we want to change |
value: |
object | the new value for the object we want to change |
updateProcess(id, bpmn, newName)
Saves new process bpmn for an existing process and changes the file and directory name if the process name changed
Parameters:
Name | Type | Description |
---|---|---|
id |
String | |
bpmn |
String | |
newName |
String | optional |
updateProcess(processDefinitionsId, newBpmn) → {Object}
Updates an existing process with the given bpmn
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String | |
newBpmn |
String |
Returns:
- contains the new process meta information
- Type
- Object
updateProcessMetaData(processDefinitionsId, metaChanges)
Direct updates to process meta data, should mostly be used for internal changes (puppeteer client, electron) to avoid parsing the bpmn unnecessarily
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
Object | |
metaChanges |
Object | contains the elements to change and their new values |
(async) updateProcessViaWebsocket(id, bpmn, processChanges)
Sends the new bpmn of a process for the backend to save
Parameters:
Name | Type | Description |
---|---|---|
id |
String | id of the process |
bpmn |
String | |
processChanges |
String | changes to the process meta information that should be merged on the server |
updateStoreIfInfoChanged(oldInfo, newInfo)
Checks if a change of machine information should trigger a mutation of the backend machine store
Parameters:
Name | Type | Description |
---|---|---|
oldInfo |
Object | contains the previously known information about a machine |
newInfo |
Object | contains the newly available information about a machine |
(async) waitForNetworkConnection()
Periodically checks if there is a network connection and restarts discovery functionality if there is
Type Definitions
Constraint
Type:
- Object
Properties:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
_type |
String | ||||||||||
_attributes |
Object | ||||||||||
name |
String | ||||||||||
condition |
String | ||||||||||
values |
Array.<Object> |
Properties
|
|||||||||
_valuesAttributes |
Object |
downCallback(machine)
callbacks that are to be called when a discovered service goes down
Parameters:
Name | Type | Description |
---|---|---|
machine |
Object | the machine that unpublished its service |
TaskConstraintMapping
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
softConstraints |
Array.<Constraint> | List of soft constraints |
hardConstraints |
Array.<Constraint> | List of hard constraints |
upCallback(newMachine)
callbacks that are to be called if a new machine is discovered
Parameters:
Name | Type | Description |
---|---|---|
newMachine |
Object | the machine that was newly discovered |