Members
activeTab
The currently open tab in the sidebar
(constant) addResourcePermission
adds a new permission depending on role permissions for a newly created resource
(constant) buildPermissions
builds permission for user that wants to authenticate
(constant) CONFIG_PROPERTIES
The property names of the machine values that are set/appended by the config.
(constant) createAdminUser
initially migrates data to iam related stores and creates admin user if not exists
(constant) defineRules
translates userinfo permissions object into casl rules
detectedCapabilities
A list of capabilities detected in the code
elementFilter
Model for the filter field.
(constant) ensureCleanRoleMappings
cleans up role mappings and roles members when a user is deleted
(constant) getUserinfo
fetches userinfo from idp /userinfo endpoint
- Source:
(constant) handleOauthCallback
handles oauth callback, exchanges authorization code for tokens and caches tokens
(constant) initOpaCache
migrates data on server start to the opa cache for policy decision making
(constant) initResourcePermissions
initializes permissions for each individual resource that is loaded in stores on initial page load
(constant) isAllowed
can be used as express middleware in app.use(...) or directly in route e.g. app.get(path, isAllowed(...), ...)
Example
// checks if user has 16 = manage permissions for resource Role
isAllowed(16, 'Role')
// checks if user has 8 = delete OR 16 = manage permissions for resource Group
isAllowed([8, 16], 'Group')
// checks if user has 8 = delete AND 16 = manage permissions for resource Group (default decisionStrategy = "affirmative")
isAllowed([8, 16], 'Group', { decisionStrategy: "unanimous" })
// tells OPA to filter resources, which are only available for current authenticated user if user has sufficient permissions
isAllowed(1, 'Process', { filter: true })
// if resource is set to undefined, context MUST be set to true and req.context has to be set in a middleware, to provide resourceType and resourceId to OPA via context (useful for routes that can handle multiple types of resources)
isAllowed(16, undefined, { context: true })
// get error messages from OPA
isAllowed(1, 'Process', { explain: true })
// pass http body from request to OPA
isAllowed(1, 'Process', { includeBody: true })
(constant) isAuthenticated
check if user is authenticated
(constant) login
builds authorization url for authorization code flow with pkce
(constant) logout
builds logout url
machines
The local cache of the machine list available in the network.
messages
Storing messages to be displayed about the current code.
(constant) processSockets
Contains process specific connections
(constant) PROPERTIES
Property names and corresponding cache timeouts in s.
(constant) refreshUserToken
refreshes the user's access token
(constant) revokeUserToken
revokes the user's access token at the idp
(constant) runClientCredentialsFlow
runs client credentials flow to re-authenticate service account
suggestions
Storing available autocomplete suggestions for the code.
(constant) translateListToPermission
translates a permission list into a permissions number
(constant) translatePermissionToList
translates a permissions number into a list of permissions
(constant) verifyIdToken
verifies signature of id token and validates algorithm, audience, issuer and nonce
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
(async) activateInspectionOrder(engine, userTask, _5iInformation)
Will signal to the 5thIndustry Application that the task linked to an inspection order has become active
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
engine |
Object | the engine of the process the user task occured in |
|||||||||||||||||||||
userTask |
Object | the user task that has become active |
|||||||||||||||||||||
_5iInformation |
Object | 5thIndustry data needed to match the user task to a specific inspection order in 5thIndustry App Properties
|
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
(async) addAdditionalContent(container, process, viewer, options)
Adds optional content to the pdf/directory (e.g. User Tasks for bpmn export or called processes for image exports)
Parameters:
Name | Type | Description |
---|---|---|
container |
Object | a pdf or zip directory |
process |
* | |
viewer |
* | |
options |
* |
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(processConstraints, taskConstraintMapping)
Adds process and task constraints as extension elements to the process after checking for inconsistencies
Parameters:
Name | Type | Description |
---|---|---|
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) addFile(container, process, viewer, options)
Adds a file to the given pdf/zip directory
Parameters:
Name | Type | Description |
---|---|---|
container |
Object | either a pdf file or a zip directory |
process |
Object | the process we want to create a file of |
viewer |
Object | the viewer to get image data from |
options |
Object | the selected export options |
addLocationsToElement(element, locations)
Adds the given locations to the extensionElements of the given modeler element
Parameters:
Name | Type | Description |
---|---|---|
element |
Object | the modeler element we want to add the locations to |
locations |
Object | the locations 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:
addMilestonesToElement(element, milestones)
Adds the given milestones to the extensionElements of the given modeler element
Parameters:
Name | Type | Description |
---|---|---|
element |
Object | the modeler element we want to add the milestones to |
milestones |
Object | the milestones we want to add |
- 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
addProcess(processData)
Adds a new process to the browsers localStorage
Parameters:
Name | Type | Description |
---|---|---|
processData |
String | the process definition and additional process info |
(async) addProcess(processData)
Will send the process to the backend for authenticated users and shared processes or store it in the browser-storage for unauthenticated users
Parameters:
Name | Type | Description |
---|---|---|
processData |
Object |
addResourcesToElement(element, resources)
Adds the given resources to the extensionElements of the given modeler element
Parameters:
Name | Type | Description |
---|---|---|
element |
Object | the modeler element we want to add the resources to |
resources |
Object | the resources we want to add |
- Source:
addRole(roleRepresentation) → {Object}
Adds a new role for the PROCEED MS
Parameters:
Name | Type | Description |
---|---|---|
roleRepresentation |
Object | role representation |
Returns:
- newly created role
- Type
- Object
addRoleMapping(roleMapping) → {Object}
Adds a user role mapping
Parameters:
Name | Type | Description |
---|---|---|
roleMapping |
Object | role mapping object containing userId & roleId |
Returns:
- new user role mapping
- Type
- Object
addShare(share) → {Object}
Creates a new share
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
share |
Object | the new share object Properties
|
Returns:
- new share object
- Type
- Object
addToPDF(pdf, viewer, process, options) → {Promise.<Object>}
Adds an image of a (sub)process to the given pdf
Parameters:
Name | Type | Description |
---|---|---|
pdf |
Object | the pdf file to write to |
viewer |
Object | the bpmn-js viewer to get the image data from |
process |
Object | the (sub)process we want to create the pdf data from |
options |
Object | the selected export options |
Returns:
the updated pdf file
- Type
- Promise.<Object>
addZipFile(processFolder, fileName, file, options)
Adds a file to the given directory inside the zip
Parameters:
Name | Type | Description |
---|---|---|
processFolder |
Object | the directory the file will be added to |
fileName |
Object | the name to be used for the zip file |
file |
Object | the content of the new zip file |
options |
Object | the selected export options |
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 |
(async) asyncForEach(array, cb)
Executes an async callback for every entry in an array and will resolve when all callbacks resolved
Parameters:
Name | Type | Description |
---|---|---|
array |
Array | the array for which the async forEach is supposed to be executed |
cb |
asyncArrayCallback | the function to execute for every entry |
(async) asyncMap(array, cb)
Executes an async callback to map every entry in an array and will resolve with the results when all callbacks resolved
Parameters:
Name | Type | Description |
---|---|---|
array |
Array | the entries which are supposed to be mapped |
cb |
asyncArrayCallback | the async mapping function |
authRouter() → {Express.Router}
creates authentication related routes for express application
Returns:
- Express router
- Type
- Express.Router
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) → {Promise.<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
- Promise.<boolean>
checkForUncoveredDomains(domains, coveredDomains) → {Boolean}
Checks if a list of domains contains at least one that is not in a list of covered domains
Parameters:
Name | Type | Description |
---|---|---|
domains |
Array.<String> | the domain list to check |
coveredDomains |
Array.<String> | the list of covered domains |
Returns:
if there are uncovered domains
- 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 |
completeUserTask(machine, instanceId, userTaskId, processChain, callChain)
Complete userTask on machine
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
machine |
object | contains machine information Properties
|
|||||||||
instanceId |
string | id of the instance the userTask is running in |
|||||||||
userTaskId |
string | id of the active userTask |
|||||||||
processChain |
string | ||||||||||
callChain |
string |
- Source:
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
(async) createConfig() → {Object}
creates iam configuration based on parameters and schema
Parameters:
Type | Description |
---|---|
Object | iam configuration object |
Returns:
- validated iam configuration object
- Type
- Object
(async) createProcessContainer(process, viewer, options, zipopt) → {Promise.<Object>}
Creates a pdf in case of pdf export or a zip directory in case we export multiple non pdf files
will add the pdf to the given optionally given zip
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
process |
Object | the process to export |
|
viewer |
Object | the bpmn-js process viewer |
|
options |
Object | the selected export options |
|
zip |
Object |
<optional> |
the zip we want to create the container in in case of multi process export |
Returns:
either a zip directory or a pdf file
- Type
- Promise.<Object>
createUserTasks(processFolder)
Creates user task directory and files in zip
Parameters:
Name | Type | Description |
---|---|---|
processFolder |
Object | the directory in the zip to write to |
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 |
deleteRole(roleId)
Deletes a role from the PROCEED MS
Parameters:
Name | Type | Description |
---|---|---|
roleId |
String | the id of a role |
deleteRoleMapping(userId, roleId) → {Object}
Removes a role mapping from a user
Parameters:
Name | Type | Description |
---|---|---|
userId |
String | id of user |
roleId |
String | role mapping that has to be removed based on roleId |
Returns:
- new mapping object without removed element
- Type
- Object
deleteShare(shareId) → {String}
Deletes a share based on share id
Parameters:
Name | Type | Description |
---|---|---|
shareId |
Object | id share object |
Returns:
- id share object
- Type
- String
deleteUserTaskHTML(processDefinitionsId, taskFileName)
Removes data for a specific user task
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String | |
taskFileName |
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 or a zip if we export multiple files.
Parameters:
Name | Type | Description |
---|---|---|
allProcesses |
Array.<Object> | all known processes to search for referenced call activities |
selectedProcesses |
Array.<Object> | all processes that were selected for export |
selectedOption |
Object | selected export options |
filterHTML(processInfo, imported) → {Array}
Function that filters the User Tasks HTML fileNames 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 fileNames for all User-Task data we have
- 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
(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 |
getActiveUserTaskHTML(machine, instanceId, userTaskId, processChain, callChain) → {string}
Requests HTML from active userTask on machine
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
machine |
object | contains machine information Properties
|
|||||||||
instanceId |
string | id of the instance the userTask is running in |
|||||||||
userTaskId |
string | id of the active userTask |
|||||||||
processChain |
string | ||||||||||
callChain |
string |
- Source:
Returns:
HTML of the userTask
- Type
- string
getActiveUserTasks(machine) → {array}
Requests active userTasks on machine
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
machine |
object | contains machine information Properties
|
- Source:
Returns:
array with information-objects for every active usertask
- Type
- array
getAllCollapsedSubprocesses(process)
Returns content of all collapsed subprocesses for given process
Parameters:
Name | Type | Description |
---|---|---|
process |
Object | current selected process of the hierarchy |
getAllSubprocesses(allProcesses, currentProcess, includedProcesses, addUserTasksopt, includeCollapsed)
Creates a set of all called processes inside a process and their called processeses recursively
additionally adds the collapsed subprocesses of a process as an attribute to the respective process
Parameters:
Name | Type | Attributes | 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 containing all (nested) call activities |
|
addUserTasks |
Boolean |
<optional> |
if we want to get the user tasks of the called processes |
includeCollapsed |
Boolean | signal if also collapsed subprocesses should be retrieved |
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
getCertificate(letsencryptPath) → {Object}
Returns a certificate which is supposed to be used for the servers that provide the frontend and the websockets
Parameters:
Name | Type | Description |
---|---|---|
letsencryptPath |
String | the file path where the Let's Encrypt Challenge Files are served from |
Returns:
The private key and public certificate to use
- Type
- Object
getCertificateDomains(pem) → {Array.<String>}
Returns the domains specified inside a certificate
Parameters:
Name | Type | Description |
---|---|---|
pem |
String | the certificate string |
Returns:
list of domains
- Type
- Array.<String>
(async) getClient(config) → {Object}
creates openid client with library: https://github.com/panva/node-openid-client/blob/main/docs/README.md#client
Parameters:
Name | Type | Description |
---|---|---|
config |
Object | the iam configuration |
Returns:
- OpenID Client
- Type
- Object
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
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
(async) getExportFile(processesToExport, options) → {Promise.<Object>}
Creates the file we want to export
Parameters:
Name | Type | Description |
---|---|---|
processesToExport |
Array.<Object> | the processes we want to export and their information |
options |
Object | the selected export options |
Returns:
the file to export
- Type
- Promise.<Object>
(async) getExportZip(processesToExport, viewer, options) → {Promise.<Object>}
Creates the zip file containing all the files we want from the export
Parameters:
Name | Type | Description |
---|---|---|
processesToExport |
Array.<Object> | the processes we want to export |
viewer |
Object | a bpmn-io viewer |
options |
Object | the selected export options |
Returns:
the zip file to export
- Type
- Promise.<Object>
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
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:
(async) getPlanInspectionOrder(engine, _5iInformation) → {Object}
Requests some information about a specific inspection order that we need to check if the order was finished
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
engine |
Object | the engine of the process the user task occured in |
||||||||||||||||||
_5iInformation |
Object | 5thIndustry data needed to match the user task to a specific inspection order in 5thIndustry App Properties
|
Returns:
the order information
- Type
- Object
getPNG(viewer, isMultiDownload, resolution) → {Promise.<String>}
Creates a png from the process in the viewer
Parameters:
Name | Type | Description |
---|---|---|
viewer |
Object | the bpmn-js viewer to get the image from |
isMultiDownload |
Boolean | if the png will be added to some kind of containing file |
resolution |
Number |
Returns:
the png data
- Type
- Promise.<String>
getProcess(processDefinitionsId, processesopt) → {Object}
Returns the locally stored process with the given id
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
processDefinitionsId |
String | ||
processes |
Object |
<optional> |
the list of objects to search (to avoid redundant parsing) |
Returns:
an Object containing the processes information
- Type
- Object
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
getProcesses() → {Object}
Returns all processes that are stored in the browser
Returns:
an object containing all locally stored processes
- Type
- Object
getProcessesFolder() → {String}
Find the path to the folder where the info about all Processes is stored
Returns:
- Type
- String
(async) getProcessFile(process, viewer, options, containeropt) → {Promise.<(Object|String)>}
Creates a single file for a process
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
process |
Object | the process from which we want to create the file |
|
viewer |
Object | a bpmn-js viewer |
|
options |
Object | the selected export options |
|
container |
Boolean |
<optional> |
pdf or zip directory the file will be added to |
Returns:
the file or string with the process information
- Type
- Promise.<(Object|String)>
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
getResource(resourceId) → {Array}
Returns a resource based on resource id
Parameters:
Name | Type | Description |
---|---|---|
resourceId |
String | the id of a resource |
Returns:
- array containing all resources
- Type
- Array
getResources() → {Array}
Returns all resources in form of an array
Returns:
- array containing all resources
- Type
- Array
getRoleById(roleId) → {Object}
Returns a role based on role id
Parameters:
Name | Type | Description |
---|---|---|
roleId |
String | the id of a role |
Returns:
- role object
- Type
- Object
getRoleMappingByUserId(userId) → {Array}
Returns a role mapping by user id
Parameters:
Name | Type | Description |
---|---|---|
userId |
String | the id of a user |
Returns:
- role mappings of a user
- Type
- Array
getRoleMappings() → {Array}
Returns all role mappings in form of an array
Returns:
- array containing all role mappings
- Type
- Array
getRoles() → {Array}
Returns all roles in form of an array
Returns:
- array containing all roles
- Type
- Array
getShare(shareId) → {Array}
Returns a share based on share id
Parameters:
Name | Type | Description |
---|---|---|
shareId |
String | the id of a share |
Returns:
- array containing all shares
- Type
- Array
getShares() → {Array}
Returns shares in form of an array
Returns:
- array containing shares
- Type
- Array
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(viewer, isMultiDownload)
Creates a SVG from the modeler content
Parameters:
Name | Type | Description |
---|---|---|
viewer |
Object | the bpmn-js viewer to get the data from |
isMultiDownload |
Boolean | if the SVG will be added to some kind of container 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:
getUpdateInterval() → {Number}
Returns the time between two requests for machine information
- Source:
Returns:
the interval time
- Type
- Number
(async) getUserInfo() → {Object}
calls userinfo endpoint at idp via backend to retreive user information
Returns:
- userinfo object
- Type
- Object
getUserTaskDir(id)
Find the user task directory for the given process
Parameters:
Name | Type | Description |
---|---|---|
id |
String |
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
getUserTasksHTML(processDefinitionsId) → {Object}
Returns the user task data for all user tasks in a process
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String |
Returns:
contains mapping from user task filename to user task data
- Type
- Object
getXmlByProcess(process)
Parameters:
Name | Type | Description |
---|---|---|
process |
Object |
Returns:
- Returns xml for a process from the store
(async) handle5thIndustryUserTask(userTask, engine)
Will setup everything that is needed to handle a User Task that is using 5thIndustry as its implementation
Parameters:
Name | Type | Description |
---|---|---|
userTask |
Object | the user task object from the neo engine |
engine |
Object | the proceed engine instance associated with the process the user task occured in |
handleLetsEncrypt(letsencryptPath, frontendServers)
Handles Let's Encrypt functionality, e.g. keeping certificates up to date and requesting a new certificate when the list of domains for the server changes
Parameters:
Name | Type | Description |
---|---|---|
letsencryptPath |
String | the file path where the Let's Encrypt Challenge Files are served from |
frontendServers |
Array.<Object> | the node https servers used for the frontend and the websockets |
(async) handleOauthCallback() → {Object}
executed on every page load performs oauth callback when oauth authorization request is detected based at backend
Returns:
- authenticated or unauthenticated user information
- Type
- Object
hasProcess(processDefinitionsId) → {Boolean}
Returns if a process with the given id is stored in the browser
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String |
Returns:
- Type
- Boolean
(async) init()
For explanation for the general server architecture, see: https://gitlab.com/dBPMS-PROCEED/proceed/-/wikis/MS/Architecture-Server-and-Desktop-App#ms-server-architecture
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 resources meta information objects
init()
initializes the role mappings meta information objects
init()
initializes the roles meta information objects
init()
initializes the shares meta information objects
init()
initializes the process meta information objects
(async) initAdditionalLetsEnrypt(letsencryptPath, frontendServers, coveredDomains)
Will initialize an AcmeService to augment the already existing Certificate.
This will request a Let's Encrypt Certificate for URLs that are entered into the config and that point at the server but are not covered by the main certificate. Requests to the URLs will be served using the Let's Encrypt Certificate while all others are served using the main certificate
Parameters:
Name | Type | Description |
---|---|---|
letsencryptPath |
String | the file path where the Let's Encrypt Challenge Files are served from |
frontendServers |
Array.<Object> | the node https servers used for the frontend and the websockets |
coveredDomains |
Array.<String> | the domains that are already covered by the main certificate and should not be considered for the LE certificate |
initRenderJSON(config)
Initializes the dom tree that represents the config ui
Parameters:
Name | Type | Description |
---|---|---|
config |
Object | the config values as gotten from the engine |
inputElement(parentElement, key, valueBefore, callback) → {Object}
Sets up dom elements (input etc.) and callbacks for a specific config entry
Parameters:
Name | Type | Description |
---|---|---|
parentElement |
Object | the DOM element the new elements should be placed in |
key |
String | the key of the entry we want to set up the input for |
valueBefore |
String | Boolean | Number | the current value of the entry |
callback |
function | the callback that is supposed to be called on change |
Returns:
the newly created line containing the input elements
- Type
- Object
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 |
(async) mapUserTasks(newPlan)
Tries to adjust the ids of the assembly groups, manufacturing steps and inspection orders that were assigned to user tasks
This is necessary since the ids change when a plan is created from a template
Parameters:
Name | Type | Description |
---|---|---|
newPlan |
Object | the newly created plan |
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
(async) migrateProcesses()
migrates all available processes
(async) migrateRoles()
migrates all available roles
(async) migrateShares()
migrates all available shares
moveToken(machine, processDefinitionsId, instanceId, tokenId, flowElementId)
Moves token inside an instance to a new flow element
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
machine |
Object |
Properties
|
|||||||||
processDefinitionsId |
String | ||||||||||
instanceId |
String | ||||||||||
tokenId |
String | ||||||||||
flowElementId |
String |
moveToken(machine, definitionId, instanceId, tokenId, flowElementId)
Sends a request to move a token from one element to another
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
machine |
Object | the machine that is currently executing the token Properties
|
|||||||||
definitionId |
string | name of the file the process is saved in |
|||||||||
instanceId |
string | id of the specific instance |
|||||||||
tokenId |
string | id of the token to move |
|||||||||
flowElementId |
string | id of the target element |
- Source:
needZipExport(processesToExport, options) → {Boolean}
Checks if we have to export more than one file which means we have to use a zip file
Parameters:
Name | Type | Description |
---|---|---|
processesToExport |
Array.<Object> | the process(es) we want to export |
options |
Object | the export options (e.g. which file format to export to) |
Returns:
if the export has to be in form of a zip
- Type
- Boolean
normalizeUrl(url)
Will remove trailing slash from a url if there is one
Parameters:
Name | Type | Description |
---|---|---|
url |
String | the url to normalize |
observeProcess(processDefinitionsId)
Connects to process namespace and sets up handlers for server side events
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String |
onCallActivity(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 |
onRefreshData()
Gets current config values from engine and builds dom from it
onUserTask(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 |
onWriteUserConfig()
Sends updated config to the engine
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) pollInspectionOrderProgress(engine, userTask, _5iInformation)
Will poll the 5thIndustry App to see if the Inspection Order linked to the user task has been finished
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
engine |
Object | an instance of the proceed engine in which the process is executed in |
||||||||||||||||||
userTask |
Object | the user task that has become active insde the process |
||||||||||||||||||
_5iInformation |
Object | 5thIndustry data needed to match the user task to a specific inspection order in 5thIndustry App Properties
|
(async) pollMachinesInformation()
Occasionally polls all machines for up to date informations
- Source:
prepareProcesses(allProcesses, processesToExport, options)
Retrieve every subprocess and subprocesses of call activities for the processes to export and their meta information, bpmn and user tasks
Parameters:
Name | Type | Description |
---|---|---|
allProcesses |
Array.<Object> | all known processes to search for referenced call activities |
processesToExport |
Array.<Object> | all processes that need to be exported |
options |
Object | 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
(async) pullProcess(id, isUpdateopt) → {Object}
Pulls process from the backend writes it to the browser storage and returns it
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
id |
String | the definitions id of the process |
|
isUpdate |
Boolean |
<optional> |
if the process is known but supposed to be synchronized with the server |
Returns:
The process with the given id
- Type
- Object
(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 |
removeDictElement(storeName, elementId, itemId)
Function to remove an element from a store in dictionary format
Parameters:
Name | Type | Default | Description |
---|---|---|---|
storeName |
String | name of the store we want to remove from |
|
elementId |
String | id of the element we want to remove |
|
itemId |
String | null | only if nested item in element should be removed |
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, ip, 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 |
removeProcess(processDefinitionsId)
Removes a process from the localStorage
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String |
removeUserTaskForm(taskId)
Removes the displayed form of a user task (does nothing if it isn't currently displayed)
Parameters:
Name | Type | Description |
---|---|---|
taskId |
String | id of the user task of which we want to remove the form |
renderFirstLayerJSON(parentNode, configObject)
Actually the same functionality as in renderJSON(), but that it puts the input elements first and then the configuration objects. Needed to put 'name' and 'description' before all other configs.
Parameters:
Name | Type | Description |
---|---|---|
parentNode |
Object | the node inside which the current tree should be build (might be the root or some encapsulating config tree) |
configObject |
Object | the config for which the ui should be build |
renderJSON(parentNode, configObject)
(Recursively) builds the ui which allows editing the given config
Parameters:
Name | Type | Description |
---|---|---|
parentNode |
Object | the node inside which the current tree should be build (might be the root or some encapsulating config tree) |
configObject |
Object | the config for which the ui should be build |
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>
requestDeploymentInformation() → {Promise.<Array.<void>>}
Request deployment information from every connected machine
- Source:
Returns:
Resolves if all deployment information was requested
- Type
- Promise.<Array.<void>>
(async) restRequest(path, options) → {Object|Array|String}
function prepares http requests
Parameters:
Name | Type | Description |
---|---|---|
path |
String | request path |
options |
Object | default undefined, otherwise necessary http request options |
Returns:
- response of http request
- Type
- Object | Array | String
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:
runningInstances()
Returns array with all instances that didn't finish yet for the displayed machine
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 |
saveScriptTaskJS(processDefinitionsId, taskId, js)
Saves script task data for a specific task inside a process
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 |
saveUserTaskHTML(definitionsId, taskFileName, html)
Saves user task data for a specific process
Parameters:
Name | Type | Description |
---|---|---|
definitionsId |
String | |
taskFileName |
String | the tasks filename that would be used if it was stored on the server |
html |
String | the user task data |
saveUserTasksHtml(definitionsId, userTasks)
Overwrites user tasks of a process with the given ones
Parameters:
Name | Type | Description |
---|---|---|
definitionsId |
String | |
userTasks |
Object | mapping from filenames to the contained html |
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) sendGraphQLRequest(data) → {Object}
Will send a request to 5thIndustries GraphQL API
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | the request data to send |
Throws:
Throws an exception if the GraphQL API returns an error code
Returns:
the response body
- Type
- Object
sendImportedProcess(machine, definitionId, importedDefinitionId, bpmn)
Sends process used in call activity of another process
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
machine |
Object | contains machine information Properties
|
|||||||||
definitionId |
String | the id in the definitions field of the importing process |
|||||||||
importedDefinitionId |
String | the id in the definitions field of the imported process |
|||||||||
bpmn |
String | the description of the process in xml |
- Source:
(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:
setDictElement(storeName, newItem)
Function to set an element in dictionary format
Parameters:
Name | Type | Description |
---|---|---|
storeName |
String | the name of the store we want to add to |
newItem |
Object | the object we want to add |
(async) setInspectionOrderTokenState(engine, _5iInformation, tokenState)
Will set an attribute on a specific inspection order that signals that the linked User Task is either currently active or not active
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
engine |
Object | the engine of the process the user task occured in |
||||||||||||||||||
_5iInformation |
Object | 5thIndustry data needed to match the user task to a specific inspection order in 5thIndustry App Properties
|
||||||||||||||||||
tokenState |
Boolean | if the token is currently on the linked user task or not |
setPdfPropsAndValues(pdf, imageURI, process, isHeadingRequested, svgWidth, svgHeight)
create PDF with Properties and Values
Parameters:
Name | Type | Description |
---|---|---|
pdf |
Object | the pdf we want to add to |
imageURI |
String | |
process |
Object | the process we add the image for |
isHeadingRequested |
Boolean | if the images in the pdf should be anotated |
svgWidth |
String | |
svgHeight |
String |
setProcessDefinitionsId(pId, sId)
Sets processDefinitionsId and optional subprocessId which is needed when distributing the event
Parameters:
Name | Type | Description |
---|---|---|
pId |
String | supposed id of the process insidethe modeler |
sId |
String | supposed id of the subprocess |
setTaskExternal(element, external)
Sets external value on a task
Parameters:
Name | Type | Description |
---|---|---|
element |
Object | the element to change |
external |
Boolean | if the task is supposed to be external |
- Source:
(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 |
start5thIndustryPlan(inspectionPlanId)
Will set a plan into a in progress state to signal that it is being executed
Parameters:
Name | Type | Description |
---|---|---|
inspectionPlanId |
String |
- Source:
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 |
stop5thIndustryPlan(inspectionPlanId)
Will set the plan back to an open state to signal that is currently not being executed (might be necessary when something in the linked process fails)
Parameters:
Name | Type | Description |
---|---|---|
inspectionPlanId |
String |
- Source:
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 |
subObjectElement(parentNode, objName, subObject)
Sets up recursive rendering of a config sub object inside the parent element
Parameters:
Name | Type | Description |
---|---|---|
parentNode |
Object | the element the subobject nodes should be placed in |
objName |
String | key of the config subobject |
subObject |
Object | an object inside a config 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 |
tablesChanged(data) → {Boolean}
Checks if there are new tables or tables were removed
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | new logging data |
Returns:
if the list of tables changed
- Type
- Boolean
toListString(array, cutoffopt) → {String}
Takes an array of strings and returns a string that lists all entries separated by commas and an "and"
e.g.
[entry] => "[entry]"; [entry 1, entry 2] => "[entry 1] and [entry 2]" [entry 1, entry 2, ..., entry n] => "[entry 1], [entry 2], ..., [entry n-1] and [entry n]"
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
array |
Array.<String> | the array of strings to convert |
|
cutoff |
Number |
<optional> |
the maximum number of elements that will be enumerated (if there are more a "and x more" will be appended to the string) |
Returns:
the string listing the entries of the array
- Type
- String
triggerExport(fileName, objectContent)
Handles the export of the created file
Parameters:
Name | Type | Description |
---|---|---|
fileName |
String | name used to download file |
objectContent |
String | Object | content, either as Blob or objectURL DOMString |
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 |
(async) update5thIndustryAuthorization()
Will try to create a valid 5thIndustry Authorization token using the service account data provided through the REST API
Throws:
Will throw an error if there is no service account data
updateBPMN(processDefinitionsId, bpmn)
Updates the process definition of a process in the local storage
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String | |
bpmn |
String | the new process definition |
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 |
(async) updateInspectionPlan(inspectionPlanId, values, type)
Sends a request to the 5thIndustry backend to change attributes of an existing plan
Parameters:
Name | Type | Description |
---|---|---|
inspectionPlanId |
String | |
values |
Object | the entries to change as key value pairs |
type |
String | what kind of plan is supposed to be changed (either "template" or "entity") |
- Source:
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
updateProcessDescription(processDefinitionsId, description)
Updates a processes description in its definition and meta data
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String | |
description |
String |
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 |
updateProcessMetaData(processDefinitionsId, metaChanges)
Updates the meta data about a process in the local storage
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String | |
metaChanges |
String | contains the entries to change |
updateProcessName(processDefinitionsId, newName)
Changes the name of a process in its definition and meta data
Parameters:
Name | Type | Description |
---|---|---|
processDefinitionsId |
String | |
newName |
String |
(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 |
updateRole(roleId, roleRepresentation) → {Object}
Updates a role by id for the PROCEED MS
Parameters:
Name | Type | Description |
---|---|---|
roleId |
String | if of role |
roleRepresentation |
Object | role representation |
Returns:
- updated role
- Type
- Object
updateShare(shareId, updates) → {Object}
Updates a share based on share id
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
shareId |
String | the id of a share object |
|||||||||||||||
updates |
Object | the updated share object properties Properties
|
Returns:
- updated share object
- Type
- Object
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 |
updateUserTaskMilestone(machine, instanceId, userTaskId, processChain, callChain, milestone)
Update milestone on UserTask
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
machine |
object | contains machine information Properties
|
|||||||||
instanceId |
string | id of the instance the userTask is running in |
|||||||||
userTaskId |
string | id of the active userTask |
|||||||||
processChain |
string | ||||||||||
callChain |
string | ||||||||||
milestone |
object | object with id and value of milestone |
- Source:
(async) waitForNetworkConnection()
Periodically checks if there is a network connection and restarts discovery functionality if there is
Type Definitions
asyncArrayCallback(entry, index)
A function called for all functions of an array
Parameters:
Name | Type | Description |
---|---|---|
entry |
* | The current entry of the array |
index |
Number | The index of the current entry inside the array |
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 |
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 |
Events
input(value): the changed editor value
Monaco Editor component.
Emits: