KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.jbpm.bpel.service.def;
2
3 import java.io.Serializable;
4
5 import org.apache.commons.lang.enum.Enum;
6
7 /**
8  * Indicates a correlation set ocurring in the message being sent or received
9  * in an activity.
10  * @see "WS-BPEL 2.0 §10.2"
11  * @author Alejandro Guízar
12  * @version $Revision: 1.5 $ $Date: 2005/05/31 00:49:53 $
13  */

14 public class Correlation implements Serializable {
15   
16   long id;
17   private CorrelationSetDefinition set;
18   private Initiate initiate;
19   
20   private static final long serialVersionUID = 1L;
21   
22   public CorrelationSetDefinition getSet() {
23     return set;
24   }
25   
26   public void setSet(CorrelationSetDefinition set) {
27     this.set = set;
28   }
29   
30   public Initiate getInitiate() {
31     return initiate;
32   }
33   
34   public void setInitiate(Initiate initiate) {
35     this.initiate = initiate;
36   }
37   
38   /**
39    * The correlation value specifies whether the related activity should
40    * attempt to initiate the correlation set.
41    */

42   public static final class Initiate extends Enum {
43     
44     /**
45      * The related activity <i>must</i> attempt to initiate the correlation set.
46      */

47     public static final Initiate YES = new Initiate("yes");
48     
49     /**
50      * The related activity <i>must not</i> attempt to initiate the correlation set.
51      */

52     public static final Initiate NO = new Initiate("no");
53     
54     /**
55      * The related activity <i>must</i> attempt to initiate the correlation set,
56      * if the correlation set is <i>not</i> initiated yet.
57      */

58     public static final Initiate RENDEZVOUS = new Initiate("rendezvous");
59     
60     private static final long serialVersionUID = 1L;
61     
62     /**
63      * Enumeration constructor.
64      * @param name the desired textual representation.
65      */

66     private Initiate(String name) {
67       super(name);
68     }
69     
70     /**
71      * Gets an enumeration object by name.
72      * @param name a string that identifies one element
73      * @return the appropiate enumeration object, or <code>null</code> if the
74      * object does not exist
75      */

76     public static Initiate valueOf(String name) {
77       return name != null ? (Initiate) getEnum(Initiate.class, name) : Initiate.NO;
78     }
79   }
80   
81   /**
82    * The pattern value specifies whether a correlation applies to the outbound
83    * (request) message, the inbound (response) message, or both.
84    * Used in the case of invoke, when the operation is synchronous request/response.
85    */

86   public static final class Pattern extends Enum {
87
88     /**
89      * The correlation applies to the inbound message only.
90      */

91     public static final Pattern IN = new Pattern("in");
92
93     /**
94      * The correlation applies to the outbound message only.
95      */

96     public static final Pattern OUT = new Pattern("out");
97
98     /**
99      * The correlation applies to both outbound and inbound messages.
100      */

101     public static final Pattern OUT_IN = new Pattern("out-in");
102     
103     private static final long serialVersionUID = 1L;
104
105     /**
106      * Enumeration constructor.
107      * @param name the desired textual representation.
108      */

109     private Pattern(String name) {
110       super(name);
111     }
112     
113     /**
114      * Gets an enumeration object by name.
115      * @param name a string that identifies one element
116      * @return the appropiate enumeration object, or <code>null</code> if the
117      * object does not exist
118      */

119     public static Pattern valueOf(String name) {
120       return (Pattern) getEnum(Pattern.class, name);
121     }
122   }
123 }
124
Popular Tags