com.smartgwt.client.util.workflow

## Class XORGateway

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

- All Implemented Interfaces:
    com.google.gwt.event.shared.HasHandlers

      public class XORGateway
      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`.

  Note that "XOR" in `XORGateway` means "exclusive or" - only one next element is chosen.

- - ### Field Summary

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

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XORGateway()`
    `XORGateway(com.google.gwt.core.client.JavaScriptObject jsObj)`
    `XORGateway(java.lang.String ID, ProcessElement nextElement, ProcessElement failureElement)`
    `XORGateway(java.lang.String ID, java.lang.String nextElement, java.lang.String failureElement)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `com.google.gwt.core.client.JavaScriptObject` | `create()`
    `Criteria` | `getCriteria()` Simple or `AdvancedCriteria` to be applied against the `Process.state`.
    `java.lang.String` | `getFailureElement()` ID of the next sequence or element to proceed to if the criteria do not match.
    `java.lang.String` | `getNextElement()` Next `sequence` or `element` to execute if the criteria match the process state.
    `static XORGateway` | `getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)`
    `XORGateway` | `setCriteria(Criteria criteria)` Simple or `AdvancedCriteria` to be applied against the `Process.state`.
    `void` | `setFailureElement(ProcessElement failureElement)`
    `XORGateway` | `setFailureElement(java.lang.String failureElement)` ID of the next sequence or element to proceed to if the criteria do not match.
    `void` | `setNextElement(ProcessElement nextElement)`
    `XORGateway` | `setNextElement(java.lang.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

      `convertToJavaScriptArray, getClassDescription, getDescription, getEditorType, getElementDescription, getID, getJsObj, getOrCreateJsObj, getPassThruOutput, getProcessElements, getTitle, isCreated, onInit, setAttribute, setClassDescription, setDescription, setEditorType, setID, setJavaScriptObject, setPassThruOutput, setTitle`

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

      `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 Detail

    - #### XORGateway

          public XORGateway()

    - #### XORGateway

          public XORGateway(com.google.gwt.core.client.JavaScriptObject jsObj)

    - #### XORGateway

          public XORGateway(java.lang.String ID,
                            java.lang.String nextElement,
                            java.lang.String failureElement)

    - #### XORGateway

          public XORGateway(java.lang.String ID,
                            ProcessElement nextElement,
                            ProcessElement failureElement)

  - ### Method Detail

    - #### getOrCreateRef

          public static XORGateway getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)

    - #### create

          public com.google.gwt.core.client.JavaScriptObject create()

      Overrides:
        `create` in class `ProcessElement`

    - #### setCriteria

          public XORGateway setCriteria(Criteria criteria)
                                 throws java.lang.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 an XORGateway 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:
        `XORGateway` instance, for chaining setter calls
      Throws:
        `java.lang.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 an XORGateway 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 XORGateway setFailureElement(java.lang.String failureElement)
                                       throws java.lang.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:
        `XORGateway` instance, for chaining setter calls
      Throws:
        `java.lang.IllegalStateException` - this property cannot be changed after the underlying component has been created

    - #### getFailureElement

          public java.lang.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 XORGateway setNextElement(java.lang.String nextElement)
                                    throws java.lang.IllegalStateException

      Next `sequence` or `element` to execute if the criteria match the process state.

      `nextElement` does not need to be specified if this gateway 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:
        `XORGateway` instance, for chaining setter calls
      Throws:
        `java.lang.IllegalStateException` - this property cannot be changed after the underlying component has been created

    - #### getNextElement

          public java.lang.String getNextElement()

      Next `sequence` or `element` to execute if the criteria match the process state.

      `nextElement` does not need to be specified if this gateway 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

    - #### setFailureElement

          public void setFailureElement(ProcessElement failureElement)
                                 throws java.lang.IllegalStateException

      Throws:
        `java.lang.IllegalStateException`
      See Also:
        `setFailureElement(String)`

    - #### setNextElement

          public void setNextElement(ProcessElement nextElement)
                              throws java.lang.IllegalStateException

      Throws:
        `java.lang.IllegalStateException`
      See Also:
        `setNextElement(String)`