Package com.smartgwt.client.util.workflow

# Class DecisionTask

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

All Implemented Interfaces:
  `HasHandlers`

Direct Known Subclasses:
  `XORGateway`

public class DecisionTask extends ProcessElement
Chooses one or another next process element based on AdvancedCriteria applied to `Process.state`.

If the AdvancedCriteria evaluate to true, the `nextElement` is chosen, otherwise the `failureElement`.

Inside an `OperationBinding.process`, criteria support the full ServerDynamicCriteria syntax including `auth.userId`, `auth.roles`, relational FK references, and aggregation shorthand. For example, if an Order DS has `foreignKey="Customer.customerId"`: See `ServerProcess` for a complete example.

See Also:
  - `Server-Side Process Execution`

- ## Field Summary

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

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

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DecisionTask()`
  `DecisionTask(JavaScriptObject jsObj)`
  `DecisionTask(String ID, String nextElement, String failureElement)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `JavaScriptObject`
  `create()`
  `Criteria`
  `getCriteria()`
  Simple or `AdvancedCriteria` to be applied against the `Process.state`.
  `String`
  `getFailureElement()`
  ID of the next sequence or element to proceed to if the criteria do not match.
  `String`
  `getNextElement()`
  Next `sequence` or `element` to execute if the criteria match the process state.
  `static DecisionTask`
  `getOrCreateRef(JavaScriptObject jsObj)`
  `DecisionTask`
  `setCriteria(Criteria criteria)`
  Simple or `AdvancedCriteria` to be applied against the `Process.state`.
  `DecisionTask`
  `setFailureElement(String failureElement)`
  ID of the next sequence or element to proceed to if the criteria do not match.
  `DecisionTask`
  `setNextElement(String nextElement)`
  Next `sequence` or `element` to execute if the criteria match the process state.

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

  `completeElement, convertToJavaScriptArray, executeElement, getBindOutput, getClassDescription, getComponentReferences, getCurrentProcess, getDescription, getDynamicValue, getEditorType, getElementDescription, getForceSingle, getID, getInstanceDescription, getInstanceTitle, getInvalidTaskMessage, getJsObj, getMockMode, 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, 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

  - ### DecisionTask

    public DecisionTask()

  - ### DecisionTask

    public DecisionTask(JavaScriptObject jsObj)

  - ### DecisionTask

    public DecisionTask(String ID, String nextElement, String failureElement)

- ## Method Details

  - ### getOrCreateRef

    public static DecisionTask getOrCreateRef(JavaScriptObject jsObj)

  - ### create

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

  - ### setCriteria

    public DecisionTask setCriteria(Criteria criteria) throws IllegalStateException
    Simple or `AdvancedCriteria` to be applied against the `Process.state`.

    Data values in this criteria prefixed with "$" will be treated as dynamic expressions as detailed in `TaskInputExpression`. Specifically, this means that for simple criteria, any property value that is a String and is prefixed with "$" will be assumed to be an expression, and for AdvancedCriteria, the same treatment will be applied to `Criterion.value`.

    Note that dynamic expressions starting with "$input" are not applicable for a DecisionTask but "$inputRecord" can be used for direct reference to `Process.state`.

    This property supports `DynamicCriteria` - use `Criterion.valuePath` to refer to values in the `Process.ruleScope`.

    Parameters:
      `criteria` - New criteria value. Default value is null
    Returns:
      `DecisionTask` instance, for chaining setter calls
    Throws:
      `IllegalStateException` - this property cannot be changed after the underlying component has been created

  - ### getCriteria

    public Criteria getCriteria()
    Simple or `AdvancedCriteria` to be applied against the `Process.state`.

    Data values in this criteria prefixed with "$" will be treated as dynamic expressions as detailed in `TaskInputExpression`. Specifically, this means that for simple criteria, any property value that is a String and is prefixed with "$" will be assumed to be an expression, and for AdvancedCriteria, the same treatment will be applied to `Criterion.value`.

    Note that dynamic expressions starting with "$input" are not applicable for a DecisionTask but "$inputRecord" can be used for direct reference to `Process.state`.

    This property supports `DynamicCriteria` - use `Criterion.valuePath` to refer to values in the `Process.ruleScope`.

    Returns:
      Current criteria value. Default value is null

  - ### setFailureElement

    public DecisionTask setFailureElement(String failureElement) throws IllegalStateException
    ID of the next sequence or element to proceed to if the criteria do not match.
    Parameters:
      `failureElement` - New failureElement value. Default value is null
    Returns:
      `DecisionTask` instance, for chaining setter calls
    Throws:
      `IllegalStateException` - this property cannot be changed after the underlying component has been created

  - ### getFailureElement

    public String getFailureElement()
    ID of the next sequence or element to proceed to if the criteria do not match.
    Returns:
      Current failureElement value. Default value is null

  - ### setNextElement

    public DecisionTask setNextElement(String nextElement) throws IllegalStateException
    Next `sequence` or `element` to execute if the criteria match the process state.

    `nextElement` does not need to be specified if this element is part of a `sequence` and has a next element in the sequence.

    Note that if there is both a `sequence` and a normal `element` with the same name in the current `Process`, the `sequence` will be used.

    Overrides:
      `setNextElement` in class `ProcessElement`
    Parameters:
      `nextElement` - New nextElement value. Default value is null
    Returns:
      `DecisionTask` instance, for chaining setter calls
    Throws:
      `IllegalStateException` - this property cannot be changed after the underlying component has been created

  - ### getNextElement

    public String getNextElement()
    Next `sequence` or `element` to execute if the criteria match the process state.

    `nextElement` does not need to be specified if this element is part of a `sequence` and has a next element in the sequence.

    Note that if there is both a `sequence` and a normal `element` with the same name in the current `Process`, the `sequence` will be used.

    Overrides:
      `getNextElement` in class `ProcessElement`
    Returns:
      Current nextElement value. Default value is null