Process module configuration edit

The Process module runtime configuration conventions make it possible to standardise runtime configuration editing.

The edit is carried out by a group-level configure process, even on its own configuration, or on the configuration of a worker passed to it.

The configure process requires a description of the items that can be updated. This is, by convention, achieved using a getConfigDecriptions which returns an object of form.

{
"reference": {
"property": "property",
"name": "Property name",
"data": .. current value ..,
"path": "path.to.value",
"dataType": "text/line|object/object|text/html|...",
"dataTypeOptions": { .. },
...
}, ...
}
  • property identifies the property on the configuration options to be updated. It defaults to the reference that acts as a key to the object.
  • name is a human-readable name for the data.
  • data is the current data. This will either be the value from the configuration options or the default value. This should always relate to a top-level configuration options property.
  • path is an optional path to the value within the data. If omitted, the whole configuration options property is updated. The value is later extracted and held in the value property of the config description.
  • dataType is the data type, as described in Data Type Script. Common types are 'text/line', 'object/object' and 'text/html'.
  • dataTypeOptions are the options associated with the data type.
  • Other properties can be set

Use a property of "*" to indicate that the whole configuration options object should be updated. Other properties within the config description will take suitable defaults and should not be set. This will edit the configuration options as is, without reference to any default values.

getConfigDescriptions is conventionally implemented as a wildcard call, in the same way as Process module partner initialisation. The example below also includes a status rule to call the group-level configure action passing the worker. The group-level status rule would be the same, but without the url property.

{
  "name": "getConfigDescriptions",
  "script": "call",
  "config": {
    "callAction": "configDescription.*",
    "returnMode": "object"
  },
  "statusRule": {
    "role": "user",
    "status": ["prepare", "ready"],
    "action": {
      "caption": "Configure",
      "url": "%{groupRef/nodeURL:.}?method=execute&action=configure&worker=%{ref}"
    }
  },
  "next": false
}

Each configuration option to be configured can then declare itself, as in this example.

{
"name": "configDescription.fooBar",
"script": "getData",
"config": {
  "data": {
"name": "Foo bar",
"value": "${fooBar}",
"dataType": "text/line",
"dataTypeOptions": {
"length": 20
}
}
},
"next": false
}

if you want to be be able to edit all of the configuration options at once, use this.

{
"name": "configDescription.all",
"script": "getData",
"config": {
  "data": {
"property": "*"
}
},
"next": false
}

See the documentation on the Configure component for more details.