Pipelet and Worker descriptions contain a section that describes the parameters that can be set in the pipelet configuration (in the BPEL pipeline) or in the job or workflow in which a worker appears. The parameter description is a sequence of maps, each of which describes a (top-level) parameter. A parameter can be a single or multiple value or even a complex structure. One of these parameter description maps can contain the following properties:
- name: the name of the parameter
- if the name contains a section with '<...>' this section will not be evaluated when evaluating the parameters, e.g. if the definition contained a parameter with the name param<whatever> a configured parameter with the name paramABC would match this parameter definition. This is a kind of wildcard.
- type: the data type of the parameter
- optional, default: string
- The possible types for the parameter definition are derived from the datamodel Any type hierarchy:
- string (default): a String value
- double: a Double value (value range: see Java Double)
- boolean: a Boolean value (true / false)
- long: a Long value (value range: see Java Long)
- date: a Date value ("yyyy-MM-dd")
- datetime: a Date value with time portion ("yyyy-MM-dd'T'HH:mm:ssZ", see Javadoc of SimpleDateFormat for the meaning of the format string)
- any: an unspecified Any of any type (will automatically be converted from the given json)
- map: a Map of key/value-pairs as specified by the attribute entries (see below)
- A sequence (AnySeq) cannot be specified explicitly. It will be defined implicitly by using the multi key.
- range: A description of the meaning of the value.
- Arbitrary value can be used. They could be used by the JobManager for advanced validation or by workflow authoring tools to choose an appropriate input element for editing this parameter value.
- Currently only one value is used by the JobManager itself:
- jobName: The value of this parameter is the name of a job that needs to be running so that the worker can work successfully. The JobManager will not allow that a job using the worker is started, if the needed job is not running at job start. Also, it will not allow that the needed job is finished while a job that needs it is still runnning (or finishing). However, it will still be possible to cancel the needed job without stopping the dependent job first.
- entries: describes keys and types of the entries of a map
- optional, if not defined any entry types or keys will be accepted
- can only be used for parameters of type map
- contains a sequence of parameter descriptions, just like the parameter descriptions on top-level (-> further recursion possible)
- values: a sequence defining the possible values for a parameter
- the parameter only accepts the values defined in the values sequence
- multi: boolean value: if 'true' there can be a sequence of values of the defined type.
- default: false
- Please note that the implementation is not required to return a sequence (AnySeq) if there is only one value of that type. But since Any is an iterable itself you can access these values vie Any's iterable interface.
- optional: boolean value specifying if the parameter is optional (true) or mandatory (false)
- default: false, so parameters without the optional flag must be specified.
See the worker and pipelet description included in SMILA for examples.
Bundle org.eclipse.smila.common contains a class org.eclipse.smila.common.defitions.ParameterDefinition that can be used to interpret such descriptions parsed from JSON into an Any object.