private void setUpForTaskTypeTests() { makeSendTask(getTask1InB(true, false)); makeReceiveTask(getTask2InB(false, true)); addSequenceFlow(getTask1InB(), getTask2InB()); // add some MessageFlow, so that these both tasks do not do any harm, // if the are not needed // add some MessageFlow, so that these both tasks do not do any harm, // if the are not needed // add some MessageFlow, so that these both tasks do not do any harm, // if the are not needed Pool poolC = new Pool(); poolC.setText("poolC"); model.addNode(poolC); Task receiver = new Task(); Task sender = new Task(); receiver.setText("receiver"); sender.setText("sender"); makeSendTask(sender); makeReceiveTask(receiver); model.addNode(sender); model.addNode(receiver); poolC.addProcessNode(sender); poolC.addProcessNode(receiver); addMessageFlow(getTask1InB(), receiver); addMessageFlow(sender, getTask2InB()); StartEvent startInC = createTimerStartEvent(); EndEvent endInC = createEndEvent(); poolC.addProcessNode(startInC); poolC.addProcessNode(endInC); addSequenceFlow(startInC, receiver); addSequenceFlow(receiver, sender); addSequenceFlow(sender, endInC); }
@Test public void testTaskWithIncommingAndOutgoingMessageFlowWithMultiplePartners() { setUpForTaskTypeTests(); Pool poolD = new Pool(); poolD.setText("PoolD"); model.addNode(poolD); Task taskInD = new Task(); taskInD.setText("TaskInD"); model.addNode(taskInD); poolD.addProcessNode(taskInD); makeSendTask(taskInD); StartEvent startInD = createTimerStartEvent(); EndEvent endInD = createEndEvent(); poolD.addProcessNode(startInD); poolD.addProcessNode(endInD); addSequenceFlow(startInD, taskInD); addSequenceFlow(taskInD, endInD); MessageFlow in = addMessageFlow(taskInD, getTask1InA()); MessageFlow out = addMessageFlow(getTask1InA(), getTask2InB()); assertOneWarning( texts.getLongText("taskWithInAndOutMessageFlowWithMultiplePartners"), getTask1InA(), listOf(in, out), true); }
@Test public void TestRemoveNodeFromCluster() { BPMNModel m = new BPMNModel(); Task task1 = new Task(100, 100, "Task1"); m.addNode(task1); Pool pool = new Pool(50, 50, "Pool"); m.addNode(pool); pool.addProcessNode(task1); m.removeNode(task1); assertFalse(pool.getProcessNodes().contains(task1)); }