public override Void execute(CommandContext commandContext) { DbEntityManagerFactory dbEntityManagerFactory = new DbEntityManagerFactory(Context.ProcessEngineConfiguration.IdGenerator); DbEntityManager newEntityManager = dbEntityManagerFactory.openSession(); HistoricProcessInstanceEventEntity hpi = new HistoricProcessInstanceEventEntity(); hpi.Id = id; hpi.ProcessInstanceId = id; hpi.ProcessDefinitionId = "someProcDefId"; hpi.StartTime = DateTime.Now; hpi.State = org.camunda.bpm.engine.history.HistoricProcessInstance_Fields.STATE_ACTIVE; newEntityManager.insert(hpi); newEntityManager.flush(); monitor.sync(); DbEntityManager cmdEntityManager = commandContext.DbEntityManager; cmdEntityManager.createHistoricProcessInstanceQuery().list(); monitor.sync(); return(null); }
public Void execute(CommandContext commandContext) { DbEntityManager dbEntityManager = commandContext.DbEntityManager; dbEntityManager.delete(outerInstance.dummySchemaLogEntry); dbEntityManager.flush(); return(null); }
public Void execute(CommandContext commandContext) { DbEntityManagerFactory dbEntityManagerFactory = new DbEntityManagerFactory(Context.ProcessEngineConfiguration.IdGenerator); DbEntityManager newEntityManager = dbEntityManagerFactory.openSession(); newEntityManager.insert(outerInstance.dummySchemaLogEntry); newEntityManager.flush(); return(null); }
public override Void execute(CommandContext commandContext) { DbEntityManagerFactory dbEntityManagerFactory = new DbEntityManagerFactory(Context.ProcessEngineConfiguration.IdGenerator); DbEntityManager entityManager = dbEntityManagerFactory.openSession(); JobEntity job = entityManager.selectById(typeof(JobEntity), JOB_ENTITY_ID); job.LockOwner = lockOwner; entityManager.forceUpdate(job); monitor.sync(); // flush the changed entity and create a lock for the table entityManager.flush(); monitor.sync(); // commit transaction and remove the lock commandContext.TransactionContext.commit(); return(null); }