assertEquals(new Integer(ITaskInstance.RUNNING), ((IWorkItem) workItemList.get(0)).getState());
paymentWorkItemId = ((IWorkItem) workItemList.get(0)).getId();
//---------------------------------------------------------
System.out.println("--------------Withdraw Payment WorkItem ----------------");
transactionTemplate.execute(new TransactionCallbackWithoutResult() {
@Override
protected void doInTransactionWithoutResult(TransactionStatus arg0) {
try {
IWorkflowSession workflowSession = runtimeContext.getWorkflowSession();
IWorkItem paymentTaskWorkItem = workflowSession.findWorkItemById(paymentWorkItemId);
paymentTaskWorkItem.withdraw();
} catch (EngineException ex) {
Logger.getLogger(FireWorkflowEngineTest.class.getName()).log(Level.SEVERE, null, ex);
throw new RuntimeException(ex.getMessage());
} catch (KernelException ex) {
Logger.getLogger(FireWorkflowEngineTest.class.getName()).log(Level.SEVERE, null, ex);
}
}
});
//----------------------------------------------------------
System.out.println("--------------Complete Payment WorkItem ----------------");
transactionTemplate.execute(new TransactionCallbackWithoutResult() {
@Override
protected void doInTransactionWithoutResult(TransactionStatus arg0) {
try {
IWorkflowSession workflowSession = runtimeContext.getWorkflowSession();