org.jbpm.persistence.processinstance
Class ProcessInstanceInfo
java.lang.Object
org.jbpm.persistence.processinstance.ProcessInstanceInfo
public class ProcessInstanceInfo
- extends Object
This is the object that contains the
marshalled byte stream of information representing the
ProcessInstance class.
Because of Hibernate 3.3.x/3.4.x <-> 4.x compatibility issues,
the mapping for this class has been moved to
ProcessInstanceInfo
protected ProcessInstanceInfo()
ProcessInstanceInfo
public ProcessInstanceInfo(ProcessInstance processInstance)
ProcessInstanceInfo
public ProcessInstanceInfo(ProcessInstance processInstance,
Environment env)
getProcessInstanceId
public Long getProcessInstanceId()
- Added in order to satisfy Hibernate AND the JBPMorm.xml:
- Hibernate needs getter/setters for a the field that's mapped.
- (field access is inefficient/dangerous, and not necessary)
- The JBPMorm.xml queries reference .processInstanceId as well.
If we mapped the field using 'name="id"', the queries would thus fail.
So instead of that, we just add the getters and use 'name="processInstanceId"'.
- Returns:
- The processInstanceId field value.
setProcessInstanceId
public void setProcessInstanceId(Long processInstanceId)
getId
public Long getId()
setId
public void setId(Long processInstanceId)
getProcessId
public String getProcessId()
getStartDate
public Date getStartDate()
getLastModificationDate
public Date getLastModificationDate()
getLastReadDate
public Date getLastReadDate()
updateLastReadDate
public void updateLastReadDate()
getState
public int getState()
getProcessInstance
public ProcessInstance getProcessInstance(org.drools.common.InternalKnowledgeRuntime kruntime,
Environment env)
update
public void update()
- Adding @PrePersist breaks things, because:
- We retrieve/generate the marshaller (see below).
- ..and the marshaller retrieves the context instance
- ..which actually (re)sets all variables in
VariableScopeInstance
.setContextInstanceContainer(...)
- This of course causes
ProcessEventSupport
.fireBeforeVariableChanged(...) to fire.
- Then the
JPAWorkingMemoryDbLogger
ends up logging a variable change
-- but the associated process instance hasn't been persisted yet.
- So the variable instance change is associated with process instance "0"
- ...and can never be retrieved, because "0" is not a valid id.
Normally, the variable change is logged after the following method has completed.
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
getVersion
public int getVersion()
getEventTypes
public Set<String> getEventTypes()
getProcessInstanceByteArray
public byte[] getProcessInstanceByteArray()
clearProcessInstance
public void clearProcessInstance()
getEnv
public Environment getEnv()
setEnv
public void setEnv(Environment env)
Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.