Package com.smartgwt.client.util.workflow

# Class Task

java.lang.Object
com.smartgwt.client.core.BaseClass
com.smartgwt.client.util.workflow.ProcessElement
com.smartgwt.client.util.workflow.Task

All Implemented Interfaces:
  `HasHandlers`

Direct Known Subclasses:
  `ComponentTask`, `DSRequestTask`, `ScriptTask`, `StateTask`, `UserTask`

public class Task extends ProcessElement
A Task is an abstract superclass for all Task types that can be involved in a Process, such as a `DSRequestTask`.

- ## Field Summary

  ### Fields inherited from class com.smartgwt.client.core.BaseClass

  `config, configOnly, factoryCreated, factoryProperties, id, scClassName`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Task()`
  `Task(JavaScriptObject jsObj)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `JavaScriptObject`
  `create()`
  `Object`
  `getExpressionValue(String value)`
  Get the value of a `inputExpression`.
  `String[]`
  `getInputFieldList()`
  Deprecated.
  In favor of `inputs` as of SmartGWT release 13.1
  `Record`
  `getInputRecord()`
  Get all inputs to the task as specified by the `inputs`, as a Record.
  `Map`
  `getInputs()`
  Defines how fields in the `process state` are extracted for the input record to this task.
  `String`
  `getInputsAsString()`
  Defines how fields in the `process state` are extracted for the input record to this task.
  `String[]`
  `getInputsAsStringArray()`
  Defines how fields in the `process state` are extracted for the input record to this task.
  `static Task`
  `getOrCreateRef(JavaScriptObject jsObj)`
  `String`
  `getOutputExpression()`
  Special expression to write task output directly into a `DataBoundComponent`.
  `String`
  `getOutputField()`
  Field in the `process state` where this task writes outputs.
  `String[]`
  `getOutputFieldList()`
  List of multiple fields in the `process state` where this task will write outputs.
  `Object`
  `getState(String statePath)`
  Returns a value from the `process state`.
  `Boolean`
  `getStrictPaths()`
  If set to true, the task will not allow any intermediate state to be set via `setState()` that is not explicitly defined first.
  `Task`
  `setInputFieldList(String... inputFieldList)`
  Deprecated.
  In favor of `inputs` as of SmartGWT release 13.1
  `Task`
  `setInputs(String inputs)`
  Defines how fields in the `process state` are extracted for the input record to this task.
  `Task`
  `setInputs(String... inputs)`
  Defines how fields in the `process state` are extracted for the input record to this task.
  `Task`
  `setInputs(Map inputs)`
  Defines how fields in the `process state` are extracted for the input record to this task.
  `void`
  `setOutput(Object output)`
  Sets the task output available to the next task via `Process.getLastTaskOutput()` or more commonly, with a `TaskInputExpression` property.
  `Task`
  `setOutputExpression(String outputExpression)`
  Special expression to write task output directly into a `DataBoundComponent`.
  `Task`
  `setOutputField(String outputField)`
  Field in the `process state` where this task writes outputs.
  `Task`
  `setOutputFieldList(String... outputFieldList)`
  List of multiple fields in the `process state` where this task will write outputs.
  `void`
  `setState(String stateVariablePath, String value, Boolean strict)`
  Sets a `process state` value for later reference with `Process.getStateVariable()` or more commonly with a `TaskInputExpression` property.
  `Task`
  `setStrictPaths(Boolean strictPaths)`
  If set to true, the task will not allow any intermediate state to be set via `setState()` that is not explicitly defined first.

  ### Methods inherited from class com.smartgwt.client.util.workflow.ProcessElement

  `completeElement, convertToJavaScriptArray, executeElement, getBindOutput, getClassDescription, getComponentReferences, getCurrentProcess, getDescription, getDynamicValue, getEditorType, getElementDescription, getForceSingle, getID, getInvalidTaskMessage, getJsObj, getMockMode, getNextElement, getOrCreateJsObj, getPassThruOutput, getProcessElements, getSupportsMultipleInputRecords, getTextFormulaValue, getTypeTitle, getUndefinedComponentMessage, getUnresolvedComponentMessage, getWaitDuration, getWaitFor, getWaitLocator, isCreated, isValid, objectReferencesLastTaskOutput, onInit, reset, setAttribute, setBindOutput, setClassDescription, setCurrentProcess, setDescription, setEditorType, setForceSingle, setID, setJavaScriptObject, setMockMode, setNextElement, setPassThruOutput, setSupportsMultipleInputRecords, setTypeTitle, setUndefinedComponentMessage, setUnresolvedComponentMessage, setWaitDuration, setWaitFor, setWaitLocator, updateGlobalIDInCriteria, updateGlobalIDInTextFormula, updateGlobalIDInValueProperty, updateGlobalIDInValues, updateGlobalIDReferences, updateLastElementBindingReferences, updateLastElementInCriteria, updateLastElementInValueProperty, updateLastElementInValues`

  ### Methods inherited from class com.smartgwt.client.core.BaseClass

  `addDynamicProperty, addDynamicProperty, addDynamicProperty, addDynamicProperty, applyFactoryProperties, asSGWTComponent, clearDynamicProperty, createJsObj, destroy, doAddHandler, doInit, error, error, errorIfNotCreated, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getAttributeAsStringArray, getClassName, getConfig, getHandlerCount, getRef, getRuleScope, getScClassName, getTestInstance, hasAutoAssignedID, hasDynamicProperty, internalSetID, internalSetID, isConfigOnly, isFactoryCreated, onBind, registerID, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfig, setConfigOnly, setFactoryCreated, setProperty, setProperty, setProperty, setProperty, setRuleScope, setScClassName`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Task

    public Task()

  - ### Task

    public Task(JavaScriptObject jsObj)

