Class Task
- All Implemented Interfaces:
HasHandlers
- Direct Known Subclasses:
ComponentTask,DSRequestTask,ScriptTask,StateTask,UserTask
DSRequestTask.-
Field Summary
Fields inherited from class com.smartgwt.client.core.BaseClass
config, configOnly, factoryCreated, factoryProperties, id, scClassName -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate()Get the value of a Criteria or AdvancedCriteria by resolving any values containingtaskInputExpressions.Get the value of a Criteria or AdvancedCriteria by resolving any values containingtaskInputExpressions.getExpressionValue(Object value) Get the value of ainputExpression.getExpressionValue(String value) Get the value of ainputExpression.String[]Deprecated.Get all inputs to the task as specified by theinputs, as a Record.Defines how fields in theprocess stateare extracted for theinput recordto this task.Defines how fields in theprocess stateare extracted for theinput recordto this task.String[]Defines how fields in theprocess stateare extracted for theinput recordto this task.static TaskgetOrCreateRef(JavaScriptObject jsObj) Special expression to write task output directly into aDataBoundComponent.Field in theprocess statewhere this task writes outputs.String[]List of multiple fields in theprocess statewhere this task will write outputs.Returns a value from theprocess state.If set to true, the task will not allow any intermediate state to be set viasetState()that is not explicitly defined first.setInputFieldList(String... inputFieldList) Deprecated.In favor ofinputsas of SmartGWT release 13.1Defines how fields in theprocess stateare extracted for theinput recordto this task.Defines how fields in theprocess stateare extracted for theinput recordto this task.Defines how fields in theprocess stateare extracted for theinput recordto this task.voidSets the task output available to the next task viaProcess.getLastTaskOutput()or more commonly, with aTaskInputExpressionproperty.setOutputExpression(String outputExpression) Special expression to write task output directly into aDataBoundComponent.setOutputField(String outputField) Field in theprocess statewhere this task writes outputs.setOutputFieldList(String... outputFieldList) List of multiple fields in theprocess statewhere this task will write outputs.voidSets aprocess statevalue for later reference withProcess.getStateVariable()or more commonly, with aTaskInputExpressionproperty.setStrictPaths(Boolean strictPaths) If set to true, the task will not allow any intermediate state to be set viasetState()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, getInstanceDescription, getInstanceTitle, 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, 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
-
Task
public Task() -
Task
-
-
Method Details
-
getOrCreateRef
-
create
- Overrides:
createin classProcessElement
-
setInputFieldList
Deprecated.In favor ofinputsas of SmartGWT release 13.1List of multiple fields from theprocess statewhich are provided as input data to this task. SeeTaskIO.- Parameters:
inputFieldList- New inputFieldList value. Default value is null- Returns:
Taskinstance, for chaining setter calls- Throws:
IllegalStateException- this property cannot be changed after the underlying component has been created- See Also:
-
getInputFieldList
Deprecated.In favor ofinputsas of SmartGWT release 13.1List of multiple fields from theprocess statewhich are provided as input data to this task. SeeTaskIO.- Returns:
- Current inputFieldList value. Default value is null
- See Also:
-
setInputs
Defines how fields in theprocess stateare extracted for theinput recordto this task.inputsmay be:- a single
StatePathorTaskInputExpression: the value it refers to is the task's$input. If that value is a Record, its fields form the input record; otherwise the value is stored in the input record under the last segment of the path. - an Array of
StatePaths: each value is stored in the input record under the last segment of its path. - an Object:
each key is a
StatePath(in its setter form) into the input record, and each value is aTaskInputExpression, aStatePathintoProcess.state, or, for a non-String value, a literal. Because a String value is always resolved, a literal String cannot be supplied this way.$inputcannot be referenced here, since it is the result of theseinputs.
inputsnor the deprecatedinputFieldListis set, the input record is the entire process state. SeeTaskIOfor details and examples.- Parameters:
inputs- New inputs value. Default value is null- Returns:
Taskinstance, for chaining setter calls- Throws:
IllegalStateException- this property cannot be changed after the underlying component has been created- See Also:
- a single
-
getInputs
Defines how fields in theprocess stateare extracted for theinput recordto this task.inputsmay be:- a single
StatePathorTaskInputExpression: the value it refers to is the task's$input. If that value is a Record, its fields form the input record; otherwise the value is stored in the input record under the last segment of the path. - an Array of
StatePaths: each value is stored in the input record under the last segment of its path. - an Object:
each key is a
StatePath(in its setter form) into the input record, and each value is aTaskInputExpression, aStatePathintoProcess.state, or, for a non-String value, a literal. Because a String value is always resolved, a literal String cannot be supplied this way.$inputcannot be referenced here, since it is the result of theseinputs.
inputsnor the deprecatedinputFieldListis set, the input record is the entire process state. SeeTaskIOfor details and examples.- Returns:
- Current inputs value. Default value is null
- See Also:
- a single
-
setInputs
Defines how fields in theprocess stateare extracted for theinput recordto this task.inputsmay be:- a single
StatePathorTaskInputExpression: the value it refers to is the task's$input. If that value is a Record, its fields form the input record; otherwise the value is stored in the input record under the last segment of the path. - an Array of
StatePaths: each value is stored in the input record under the last segment of its path. - an Object:
each key is a
StatePath(in its setter form) into the input record, and each value is aTaskInputExpression, aStatePathintoProcess.state, or, for a non-String value, a literal. Because a String value is always resolved, a literal String cannot be supplied this way.$inputcannot be referenced here, since it is the result of theseinputs.
inputsnor the deprecatedinputFieldListis set, the input record is the entire process state. SeeTaskIOfor details and examples.- Parameters:
inputs- New inputs value. Default value is null- Returns:
Taskinstance, for chaining setter calls- Throws:
IllegalStateException- this property cannot be changed after the underlying component has been created- See Also:
- a single
-
getInputsAsStringArray
Defines how fields in theprocess stateare extracted for theinput recordto this task.inputsmay be:- a single
StatePathorTaskInputExpression: the value it refers to is the task's$input. If that value is a Record, its fields form the input record; otherwise the value is stored in the input record under the last segment of the path. - an Array of
StatePaths: each value is stored in the input record under the last segment of its path. - an Object:
each key is a
StatePath(in its setter form) into the input record, and each value is aTaskInputExpression, aStatePathintoProcess.state, or, for a non-String value, a literal. Because a String value is always resolved, a literal String cannot be supplied this way.$inputcannot be referenced here, since it is the result of theseinputs.
inputsnor the deprecatedinputFieldListis set, the input record is the entire process state. SeeTaskIOfor details and examples.- Returns:
- Current inputs value. Default value is null
- See Also:
- a single
-
setInputs
Defines how fields in theprocess stateare extracted for theinput recordto this task.inputsmay be:- a single
StatePathorTaskInputExpression: the value it refers to is the task's$input. If that value is a Record, its fields form the input record; otherwise the value is stored in the input record under the last segment of the path. - an Array of
StatePaths: each value is stored in the input record under the last segment of its path. - an Object:
each key is a
StatePath(in its setter form) into the input record, and each value is aTaskInputExpression, aStatePathintoProcess.state, or, for a non-String value, a literal. Because a String value is always resolved, a literal String cannot be supplied this way.$inputcannot be referenced here, since it is the result of theseinputs.
inputsnor the deprecatedinputFieldListis set, the input record is the entire process state. SeeTaskIOfor details and examples.- Parameters:
inputs- New inputs value. Default value is null- Returns:
Taskinstance, for chaining setter calls- Throws:
IllegalStateException- this property cannot be changed after the underlying component has been created- See Also:
- a single
-
getInputsAsString
Defines how fields in theprocess stateare extracted for theinput recordto this task.inputsmay be:- a single
StatePathorTaskInputExpression: the value it refers to is the task's$input. If that value is a Record, its fields form the input record; otherwise the value is stored in the input record under the last segment of the path. - an Array of
StatePaths: each value is stored in the input record under the last segment of its path. - an Object:
each key is a
StatePath(in its setter form) into the input record, and each value is aTaskInputExpression, aStatePathintoProcess.state, or, for a non-String value, a literal. Because a String value is always resolved, a literal String cannot be supplied this way.$inputcannot be referenced here, since it is the result of theseinputs.
inputsnor the deprecatedinputFieldListis set, the input record is the entire process state. SeeTaskIOfor details and examples.- Returns:
- Current inputs value. Default value is null
- See Also:
- a single
-
setOutputExpression
Special expression to write task output directly into aDataBoundComponent. SeeTaskIO.- Parameters:
outputExpression- New outputExpression value. Default value is null- Returns:
Taskinstance, for chaining setter calls- Throws:
IllegalStateException- this property cannot be changed after the underlying component has been created- See Also:
-
getOutputExpression
Special expression to write task output directly into aDataBoundComponent. SeeTaskIO.- Returns:
- Current outputExpression value. Default value is null
- See Also:
-
setOutputField
Field in theprocess statewhere this task writes outputs. SeeTaskIO.- Parameters:
outputField- New outputField value. Default value is null- Returns:
Taskinstance, for chaining setter calls- Throws:
IllegalStateException- this property cannot be changed after the underlying component has been created- See Also:
-
getOutputField
Field in theprocess statewhere this task writes outputs. SeeTaskIO.- Returns:
- Current outputField value. Default value is null
- See Also:
-
setOutputFieldList
List of multiple fields in theprocess statewhere this task will write outputs. SeeTaskIO.If
outputFieldis also specified, it will be implicitly added to theoutputFieldListif it is not already present.- Parameters:
outputFieldList- New outputFieldList value. Default value is null- Returns:
Taskinstance, for chaining setter calls- Throws:
IllegalStateException- this property cannot be changed after the underlying component has been created- See Also:
-
getOutputFieldList
List of multiple fields in theprocess statewhere this task will write outputs. SeeTaskIO.If
outputFieldis also specified, it will be implicitly added to theoutputFieldListif it is not already present.- Returns:
- Current outputFieldList value. Default value is null
- See Also:
-
setStrictPaths
If set to true, the task will not allow any intermediate state to be set viasetState()that is not explicitly defined first. This requirement can be overridden by an optional value in thesetState()call.This setting can be applied to the entire process with
Process.strictPaths.- Parameters:
strictPaths- New strictPaths value. Default value is null- Returns:
Taskinstance, for chaining setter calls
-
getStrictPaths
If set to true, the task will not allow any intermediate state to be set viasetState()that is not explicitly defined first. This requirement can be overridden by an optional value in thesetState()call.This setting can be applied to the entire process with
Process.strictPaths.- Returns:
- Current strictPaths value. Default value is null
-
getCriteriaExpressionValue
Get the value of a Criteria or AdvancedCriteria by resolving any values containingtaskInputExpressions. The criteria passed in is not modified; a resolved copy is returned.Data values in the 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 toCriterion.value. To use a literal value starting with "$", escape it with a backslash: the value\$lastresolves to the String$last.For AdvancedCriteria only, when
Process.ruleScopeis set, adynamic criteriacontainingCriterion.valuePathvalues is also resolved against the ruleScope component'sruleContext.Returns null when called outside of a running process.
- Parameters:
value- criteria to resolve- Returns:
- resolved copy of criteria
- See Also:
-
getCriteriaExpressionValueAsAdvancedCriteria
Get the value of a Criteria or AdvancedCriteria by resolving any values containingtaskInputExpressions. The criteria passed in is not modified; a resolved copy is returned.Data values in the 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 toCriterion.value. To use a literal value starting with "$", escape it with a backslash: the value\$lastresolves to the String$last.For AdvancedCriteria only, when
Process.ruleScopeis set, adynamic criteriacontainingCriterion.valuePathvalues is also resolved against the ruleScope component'sruleContext.Returns null when called outside of a running process.
- Parameters:
value- criteria to resolve- Returns:
- resolved copy of criteria
-
getExpressionValue
Get the value of ainputExpression. A String that does not start with "$" is treated as aStatePathintoProcess.state; any other non-null value is a literal and returned unchanged. Expressions are resolved as byProcess.getExpressionValue(), plus$input, drawn from this task'sinputs.Outside of a running process a String expression resolves to null.
- Parameters:
value- expression to evaluate, or a StatePath. SeeTaskInputExpression- Returns:
- value of expression
- See Also:
-
getExpressionValue
Get the value of ainputExpression. A String that does not start with "$" is treated as aStatePathintoProcess.state; any other non-null value is a literal and returned unchanged. Expressions are resolved as byProcess.getExpressionValue(), plus$input, drawn from this task'sinputs.Outside of a running process a String expression resolves to null.
- Parameters:
value- expression to evaluate, or a StatePath. SeeTaskInputExpression- Returns:
- value of expression
- See Also:
-
getInputRecord
Get all inputs to the task as specified by theinputs, as a Record. When the task declares noinputs, the input record is a shallow copy of the entireProcess.state: fields can be added to or replaced in the returned record without affecting the process state, but nested objects are shared with it and must not be modified. SeeTaskIOfor how each form ofinputscontributes to the input record.Outside of a running process, for example while a task is being edited, there is no state to draw from and declared inputs have no values.
- Returns:
- input record
- See Also:
-
getState
Returns a value from theprocess state. Values can be written into the process state bysetState(), settingProcessElement.bindOutput, or various task output settings (SeeTaskIO.) -
setOutput
Sets the task output available to the next task viaProcess.getLastTaskOutput()or more commonly, with aTaskInputExpressionproperty. IfoutputFieldListis specified, the output will also be written to the specified fields in the process state (SeeTaskIO).To have the output written as-is to the process state, see
bindOutput.- Parameters:
output- output record to provide to next task
-
setState
Sets aprocess statevalue for later reference withProcess.getStateVariable()or more commonly, with aTaskInputExpressionproperty.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:
statePath- path to the variable in the process state to set. segments are separated by a decimal point (.). SeeStatePathvalue- the value to save. SeeTaskInputExpressionstrict- if true, every intermediate segment of the path must already exist in the state; the final segment is always created or replaced. If false, missing intermediate objects are created. Defaults tostrictPaths, thenProcess.strictPaths, when null.
-
inputsas of SmartGWT release 13.1