|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.smartgwt.client.core.BaseClass
com.smartgwt.client.util.workflow.ProcessElement
com.smartgwt.client.util.workflow.Task
com.smartgwt.client.util.workflow.ScriptTask
public class ScriptTask
Task that executes arbitrary code, either synchronous or asynchronous. Override the execute
method to provide custom logic.
Field Summary |
---|
Fields inherited from class com.smartgwt.client.core.BaseClass |
---|
config, id, scClassName |
Constructor Summary | |
---|---|
ScriptTask()
|
|
ScriptTask(JavaScriptObject jsObj)
|
|
ScriptTask(String ID)
|
|
ScriptTask(String ID,
ProcessElement nextElement)
|
|
ScriptTask(String ID,
String nextElement)
|
Method Summary | |
---|---|
JavaScriptObject |
create()
|
Object |
execute(Object input,
Record inputRecord)
Execute the task. |
Object |
getInputData()
Get the inputs to this task as specified by inputField . |
Record |
getInputRecord()
Get all inputs to the task as specified by the inputFieldList , as a Record. |
Boolean |
getIsAsync()
Whether the script task is asynchronous. |
static ScriptTask |
getOrCreateRef(JavaScriptObject jsObj)
|
protected void |
onInit_ScriptTask()
|
protected void |
onInit()
|
void |
setIsAsync(Boolean isAsync)
Whether the script task is asynchronous. |
void |
setJavaScriptObject(JavaScriptObject jsObj)
|
void |
setOutputData(Object taskOutput)
Set the task output as specified by outputField . |
void |
setOutputRecord(Record outputRecord)
Set all outputs of the task as specified by the outputFieldList , by providing a Record. |
Methods inherited from class com.smartgwt.client.util.workflow.Task |
---|
getInputField, getInputFields, getOutputField, getOutputFields, setInputField, setInputFields, setOutputField, setOutputFields |
Methods inherited from class com.smartgwt.client.util.workflow.ProcessElement |
---|
convertToJavaScriptArray, getID, getJsObj, getNextElement, getOrCreateJsObj, getProcessElements, isCreated, setAttribute, setID, setNextElement |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ScriptTask()
public ScriptTask(JavaScriptObject jsObj)
public ScriptTask(String ID)
public ScriptTask(String ID, String nextElement)
public ScriptTask(String ID, ProcessElement nextElement)
Method Detail |
---|
public static ScriptTask getOrCreateRef(JavaScriptObject jsObj)
public void setJavaScriptObject(JavaScriptObject jsObj)
setJavaScriptObject
in class Task
public JavaScriptObject create()
create
in class Task
public void setIsAsync(Boolean isAsync) throws IllegalStateException
An asnychronous task is expected to start processing in
execute(), and will not be considered complete until either ScriptTask.setOutputData
or ScriptTask.setOutputRecord
is called.
isAsync
- isAsync Default value is false
IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic Boolean getIsAsync()
An asnychronous task is expected to start processing in
execute(), and will not be considered complete until either ScriptTask.setOutputData
or ScriptTask.setOutputRecord
is called.
public Object execute(Object input, Record inputRecord)
input
- the task inputinputRecord
- the task input record if an inputFieldList
was specified. See TaskIO
ScriptTask.setOutputRecord
instead, and return nullpublic Object getInputData()
inputField
.
For a task with a inputFieldList
, use ScriptTask.getInputRecord
to get access to other inputs.
TaskIO overview and related methods
public Record getInputRecord()
inputFieldList
, as a Record.
TaskIO overview and related methods
public void setOutputRecord(Record outputRecord)
outputFieldList
, by providing a Record.
outputRecord
- output recordpublic void setOutputData(Object taskOutput)
outputField
. NOTE:
for an asychronous task, calling setOutputData()
indicates the task is complete. For a task with multiple outputs
, call ScriptTask.setOutputRecord
instead.
taskOutput
- task outputprotected void onInit_ScriptTask()
protected void onInit()
onInit
in class BaseClass
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |