|
|||||||||
| 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.Process
public class Process
A instance of Process represents a stateful process executing a series of Tasks, which may be:
state across the different tasks that are executed. This allows you
to maintain context as you walk a user through a multi-step business process in your application, which may involve
multiple operations on multiple entities. Each Task that executes can use the Process state as inputs, and can output a
result which is stored in the Process state - see TaskIO. A Process can have
multiple branches, choosing the next Task to execute based on Criteria - see XORGateway and DecisionGateway.
Because
a Process may return to a previous Task in various situations, the data model of a Process is strictly speaking a
graph (a set of nodes connected by arbitary interlinks). However, most processes have sequences of several tasks
in a row, and the definition format allows these to be represented as simple Arrays called "sequences", specified via
sequences. This reduces the need to manually specify IDs
and interlinks for Tasks that simply proceed to the next task in a sequence.
| Nested Class Summary | |
|---|---|
static interface |
Process.ProcessCallback
|
| Field Summary |
|---|
| Fields inherited from class com.smartgwt.client.core.BaseClass |
|---|
config, id, scClassName |
| Constructor Summary | |
|---|---|
Process()
|
|
Process(JavaScriptObject jsObj)
|
|
| Method Summary | |
|---|---|
JavaScriptObject |
create()
|
void |
finished(Record state)
StringMethod called when a process completes, meaning the process executes a ProcessElement with no next element. |
String |
getContainerId()
Identifier of canvas where should be added UI elements created by using inline view property. |
ProcessElement |
getElement(String ID)
Retrieve a ProcessElement by it's ID |
ProcessElement[] |
getElements()
Elements involved in this Process. |
static Process |
getOrCreateRef(JavaScriptObject jsObj)
|
static Process |
getProcess(String processId)
Get a Process instance by it's ID. |
ProcessSequence[] |
getSequences()
Sequences of ProcessElements. |
Record |
getSetState()
Set new process state. |
String |
getStartElement()
The ID of either a sequence or an element which should be the starting point of the process. |
Record |
getState()
Current state of a process. |
Boolean |
getWizard()
If wizard is set then current workflow will be handled as wizard. |
static void |
loadProcess(String processId,
Process.ProcessCallback callback)
|
protected void |
onInit_Process()
|
protected void |
onInit()
|
void |
reset(Record state)
Reset process to it's initial state, so process can be started again. |
void |
setConfig(JavaScriptObject jsObj)
|
void |
setContainerId(String containerId)
Identifier of canvas where should be added UI elements created by using inline view property. |
void |
setElements(ProcessElement... elements)
Elements involved in this Process. |
void |
setJavaScriptObject(JavaScriptObject jsObj)
|
void |
setSequences(ProcessSequence... sequences)
Sequences of ProcessElements. |
void |
setSetState(Record setState)
Set new process state. |
void |
setStartElement(ProcessElement startElement)
|
void |
setStartElement(String startElement)
The ID of either a sequence or an element which should be the starting point of the process. |
void |
setState(Record state)
Current state of a process. |
void |
setWizard(Boolean wizard)
If wizard is set then current workflow will be handled as wizard. |
void |
start()
Starts this task by executing the startElement. |
| 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 Process()
public Process(JavaScriptObject jsObj)
| Method Detail |
|---|
public static Process getOrCreateRef(JavaScriptObject jsObj)
public void setJavaScriptObject(JavaScriptObject jsObj)
setJavaScriptObject in class Taskpublic JavaScriptObject create()
create in class Taskpublic void setContainerId(String containerId)
inline view property.
containerId - . See String. Default value is nullpublic String getContainerId()
inline view property.
String
public void setSequences(ProcessSequence... sequences)
throws IllegalStateException
nextElement implicit.
Example of using sequences:
Process process = new Process();
process.setStartElement("firstSequence");
ProcessSequence innerSequence = new ProcessSequence(incTask, add2Task, incTask);
process.setSequences(
new ProcessSequence("firstSequence", serviceTask, decisionGateway),
new ProcessSequence("errorFlow", failureTask, userNotifyTask)
);
// standalone process elements not part of sequences
process.setElements(new ServiceTask(){...});
Record state = new Record();
state.setAttribute("someField", "someValue");
process.setState(state);
process.start();
sequences - sequences Default value is null
IllegalStateException - this property cannot be changed after the underlying component has been createdpublic ProcessSequence[] getSequences()
nextElement implicit.
Example of using sequences:
Process process = new Process();
process.setStartElement("firstSequence");
ProcessSequence innerSequence = new ProcessSequence(incTask, add2Task, incTask);
process.setSequences(
new ProcessSequence("firstSequence", serviceTask, decisionGateway),
new ProcessSequence("errorFlow", failureTask, userNotifyTask)
);
// standalone process elements not part of sequences
process.setElements(new ServiceTask(){...});
Record state = new Record();
state.setAttribute("someField", "someValue");
process.setState(state);
process.start();
public void setSetState(Record setState)
setState - setState Default value is nullpublic Record getSetState()
public void setStartElement(String startElement)
throws IllegalStateException
sequence or an element which should be the starting point of the process. If
not specified, the first sequence is chosen, or if there are no sequences, the first element. - log a warning and do
nothing if there are neither sequences or elements
startElement - . See String. Default value is null
IllegalStateException - this property cannot be changed after the underlying component has been createdpublic String getStartElement()
sequence or an element which should be the starting point of the process. If
not specified, the first sequence is chosen, or if there are no sequences, the first element. - log a warning and do
nothing if there are neither sequences or elements
Stringpublic void setState(Record state)
state - the new process state. Default value is nullpublic Record getState()
public void setWizard(Boolean wizard)
throws IllegalStateException
wizard - wizard Default value is false
IllegalStateException - this property cannot be changed after the underlying component has been createdpublic Boolean getWizard()
public void finished(Record state)
state - the final process statepublic ProcessElement getElement(String ID)
ProcessElement by it's ID
ID - id of the process element
public void reset(Record state)
state - new state of the processpublic void start()
startElement.
public static Process getProcess(String processId)
Process.loadProcess.
processId - process IDs to retrieve
public void setConfig(JavaScriptObject jsObj)
public static void loadProcess(String processId,
Process.ProcessCallback callback)
public ProcessElement[] getElements()
sequences to reduce the need to explicitly define IDs for
elements and interlink them.
public void setElements(ProcessElement... elements)
throws IllegalStateException
sequences to reduce the need to explicitly define IDs for
elements and interlink them.
elements - elements Default value is null
IllegalStateException - this property cannot be changed after the underlying component has been created
public void setStartElement(ProcessElement startElement)
throws IllegalStateException
IllegalStateExceptionsetStartElement(String)protected void onInit_Process()
protected void onInit()
onInit in class BaseClass
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||