Class UserTask
- All Implemented Interfaces:
HasHandlers
- Direct Known Subclasses:
TourConfirmStep,TourStep
A UserTask takes the following steps:
-
Optionally show() or otherwise make visible the
targetVieworinlineView - Provide values to
either a
DynamicFormdesignated as thetargetFormor to aValuesManagerdesignated as thetargetVM, viasetValues() - Waits for notification of completion or
cancellation. The UserTask is notified of completion if a
SubmitItemis pressed in either thetargetFormor any form that is a member of thetargetVM. Likewise a CancelItem triggers cancellation. Direct calls toDynamicForm.cancelEditing()orDynamicForm.completeEditing()achieve the same result. - if cancellation occurs, the process continues to the
cancelElementif specified. Otherwise the workflow is immediately finished. - if completion occurs, values are retrieved from the form or valuesManager and applied to
the process state based on
outputField,outputFieldListorinputField, in that order.
-
Field Summary
Fields inherited from class com.smartgwt.client.core.BaseClass
config, configOnly, factoryCreated, factoryProperties, id, scClassName -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRevert any changes made in a form and finish this userTask execution.voidFinish editing and store edited values inprocess state.create()Next element to proceed to if the task is cancelled because thetargetFormortargetVMhadcancelEditing()called on it.An inline definition of the form.static UserTaskgetOrCreateRef(JavaScriptObject jsObj) Does this processElement pass through output from the last executed task (i.e.If saveToServer is set then the associated form (targetForm) will perform the normalDynamicForm.submit()actions when submitted (typically from aSubmitItem).DynamicForm that should be populated with data and that should provide the data for the task outputs.DynamicForm that should be populated with data and that should provide the data for the task outputs.Optional widget that should be shown to allow user input.Optional ValuesManager which will receive task inputs and provide task outputs.If wizard is set then associated form will be hidden after user goes to next or prev step of current workflow.voidSetpreviousElementas next element of workflow.setCancelElement(String cancelElement) Next element to proceed to if the task is cancelled because thetargetFormortargetVMhadcancelEditing()called on it.setInlineView(Canvas inlineView) An inline definition of the form.setPassThruOutput(Boolean passThruOutput) Does this processElement pass through output from the last executed task (i.e.setPreviousElement(String previousElement) setSaveToServer(Boolean saveToServer) If saveToServer is set then the associated form (targetForm) will perform the normalDynamicForm.submit()actions when submitted (typically from aSubmitItem).setTargetForm(DynamicForm targetForm) DynamicForm that should be populated with data and that should provide the data for the task outputs.setTargetForm(String targetForm) DynamicForm that should be populated with data and that should provide the data for the task outputs.voidsetTargetView(Canvas targetView) Optional widget that should be shown to allow user input.voidsetTargetView(String targetView) Optional widget that should be shown to allow user input.voidsetTargetVM(ValuesManager targetVM) Optional ValuesManager which will receive task inputs and provide task outputs.voidsetTargetVM(String targetVM) Optional ValuesManager which will receive task inputs and provide task outputs.If wizard is set then associated form will be hidden after user goes to next or prev step of current workflow.Methods inherited from class com.smartgwt.client.util.workflow.Task
getInputField, getInputFieldList, getOutputExpression, getOutputField, getOutputFieldList, setInputField, setInputFieldList, setOutputExpression, setOutputField, setOutputFieldListMethods inherited from class com.smartgwt.client.util.workflow.ProcessElement
completeElement, convertToJavaScriptArray, executeElement, getBindOutput, getClassDescription, getComponentReferences, getDescription, getDynamicValue, getEditorType, getElementDescription, getForceSingle, getID, getInvalidTaskMessage, getJsObj, getMockMode, getNextElement, getOrCreateJsObj, getProcessElements, getSupportsMultipleInputRecords, getTextFormulaValue, getTypeTitle, getUndefinedComponentMessage, getUnresolvedComponentMessage, getWaitDuration, getWaitFor, getWaitLocator, isCreated, isValid, objectReferencesLastTaskOutput, onInit, reset, setAttribute, setBindOutput, setClassDescription, setDescription, setEditorType, setForceSingle, setID, setJavaScriptObject, setMockMode, setNextElement, setSupportsMultipleInputRecords, setTypeTitle, setUndefinedComponentMessage, setUnresolvedComponentMessage, setWaitDuration, setWaitFor, setWaitLocator, updateGlobalIDInCriteria, updateGlobalIDInTextFormula, updateGlobalIDInValueProperty, updateGlobalIDInValues, updateGlobalIDReferences, updateLastElementBindingReferences, updateLastElementInCriteria, updateLastElementInValueProperty, updateLastElementInValuesMethods 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
-
Constructor Details
-
UserTask
public UserTask() -
UserTask
-
-
Method Details
-
getOrCreateRef
-
create
-
setCancelElement
Next element to proceed to if the task is cancelled because thetargetFormortargetVMhadcancelEditing()called on it.if no value is provided the workflow immediately completes.
- Parameters:
cancelElement- New cancelElement value. Default value is null- Returns:
UserTaskinstance, for chaining setter calls- Throws:
IllegalStateException- this property cannot be changed after the underlying component has been created
-
getCancelElement
Next element to proceed to if the task is cancelled because thetargetFormortargetVMhadcancelEditing()called on it.if no value is provided the workflow immediately completes.
- Returns:
- Current cancelElement value. Default value is null
-
setInlineView
An inline definition of the form. Can be used in place oftargetViewto encode form directly in process xml.- Parameters:
inlineView- New inlineView value. Default value is null- Returns:
UserTaskinstance, for chaining setter calls
-
getInlineView
An inline definition of the form. Can be used in place oftargetViewto encode form directly in process xml.- Returns:
- Current inlineView value. Default value is null
-
setPassThruOutput
Does this processElement pass through output from the last executed task (i.e. transient state)?See
taskInputExpressionsfor 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:
setPassThruOutputin classProcessElement- Parameters:
passThruOutput- New passThruOutput value. Default value is false- Returns:
UserTaskinstance, for chaining setter calls- Throws:
IllegalStateException- this property cannot be changed after the underlying component has been created
-
getPassThruOutput
Does this processElement pass through output from the last executed task (i.e. transient state)?See
taskInputExpressionsfor 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:
getPassThruOutputin classProcessElement- Returns:
- Current passThruOutput value. Default value is false
-
setPreviousElement
Previous workflowsequenceorelementthat is helpful for wizards. This element will be executed ifgoToPrevious()method of userTask will be invoked. You can get userTask for attached form by usinguserTaskproperty.- Parameters:
previousElement- New previousElement value. Default value is null- Returns:
UserTaskinstance, for chaining setter calls- Throws:
IllegalStateException- this property cannot be changed after the underlying component has been created
-
getPreviousElement
Previous workflowsequenceorelementthat is helpful for wizards. This element will be executed ifgoToPrevious()method of userTask will be invoked. You can get userTask for attached form by usinguserTaskproperty.- Returns:
- Current previousElement value. Default value is null
-
setSaveToServer
If saveToServer is set then the associated form (targetForm) will perform the normalDynamicForm.submit()actions when submitted (typically from aSubmitItem). By default the form submit action is bypassed.- Parameters:
saveToServer- New saveToServer value. Default value is false- Returns:
UserTaskinstance, for chaining setter calls- Throws:
IllegalStateException- this property cannot be changed after the underlying component has been created
-
getSaveToServer
If saveToServer is set then the associated form (targetForm) will perform the normalDynamicForm.submit()actions when submitted (typically from aSubmitItem). By default the form submit action is bypassed.- Returns:
- Current saveToServer value. Default value is false
-
setTargetForm
DynamicForm that should be populated with data and that should provide the data for the task outputs. IftargetViewis a DynamicForm and would also be the targetForm, the targetForm attribute can be left unset.Use
targetVMto use aValuesManagerinstead.- Parameters:
targetForm- New targetForm value. Default value is null- Returns:
UserTaskinstance, for chaining setter calls- Throws:
IllegalStateException- this property cannot be changed after the underlying component has been created
-
getTargetForm
DynamicForm that should be populated with data and that should provide the data for the task outputs. IftargetViewis a DynamicForm and would also be the targetForm, the targetForm attribute can be left unset.Use
targetVMto use aValuesManagerinstead.- Returns:
- Current targetForm value. Default value is null
-
setTargetForm
DynamicForm that should be populated with data and that should provide the data for the task outputs. IftargetViewis a DynamicForm and would also be the targetForm, the targetForm attribute can be left unset.Use
targetVMto use aValuesManagerinstead.- Parameters:
targetForm- New targetForm value. Default value is null- Returns:
UserTaskinstance, for chaining setter calls- Throws:
IllegalStateException- this property cannot be changed after the underlying component has been created
-
getTargetFormAsString
DynamicForm that should be populated with data and that should provide the data for the task outputs. IftargetViewis a DynamicForm and would also be the targetForm, the targetForm attribute can be left unset.Use
targetVMto use aValuesManagerinstead.- Returns:
- Current targetForm value. Default value is null
-
setWizard
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:
UserTaskinstance, for chaining setter calls- Throws:
IllegalStateException- this property cannot be changed after the underlying component has been created
-
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.cancelElementwill be proceed as the next element of current process. -
completeEditing
public void completeEditing()Finish editing and store edited values inprocess state. -
goToPrevious
public void goToPrevious()SetpreviousElementas next element of workflow. This method could be used to create wizard-like UI behavior. -
setTargetView
Optional widget that should be shown to allow user input. If this widget is a DynamicForm, it will also be automatically used as thetargetFormunless eithertargetFormortargetVMis set.UserTaskwill automatically handle various scenarios of thetargetViewbeing 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
paneof a tab in a TabSet, the tab will be selected - if the view is
listed in
itemsfor a which is either collapsed or hidden section, the section will be shown and expanded - if the view is listed in
itemsfor 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
Optional widget that should be shown to allow user input. If this widget is a DynamicForm, it will also be automatically used as thetargetFormunless eithertargetFormortargetVMis set.UserTaskwill automatically handle various scenarios of thetargetViewbeing 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
paneof a tab in a TabSet, the tab will be selected - if the view is
listed in
itemsfor a which is either collapsed or hidden section, the section will be shown and expanded - if the view is listed in
itemsfor 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
Optional widget that should be shown to allow user input. If this widget is a DynamicForm, it will also be automatically used as thetargetFormunless eithertargetFormortargetVMis set.UserTaskwill automatically handle various scenarios of thetargetViewbeing 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
paneof a tab in a TabSet, the tab will be selected - if the view is
listed in
itemsfor a which is either collapsed or hidden section, the section will be shown and expanded - if the view is listed in
itemsfor 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
Optional ValuesManager which will receive task inputs and provide task outputs. UsetargetForminstead of you want to use a DynamicForm.- Parameters:
targetVM- targetVM Default value is null
-
getTargetVM
Optional ValuesManager which will receive task inputs and provide task outputs. UsetargetForminstead of you want to use a DynamicForm.- Returns:
- ValuesManager
-
setTargetVM
Optional ValuesManager which will receive task inputs and provide task outputs. UsetargetForminstead of you want to use a DynamicForm.- Parameters:
targetVM- targetVM Default value is null
-