09-06-2012 04:52 AM
@Transient transient final public AtomicInteger ignoreChangesGate = new AtomicInteger();
Map<String, Object> lProcessVariables = new HashMap<>();
lProcessVariables.put("a", this);
System.out.println("!!!1 iIgnoreChangesGate = " + this.ignoreChangesGate);
ProcessInstance lProcessInstance = lProcessEngine.getRuntimeService().startProcessInstanceByKey("frozn", lProcessVariables);
@Override
public void notify(org.activiti.engine.delegate.DelegateTask delegateTask)
{
Application lApplication = (Application)delegateTask.getVariable("a");
System.out.println("!!!2 iIgnoreChangesGate = " + lApplication.ignoreChangesGate);
…
!!!1 iIgnoreChangesGate = 0
!!!2 iIgnoreChangesGate = null
@Override
public void notify(org.activiti.engine.delegate.DelegateTask delegateTask)
{
Application lApplication = (Application)delegateTask.getVariable("a");
System.out.println("!!!2 iIgnoreChangesGate = " + lApplication.ignoreChangesGate);
// reload
lApplication = (Application)lEntityManager.find(Application.class, lApplication.getApplicationId());
System.out.println("!!!3 iIgnoreChangesGate = " + lApplication.ignoreChangesGate);
…
!!!1 iIgnoreChangesGate = 0
!!!2 iIgnoreChangesGate = null
!!!3 iIgnoreChangesGate = 0
09-06-2012 05:32 AM
09-06-2012 06:02 AM
09-06-2012 06:45 AM
static public <T> T fromId(Object id)
{
try
{
// preconditions
String lId = "" + id;
if ("null".equals(lId)) return null;
// split id
int lIdx = lId.indexOf(":");
String lClassname = lId.substring(0, lIdx);
BigInteger lPK = new BigInteger(lId.substring(lIdx + 1));
// get entity
EntityManager lEntityManager = EntityManagerFinder.find();
T lEntity = (T)lEntityManager.find(Class.forName(lClassname), lPK);
return lEntity;
}
catch (ClassNotFoundException e) { throw new IllegalStateException(e); }
}
09-06-2012 09:32 AM
09-06-2012 10:58 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.