Permalink
Browse files

adding jbpm-examples

  • Loading branch information...
1 parent fe079c7 commit 0e7ab27e9362a34588c942c7018d0a0f4229e9c1 krisv committed Jun 2, 2011
Showing with 8,195 additions and 2 deletions.
  1. +1 −0 jbpm-distribution/pom.xml
  2. +24 −0 jbpm-distribution/src/main/assembly/examples.xml
  3. +9 −0 jbpm-examples/.classpath
  4. +2 −0 jbpm-examples/.gitignore
  5. +15 −0 jbpm-examples/.project
  6. +2 −2 jbpm-examples/pom.xml
  7. +42 −0 jbpm-examples/src/main/java/org/jbpm/examples/evaluation/EvaluationExample.java
  8. +1,020 −0 jbpm-examples/src/main/java/org/jbpm/examples/junit/BPMN2JUnitTests.java
  9. +25 −0 jbpm-examples/src/main/java/org/jbpm/examples/junit/HelloService.java
  10. +35 −0 jbpm-examples/src/main/java/org/jbpm/examples/junit/Person.java
  11. +51 −0 jbpm-examples/src/main/resources/META-INF/BPMN2WorkDefinitions.conf
  12. +1 −0 jbpm-examples/src/main/resources/META-INF/drools.rulebase.conf
  13. +272 −0 jbpm-examples/src/main/resources/evaluation/Evaluation.bpmn
  14. +91 −0 jbpm-examples/src/main/resources/junit/BPMN2-AdHocProcess.bpmn2
  15. +94 −0 jbpm-examples/src/main/resources/junit/BPMN2-AdHocSubProcess.bpmn2
  16. +28 −0 jbpm-examples/src/main/resources/junit/BPMN2-AdHocSubProcess.drl
  17. +77 −0 jbpm-examples/src/main/resources/junit/BPMN2-AdHocSubProcessAutoComplete.bpmn2
  18. +77 −0 jbpm-examples/src/main/resources/junit/BPMN2-CallActivity.bpmn2
  19. +61 −0 jbpm-examples/src/main/resources/junit/BPMN2-CallActivitySubProcess.bpmn2
  20. +84 −0 jbpm-examples/src/main/resources/junit/BPMN2-CompensateEndEvent.bpmn2
  21. +80 −0 jbpm-examples/src/main/resources/junit/BPMN2-CompositeProcessWithDIGraphical.bpmn2
  22. +61 −0 jbpm-examples/src/main/resources/junit/BPMN2-ConditionalStart.bpmn2
  23. +58 −0 jbpm-examples/src/main/resources/junit/BPMN2-DataObject.bpmn2
  24. +131 −0 jbpm-examples/src/main/resources/junit/BPMN2-ErrorBoundaryEventInterrupting.bpmn2
  25. +43 −0 jbpm-examples/src/main/resources/junit/BPMN2-ErrorEndEvent.bpmn2
  26. +98 −0 jbpm-examples/src/main/resources/junit/BPMN2-EscalationBoundaryEvent.bpmn2
  27. +130 −0 jbpm-examples/src/main/resources/junit/BPMN2-EscalationBoundaryEventInterrupting.bpmn2
  28. +43 −0 jbpm-examples/src/main/resources/junit/BPMN2-EscalationEndEvent.bpmn2
  29. +119 −0 jbpm-examples/src/main/resources/junit/BPMN2-EvaluationProcess.bpmn2
  30. +268 −0 jbpm-examples/src/main/resources/junit/BPMN2-EvaluationProcess2.bpmn2
  31. +132 −0 jbpm-examples/src/main/resources/junit/BPMN2-EvaluationProcess3.bpmn2
  32. +173 −0 jbpm-examples/src/main/resources/junit/BPMN2-EventBasedSplit.bpmn2
  33. +167 −0 jbpm-examples/src/main/resources/junit/BPMN2-EventBasedSplit2.bpmn2
  34. +167 −0 jbpm-examples/src/main/resources/junit/BPMN2-EventBasedSplit3.bpmn2
  35. +179 −0 jbpm-examples/src/main/resources/junit/BPMN2-EventBasedSplit4.bpmn2
  36. +183 −0 jbpm-examples/src/main/resources/junit/BPMN2-EventBasedSplit5.bpmn2
  37. +154 −0 jbpm-examples/src/main/resources/junit/BPMN2-ExclusiveSplit.bpmn2
  38. +154 −0 jbpm-examples/src/main/resources/junit/BPMN2-ExclusiveSplitDefault.bpmn2
  39. +154 −0 jbpm-examples/src/main/resources/junit/BPMN2-ExclusiveSplitPriority.bpmn2
  40. +154 −0 jbpm-examples/src/main/resources/junit/BPMN2-ExclusiveSplitXPath-advanced-vars-not-signaled.bpmn2
  41. +154 −0 jbpm-examples/src/main/resources/junit/BPMN2-ExclusiveSplitXPath-advanced-with-vars.bpmn2
  42. +154 −0 jbpm-examples/src/main/resources/junit/BPMN2-ExclusiveSplitXPath-advanced.bpmn2
  43. +154 −0 jbpm-examples/src/main/resources/junit/BPMN2-ExclusiveSplitXPath.bpmn2
  44. +58 −0 jbpm-examples/src/main/resources/junit/BPMN2-Import.bpmn2
  45. +111 −0 jbpm-examples/src/main/resources/junit/BPMN2-InclusiveSplit.bpmn2
  46. +111 −0 jbpm-examples/src/main/resources/junit/BPMN2-InclusiveSplitDefault.bpmn2
  47. +71 −0 jbpm-examples/src/main/resources/junit/BPMN2-IntermediateCatchEventCondition.bpmn2
  48. +100 −0 jbpm-examples/src/main/resources/junit/BPMN2-IntermediateCatchEventMessage.bpmn2
  49. +97 −0 jbpm-examples/src/main/resources/junit/BPMN2-IntermediateCatchEventSignal.bpmn2
  50. +71 −0 jbpm-examples/src/main/resources/junit/BPMN2-IntermediateCatchEventTimerCycle1.bpmn2
  51. +69 −0 jbpm-examples/src/main/resources/junit/BPMN2-IntermediateCatchEventTimerCycle2.bpmn2
  52. +71 −0 jbpm-examples/src/main/resources/junit/BPMN2-IntermediateCatchEventTimerDuration.bpmn2
  53. +93 −0 jbpm-examples/src/main/resources/junit/BPMN2-IntermediateThrowEventCompensate.bpmn2
  54. +52 −0 jbpm-examples/src/main/resources/junit/BPMN2-IntermediateThrowEventEscalation.bpmn2
  55. +67 −0 jbpm-examples/src/main/resources/junit/BPMN2-IntermediateThrowEventMessage.bpmn2
  56. +54 −0 jbpm-examples/src/main/resources/junit/BPMN2-IntermediateThrowEventNone.bpmn2
  57. +64 −0 jbpm-examples/src/main/resources/junit/BPMN2-IntermediateThrowEventSignal.bpmn2
  58. +88 −0 jbpm-examples/src/main/resources/junit/BPMN2-Lane.bpmn2
  59. +58 −0 jbpm-examples/src/main/resources/junit/BPMN2-MessageEndEvent.bpmn2
  60. +71 −0 jbpm-examples/src/main/resources/junit/BPMN2-MessageStart.bpmn2
  61. +55 −0 jbpm-examples/src/main/resources/junit/BPMN2-MinimalProcess.bpmn2
  62. +109 −0 jbpm-examples/src/main/resources/junit/BPMN2-MultiInstanceLoopCharacteristicsProcess.bpmn2
  63. +73 −0 jbpm-examples/src/main/resources/junit/BPMN2-MultiThreadServiceProcess.bpmn
  64. +70 −0 jbpm-examples/src/main/resources/junit/BPMN2-OnEntryExitScriptProcess.bpmn2
  65. +71 −0 jbpm-examples/src/main/resources/junit/BPMN2-ReceiveTask.bpmn2
  66. +52 −0 jbpm-examples/src/main/resources/junit/BPMN2-RuleTask.bpmn2
  67. +10 −0 jbpm-examples/src/main/resources/junit/BPMN2-RuleTask.drl
  68. +53 −0 jbpm-examples/src/main/resources/junit/BPMN2-ScriptTask.bpmn2
  69. +71 −0 jbpm-examples/src/main/resources/junit/BPMN2-SendTask.bpmn2
  70. +84 −0 jbpm-examples/src/main/resources/junit/BPMN2-ServiceProcess.bpmn2
  71. +55 −0 jbpm-examples/src/main/resources/junit/BPMN2-SignalEndEvent.bpmn2
  72. +68 −0 jbpm-examples/src/main/resources/junit/BPMN2-SignalStart.bpmn2
  73. +53 −0 jbpm-examples/src/main/resources/junit/BPMN2-SimpleXMLProcess.bpmn2
  74. +115 −0 jbpm-examples/src/main/resources/junit/BPMN2-SubProcess.bpmn2
  75. +114 −0 jbpm-examples/src/main/resources/junit/BPMN2-TimerBoundaryEventCycle1.bpmn2
  76. +112 −0 jbpm-examples/src/main/resources/junit/BPMN2-TimerBoundaryEventCycle2.bpmn2
  77. +114 −0 jbpm-examples/src/main/resources/junit/BPMN2-TimerBoundaryEventDuration.bpmn2
  78. +112 −0 jbpm-examples/src/main/resources/junit/BPMN2-TimerBoundaryEventInterrupting.bpmn2
  79. +57 −0 jbpm-examples/src/main/resources/junit/BPMN2-TimerStart.bpmn2
  80. +57 −0 jbpm-examples/src/main/resources/junit/BPMN2-TimerStartCron.bpmn2
  81. +63 −0 jbpm-examples/src/main/resources/junit/BPMN2-UserTask.bpmn2
  82. +95 −0 jbpm-examples/src/main/resources/junit/BPMN2-XpathExpression.bpmn2
  83. +105 −0 jbpm-examples/src/main/resources/junit/BPMN2-gatewayTest.bpmn2
