Skip to main content
Jump to: navigation, search

Difference between revisions of "SMILA/Documentation/ParameterDefinition"

Line 18: Line 18:
 
*<tt>range</tt>: A description of the meaning of the value.  
 
*<tt>range</tt>: A description of the meaning of the value.  
 
** optional.  
 
** optional.  
** 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.
+
** an 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:
 
** Currently only one value is used by the JobManager itself:
 
*** <tt>jobName</tt>: 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.
 
*** <tt>jobName</tt>: 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.
Line 28: Line 28:
 
** optional
 
** optional
 
** the parameter only accepts the values defined in the <tt>values</tt> sequence
 
** the parameter only accepts the values defined in the <tt>values</tt> sequence
 +
** each element in the sequence can be either a simple value, or a map containing at least a property <tt>value</tt> containing the allowed value. Such a map can contain additional properties like a description of the value's meaning.
 
* <tt>multi</tt>: boolean value: if 'true' there can be a sequence of values of the defined type.
 
* <tt>multi</tt>: boolean value: if 'true' there can be a sequence of values of the defined type.
 
** optional
 
** optional
Line 35: Line 36:
 
** default: <tt>false</tt>, so parameters without the optional flag must be specified.
 
** default: <tt>false</tt>, so parameters without the optional flag must be specified.
  
See the worker and pipelet description included in SMILA for examples.  
+
See the worker and pipelet description included in SMILA for examples. Additional properties can be added at any place in the description structure, for example to add comments or descriptions. This is ignored by SMILA itself.
  
 
Bundle <tt>org.eclipse.smila.common</tt> contains a class <tt>org.eclipse.smila.common.defitions.ParameterDefinition</tt> that can be used to interpret such descriptions parsed from JSON into an <tt>Any</tt> object.
 
Bundle <tt>org.eclipse.smila.common</tt> contains a class <tt>org.eclipse.smila.common.defitions.ParameterDefinition</tt> that can be used to interpret such descriptions parsed from JSON into an <tt>Any</tt> object.

Revision as of 11:29, 9 March 2012

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
    • mandatory
    • 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.
    • optional.
    • an 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
    • optional
    • the parameter only accepts the values defined in the values sequence
    • each element in the sequence can be either a simple value, or a map containing at least a property value containing the allowed value. Such a map can contain additional properties like a description of the value's meaning.
  • multi: boolean value: if 'true' there can be a sequence of values of the defined type.
    • optional
    • 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. Additional properties can be added at any place in the description structure, for example to add comments or descriptions. This is ignored by SMILA itself.

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.

Back to the top