WFExecutionObject interface and implementation
1. Overview
The WFExecutionObject interface is an abstract base interface that defines WfProcess and WFActivity public properties, status, and operations. The status of the operation returned by WFExecutionObject is different from the flow state. WFExecutionObject provides a method to get the current state and complete the transition from the current state to another. However, the status of WFExecutionObject is the status of the execution object, and the state of WfProcess is the state of the process, and there is no necessarily relationship between them.
2. Attributes and corresponding methods
2.1 Name
The Name property is a descriptive name of the workflow execution object, the acquisition and setting of the Name property is done by GenericDelegator and WorkeffORTID:
Public string name () throws wfexception {
Return getRuntimeObject (). getString ("WorkeffortName");
}
Public void setname (String newValue) throws wfexception {
GenericValue DataObject = GETRUNTIMEOBJECT ();
Try {
DataObject.set ("WorkeffortName", NewValue;
DataObject.store ();
} catch (genericentityException e) {
Throw new wfexception (E.GetMessage (), E);
}
}
2.2 Key
Key is the unique marker for the workflow execution object. Among the processes generated by a specific workflow manager, each process has a unique key; a collection of activities containing a unique Key. When the workflow execution object is generated, the workflow manager assigns a specific key for it.
Key is different from the object marker, which is a process or activity of the workflow execution object lifecycle. It is represented by ActivityID or Processid.
2.3 Process_Context
Process_context is a process-related data defined to perform an object environment, which is described by a series of name properties. Process_Context is expressed by a series of name value pairs, and the acquisition and setting of Process_Context is implemented by RuntIMedataID and GenericValue.
2.4 priority
The valid value of Priority is between 0 and 5, one is highest, three is Normal, and the other is otherwise.
2.5 last_state_time
Indicates the time when the last state is changed, as follows:
Public timestamp laststatetime () throws wfexception {
GenericValue DataObject = GETRUNTIMEOBJECT ();
IF (DataObject == Null || DataObject.get ("LastStatusupdate") == NULL)
Throw New WFEXCEPTION ("NO Runtime Object or Status Has Never Been Set.");
Return DataObject.getTimeStamp ("LastStatusUpdate");
}
3. status
The total state is divided into open and closed.
Open is divided into open.running and open.not_running.
Open.not_running is divided into not_running.not_started and not_running.suspend. Closed is divided into closed.completed, closed.terminated and closed.aborted.
From Not_Running.suspended to Open.Running, you should use the resume () method. In addition, the Terminate () method, an abort () method, or a complete () method can be adjusted to the corresponding state. Of course, the most common way to change the state is to use the ChangeState (Int State) method.