- ## Method Details

  - ### getOrCreateRef

    public static Task getOrCreateRef(JavaScriptObject jsObj)

  - ### create

    public JavaScriptObject create()
    Overrides:
      `create` in class `ProcessElement`

  - ### setInputFieldList

    public Task setInputFieldList(String... inputFieldList) throws IllegalStateException
    Deprecated.
    In favor of `inputs` as of SmartGWT release 13.1
    List of multiple fields from the `process state` which are provided as input data to this task. See `TaskIO`.
    Parameters:
      `inputFieldList` - New inputFieldList value. Default value is null
    Returns:
      `Task` instance, for chaining setter calls
    Throws:
      `IllegalStateException` - this property cannot be changed after the underlying component has been created
    See Also:
      - `Task Input / Output`

  - ### getInputFieldList

    public String[] getInputFieldList()
    Deprecated.
    In favor of `inputs` as of SmartGWT release 13.1
    List of multiple fields from the `process state` which are provided as input data to this task. See `TaskIO`.
    Returns:
      Current inputFieldList value. Default value is null
    See Also:
      - `Task Input / Output`

  - ### setInputs

    public Task setInputs(Map inputs) throws IllegalStateException
    Defines how fields in the `process state` are extracted for the input record to this task.

    When `inputs` is an object, the keys are the `setter paths` of the fields to be set in the input record, and the values are literals or `taskInputExpressions`. See `TaskIO`.

    Parameters:
      `inputs` - New inputs value. Default value is null
    Returns:
      `Task` instance, for chaining setter calls
    Throws:
      `IllegalStateException` - this property cannot be changed after the underlying component has been created
    See Also:
      - `Task Input / Output`

  - ### getInputs

    public Map getInputs()
    Defines how fields in the `process state` are extracted for the input record to this task.

    When `inputs` is an object, the keys are the `setter paths` of the fields to be set in the input record, and the values are literals or `taskInputExpressions`. See `TaskIO`.

    Returns:
      Current inputs value. Default value is null
    See Also:
      - `Task Input / Output`

  - ### setInputs

    public Task setInputs(String... inputs) throws IllegalStateException
    Defines how fields in the `process state` are extracted for the input record to this task.

    When `inputs` is an object, the keys are the `setter paths` of the fields to be set in the input record, and the values are literals or `taskInputExpressions`. See `TaskIO`.

    Parameters:
      `inputs` - New inputs value. Default value is null
    Returns:
      `Task` instance, for chaining setter calls
    Throws:
      `IllegalStateException` - this property cannot be changed after the underlying component has been created
    See Also:
      - `StatePath`
      - `Task Input / Output`

  - ### getInputsAsStringArray

    public String[] getInputsAsStringArray()
    Defines how fields in the `process state` are extracted for the input record to this task.

    When `inputs` is an object, the keys are the `setter paths` of the fields to be set in the input record, and the values are literals or `taskInputExpressions`. See `TaskIO`.

    Returns:
      Current inputs value. Default value is null
    See Also:
      - `StatePath`
      - `Task Input / Output`

  - ### setInputs

    public Task setInputs(String inputs) throws IllegalStateException
    Defines how fields in the `process state` are extracted for the input record to this task.

    When `inputs` is an object, the keys are the `setter paths` of the fields to be set in the input record, and the values are literals or `taskInputExpressions`. See `TaskIO`.

    Parameters:
      `inputs` - New inputs value. Default value is null
    Returns:
      `Task` instance, for chaining setter calls
    Throws:
      `IllegalStateException` - this property cannot be changed after the underlying component has been created
    See Also:
      - `StatePath`
      - `StatePath`
      - `Task Input / Output`

  - ### getInputsAsString

    public String getInputsAsString()
    Defines how fields in the `process state` are extracted for the input record to this task.

    When `inputs` is an object, the keys are the `setter paths` of the fields to be set in the input record, and the values are literals or `taskInputExpressions`. See `TaskIO`.

    Returns:
      Current inputs value. Default value is null
    See Also:
      - `StatePath`
      - `StatePath`
      - `Task Input / Output`

  - ### setOutputExpression

    public Task setOutputExpression(String outputExpression) throws IllegalStateException
    Special expression to write task output directly into a `DataBoundComponent`. See `TaskIO`.
    Parameters:
      `outputExpression` - New outputExpression value. Default value is null
    Returns:
      `Task` instance, for chaining setter calls
    Throws:
      `IllegalStateException` - this property cannot be changed after the underlying component has been created
    See Also:
      - `Task Input / Output`

  - ### getOutputExpression

    public String getOutputExpression()
    Special expression to write task output directly into a `DataBoundComponent`. See `TaskIO`.
    Returns:
      Current outputExpression value. Default value is null
    See Also:
      - `Task Input / Output`

  - ### setOutputField

    public Task setOutputField(String outputField) throws IllegalStateException
    Field in the `process state` where this task writes outputs. See `TaskIO`.
    Parameters:
      `outputField` - New outputField value. Default value is null
    Returns:
      `Task` instance, for chaining setter calls
    Throws:
      `IllegalStateException` - this property cannot be changed after the underlying component has been created
    See Also:
      - `Task Input / Output`

  - ### getOutputField

    public String getOutputField()
    Field in the `process state` where this task writes outputs. See `TaskIO`.
    Returns:
      Current outputField value. Default value is null
    See Also:
      - `Task Input / Output`

  - ### setOutputFieldList

    public Task setOutputFieldList(String... outputFieldList) throws IllegalStateException
    List of multiple fields in the `process state` where this task will write outputs. See `TaskIO`.

    If `outputField` is also specified, it will be implicitly added to the `outputFieldList` if it is not already present.

    Parameters:
      `outputFieldList` - New outputFieldList value. Default value is null
    Returns:
      `Task` instance, for chaining setter calls
    Throws:
      `IllegalStateException` - this property cannot be changed after the underlying component has been created
    See Also:
      - `Task Input / Output`

  - ### getOutputFieldList

    public String[] getOutputFieldList()
    List of multiple fields in the `process state` where this task will write outputs. See `TaskIO`.

    If `outputField` is also specified, it will be implicitly added to the `outputFieldList` if it is not already present.

    Returns:
      Current outputFieldList value. Default value is null
    See Also:
      - `Task Input / Output`

  - ### setStrictPaths

    public Task setStrictPaths(Boolean strictPaths)
    If set to true, the task will not allow any intermediate state to be set via `setState()` that is not explicitly defined first. This requirement can be overridden by an optional value in the `setState()` call.

    This setting can be applied to the entire process with `Process.strictPaths`.

    Parameters:
      `strictPaths` - New strictPaths value. Default value is null
    Returns:
      `Task` instance, for chaining setter calls

  - ### getStrictPaths

    public Boolean getStrictPaths()
    If set to true, the task will not allow any intermediate state to be set via `setState()` that is not explicitly defined first. This requirement can be overridden by an optional value in the `setState()` call.

    This setting can be applied to the entire process with `Process.strictPaths`.

    Returns:
      Current strictPaths value. Default value is null

  - ### getExpressionValue

    public Object getExpressionValue(String value)
    Get the value of a `inputExpression`.
    Parameters:
      `value` - expression to evaluate
    Returns:
      value of expression
    See Also:
      - `Task Input / Output`

  - ### getInputRecord

    public Record getInputRecord()
    Get all inputs to the task as specified by the `inputs`, as a Record.
    Returns:
      input record
    See Also:
      - `Task Input / Output`

  - ### getState

    public Object getState(String statePath)
    Returns a value from the `process state`. Values can be written into the process state by `setState()`, setting `ProcessElement.bindOutput`, or various task output settings (See `TaskIO`.)
    Parameters:
      `statePath` - path to the value in the process state to set. Segments are separated by a decimal point (.)
    Returns:
      the value found at the path

  - ### setOutput

    public void setOutput(Object output)
    Sets the task output available to the next task via `Process.getLastTaskOutput()` or more commonly, with a `TaskInputExpression` property. If `outputFieldList` is specified, the output will also be written to the specified fields in the process state (See `TaskIO`).

    To have the output written as-is to the process state, see `bindOutput`.

    Parameters:
      `output` - output record to provide to next task

  - ### setState

    public void setState(String stateVariablePath, String value, Boolean strict)
    Sets a `process state` value for later reference with `Process.getStateVariable()` or more commonly with a `TaskInputExpression` property.

    The path, which is one or more valid identifiers separated by periods, is used to identify the variable. By appending an empty pair of brackets ([]) the value will be placed into an existing or new array at the specified path.

    Parameters:
      `stateVariablePath` - path to the variable in the process state to set. segments are separated by a decimal point (.)
      `value` - the value to save. See `TaskInputExpression`
      `strict` - if true, the path must exist in the state to be set. If false, the path will be created if it does not exist. Defaults to `process.strictPaths` when null.