Class UserTask

All Implemented Interfaces:
HasHandlers
Direct Known Subclasses:
TourConfirmStep, TourStep

public class UserTask extends Task
A task that involves showing a user interface to the end user allowing the user to view and input data and press a button (or do some other UI gesture) to complete the task.

A UserTask takes the following steps:

  • Constructor Details

    • UserTask

      public UserTask()
    • UserTask

      public UserTask(JavaScriptObject jsObj)
  • Method Details

    • getOrCreateRef

      public static UserTask getOrCreateRef(JavaScriptObject jsObj)
    • create

      public JavaScriptObject create()
      Overrides:
      create in class Task
    • setCancelElement

      public UserTask setCancelElement(String cancelElement) throws IllegalStateException
      Next element to proceed to if the task is cancelled because the targetForm or targetVM had cancelEditing() called on it.

      if no value is provided the workflow immediately completes.

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

      public String getCancelElement()
      Next element to proceed to if the task is cancelled because the targetForm or targetVM had cancelEditing() called on it.

      if no value is provided the workflow immediately completes.

      Returns:
      Current cancelElement value. Default value is null
    • setInlineView

      public UserTask setInlineView(Canvas inlineView)
      An inline definition of the form. Can be used in place of targetView to encode form directly in process xml.
      Parameters:
      inlineView - New inlineView value. Default value is null
      Returns:
      UserTask instance, for chaining setter calls
    • getInlineView

      public Canvas getInlineView()
      An inline definition of the form. Can be used in place of targetView to encode form directly in process xml.
      Returns:
      Current inlineView value. Default value is null
    • setPassThruOutput

      public UserTask setPassThruOutput(Boolean passThruOutput) throws IllegalStateException
      Does this processElement pass through output from the last executed task (i.e. transient state)?

      See taskInputExpressions for details on the transient state outputs.

      Note that this property does not affect the task at all but is an indicator to the user and to the workflow editor of the behavior of the task as coded (See Process.passThruTaskOutput()).

      Overrides:
      setPassThruOutput in class ProcessElement
      Parameters:
      passThruOutput - New passThruOutput value. Default value is false
      Returns:
      UserTask instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the underlying component has been created
    • getPassThruOutput

      public Boolean getPassThruOutput()
      Does this processElement pass through output from the last executed task (i.e. transient state)?

      See taskInputExpressions for details on the transient state outputs.

      Note that this property does not affect the task at all but is an indicator to the user and to the workflow editor of the behavior of the task as coded (See Process.passThruTaskOutput()).

      Overrides:
      getPassThruOutput in class ProcessElement
      Returns:
      Current passThruOutput value. Default value is false
    • setPreviousElement

      public UserTask setPreviousElement(String previousElement) throws IllegalStateException
      Previous workflow sequence or element that is helpful for wizards. This element will be executed if goToPrevious() method of userTask will be invoked. You can get userTask for attached form by using userTask property.
      Parameters:
      previousElement - New previousElement value. Default value is null
      Returns:
      UserTask instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the underlying component has been created
    • getPreviousElement

      public String getPreviousElement()
      Previous workflow sequence or element that is helpful for wizards. This element will be executed if goToPrevious() method of userTask will be invoked. You can get userTask for attached form by using userTask property.
      Returns:
      Current previousElement value. Default value is null
    • setSaveToServer

      public UserTask setSaveToServer(Boolean saveToServer) throws IllegalStateException
      If saveToServer is set then the associated form (targetForm) will perform the normal DynamicForm.submit() actions when submitted (typically from a SubmitItem). By default the form submit action is bypassed.
      Parameters:
      saveToServer - New saveToServer value. Default value is false
      Returns:
      UserTask instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the underlying component has been created
    • getSaveToServer

      public Boolean getSaveToServer()
      If saveToServer is set then the associated form (targetForm) will perform the normal DynamicForm.submit() actions when submitted (typically from a SubmitItem). By default the form submit action is bypassed.
      Returns:
      Current saveToServer value. Default value is false
    • setTargetForm

      public UserTask setTargetForm(DynamicForm targetForm) throws IllegalStateException
      DynamicForm that should be populated with data and that should provide the data for the task outputs. If targetView is a DynamicForm and would also be the targetForm, the targetForm attribute can be left unset.

      Use targetVM to use a ValuesManager instead.

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

      public DynamicForm getTargetForm()
      DynamicForm that should be populated with data and that should provide the data for the task outputs. If targetView is a DynamicForm and would also be the targetForm, the targetForm attribute can be left unset.

      Use targetVM to use a ValuesManager instead.

      Returns:
      Current targetForm value. Default value is null
    • setTargetForm

      public UserTask setTargetForm(String targetForm) throws IllegalStateException
      DynamicForm that should be populated with data and that should provide the data for the task outputs. If targetView is a DynamicForm and would also be the targetForm, the targetForm attribute can be left unset.

      Use targetVM to use a ValuesManager instead.

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

      public String getTargetFormAsString()
      DynamicForm that should be populated with data and that should provide the data for the task outputs. If targetView is a DynamicForm and would also be the targetForm, the targetForm attribute can be left unset.

      Use targetVM to use a ValuesManager instead.

      Returns:
      Current targetForm value. Default value is null
    • setWizard

      public UserTask setWizard(Boolean wizard) throws IllegalStateException
      If wizard is set then associated form will be hidden after user goes to next or prev step of current workflow.
      Parameters:
      wizard - New wizard value. Default value is false
      Returns:
      UserTask instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the underlying component has been created
    • getWizard

      public Boolean getWizard()
      If wizard is set then associated form will be hidden after user goes to next or prev step of current workflow.
      Returns:
      Current wizard value. Default value is false
    • cancelEditing

      public void cancelEditing()
      Revert any changes made in a form and finish this userTask execution. cancelElement will be proceed as the next element of current process.
    • completeEditing

      public void completeEditing()
      Finish editing and store edited values in process state.
    • goToPrevious

      public void goToPrevious()
      Set previousElement as next element of workflow. This method could be used to create wizard-like UI behavior.
    • setTargetView

      public void setTargetView(Canvas targetView)
      Optional widget that should be shown to allow user input. If this widget is a DynamicForm, it will also be automatically used as the targetForm unless either targetForm or targetVM is set.

      UserTask will automatically handle various scenarios of the targetView being not currently visible or draw()n, according to the following rules:

      • if the view itself is marked hidden, it will be show()n
      • if the view is inside a hidden parent, the parent will be show()n
      • if the view is the pane of a tab in a TabSet, the tab will be selected
      • if the view is listed in items for a which is either collapsed or hidden section, the section will be shown and expanded
      • if the view is listed in items for a Window, the Window will be shown
      • if any of these conditions apply to any parent of the targetView, the rules will be applied to that parent as well. For example, the targetView is in a collapsed section inside a tab which is not selected, the section will be expanded and the tab selected
      Parameters:
      targetView - targetView Default value is null
    • getTargetView

      public Canvas getTargetView()
      Optional widget that should be shown to allow user input. If this widget is a DynamicForm, it will also be automatically used as the targetForm unless either targetForm or targetVM is set.

      UserTask will automatically handle various scenarios of the targetView being not currently visible or draw()n, according to the following rules:

      • if the view itself is marked hidden, it will be show()n
      • if the view is inside a hidden parent, the parent will be show()n
      • if the view is the pane of a tab in a TabSet, the tab will be selected
      • if the view is listed in items for a which is either collapsed or hidden section, the section will be shown and expanded
      • if the view is listed in items for a Window, the Window will be shown
      • if any of these conditions apply to any parent of the targetView, the rules will be applied to that parent as well. For example, the targetView is in a collapsed section inside a tab which is not selected, the section will be expanded and the tab selected
      Returns:
      Canvas
    • setTargetView

      public void setTargetView(String targetView)
      Optional widget that should be shown to allow user input. If this widget is a DynamicForm, it will also be automatically used as the targetForm unless either targetForm or targetVM is set.

      UserTask will automatically handle various scenarios of the targetView being not currently visible or draw()n, according to the following rules:

      • if the view itself is marked hidden, it will be show()n
      • if the view is inside a hidden parent, the parent will be show()n
      • if the view is the pane of a tab in a TabSet, the tab will be selected
      • if the view is listed in items for a which is either collapsed or hidden section, the section will be shown and expanded
      • if the view is listed in items for a Window, the Window will be shown
      • if any of these conditions apply to any parent of the targetView, the rules will be applied to that parent as well. For example, the targetView is in a collapsed section inside a tab which is not selected, the section will be expanded and the tab selected
      Parameters:
      targetView - targetView Default value is null
    • setTargetVM

      public void setTargetVM(ValuesManager targetVM)
      Optional ValuesManager which will receive task inputs and provide task outputs. Use targetForm instead of you want to use a DynamicForm.
      Parameters:
      targetVM - targetVM Default value is null
    • getTargetVM

      public ValuesManager getTargetVM()
      Optional ValuesManager which will receive task inputs and provide task outputs. Use targetForm instead of you want to use a DynamicForm.
      Returns:
      ValuesManager
    • setTargetVM

      public void setTargetVM(String targetVM)
      Optional ValuesManager which will receive task inputs and provide task outputs. Use targetForm instead of you want to use a DynamicForm.
      Parameters:
      targetVM - targetVM Default value is null