@@ -41,6 +41,7 @@
<descriptor>src/main/assembly/installer.xml</descriptor>
<descriptor>src/main/assembly/docs-build.xml</descriptor>
<descriptor>src/main/assembly/docs.xml</descriptor>
+ <descriptor>src/main/assembly/examples.xml</descriptor>
</descriptors>
<!--<appendAssemblyId>false</appendAssemblyId>-->
</configuration>
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<assembly>
+ <id>examples</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <fileSets>
+ <fileSet>
+ <directory>..</directory>
+ <outputDirectory></outputDirectory>
+ <includes>
+ <include>jbpm-examples/**</include>
+ </includes>
+ <excludes>
+ <exclude>**/.gitignore</exclude>
+ <exclude>**/*.log/**</exclude>
+ <exclude>**/target/**</exclude>
+ <exclude>**/.git</exclude>
+ <exclude>**/.metadata/**</exclude>
+ </excludes>
+ </fileSet>
+ </fileSets>
+</assembly>
View
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry including="**/*.java" kind="src" path="src/main/java"/>
+ <classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="JBPM/jbpm"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
View
@@ -4,6 +4,8 @@
# Eclipse, Netbeans and IntelliJ files
/.*
!.gitignore
+!.project
+!.classpath
/nbproject
/*.ipr
/*.iws
View
@@ -0,0 +1,15 @@
+<projectDescription>
+ <name>jbpm-examples</name>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ <buildCommand>
+ <name>org.drools.eclipse.droolsbuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
View
@@ -67,11 +67,11 @@
<!-- Internal dependencies -->
<dependency>
<groupId>org.jbpm</groupId>
- <artifactId>jbpm-flow</artifactId>
+ <artifactId>jbpm-bpmn2</artifactId>
</dependency>
<dependency>
<groupId>org.jbpm</groupId>
- <artifactId>jbpm-flow-builder</artifactId>
+ <artifactId>jbpm-human-task</artifactId>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,42 @@
+package org.jbpm.examples.evaluation;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.drools.KnowledgeBase;
+import org.drools.builder.KnowledgeBuilder;
+import org.drools.builder.KnowledgeBuilderFactory;
+import org.drools.builder.ResourceType;
+import org.drools.io.ResourceFactory;
+import org.drools.logger.KnowledgeRuntimeLogger;
+import org.drools.logger.KnowledgeRuntimeLoggerFactory;
+import org.drools.runtime.StatefulKnowledgeSession;
+import org.jbpm.process.workitem.wsht.WSHumanTaskHandler;
+
+public class EvaluationExample {
+
+ public static final void main(String[] args) {
+ try {
+ // load up the knowledge base
+ KnowledgeBase kbase = readKnowledgeBase();
+ StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
+ KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newThreadedFileLogger(ksession, "test", 1000);
+ ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new WSHumanTaskHandler());
+ // start a new process instance
+ Map<String, Object> params = new HashMap<String, Object>();
+ params.put("employee", "krisv");
+ params.put("reason", "Yearly performance evaluation");
+ ksession.startProcess("com.sample.evaluation", params);
+ logger.close();
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+
+ private static KnowledgeBase readKnowledgeBase() throws Exception {
+ KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
+ kbuilder.add(ResourceFactory.newClassPathResource("Evaluation.bpmn"), ResourceType.BPMN2);
+ return kbuilder.newKnowledgeBase();
+ }
+
+}
Oops, something went wrong.

0 comments on commit 0e7ab27

Please sign in to comment.