KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > bpel > service > def > Replier


1 package org.jbpm.bpel.service.def;
2
3 import java.io.Serializable JavaDoc;
4
5 import javax.wsdl.Operation;
6 import javax.xml.namespace.QName JavaDoc;
7
8 import org.jbpm.graph.exe.Token;
9
10 import org.jbpm.bpel.data.def.VariableDefinition;
11 import org.jbpm.bpel.data.exe.MessageVariableInstance;
12 import org.jbpm.bpel.messager.MessagerSession;
13 import org.jbpm.bpel.service.exe.OutstandingRequest;
14 import org.jbpm.bpel.service.exe.PartnerLinkInstance;
15
16 /**
17  * @author Alejandro Guízar
18  * @version $Revision: 1.8 $ $Date: 2005/05/13 20:07:06 $
19  */

20 public class Replier implements Serializable JavaDoc {
21   
22   private static final long serialVersionUID = 1L;
23   
24   long id;
25   private PartnerLinkDefinition partnerLink;
26   private Operation operation;
27   private VariableDefinition variable;
28   private QName JavaDoc faultName;
29   private String JavaDoc messageExchange;
30   private Correlations correlations;
31  
32   public PartnerLinkDefinition getPartnerLink() {
33     return partnerLink;
34   }
35   
36   public void setPartnerLink(PartnerLinkDefinition partnerLink) {
37     this.partnerLink = partnerLink;
38   }
39   
40   public Operation getOperation() {
41     return operation;
42   }
43   
44   public void setOperation(Operation operationName) {
45     this.operation = operationName;
46   }
47   
48   public VariableDefinition getVariable() {
49     return variable;
50   }
51   
52   public void setVariable(VariableDefinition variable) {
53     this.variable = variable;
54   }
55   
56   public QName JavaDoc getFaultName() {
57     return faultName;
58   }
59   
60   public void setFaultName(QName JavaDoc faultName) {
61     this.faultName = faultName;
62   }
63   
64   public String JavaDoc getMessageExchange() {
65     return messageExchange;
66   }
67   
68   public void setMessageExchange(String JavaDoc messageExchange) {
69     this.messageExchange = messageExchange;
70   }
71   
72   public Correlations getCorrelations() {
73     return correlations;
74   }
75   
76   public void setCorrelations(Correlations correlations) {
77     this.correlations = correlations;
78   }
79
80   public void reply(Token token) {
81     PartnerLinkInstance plinkInstance = partnerLink.getInstance(token);
82     OutstandingRequest request = plinkInstance.unregisterRequest(operation.getName(), messageExchange);
83     MessageVariableInstance variableInstance = (MessageVariableInstance) variable.getInstance(token);
84     if (correlations != null) {
85       correlations.ensureConstraint(variableInstance, token);
86     }
87     request.sendReply(variableInstance.getMessage(), faultName, MessagerSession.getCurrentSession());
88   }
89 }
90
Popular Tags