KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > bpel > exe > LinkInstance


1 package org.jbpm.bpel.exe;
2
3 import java.io.Serializable JavaDoc;
4
5 import org.jbpm.context.exe.ContextInstance;
6 import org.jbpm.graph.exe.Token;
7
8 public class LinkInstance implements Serializable JavaDoc {
9   
10   private static final long serialVersionUID = 1L;
11   
12   private long id;
13   protected String JavaDoc name = null;
14   protected Boolean JavaDoc reached = null;
15   protected Token token = null;
16   
17   public LinkInstance() {
18   }
19
20   public LinkInstance(String JavaDoc name) {
21     this.name = name;
22   }
23   
24   public static LinkInstance get(Token token, String JavaDoc linkName) {
25     ContextInstance ci = token.getProcessInstance().getContextInstance();
26     return (LinkInstance) ci.getVariable(linkName, token);
27   }
28   
29   public static LinkInstance create(Token token, String JavaDoc linkName) {
30     ContextInstance ci = token.getProcessInstance().getContextInstance();
31     LinkInstance mi = new LinkInstance(linkName);
32     mi.setToken(token);
33     ci.createVariable( linkName, mi, token );
34     return mi;
35   }
36
37   public long getId() {
38     return id;
39   }
40   public void setId(long id) {
41     this.id = id;
42   }
43   public String JavaDoc getName() {
44     return name;
45   }
46   public void setName(String JavaDoc name) {
47     this.name = name;
48   }
49   public Boolean JavaDoc getReached() {
50     return reached;
51   }
52   public void setReached(Boolean JavaDoc reached) {
53     this.reached = reached;
54   }
55   public Token getToken() {
56     return token;
57   }
58   public void setToken(Token token) {
59     this.token = token;
60   }
61 }
Popular Tags