Constructor
new ConstraintParser(logger)
A logger that shall be used by the parser
Parameters:
Name | Type | Description |
---|---|---|
logger |
object |
Classes
Methods
checkConstraintDefinition(constraintsInJS)
checks for circular dependencies and other inconsistencies in hardconstraints
errors: at (easy) circular dependencies, at AND conjunction of multiple values from machine.id, machine.name, machine.hostname (meaning multiple id) warnings: at AND conjunction of machine.id, machine.name, machine.hostname at AND conjunction of multiple values from network.ip4, .ip6, .mac at AND conjunction of network.ip4, .ip6, .mac
Parameters:
Name | Type | Description |
---|---|---|
constraintsInJS |
constraintsInJS |
checkForCriticalConstraintComposition(constraintNamesopt, constraintsopt)
Checks if every constraintName of constraintNames-array is present in constraints
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
constraintNames |
<optional> |
machineConstraints or networkConstraints |
|
constraints |
<optional> |
Returns:
boolean
checkForCriticalMultipleValues(constraintNamesopt, constraint)
Checks if constraint contains multiple values with constraintName of constraintNames-array
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
constraintNames |
<optional> |
machineConstraints or networkConstraints |
|
constraint |
constraint |
Returns:
boolean
fromJsonToXml(constraintsInJSON) → {string}
Parses the JSON string to return the XML representation of the constraints
Parameters:
Name | Type | Description |
---|---|---|
constraintsInJSON |
string | the XML respresentation of the constraints |
Returns:
- the XML representation of the constraints
- Type
- string
fromJsToXml(constraintsInJS) → {string}
Parses the JS object to return the XML representation of the constraints
Parameters:
Name | Type | Description |
---|---|---|
constraintsInJS |
object | the XML respresentation of the constraints |
Returns:
- the XML representation of the constraints
- Type
- string
fromXmlToJs(constraintsInXML) → {object}
Parses the XML string to return the JS representation of the constraints
Parameters:
Name | Type | Description |
---|---|---|
constraintsInXML |
string | the XML respresentation of the constraints |
Returns:
- the JS representation of the constraints
- Type
- object
fromXmlToJson(constraintsInXML) → {string}
Parses the XML string to return the JSON representation of the constraints
Parameters:
Name | Type | Description |
---|---|---|
constraintsInXML |
string | the XML respresentation of the constraints |
Returns:
- the JSON representation of the constraints
- Type
- string
getConstraints(bpmn, taskId)
Returns either the process constraints or the constraints of a task in form of an object
Parameters:
Name | Type | Description |
---|---|---|
bpmn |
string | process definition |
taskId |
string | undefined | string: we want constraints of a task, undefined: we want the process constraints |
searchForCircularDependencies(->, groupId, referencedGroupsopt)
Checks for circular dependencies in constraintgroup -> Runs through path of referenced groups and searches for cycle
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
-> |
constraintGroups | every existing constraint group |
|
groupId |
|
||
referencedGroups |
<optional> |
|
Returns:
boolean -> Returns true if circular dependency is found
setLogger(logger)
Sets logger that shall be used while parsing if the given value is falsey a default logger is used
Parameters:
Name | Type | Description |
---|---|---|
logger |
object |