1
2
3
4
5
6 package net.kwfgrid.gworkflowdl.protocol.calls;
7
8 import net.kwfgrid.gworkflowdl.protocol.structure.*;
9
10 import java.io.IOException;
11
12 import org.xmlpull.v1.XmlSerializer;
13
14 /***
15 Modification that add a transition to a workflow.
16 */
17 public class WorkflowAddTransition extends AbstractMethodCall {
18 protected ProtocolTransition _transition;
19 protected ProtocolWorkflow _wf;
20
21 public WorkflowAddTransition(ProtocolWorkflow wf, ProtocolTransition transition) {
22 super(wf.getRoot());
23 _transition = transition;
24 _wf = wf;
25 }
26
27 public void marshal(IMethodCallMarshaller encoder, XmlSerializer serializer) throws IOException {
28 encoder.marshalWorkflowAddTransition(serializer, _wf, _transition);
29 }
30
31 public Object execute() {
32 _wf.__addTransition(_transition);
33 setExecuted();
34 return null;
35 }
36 }