-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
issue #302
- Loading branch information
Showing
9 changed files
with
1,150 additions
and
82 deletions.
There are no files selected for viewing
374 changes: 313 additions & 61 deletions
374
imixs-workflow-core/src/main/java/org/imixs/workflow/WorkflowKernel.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
imixs-workflow-core/src/test/java/org/imixs/workflow/bpmn/TestBPMNParserSplitEvents.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
package org.imixs.workflow.bpmn; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.io.UnsupportedEncodingException; | ||
import java.text.ParseException; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import javax.xml.parsers.ParserConfigurationException; | ||
|
||
import org.imixs.workflow.ItemCollection; | ||
import org.imixs.workflow.exceptions.ModelException; | ||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.xml.sax.SAXException; | ||
|
||
import junit.framework.Assert; | ||
|
||
/** | ||
* Test class test the Imixs BPMNParser. | ||
* | ||
* Special case: Conditional-Events | ||
* | ||
* @see issue #299 | ||
* @author rsoika | ||
*/ | ||
public class TestBPMNParserSplitEvents { | ||
|
||
@Before | ||
public void setup() { | ||
|
||
} | ||
|
||
@After | ||
public void teardown() { | ||
|
||
} | ||
|
||
@SuppressWarnings("unchecked") | ||
@Test | ||
public void testSimple() | ||
throws ParseException, ParserConfigurationException, SAXException, IOException, ModelException { | ||
|
||
InputStream inputStream = getClass().getResourceAsStream("/bpmn/split_event1.bpmn"); | ||
|
||
BPMNModel model = null; | ||
try { | ||
model = BPMNParser.parseModel(inputStream, "UTF-8"); | ||
} catch (UnsupportedEncodingException e) { | ||
e.printStackTrace(); | ||
Assert.fail(); | ||
} catch (ModelException e) { | ||
e.printStackTrace(); | ||
Assert.fail(); | ||
} | ||
Assert.assertNotNull(model); | ||
|
||
// Test Environment | ||
ItemCollection profile = model.getDefinition(); | ||
Assert.assertNotNull(profile); | ||
|
||
// test count of elements | ||
Assert.assertEquals(3, model.findAllTasks().size()); | ||
|
||
// test task 1000 | ||
ItemCollection task = model.getTask(1000); | ||
Assert.assertNotNull(task); | ||
|
||
// test events for task 1000 | ||
List<ItemCollection> events = model.findAllEventsByTask(1000); | ||
Assert.assertNotNull(events); | ||
Assert.assertEquals(1, events.size()); | ||
|
||
// test activity 1000.10 submit | ||
ItemCollection activity = model.getEvent(1000, 10); | ||
Assert.assertNotNull(activity); | ||
Assert.assertEquals("split event", activity.getItemValueString("txtname")); | ||
|
||
Assert.assertEquals(1000, activity.getItemValueInteger("numNextProcessID")); | ||
|
||
// Now we need to evaluate if the Event is marked as an conditional Event with | ||
// the condition list copied from the gateway. | ||
Assert.assertTrue(activity.hasItem("keySplitConditions")); | ||
Map<String,String> conditions=(Map<String,String>) activity.getItemValue("keySplitConditions").get(0); | ||
Assert.assertNotNull(conditions); | ||
Assert.assertEquals("true", conditions.get("task=1100")); | ||
} | ||
|
||
|
||
|
||
|
||
} |
Oops, something went wrong.