06-12-2010 09:55 AM
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="propertyTest" xmlns="http://schema.omg.org/spec/BPMN/2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn-extensions"
typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath"
targetNamespace="http://www.activiti.org/bpmn2.0">
<process id="xorTest">
<startEvent id="startEvent" />
<sequenceFlow targetRef="chooseRecipeTask" sourceRef="startEvent" />
<userTask id="chooseRecipeTask" name="Choose Recipe" />
<exclusiveGateway id="recipeChosenXorGateway" />
<sequenceFlow sourceRef="recipeChosenXorGateway"
targetRef="cookPastaTask">
<conditionExpression xsi:type="tFormalExpression">${recipe == 0}</conditionExpression>
</sequenceFlow>
<sequenceFlow sourceRef="recipeChosenXorGateway"
targetRef="roastSteakTask">
<conditionExpression xsi:type="tFormalExpression">${recipe == 1}</conditionExpression>
</sequenceFlow>
<sequenceFlow sourceRef="recipeChosenXorGateway"
targetRef="prepareSaladTask">
<conditionExpression xsi:type="tFormalExpression">${recipe == 2}</conditionExpression>
</sequenceFlow>
<userTask id="cookPastaTask" name="Cook Pasta" />
<userTask id="roastSteakTask" name="Roast Steak" />
<userTask id="prepareSaladTask" name="Prepare Salad" />
<sequenceFlow targetRef="endEvent" sourceRef="cookPastaTask" />
<sequenceFlow targetRef="endEvent" sourceRef="roastSteakTask" />
<sequenceFlow targetRef="endEvent" sourceRef="prepareSaladTask" />
<endEvent id="endEvent" />
</process>
</definitions>
public class XorTest extends ActivitiTestCase {
public void testXorFunctionality() {
deployProcessForThisTestMethod();
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("recipe", 2);
ProcessInstance processInstance = processService
.startProcessInstanceById("xorTest:1", variables);
Task task = taskService.createTaskQuery().processInstance(
processInstance.getId()).singleResult();
assertEquals("Choose Recipe", task.getName());
taskService.complete(task.getId());
task = taskService.createTaskQuery().processInstance(
processInstance.getId()).singleResult();
// task is null at this place (but shouldn't be)
assertEquals("Prepare Salad", task.getName());
}
}
06-14-2010 05:21 AM
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("No outgoing sequence flow found for " + execution.getActivity().getId() + ". Ending execution.");
}
execution.end();
06-14-2010 06:28 PM
It looks like there is no sequence flow going from your first task to the exclusive gateway.Oh, that's correct. - Sorry, and thank you for getting into this.
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.