1 package org.jbpm.bpel.exe; 2 3 import java.io.Serializable ; 4 5 import org.jbpm.context.exe.ContextInstance; 6 import org.jbpm.graph.exe.Token; 7 8 public class LinkInstance implements Serializable { 9 10 private static final long serialVersionUID = 1L; 11 12 private long id; 13 protected String name = null; 14 protected Boolean reached = null; 15 protected Token token = null; 16 17 public LinkInstance() { 18 } 19 20 public LinkInstance(String name) { 21 this.name = name; 22 } 23 24 public static LinkInstance get(Token token, String linkName) { 25 ContextInstance ci = token.getProcessInstance().getContextInstance(); 26 return (LinkInstance) ci.getVariable(linkName, token); 27 } 28 29 public static LinkInstance create(Token token, String 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 getName() { 44 return name; 45 } 46 public void setName(String name) { 47 this.name = name; 48 } 49 public Boolean getReached() { 50 return reached; 51 } 52 public void setReached(Boolean 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 |