00194585-05_Installation_Manual_EDM_EN.pdf - 第45页

Installation Manual SIPLACE EDM Version 1.1 SP2 Issue 12/2006 They determine the reactions to incoming events. Every transition can execute any number of “actions “ when triggered by an event. To permit a cert ain degree…

100%1 / 65
Installation Manual, SIPLACE EDM Version 1.1 SP2 Issue 12/2006
When starting, you will first need to declare all states, events and transitions. This is necessary so
that the workflow engine operating on the configuration file can more easily verify the finite state
machine.
First, we define the start state:
<state name="clientIdle" isStartState="true" />
In the following state declarations, isStartState=“true” is not allowed to appear any more because a
finite state machine has exactly one start state.
A “normal” state is declared:
<state name="selectObjects" />
This state is marked as an end state:
<state name="done" isEndState="true" />
Error states are declared as follows:
<state name="timedOut" isErrorState="true" />
A state can be an error state and an end state at the same time:
<state name="failed" isErrorState="true" isEndState="true" />
The names of the states must be unique. Next, the events that the workflow engine can react to are
declared in the configuration file:
<event name="pullData" />
The names of the events also need to be unique because they are referenced in the definitions of
the transitions just like the states.
The transitions are the heart of the workflow definition. They are a kind of “building block” that can
be used to model a customer workflow.
44 of 65
Installation Manual SIPLACE EDM Version 1.1 SP2 Issue 12/2006
They determine the reactions to incoming events. Every transition can execute any number of
“actions“ when triggered by an event. To permit a certain degree of control, a transition can be
equipped with a special action that has a return value. Such actions are called controllers. In this
case, the initial state, event and result of the action are passed to the next state. An example of this
is shown below:
<transition name="getTemplateList" currentState="clientIdle" event="pullData">
<newState name="waitTemplateList">
<action
class="Siemens.SiplacePro.EDM.DataExchange.Actions.AcquireT
emplateListAction,DataExchange" />
<action
class="Siemens.SiplacePro.EDM.DataExchange.Actions.SendReq
uestAction,DataExchange" />
</newState>
</transition>
Figure 12 Example of a simple transition
This transition goes from the clientIdle state to the waitTemplateList state when the pullData event is
triggered. Two actions are performed during the transition, each of which is specified in the class
notation known from the application configuration. The actions are executed in the order they are
listed in the file.
<transition name="selectTemplate" currentState="waitTemplateList"
event="templateList"
class="Siemens.SiplacePro.EDM.DataExchange.Actions.AskForTemplateAct
ion,DataExchange">
<newState name="waitTemplate" value="OK">
<action
class="Siemens.SiplacePro.EDM.DataExchange.Actions.AcquireT
emplateAction,DataExchange" />
<action
class="Siemens.SiplacePro.EDM.DataExchange.Actions.SendReq
uestAction,DataExchange" />
</newState>
<newState name="canceled" value="Cancel" />
45 of 65
Installation Manual, SIPLACE EDM Version 1.1 SP2 Issue 12/2006
</transition>
Figure 13 Example of a conditional transition
This transition performs the state transition while taking a controller into account. This special action
is specified using the attribute “class” in class notation. In this case, there is not only one “newState”
tag like in the first example in
Figure 12, there is one tag for each possible output of the controller.
To handle these tags, the “value” attribute is added to the “newState” tag. A controller always
returns a string, so the result can always be stored in the XML file.
To make it easier for the author of the workflow configuration to handle application cases such as
the transition for all states to valid error states like the ones arising in EDM in the form of timeouts
due to the asynchronous communication, the transitions can also be defined as shown in Figure 14:
<transition name="timeoutDefault" currentState="all" event="timeOut">
<newState name="timedOut" />
</transition>
Figure 14 Default transition
Specifying “all” for the initial state causes this transition to be used for all states. The transition
above therefore defines a general timeout response. A default transition is only executed when no
specific transition is defined for the particular event. This means you can implicitly define more than
one transition for a state/event pair. However, it is not possible to describe more than one default
transition for an event.
46 of 65