private void registerForDeletion(ProcessDefinition processDefinition) { // start new transaction to avoid registering an uncommitted process definition newTransaction(); if (processDefinitionIds == null) processDefinitionIds = new ArrayList(); processDefinitionIds.add(new Long(processDefinition.getId())); }
private void registerForDeletion(ProcessDefinition processDefinition) { // start new transaction to avoid registering an uncommitted process definition newTransaction(); if (processDefinitionIds == null) processDefinitionIds = new ArrayList(); processDefinitionIds.add(new Long(processDefinition.getId())); }
/** * Tells whether this process definition is equal to the given object. This method considers * two process definitions equal if they are equal in name and version, the name is not null * and the version is not negative. */ public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof ProcessDefinition)) return false; ProcessDefinition other = (ProcessDefinition) o; if (id != 0 && id == other.getId()) return true; return name != null && version >= 0 && name.equals(other.getName()) && version == other.getVersion(); }
/** * Tells whether this process definition is equal to the given object. This method considers * two process definitions equal if they are equal in name and version, the name is not null * and the version is not negative. */ public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof ProcessDefinition)) return false; ProcessDefinition other = (ProcessDefinition) o; if (id != 0 && id == other.getId()) return true; return name != null && version >= 0 && name.equals(other.getName()) && version == other.getVersion(); }
protected ProcessDefinition saveAndReload(ProcessDefinition pd) { graphSession.saveProcessDefinition(pd); registerForDeletion(pd); return graphSession.loadProcessDefinition(pd.getId()); }
protected ProcessDefinition saveAndReload(ProcessDefinition pd) { graphSession.saveProcessDefinition(pd); registerForDeletion(pd); return graphSession.loadProcessDefinition(pd.getId()); }
ProcessClassLoader(ClassLoader parent, ProcessDefinition processDefinition, JbpmConfiguration jbpmConfiguration) { super(parent); // check whether the given process definition is transient long id = processDefinition.getId(); if (id != 0) { // persistent, keep id only processDefinitionId = id; // remember jbpm configuration if (jbpmConfiguration != null) { this.jbpmConfiguration = jbpmConfiguration; } else { JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext(); if (jbpmContext == null) throw new JbpmException("no active jbpm context"); this.jbpmConfiguration = jbpmContext.getJbpmConfiguration(); } } else { // transient, keep full object this.processDefinition = processDefinition; this.jbpmConfiguration = null; } }
ProcessClassLoader(ClassLoader parent, ProcessDefinition processDefinition, JbpmConfiguration jbpmConfiguration) { super(parent); // check whether the given process definition is transient long id = processDefinition.getId(); if (id != 0) { // persistent, keep id only processDefinitionId = id; // remember jbpm configuration if (jbpmConfiguration != null) { this.jbpmConfiguration = jbpmConfiguration; } else { JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext(); if (jbpmContext == null) throw new JbpmException("no active jbpm context"); this.jbpmConfiguration = jbpmContext.getJbpmConfiguration(); } } else { // transient, keep full object this.processDefinition = processDefinition; this.jbpmConfiguration = null; } }
public ClassLoader getProcessClassLoader(ProcessDefinition processDefinition) { // use database identifier as key to lookup cached class loader long id = processDefinition.getId(); // if process definition is transient, use hash code as key Long key = new Long(id == 0L ? processDefinition.hashCode() : id); // consider that the context class loader changes among applications ClassLoader parentClassLoader = ClassLoaderUtil.getClassLoader(); synchronized (classLoaderRefs) { // lookup cached class loader ClassLoader processClassLoader = getProcessClassLoader(key, parentClassLoader); // if class loader is not cached, if (processClassLoader == null) { // (re-)create class loader processClassLoader = new ProcessClassLoader(parentClassLoader, processDefinition, jbpmConfiguration); // add class loader to cache putProcessClassLoader(key, processClassLoader); } return processClassLoader; } }
public ClassLoader getProcessClassLoader(ProcessDefinition processDefinition) { // use database identifier as key to lookup cached class loader long id = processDefinition.getId(); // if process definition is transient, use hash code as key Long key = new Long(id == 0L ? processDefinition.hashCode() : id); // consider that the context class loader changes among applications ClassLoader parentClassLoader = ClassLoaderUtil.getClassLoader(); synchronized (classLoaderRefs) { // lookup cached class loader ClassLoader processClassLoader = getProcessClassLoader(key, parentClassLoader); // if class loader is not cached, if (processClassLoader == null) { // (re-)create class loader processClassLoader = new ProcessClassLoader(parentClassLoader, processDefinition, jbpmConfiguration); // add class loader to cache putProcessClassLoader(key, processClassLoader); } return processClassLoader; } }
try { final StringBuffer buffer = new StringBuffer(); buffer.append(processDefinition.getId()); buffer.append("/"); buffer.append(file);