Skip to content

Commit

Permalink
refactoring WofklowKernel, changed junit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rsoika committed Jun 7, 2018
1 parent 3ce1d7f commit a8fe8c2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public ItemCollection process(final ItemCollection workitem) throws PluginExcept
}

// store last $lastTask
documentResult.replaceItemValue("$lastTask", workitem.getProcessID());
documentResult.replaceItemValue("$lastTask", workitem.getTaskID());

// Check if $WorkItemID is available
if ("".equals(workitem.getItemValueString(WorkflowKernel.WORKITEMID))) {
Expand Down Expand Up @@ -343,7 +343,7 @@ public ItemCollection findNextTask(ItemCollection documentContext, ItemCollectio
} else {
// get current task...
itemColNextTask = this.ctx.getModelManager().getModel(documentContext.getItemValueString(MODELVERSION))
.getTask(documentContext.getProcessID());
.getTask(documentContext.getTaskID());
}
return itemColNextTask;
}
Expand Down Expand Up @@ -467,7 +467,7 @@ private ItemCollection processEvent(final ItemCollection documentContext, final
// Update the attributes $ProcessID and $WorkflowStatus
documentResult.replaceItemValue(PROCESSID,
Integer.valueOf(itemColNextTask.getItemValueInteger("numprocessid")));
logger.finest("......new $processid=" + documentResult.getProcessID());
logger.finest("......new $processid=" + documentResult.getTaskID());
documentResult.replaceItemValue(WORKFLOWSTATUS, itemColNextTask.getItemValueString("txtname"));
logger.finest("......new $workflowStatus=" + documentResult.getItemValueString(WORKFLOWSTATUS));
// update deprecated attributes txtworkflowStatus and txtworkflowGroup
Expand Down Expand Up @@ -536,7 +536,7 @@ private ItemCollection findConditionalExclusiveTask(ItemCollection event, ItemCo
// we update the documentContext....
ItemCollection itemColEvent = this.ctx.getModelManager()
.getModel(documentContext.getModelVersion())
.getEvent(documentContext.getProcessID(), eventID);
.getEvent(documentContext.getTaskID(), eventID);
if (itemColEvent != null) {
// create follow up event....

Expand All @@ -546,7 +546,7 @@ private ItemCollection findConditionalExclusiveTask(ItemCollection event, ItemCo
// get current task...
ItemCollection itemColNextTask = this.ctx.getModelManager()
.getModel(documentContext.getItemValueString(MODELVERSION))
.getTask(documentContext.getProcessID());
.getTask(documentContext.getTaskID());

return itemColNextTask;
}
Expand Down Expand Up @@ -611,15 +611,15 @@ private ItemCollection findConditionalSplitTask(ItemCollection event, ItemCollec
// we update the documentContext....
ItemCollection itemColEvent = this.ctx.getModelManager()
.getModel(documentContext.getModelVersion())
.getEvent(documentContext.getProcessID(), eventID);
.getEvent(documentContext.getTaskID(), eventID);
if (itemColEvent != null) {
// create follow up event....
event.replaceItemValue("keyFollowUp", "1");
event.replaceItemValue("numNextActivityID", eventID);
// get current task...
ItemCollection itemColNextTask = this.ctx.getModelManager()
.getModel(documentContext.getItemValueString(MODELVERSION))
.getTask(documentContext.getProcessID());
.getTask(documentContext.getTaskID());
return itemColNextTask;
}
}
Expand Down Expand Up @@ -686,12 +686,12 @@ private void evaluateSplitEvent(ItemCollection event, ItemCollection documentCon
// we update the documentContext....
ItemCollection itemColEvent = this.ctx.getModelManager()
.getModel(documentContext.getModelVersion())
.getEvent(documentContext.getProcessID(), eventID);
.getEvent(documentContext.getTaskID(), eventID);
if (itemColEvent != null) {
// get current task...
ItemCollection itemColNextTask = this.ctx.getModelManager()
.getModel(documentContext.getItemValueString(MODELVERSION))
.getTask(documentContext.getProcessID());
.getTask(documentContext.getTaskID());

// clone current instance to a new version...
ItemCollection cloned = createVersion(documentContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,7 @@ public void testFluentInterface() {
/**
* Test issue #383, #384
*/
@SuppressWarnings("deprecation")
@Test
@Category(org.imixs.workflow.ItemCollection.class)
public void testDeprecatedFieldProcessID() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void testSimpleNumbers() throws ParseException {
Assert.assertNotNull(itemCol);

Assert.assertEquals(10, itemCol.getEventID());
Assert.assertEquals(100, itemCol.getProcessID());
Assert.assertEquals(100, itemCol.getTaskID());
}

@Test(expected = ParseException.class)
Expand Down Expand Up @@ -114,7 +114,7 @@ public void testComplexWorkitem() throws ParseException {

Assert.assertNotNull(itemCol);

Assert.assertEquals(20, itemCol.getProcessID());
Assert.assertEquals(20, itemCol.getTaskID());

Assert.assertEquals("worklist", itemCol.getItemValueString("txtworkflowresultmessage"));

Expand Down

0 comments on commit a8fe8c2

Please sign in to comment.