View Javadoc

1   /*
2    * $Id: TransitionAddReadEdge.java 916 2008-07-08 15:47:06Z kwfgrid.bassheide $
3    *
4    * Copyright (c) 2008, Fraunhofer FIRST
5    * Fraunhofer Institute for Computer Architecture and Software Technology
6    * See http://www.first.fraunhofer.de and http://www.gridworkflow.org/gwes for more details.
7    */
8   package net.kwfgrid.gworkflowdl.protocol.calls;
9   
10  import net.kwfgrid.gworkflowdl.protocol.structure.ProtocolEdge;
11  import net.kwfgrid.gworkflowdl.protocol.structure.ProtocolTransition;
12  import org.xmlpull.v1.XmlSerializer;
13  
14  import java.io.IOException;
15  
16  /***
17     Modification that adds an readPlace to a transition.
18   */
19  public class TransitionAddReadEdge extends AbstractMethodCall {
20      protected ProtocolEdge _edge;
21      protected ProtocolTransition _transition;
22  
23      public TransitionAddReadEdge(ProtocolTransition transition, ProtocolEdge edge) {
24  	super(transition.getRoot());
25  	_edge = edge;
26  	_transition = transition;
27      }
28  
29      public void marshal(IMethodCallMarshaller encoder, XmlSerializer serializer) throws IOException {
30  	encoder.marshalTransitionAddReadEdge(serializer, _transition, _edge);
31      }
32  
33      public Object execute() {
34  	_transition.__addReadEdge(_edge);
35  	setExecuted();
36  	return null;
37      }
38  }