Class ScriptTask
- All Implemented Interfaces:
HasHandlers
- Direct Known Subclasses:
StartProcessTask
execute()
method to provide custom logic.-
Field Summary
Fields inherited from class com.smartgwt.client.core.BaseClass
config, configOnly, factoryCreated, factoryProperties, id, scClassName
-
Constructor Summary
ConstructorDescriptionScriptTask
(JavaScriptObject jsObj) ScriptTask
(String ID) ScriptTask
(String ID, ProcessElement nextElement) ScriptTask
(String ID, String nextElement) -
Method Summary
Modifier and TypeMethodDescriptioncreate()
Execute the task.Get the inputs to this task as specified byTask.inputField
.Get all inputs to the task as specified by theinputFieldList
, as a Record.Whether the script task is asynchronous.static ScriptTask
getOrCreateRef
(JavaScriptObject jsObj) Does this processElement pass through output from the last executed task (i.e.Get the process executing this task instance.protected void
onInit()
protected void
setIsAsync
(Boolean isAsync) Whether the script task is asynchronous.void
setOutputData
(Object taskOutput) Set the task output as specified byoutputField
.void
setOutputRecord
(Record outputRecord) Set all outputs of the task as specified by theoutputFieldList
, by providing a Record.setPassThruOutput
(Boolean passThruOutput) Does this processElement pass through output from the last executed task (i.e.Methods inherited from class com.smartgwt.client.util.workflow.Task
getInputField, getInputFieldList, getOutputExpression, getOutputField, getOutputFieldList, setInputField, setInputFieldList, setOutputExpression, setOutputField, setOutputFieldList
Methods 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, 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, 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
-
Constructor Details
-
ScriptTask
public ScriptTask() -
ScriptTask
-
ScriptTask
-
ScriptTask
-
ScriptTask
-
-
Method Details
-
getOrCreateRef
-
create
-
setIsAsync
Whether the script task is asynchronous. A synchronous task is expected to return data directly from execute() and is considered complete once the execute() method exits.An asynchronous task is expected to start processing in execute(), and will not be considered complete until either
setOutputData()
orsetOutputRecord()
is called.- Parameters:
isAsync
- New isAsync value. Default value is false- Returns:
ScriptTask
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the underlying component has been created
-
getIsAsync
Whether the script task is asynchronous. A synchronous task is expected to return data directly from execute() and is considered complete once the execute() method exits.An asynchronous task is expected to start processing in execute(), and will not be considered complete until either
setOutputData()
orsetOutputRecord()
is called.- Returns:
- Current isAsync value. Default value is false
-
setPassThruOutput
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 classProcessElement
- Parameters:
passThruOutput
- New passThruOutput value. Default value is false- Returns:
ScriptTask
instance, 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
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 classProcessElement
- Returns:
- Current passThruOutput value. Default value is false
-
execute
Execute the task.- Parameters:
input
- the task inputinputRecord
- the task input record if aninputFieldList
was specified. SeeTaskIO
- Returns:
- the task output. For multiple field output, call
setOutputRecord()
instead, and return null
-
getInputData
Get the inputs to this task as specified byTask.inputField
.For a task with a
inputFieldList
, usegetInputRecord()
to get access to other inputs.- Returns:
- input data
- See Also:
-
getInputRecord
Get all inputs to the task as specified by theinputFieldList
, as a Record.- Returns:
- input data
- See Also:
-
getProcess
Get the process executing this task instance.- Returns:
- the owning process
-
setOutputRecord
Set all outputs of the task as specified by theoutputFieldList
, by providing a Record.- Parameters:
outputRecord
- output record- See Also:
-
setOutputData
Set the task output as specified byoutputField
.NOTE: for an asychronous task, calling
setOutputData()
indicates the task is complete. For a task withmultiple outputs
, callScriptTask.setOutputRecord
instead.- Parameters:
taskOutput
- task output
-
onInit_ScriptTask
protected void onInit_ScriptTask() -
onInit
protected void onInit()- Overrides:
onInit
in classProcessElement
-