JBoss JBPM SVN: r5944 - in jbpm4/trunk: modules/test-enterprise/test-enterprise-suite and 2 other directories.
by do-not-reply@jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-12-11 00:54:52 -0500 (Fri, 11 Dec 2009)
New Revision: 5944
Modified:
jbpm4/trunk/modules/test-enterprise/test-enterprise-ejb/pom.xml
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/pom.xml
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/JmsTest.java
jbpm4/trunk/qa/build.xml
jbpm4/trunk/qa/hudson-jbpm4-enterprise.bat
jbpm4/trunk/qa/hudson-jbpm4-enterprise.sh
Log:
enterprise test suite and hudson scripts are working
Modified: jbpm4/trunk/modules/test-enterprise/test-enterprise-ejb/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-ejb/pom.xml 2009-12-10 17:02:19 UTC (rev 5943)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-ejb/pom.xml 2009-12-11 05:54:52 UTC (rev 5944)
@@ -11,7 +11,7 @@
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm</artifactId>
<version>4.3-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
+ <relativePath>../../../pom.xml</relativePath>
</parent>
<dependencies>
Modified: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/pom.xml 2009-12-10 17:02:19 UTC (rev 5943)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/pom.xml 2009-12-11 05:54:52 UTC (rev 5944)
@@ -53,37 +53,56 @@
</properties>
<build>
<plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>copy.libs</id>
- <phase>package</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <outputDirectory>target/jbpm.test.webapp.libs</outputDirectory>
- <artifactItems>
- <artifactItem>
- <groupId>aspectj</groupId>
- <artifactId>aspectjrt</artifactId>
- </artifactItem>
- <artifactItem>
- <groupId>cactus</groupId>
- <artifactId>cactus.core</artifactId>
- </artifactItem>
- <artifactItem>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1</version>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-test-jar</id>
+ <phase>package</phase>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ <configuration>
+ <excludes>
+ <exclude>jbpm-test-destinations-service.xml</exclude>
+ <exclude>cactus.properties</exclude>
+ <exclude>META-INF/*</exclude>
+ </excludes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy.libs</id>
+ <phase>package</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>target/jbpm.test.webapp.libs</outputDirectory>
+ <artifactItems>
+ <artifactItem>
+ <groupId>aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ </artifactItem>
+ <artifactItem>
+ <groupId>cactus</groupId>
+ <artifactId>cactus.core</artifactId>
+ </artifactItem>
+ <artifactItem>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1</version>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</profile>
Modified: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/JmsTest.java
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/JmsTest.java 2009-12-10 17:02:19 UTC (rev 5943)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/JmsTest.java 2009-12-11 05:54:52 UTC (rev 5944)
@@ -12,5 +12,9 @@
servletTestSuite.addTestSuite(JmsTest.class);
return servletTestSuite;
}
+
+ public void testSanity() {
+ assertTrue(true);
+ }
}
Modified: jbpm4/trunk/qa/build.xml
===================================================================
--- jbpm4/trunk/qa/build.xml 2009-12-10 17:02:19 UTC (rev 5943)
+++ jbpm4/trunk/qa/build.xml 2009-12-11 05:54:52 UTC (rev 5944)
@@ -196,7 +196,7 @@
<delete file="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war/WEB-INF/lib/jta.jar" />
<!-- copy the test classes to the test web app -->
- <copy file="../modules/test-enterprise/test-enterprise-suite/target/jbpm-test-enterprise-suite-${jbpm.version}.jar"
+ <copy file="../modules/test-enterprise/test-enterprise-suite/target/jbpm-test-enterprise-suite-${jbpm.version}-tests.jar"
todir="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war/WEB-INF/lib" />
<!-- add junit.jar -->
Modified: jbpm4/trunk/qa/hudson-jbpm4-enterprise.bat
===================================================================
--- jbpm4/trunk/qa/hudson-jbpm4-enterprise.bat 2009-12-10 17:02:19 UTC (rev 5943)
+++ jbpm4/trunk/qa/hudson-jbpm4-enterprise.bat 2009-12-11 05:54:52 UTC (rev 5944)
@@ -8,8 +8,8 @@
cmd /C mvn -U -Pdistro,enterprise clean install
cmd /C ant -f qa/build.xml %ANT_PROPERTIES% testsuite.enterprise.setup
-rem cd modules/test-enterprise/test-enterprise-suite
-rem mvn -Pruntest test
-rem cd ../..
+cd modules\test-enterprise\test-enterprise-suite
+cmd /C mvn -Pruntest test
+cd ..\..\..
-rem ant -f qa/build.xml %ANT_PROPERTIES% testsuite.enterprise.teardown
+cmd /C ant -f qa/build.xml %ANT_PROPERTIES% testsuite.enterprise.teardown
Modified: jbpm4/trunk/qa/hudson-jbpm4-enterprise.sh
===================================================================
--- jbpm4/trunk/qa/hudson-jbpm4-enterprise.sh 2009-12-10 17:02:19 UTC (rev 5943)
+++ jbpm4/trunk/qa/hudson-jbpm4-enterprise.sh 2009-12-11 05:54:52 UTC (rev 5944)
@@ -9,8 +9,8 @@
mvn -U -Pdistro,enterprise clean install
ant -f qa/build.xml $ANT_PROPERTIES testsuite.enterprise.setup
-#cd modules/test-enterprise/test-enterprise-suite
-#mvn -Pruntest test
-#cd ../../..
+cd modules/test-enterprise/test-enterprise-suite
+mvn -Pruntest test
+cd ../../..
-#ant -f qa/build.xml $ANT_PROPERTIES testsuite.enterprise.teardown
+ant -f qa/build.xml $ANT_PROPERTIES testsuite.enterprise.teardown
16 years, 4 months
JBoss JBPM SVN: r5943 - in jbpm4/trunk/modules: examples/src/test/java/org/jbpm/examples/serializablevariable and 21 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-12-10 12:02:19 -0500 (Thu, 10 Dec 2009)
New Revision: 5943
Added:
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/serializablevariable/
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/serializablevariable/SerializableVariableTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/serializablevariable/UpdateSerializedVariables.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/serializablevariable/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/serializablevariable/process.jpdl.xml
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/RulesActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/RulesBinding.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/RulesFact.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/DeserializedObjects.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/rules/
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/rules/Room.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/rules/RulesTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/rulesdecision/
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/variables/SerializedVariableUpdate.java
jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/examples/rules/
jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/examples/rules/process.jpdl.xml
jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/examples/rules/process.png
jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/examples/rules/rules.drl
jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/examples/rulesdecision/
jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/examples/rulesdecision/rules.drl
Removed:
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/rulesdecision/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/rulesdecision/
jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/examples/rulesdecision/isImportant.drl
Modified:
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionConditionActivity.java
jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.bindings.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Transaction.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeInstanceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/DbSession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransaction.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransaction.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Converter.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Variable.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/BooleanToStringConverter.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/ByteToLongConverter.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/CharacterToStringConverter.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/DateToLongConverter.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/DateToStringConverter.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/DoubleToStringConverter.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/FloatToDoubleConverter.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/FloatToStringConverter.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/IntegerToLongConverter.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/SerializableToBytesConverter.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/ShortToLongConverter.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/variable/BlobVariable.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/type/VariableAutoTypeResolutionTest.java
jbpm4/trunk/modules/test-db/pom.xml
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/rulesdecision/RulesDecisionTest.java
Log:
JBPM-2006 rules activity and JBPM-2684 automatic saving of updates to serializable variables
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/serializablevariable/SerializableVariableTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/serializablevariable/SerializableVariableTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/serializablevariable/SerializableVariableTest.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.examples.serializablevariable;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class SerializableVariableTest extends JbpmTestCase {
+
+ String deploymentId;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ deploymentId = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/serializablevariable/process.jpdl.xml")
+ .deploy();
+ }
+
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentId);
+
+ super.tearDown();
+ }
+
+ public void testSerializableVariableUpdate() {
+ Set<String> messages = new HashSet<String>();
+ messages.add("serialize");
+ messages.add("me");
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("messages", messages);
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("SerializableVariable", variables);
+ String pid = processInstance.getId();
+ executionService.signalExecutionById(pid);
+
+ Set<String> expectedMessages = new HashSet<String>();
+ expectedMessages.add("i");
+ expectedMessages.add("was");
+ expectedMessages.add("updated");
+
+ messages = (Set<String>) executionService.getVariable(pid, "messages");
+ assertEquals(expectedMessages, messages);
+ }
+}
Property changes on: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/serializablevariable/SerializableVariableTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/serializablevariable/UpdateSerializedVariables.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/serializablevariable/UpdateSerializedVariables.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/serializablevariable/UpdateSerializedVariables.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.examples.serializablevariable;
+
+import java.util.List;
+import java.util.Set;
+
+import org.jbpm.api.activity.ActivityBehaviour;
+import org.jbpm.api.activity.ActivityExecution;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class UpdateSerializedVariables implements ActivityBehaviour {
+
+ private static final long serialVersionUID = 1L;
+
+ public void execute(ActivityExecution execution) throws Exception {
+ Set<String> messages = (Set<String>) execution.getVariable("messages");
+ messages.clear();
+ messages.add("i");
+ messages.add("was");
+ messages.add("updated");
+ }
+
+}
Property changes on: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/serializablevariable/UpdateSerializedVariables.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/serializablevariable/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/serializablevariable/process.jpdl.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/serializablevariable/process.jpdl.xml 2009-12-10 17:02:19 UTC (rev 5943)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="SerializableVariable" xmlns="http://jbpm.org/4.3/jpdl">
+
+ <start g="20,20,48,48">
+ <transition to="wait before update" />
+ </start>
+
+ <state name="wait before update">
+ <transition to="update serialized variables" />
+ </state>
+
+ <custom name="update serialized variables"
+ class="org.jbpm.examples.serializablevariable.UpdateSerializedVariables"
+ g="96,16,100,52">
+
+ <transition to="wait after update" />
+ </custom>
+
+ <state name="wait after update" g="231,19,80,40"/>
+
+</process>
Property changes on: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/serializablevariable/process.jpdl.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionConditionActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionConditionActivity.java 2009-12-10 11:15:51 UTC (rev 5942)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionConditionActivity.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -38,12 +38,12 @@
private static final long serialVersionUID = 1L;
- public void execute(ActivityExecution execution) {
+ public void execute(ActivityExecution execution) throws Exception {
execute((ExecutionImpl) execution);
}
- public void execute(ExecutionImpl execution) {
- Transition transition = findTransition(execution);
+ public void execute(ExecutionImpl execution) throws Exception {
+ Transition transition = findTransitionUsingConditions(execution);
if (transition==null) {
throw new JbpmException("no outgoing transition condition evaluated to true for decision "+execution.getActivity());
}
@@ -53,7 +53,7 @@
execution.take(transition);
}
- private Transition findTransition(ExecutionImpl execution) {
+ public static Transition findTransitionUsingConditions(ExecutionImpl execution) {
Activity activity = execution.getActivity();
List<Transition> outgoingTransitions = activity.getOutgoingTransitions();
for (Transition transition : outgoingTransitions) {
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/RulesActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/RulesActivity.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/RulesActivity.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.activity;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.drools.KnowledgeBase;
+import org.drools.runtime.StatefulKnowledgeSession;
+import org.jbpm.api.activity.ActivityExecution;
+import org.jbpm.jpdl.internal.rules.ExecutionGlobals;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.repository.RulesDeployer;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class RulesActivity extends DecisionConditionActivity {
+
+ private static final long serialVersionUID = 1L;
+
+ List<RulesFact> rulesFacts = new ArrayList<RulesFact>();
+
+ public void execute(ActivityExecution execution) throws Exception {
+ ExecutionImpl executionImpl = (ExecutionImpl)execution;
+ String deploymentId = executionImpl.getProcessDefinition().getDeploymentId();
+ KnowledgeBase knowledgeBase = RulesDeployer.getKnowledgeBase(deploymentId);
+
+ StatefulKnowledgeSession knowledgeSession =
+ knowledgeBase.newStatefulKnowledgeSession();
+
+ ExecutionGlobals executionGlobals = new ExecutionGlobals(execution);
+ knowledgeSession.getGlobals().setDelegate(executionGlobals);
+
+ for (RulesFact rulesFact: rulesFacts) {
+ Object fact = rulesFact.getObject(execution);
+ knowledgeSession.insert(fact);
+ }
+
+ knowledgeSession.fireAllRules();
+
+ super.execute(executionImpl);
+ }
+
+ public void addRulesFact(RulesFact rulesFact) {
+ rulesFacts.add(rulesFact);
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/RulesActivity.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/RulesBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/RulesBinding.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/RulesBinding.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.activity;
+
+import java.util.List;
+
+import org.jbpm.jpdl.internal.xml.JpdlParser;
+import org.jbpm.pvm.internal.util.XmlUtil;
+import org.jbpm.pvm.internal.xml.Parse;
+import org.w3c.dom.Element;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class RulesBinding extends JpdlBinding {
+
+ public RulesBinding() {
+ super("rules");
+ }
+
+ public Object parseJpdl(Element element, Parse parse, JpdlParser parser) {
+ RulesActivity rulesActivity = new RulesActivity();
+
+ List<Element> factElements = XmlUtil.elements(element, "fact");
+ for (Element factElement: factElements) {
+ RulesFact rulesFact = new RulesFact();
+
+ String factVar = XmlUtil.attribute(factElement, "var");
+ if (factVar!=null) {
+ rulesFact.setVariableName(factVar);
+
+ } else {
+ String factExpr = XmlUtil.attribute(factElement, "expr");
+
+ if (factExpr!=null) {
+ String factLang = XmlUtil.attribute(factElement, "lang");
+ rulesFact.setExpression(factExpr);
+ rulesFact.setLanguage(factLang);
+
+ } else {
+ parse.addProblem("'fact' element inside 'rules' activity requires attribute 'var' or 'expr'", element);
+ }
+ }
+
+ rulesActivity.addRulesFact(rulesFact);
+ }
+
+ return rulesActivity;
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/RulesBinding.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/RulesFact.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/RulesFact.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/RulesFact.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.activity;
+
+import java.io.Serializable;
+
+import org.jbpm.api.activity.ActivityExecution;
+import org.jbpm.pvm.internal.script.ScriptManager;
+
+/**
+ * @author Tom Baeyens
+ */
+public class RulesFact implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String variableName;
+ protected String expression;
+ protected String language;
+
+ public String getVariableName() {
+ return variableName;
+ }
+
+ public void setVariableName(String variableName) {
+ this.variableName = variableName;
+ }
+
+ public String getExpression() {
+ return expression;
+ }
+
+ public void setExpression(String expression) {
+ this.expression = expression;
+ }
+
+ public String getLanguage() {
+ return language;
+ }
+
+ public void setLanguage(String language) {
+ this.language = language;
+ }
+
+ public Object getObject(ActivityExecution execution) {
+ if (variableName!=null) {
+ return execution.getVariable(variableName);
+
+ } else if (expression!=null) {
+ return ScriptManager.getScriptManager().evaluateExpression(expression, language);
+ }
+
+ return null;
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/RulesFact.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.bindings.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.bindings.xml 2009-12-10 11:15:51 UTC (rev 5942)
+++ jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.bindings.xml 2009-12-10 17:02:19 UTC (rev 5943)
@@ -19,6 +19,7 @@
<activity binding="org.jbpm.jpdl.internal.activity.CustomBinding" />
<activity binding="org.jbpm.jpdl.internal.activity.AssignBinding" />
<activity binding="org.jbpm.jpdl.internal.activity.PassthroughBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.RulesBinding" />
<activity binding="org.jbpm.jpdl.internal.activity.RulesDecisionBinding" />
<eventlistener binding="org.jbpm.jpdl.internal.activity.EventListenerBinding" />
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Transaction.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Transaction.java 2009-12-10 11:15:51 UTC (rev 5942)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Transaction.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -23,7 +23,10 @@
import javax.transaction.Synchronization;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
+import org.jbpm.pvm.internal.type.Variable;
+
/** provides access to the transaction in the environment.
*
* @author Tom Baeyens
@@ -40,4 +43,8 @@
/** register a transaction listener. This method will have no
* effect if the transactionListener is null. */
void registerSynchronization(Synchronization synchronization);
+
+ /** registers an object that is deserialized from the db so that it
+ * can be serialized and saved at the commit. */
+ void registerDeserializedObject(Object object, ScopeInstanceImpl scopeInstance, Variable variable);
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-12-10 11:15:51 UTC (rev 5942)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -951,7 +951,7 @@
Variable variable = systemVariables.get(key);
if (variable!=null) {
log.debug("setting system variable '"+key+"' in '"+this+"' to value '"+value+"'");
- variable.setValue(value);
+ variable.setValue(value, this);
} else {
log.debug("creating system variable '"+key+"' in '"+this+"' to value '"+value+"'");
createSystemVariable(key, value, null);
@@ -961,7 +961,7 @@
public Object getSystemVariable(String key) {
Variable variable = systemVariables.get(key);
if (variable!=null) {
- return variable.getValue();
+ return variable.getValue(this);
}
return null;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeInstanceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeInstanceImpl.java 2009-12-10 11:15:51 UTC (rev 5942)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeInstanceImpl.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -137,7 +137,7 @@
variable.setTask(getTask());
variable.setHistoryEnabled(isHistoryEnabled);
- variable.setValue(value);
+ variable.setValue(value, this);
long dbid = DbidGenerator.getDbidGenerator().getNextId();
variable.setDbid(dbid);
@@ -158,7 +158,7 @@
Variable variable = getVariableObject(key);
// if there is already a variable instance and it doesn't support the current type...
if ( (variable!=null)
- && (!variable.supports(value))
+ && (!variable.supports(value, this))
) {
// delete the old variable instance
log.debug("variable type change. deleting '"+key+"' from '"+this+"'");
@@ -168,7 +168,7 @@
if (variable!=null) {
log.debug("updating variable '"+key+"' in '"+this+"' to value '"+value+"'");
- variable.setValue(value);
+ variable.setValue(value, this);
} else if (getParentVariableScope()==null) {
createVariable(key, value, null, false);
@@ -189,7 +189,7 @@
public Object getVariable(String key) {
Variable variable = getVariableObject(key);
if (variable!=null) {
- return variable.getValue();
+ return variable.getValue(this);
}
ScopeInstanceImpl parentScope = getParentVariableScope();
@@ -237,7 +237,7 @@
for (Map.Entry<String, Variable> entry: variables.entrySet()) {
String name = (String) entry.getKey();
Variable variable = entry.getValue();
- Object value = variable.getValue();
+ Object value = variable.getValue(this);
values.put(name, value);
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/DbSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/DbSession.java 2009-12-10 11:15:51 UTC (rev 5942)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/DbSession.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -29,6 +29,7 @@
import org.jbpm.pvm.internal.client.ClientProcessDefinition;
import org.jbpm.pvm.internal.job.JobImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
import org.jbpm.pvm.internal.query.DeploymentQueryImpl;
import org.jbpm.pvm.internal.query.HistoryActivityInstanceQueryImpl;
import org.jbpm.pvm.internal.query.HistoryDetailQueryImpl;
@@ -37,6 +38,9 @@
import org.jbpm.pvm.internal.query.ProcessInstanceQueryImpl;
import org.jbpm.pvm.internal.query.TaskQueryImpl;
import org.jbpm.pvm.internal.task.TaskImpl;
+import org.jbpm.pvm.internal.tx.StandardTransaction;
+import org.jbpm.pvm.internal.tx.jta.JtaTransaction;
+import org.jbpm.pvm.internal.type.Variable;
/**
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/DeserializedObjects.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/DeserializedObjects.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/DeserializedObjects.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.tx;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
+import org.jbpm.pvm.internal.type.Variable;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DeserializedObjects implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ protected List<Object[]> deserializedObjects = new ArrayList<Object[]>();
+
+ public void registerDeserializedObject(Object object, ScopeInstanceImpl scopeInstance, Variable variable) {
+ if (deserializedObjects!=null) {
+ deserializedObjects.add(new Object[] { object, scopeInstance, variable });
+ }
+ }
+
+ public void flushDeserializedObjects() {
+ List<Object[]> copy = new ArrayList<Object[]>(deserializedObjects);
+ deserializedObjects = null;
+ for (Object[] triple: copy) {
+ Object deserializedObject = triple[0];
+ ScopeInstanceImpl scopeInstance = (ScopeInstanceImpl) triple[1];
+ Variable variable = (Variable) triple[2];
+
+ String variableName = variable.getKey();
+ Object currentValue = scopeInstance.getVariable(variableName);
+
+ if ( (currentValue!=null)
+ && (currentValue==deserializedObject)
+ ) {
+ variable.setValue(deserializedObject, scopeInstance);
+ }
+ }
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/DeserializedObjects.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransaction.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransaction.java 2009-12-10 11:15:51 UTC (rev 5942)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransaction.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -29,6 +29,8 @@
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.env.Transaction;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
+import org.jbpm.pvm.internal.type.Variable;
/** simple 2 phase commit transaction.
@@ -52,6 +54,7 @@
protected List<StandardResource> resources;
protected List<StandardSynchronization> synchronizations;
protected State state = State.CREATED;
+ protected DeserializedObjects deserializedObjects = new DeserializedObjects();
// methods for interceptor //////////////////////////////////////////////////
@@ -96,6 +99,8 @@
log.trace("committing "+this);
try {
+ deserializedObjects.flushDeserializedObjects();
+
beforeCompletion();
if (resources!=null) {
@@ -237,6 +242,14 @@
return resources;
}
+ // deserialized objects /////////////////////////////////////////////////////
+
+ public void registerDeserializedObject(Object object, ScopeInstanceImpl scopeInstance, Variable variable) {
+ deserializedObjects.registerDeserializedObject(object, scopeInstance, variable);
+ }
+
+ // general methods //////////////////////////////////////////////////////////
+
public String toString() {
return "StandardTransaction["+System.identityHashCode(this)+"]";
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransaction.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransaction.java 2009-12-10 11:15:51 UTC (rev 5942)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransaction.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -21,6 +21,8 @@
*/
package org.jbpm.pvm.internal.tx.jta;
+import java.util.List;
+
import javax.naming.InitialContext;
import javax.transaction.Status;
import javax.transaction.Synchronization;
@@ -31,6 +33,9 @@
import org.jbpm.api.JbpmException;
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.env.Transaction;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
+import org.jbpm.pvm.internal.tx.DeserializedObjects;
+import org.jbpm.pvm.internal.type.Variable;
/**
@@ -45,6 +50,7 @@
protected String userTransactionJndiName = JNDINAME_USERTRANSACTION_JBOSS_GLOBAL;
protected String transactionManagerJndiName = JNDINAME_TRANSACTIONMANAGER_JBOSS_GLOBAL;
+ protected DeserializedObjects deserializedObjects = new DeserializedObjects();
public boolean isRollbackOnly() {
try {
@@ -88,6 +94,7 @@
public void commit() {
try {
+ deserializedObjects.flushDeserializedObjects();
lookupJeeUserTransaction().commit();
} catch (Exception e) {
throw new JbpmException("couldn't commit: "+e.getMessage(), e);
@@ -148,4 +155,10 @@
log.trace("jta transaction status: "+JtaStatusHelper.toString(status));
return status;
}
+
+ // deserialized objects /////////////////////////////////////////////////////
+
+ public void registerDeserializedObject(Object object, ScopeInstanceImpl scopeInstance, Variable variable) {
+ deserializedObjects.registerDeserializedObject(object, scopeInstance, variable);
+ }
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Converter.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Converter.java 2009-12-10 11:15:51 UTC (rev 5942)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Converter.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -23,6 +23,8 @@
import java.io.Serializable;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
+
/**
* @author Tom Baeyens
*/
@@ -31,15 +33,15 @@
/**
* is true if this converter supports the given type, false otherwise.
*/
- boolean supports(Object value);
+ boolean supports(Object value, ScopeInstanceImpl scopeInstance, Variable variable);
/**
* converts a given object to its persistable format.
*/
- Object convert(Object o);
+ Object convert(Object o, ScopeInstanceImpl scopeInstance, Variable variable);
/**
* reverts a persisted object to its original formResourceName.
*/
- Object revert(Object o);
+ Object revert(Object o, ScopeInstanceImpl scopeInstance, Variable variable);
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Variable.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Variable.java 2009-12-10 11:15:51 UTC (rev 5942)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Variable.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -28,8 +28,8 @@
import org.jbpm.pvm.internal.history.HistoryEvent;
import org.jbpm.pvm.internal.history.HistorySession;
import org.jbpm.pvm.internal.history.events.VariableUpdate;
-import org.jbpm.pvm.internal.id.DbidGenerator;
import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
import org.jbpm.pvm.internal.task.TaskImpl;
/**
@@ -70,19 +70,19 @@
// variable management //////////////////////////////////////////////////////
- public boolean supports(Object value) {
+ public boolean supports(Object value, ScopeInstanceImpl scopeInstance) {
if (converter!=null) {
- return converter.supports(value);
+ return converter.supports(value, scopeInstance, this);
}
return isStorable(value);
}
- public void setValue(Object value) {
+ public void setValue(Object value, ScopeInstanceImpl scopeInstance) {
if (converter!=null) {
- if (! converter.supports(value)) {
+ if (! converter.supports(value, scopeInstance, this)) {
throw new JbpmException("the converter '"+converter.getClass().getName()+"' in variable instance '"+this.getClass().getName()+"' does not support values of type '"+value.getClass().getName()+"'. to change the type of a variable, you have to delete it first");
}
- value = converter.convert(value);
+ value = converter.convert(value, scopeInstance, this);
}
if ( (value!=null)
&& (! this.isStorable(value)) ) {
@@ -98,11 +98,11 @@
}
}
- public Object getValue() {
+ public Object getValue(ScopeInstanceImpl scopeInstance) {
Object value = getObject();
if ( (value!=null)
&& (converter!=null) ) {
- value = converter.revert(value);
+ value = converter.revert(value, scopeInstance, this);
}
return value;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/BooleanToStringConverter.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/BooleanToStringConverter.java 2009-12-10 11:15:51 UTC (rev 5942)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/BooleanToStringConverter.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -21,7 +21,9 @@
*/
package org.jbpm.pvm.internal.type.converter;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
import org.jbpm.pvm.internal.type.Converter;
+import org.jbpm.pvm.internal.type.Variable;
public class BooleanToStringConverter implements Converter {
@@ -30,12 +32,12 @@
public static final String TRUE_TEXT = "T";
public static final String FALSE_TEXT = "F";
- public boolean supports(Object value) {
+ public boolean supports(Object value, ScopeInstanceImpl scopeInstance, Variable variable) {
if (value==null) return true;
return (value.getClass()==Boolean.class);
}
- public Object convert(Object o) {
+ public Object convert(Object o, ScopeInstanceImpl scopeInstance, Variable variable) {
String convertedValue = FALSE_TEXT;
if (((Boolean)o).booleanValue()) {
convertedValue = TRUE_TEXT;
@@ -43,7 +45,7 @@
return convertedValue;
}
- public Object revert(Object o) {
+ public Object revert(Object o, ScopeInstanceImpl scopeInstance, Variable variable) {
Boolean revertedValue = Boolean.FALSE;
if (TRUE_TEXT.equals(o)) {
revertedValue = Boolean.TRUE;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/ByteToLongConverter.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/ByteToLongConverter.java 2009-12-10 11:15:51 UTC (rev 5942)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/ByteToLongConverter.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -21,22 +21,24 @@
*/
package org.jbpm.pvm.internal.type.converter;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
import org.jbpm.pvm.internal.type.Converter;
+import org.jbpm.pvm.internal.type.Variable;
public class ByteToLongConverter implements Converter {
private static final long serialVersionUID = 1L;
- public boolean supports(Object value) {
+ public boolean supports(Object value, ScopeInstanceImpl scopeInstance, Variable variable) {
if (value==null) return true;
return (value.getClass()==Byte.class);
}
- public Object convert(Object o) {
+ public Object convert(Object o, ScopeInstanceImpl scopeInstance, Variable variable) {
return new Long( ((Number)o).longValue() );
}
- public Object revert(Object o) {
+ public Object revert(Object o, ScopeInstanceImpl scopeInstance, Variable variable) {
return new Byte(((Long)o).byteValue());
}
}
\ No newline at end of file
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/CharacterToStringConverter.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/CharacterToStringConverter.java 2009-12-10 11:15:51 UTC (rev 5942)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/CharacterToStringConverter.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -21,22 +21,24 @@
*/
package org.jbpm.pvm.internal.type.converter;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
import org.jbpm.pvm.internal.type.Converter;
+import org.jbpm.pvm.internal.type.Variable;
public class CharacterToStringConverter implements Converter {
private static final long serialVersionUID = 1L;
- public boolean supports(Object value) {
+ public boolean supports(Object value, ScopeInstanceImpl scopeInstance, Variable variable) {
if (value==null) return true;
return (value.getClass()==Character.class);
}
- public Object convert(Object o) {
+ public Object convert(Object o, ScopeInstanceImpl scopeInstance, Variable variable) {
return o.toString();
}
- public Object revert(Object o) {
+ public Object revert(Object o, ScopeInstanceImpl scopeInstance, Variable variable) {
return new Character(((String)o).charAt(0));
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/DateToLongConverter.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/DateToLongConverter.java 2009-12-10 11:15:51 UTC (rev 5942)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/DateToLongConverter.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -23,22 +23,24 @@
import java.util.Date;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
import org.jbpm.pvm.internal.type.Converter;
+import org.jbpm.pvm.internal.type.Variable;
public class DateToLongConverter implements Converter {
private static final long serialVersionUID = 1L;
- public boolean supports(Object value) {
+ public boolean supports(Object value, ScopeInstanceImpl scopeInstance, Variable variable) {
if (value==null) return true;
return (Date.class.isAssignableFrom(value.getClass()));
}
- public Object convert(Object o) {
+ public Object convert(Object o, ScopeInstanceImpl scopeInstance, Variable variable) {
return new Long(((Date)o).getTime());
}
- public Object revert(Object o) {
+ public Object revert(Object o, ScopeInstanceImpl scopeInstance, Variable variable) {
return new Date(((Long)o).longValue());
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/DateToStringConverter.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/DateToStringConverter.java 2009-12-10 11:15:51 UTC (rev 5942)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/DateToStringConverter.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -27,7 +27,9 @@
import java.util.Date;
import org.jbpm.api.JbpmException;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
import org.jbpm.pvm.internal.type.Converter;
+import org.jbpm.pvm.internal.type.Variable;
/**
* @author Tom Baeyens
@@ -38,11 +40,11 @@
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss,SSS");
- public Object convert(Object o) {
+ public Object convert(Object o, ScopeInstanceImpl scopeInstance, Variable variable) {
return dateFormat.format((Date)o);
}
- public Object revert(Object o) {
+ public Object revert(Object o, ScopeInstanceImpl scopeInstance, Variable variable) {
try {
return dateFormat.parseObject((String)o);
} catch (ParseException e) {
@@ -50,7 +52,7 @@
}
}
- public boolean supports(Object value) {
+ public boolean supports(Object value, ScopeInstanceImpl scopeInstance, Variable variable) {
return ((value!=null) && (value instanceof Date));
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/DoubleToStringConverter.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/DoubleToStringConverter.java 2009-12-10 11:15:51 UTC (rev 5942)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/DoubleToStringConverter.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -21,22 +21,24 @@
*/
package org.jbpm.pvm.internal.type.converter;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
import org.jbpm.pvm.internal.type.Converter;
+import org.jbpm.pvm.internal.type.Variable;
public class DoubleToStringConverter implements Converter {
private static final long serialVersionUID = 1L;
- public boolean supports(Object value) {
+ public boolean supports(Object value, ScopeInstanceImpl scopeInstance, Variable variable) {
if (value==null) return true;
return (value.getClass()==Double.class);
}
- public Object convert(Object o) {
+ public Object convert(Object o, ScopeInstanceImpl scopeInstance, Variable variable) {
return o.toString();
}
- public Object revert(Object o) {
+ public Object revert(Object o, ScopeInstanceImpl scopeInstance, Variable variable) {
return new Double((String)o);
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/FloatToDoubleConverter.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/FloatToDoubleConverter.java 2009-12-10 11:15:51 UTC (rev 5942)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/FloatToDoubleConverter.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -21,22 +21,24 @@
*/
package org.jbpm.pvm.internal.type.converter;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
import org.jbpm.pvm.internal.type.Converter;
+import org.jbpm.pvm.internal.type.Variable;
public class FloatToDoubleConverter implements Converter {
private static final long serialVersionUID = 1L;
- public boolean supports(Object value) {
+ public boolean supports(Object value, ScopeInstanceImpl scopeInstance, Variable variable) {
if (value==null) return true;
return (value.getClass()==Float.class);
}
- public Object convert(Object o) {
+ public Object convert(Object o, ScopeInstanceImpl scopeInstance, Variable variable) {
return new Double(((Float)o).doubleValue());
}
- public Object revert(Object o) {
+ public Object revert(Object o, ScopeInstanceImpl scopeInstance, Variable variable) {
return new Float(((Double)o).floatValue());
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/FloatToStringConverter.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/FloatToStringConverter.java 2009-12-10 11:15:51 UTC (rev 5942)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/FloatToStringConverter.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -21,22 +21,24 @@
*/
package org.jbpm.pvm.internal.type.converter;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
import org.jbpm.pvm.internal.type.Converter;
+import org.jbpm.pvm.internal.type.Variable;
public class FloatToStringConverter implements Converter {
private static final long serialVersionUID = 1L;
- public boolean supports(Object value) {
+ public boolean supports(Object value, ScopeInstanceImpl scopeInstance, Variable variable) {
if (value==null) return true;
return (value.getClass()==Float.class);
}
- public Object convert(Object o) {
+ public Object convert(Object o, ScopeInstanceImpl scopeInstance, Variable variable) {
return o.toString();
}
- public Object revert(Object o) {
+ public Object revert(Object o, ScopeInstanceImpl scopeInstance, Variable variable) {
return new Float((String)o);
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/IntegerToLongConverter.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/IntegerToLongConverter.java 2009-12-10 11:15:51 UTC (rev 5942)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/IntegerToLongConverter.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -21,22 +21,24 @@
*/
package org.jbpm.pvm.internal.type.converter;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
import org.jbpm.pvm.internal.type.Converter;
+import org.jbpm.pvm.internal.type.Variable;
public class IntegerToLongConverter implements Converter {
private static final long serialVersionUID = 1L;
- public boolean supports(Object value) {
+ public boolean supports(Object value, ScopeInstanceImpl scopeInstance, Variable variable) {
if (value==null) return true;
return (Integer.class.equals(value.getClass()));
}
- public Object convert(Object o) {
+ public Object convert(Object o, ScopeInstanceImpl scopeInstance, Variable variable) {
return new Long( ((Number)o).longValue() );
}
- public Object revert(Object o) {
+ public Object revert(Object o, ScopeInstanceImpl scopeInstance, Variable variable) {
return new Integer(((Long)o).intValue());
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/SerializableToBytesConverter.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/SerializableToBytesConverter.java 2009-12-10 11:15:51 UTC (rev 5942)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/SerializableToBytesConverter.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -29,18 +29,23 @@
import java.io.Serializable;
import org.jbpm.api.JbpmException;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
+import org.jbpm.pvm.internal.env.Transaction;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
+import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.type.Converter;
+import org.jbpm.pvm.internal.type.Variable;
public class SerializableToBytesConverter implements Converter {
private static final long serialVersionUID = 1L;
- public boolean supports(Object value) {
+ public boolean supports(Object value, ScopeInstanceImpl scopeInstance, Variable variable) {
if (value==null) return true;
return Serializable.class.isAssignableFrom(value.getClass());
}
- public Object convert(Object o) {
+ public Object convert(Object o, ScopeInstanceImpl scopeInstance, Variable variable) {
byte[] bytes = null;
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -55,12 +60,20 @@
return bytes;
}
- public Object revert(Object o) {
+ public Object revert(Object o, ScopeInstanceImpl scopeInstance, Variable variable) {
byte[] bytes = (byte[]) o;
try {
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
ObjectInputStream ois = new ObjectInputStream(bais);
- return ois.readObject();
+ Object object = ois.readObject();
+
+ Transaction transaction = EnvironmentImpl.getFromCurrent(Transaction.class, false);
+ if (transaction!=null) {
+ transaction.registerDeserializedObject(object, scopeInstance, variable);
+ }
+
+ return object;
+
} catch (Exception e) {
throw new JbpmException("couldn't deserialize object", e);
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/ShortToLongConverter.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/ShortToLongConverter.java 2009-12-10 11:15:51 UTC (rev 5942)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/converter/ShortToLongConverter.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -21,22 +21,24 @@
*/
package org.jbpm.pvm.internal.type.converter;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
import org.jbpm.pvm.internal.type.Converter;
+import org.jbpm.pvm.internal.type.Variable;
public class ShortToLongConverter implements Converter {
private static final long serialVersionUID = 1L;
- public boolean supports(Object value) {
+ public boolean supports(Object value, ScopeInstanceImpl scopeInstance, Variable variable) {
if (value==null) return true;
return (value.getClass()==Short.class);
}
- public Object convert(Object o) {
+ public Object convert(Object o, ScopeInstanceImpl scopeInstance, Variable variable) {
return new Long( ((Number)o).longValue() );
}
- public Object revert(Object o) {
+ public Object revert(Object o, ScopeInstanceImpl scopeInstance, Variable variable) {
return new Short(((Long)o).shortValue());
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/variable/BlobVariable.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/variable/BlobVariable.java 2009-12-10 11:15:51 UTC (rev 5942)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/variable/BlobVariable.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -23,6 +23,7 @@
import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.lob.Lob;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.type.Variable;
@@ -31,6 +32,7 @@
private static final long serialVersionUID = 1L;
protected Lob lob = null;
+ protected Object cachedValue = null;
public boolean isStorable(Object value) {
if (value==null) return true;
@@ -52,6 +54,19 @@
this.lob = new Lob((byte[])value, true);
}
+ public Object getValue(ScopeInstanceImpl scopeInstance) {
+ if (cachedValue!=null) {
+ return cachedValue;
+ }
+ cachedValue = super.getValue(scopeInstance);
+ return cachedValue;
+ }
+
+ public void setValue(Object value, ScopeInstanceImpl scopeInstance) {
+ super.setValue(value, scopeInstance);
+ cachedValue = value;
+ }
+
public Lob getLob() {
return lob;
}
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/type/VariableAutoTypeResolutionTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/type/VariableAutoTypeResolutionTest.java 2009-12-10 11:15:51 UTC (rev 5942)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/type/VariableAutoTypeResolutionTest.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -33,7 +33,6 @@
import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.type.variable.BlobVariable;
-import org.jbpm.pvm.internal.type.variable.ClobVariable;
import org.jbpm.pvm.internal.type.variable.DoubleVariable;
import org.jbpm.pvm.internal.type.variable.LongVariable;
import org.jbpm.pvm.internal.type.variable.StringVariable;
@@ -211,7 +210,7 @@
assertEquals(BlobVariable.class, variable.getClass());
BlobVariable blobVariable = (BlobVariable) variable;
- byte[] blobVariableBytes = (byte[]) blobVariable.getValue();
+ byte[] blobVariableBytes = (byte[]) blobVariable.getValue(execution);
assertTrue(Arrays.equals(bytes, blobVariableBytes));
}
@@ -258,7 +257,7 @@
assertTrue(Arrays.equals(expected, blobVariableBytes));
- Object deserialized = blobVariable.getValue();
+ Object deserialized = blobVariable.getValue(execution);
assertNotNull(deserialized);
assertEquals(testSerializable, deserialized);
}
Modified: jbpm4/trunk/modules/test-db/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-db/pom.xml 2009-12-10 11:15:51 UTC (rev 5942)
+++ jbpm4/trunk/modules/test-db/pom.xml 2009-12-10 17:02:19 UTC (rev 5943)
@@ -58,6 +58,14 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-compiler</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<scope>test</scope>
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/rules/Room.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/rules/Room.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/rules/Room.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.examples.rules;
+
+import java.io.Serializable;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class Room implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ int temperature = 21;
+ boolean smoke = false;
+ boolean isOnFire = false;
+
+ public Room(int temperature, boolean smoke) {
+ this.temperature = temperature;
+ this.smoke = smoke;
+ }
+
+ public int getTemperature() {
+ return temperature;
+ }
+ public void setTemperature(int temperature) {
+ this.temperature = temperature;
+ }
+ public boolean isSmoke() {
+ return smoke;
+ }
+ public void setSmoke(boolean smoke) {
+ this.smoke = smoke;
+ }
+ public boolean isOnFire() {
+ return isOnFire;
+ }
+ public void setOnFire(boolean isOnFire) {
+ this.isOnFire = isOnFire;
+ }
+}
Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/rules/Room.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/rules/RulesTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/rules/RulesTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/rules/RulesTest.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.examples.rules;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class RulesTest extends JbpmTestCase {
+
+ String deploymentId;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ deploymentId = repositoryService.createDeployment()
+ .addResourceFromClasspath("org/jbpm/examples/rules/process.jpdl.xml")
+ .addResourceFromClasspath("org/jbpm/examples/rules/rules.drl")
+ .deploy();
+ }
+
+ protected void tearDown() throws Exception {
+ repositoryService.deleteDeploymentCascade(deploymentId);
+
+ super.tearDown();
+ }
+
+
+ public void testRoomOnFire() {
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("room", new Room(350, true));
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("Rules", variables);
+
+ assertTrue(processInstance.isActive("getFireExtinguisher"));
+ }
+
+ public void testRoomWithoutFire() {
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("room", new Room(21, false));
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("Rules", variables);
+
+ assertTrue(processInstance.isActive("goToPub"));
+ }
+}
Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/rules/RulesTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/rulesdecision (from rev 5935, jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/rulesdecision)
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/rulesdecision/RulesDecisionTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/rulesdecision/RulesDecisionTest.java 2009-12-09 03:22:10 UTC (rev 5935)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/examples/rulesdecision/RulesDecisionTest.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -40,7 +40,7 @@
deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("org/jbpm/examples/rulesdecision/process.jpdl.xml")
- .addResourceFromClasspath("org/jbpm/examples/rulesdecision/isImportant.drl")
+ .addResourceFromClasspath("org/jbpm/examples/rulesdecision/rules.drl")
.deploy();
}
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/variables/SerializedVariableUpdate.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/variables/SerializedVariableUpdate.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/variables/SerializedVariableUpdate.java 2009-12-10 17:02:19 UTC (rev 5943)
@@ -0,0 +1,97 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.variables;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.activity.ActivityBehaviour;
+import org.jbpm.api.activity.ActivityExecution;
+import org.jbpm.test.JbpmTestCase;
+import org.jbpm.test.activity.custom.CustomConfigurationsTest.MyCustomAutomatic;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class SerializedVariableUpdate extends JbpmTestCase {
+
+ public static class UpdateAndReplace implements ActivityBehaviour {
+
+ private static final long serialVersionUID = 1L;
+
+ public void execute(ActivityExecution execution) throws Exception {
+ Set<String> messages = (Set<String>) execution.getVariable("messages");
+ messages.clear();
+ messages.add("i");
+ messages.add("was");
+ messages.add("updated");
+
+ Set<String> newMessagesObject = new HashSet<String>();
+ newMessagesObject.add("completely");
+ newMessagesObject.add("new");
+ newMessagesObject.add("object");
+ execution.setVariable("messages", newMessagesObject);
+ }
+
+ }
+
+ public void testSerializableVariableUpdate() {
+ deployJpdlXmlString(
+ "<process name='SerializedVariableUpdate'>" +
+ " <start>" +
+ " <transition to='wait before' />" +
+ " </start>" +
+ " <state name='wait before'>" +
+ " <transition to='update' />" +
+ " </state>" +
+ " <custom name='update' class='"+UpdateAndReplace.class.getName()+"'>" +
+ " <transition to='wait after' />" +
+ " </custom>" +
+ " <state name='wait after'/>" +
+ "</process>"
+ );
+
+ Set<String> messages = new HashSet<String>();
+ messages.add("serialize");
+ messages.add("me");
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("messages", messages);
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("SerializedVariableUpdate", variables);
+ String pid = processInstance.getId();
+ executionService.signalExecutionById(pid);
+
+ Set<String> expectedMessages = new HashSet<String>();
+ expectedMessages.add("completely");
+ expectedMessages.add("new");
+ expectedMessages.add("object");
+
+ messages = (Set<String>) executionService.getVariable(pid, "messages");
+ assertEquals(expectedMessages, messages);
+ }
+
+}
Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/variables/SerializedVariableUpdate.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/examples/rules/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/examples/rules/process.jpdl.xml (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/examples/rules/process.jpdl.xml 2009-12-10 17:02:19 UTC (rev 5943)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="Rules" xmlns="http://jbpm.org/4/jpdl">
+
+ <start g="49,93,80,40">
+ <transition to="evaluateStatus"/>
+ </start>
+
+ <rules name="evaluateStatus">
+ <fact var="room" />
+ <transition to="checkForFires"/>
+ </rules>
+
+ <decision g="215,93,80,40" name="checkForFires">
+ <transition to="getFireExtinguisher" g="240,69:">
+ <condition expr="#{room.onFire}" />
+ </transition>
+ <transition to="goToPub" g="240,164:"/>
+ </decision>
+
+ <state g="294,43,120,52" name="getFireExtinguisher"/>
+ <state g="292,139,124,49" name="goToPub"/>
+
+</process>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/examples/rules/process.jpdl.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/examples/rules/process.png
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/examples/rules/process.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/examples/rules/rules.drl
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/examples/rules/rules.drl (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/examples/rules/rules.drl 2009-12-10 17:02:19 UTC (rev 5943)
@@ -0,0 +1,6 @@
+rule "CheckRoomOnFire"
+ when
+ room : org.jbpm.examples.rules.Room( temperature > 30, smoke == true )
+ then
+ room.setOnFire( true );
+end
Copied: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/examples/rulesdecision (from rev 5935, jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/rulesdecision)
Deleted: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/examples/rulesdecision/isImportant.drl
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/rulesdecision/isImportant.drl 2009-12-09 03:22:10 UTC (rev 5935)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/examples/rulesdecision/isImportant.drl 2009-12-10 17:02:19 UTC (rev 5943)
@@ -1,25 +0,0 @@
-global java.lang.Integer amount;
-global java.lang.String product;
-global org.jbpm.jpdl.internal.rules.Outcome outcome;
-
-rule "LessThen3IsIrrelevant"
- when
- eval(amount < 3)
- then
- outcome.set("irrelevant");
-end
-
-rule "MoreThen24IsImportant"
- when
- eval(amount > 24)
- then
- outcome.set("important");
-end
-
-rule "TwelveTempranillosIsImportant"
- when
- eval(product == "Tempranillo")
- eval(amount > 12)
- then
- outcome.set("important");
-end
Added: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/examples/rulesdecision/rules.drl
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/examples/rulesdecision/rules.drl (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/examples/rulesdecision/rules.drl 2009-12-10 17:02:19 UTC (rev 5943)
@@ -0,0 +1,25 @@
+global java.lang.Integer amount;
+global java.lang.String product;
+global org.jbpm.jpdl.internal.rules.Outcome outcome;
+
+rule "LessThen3IsIrrelevant"
+ when
+ eval(amount < 3)
+ then
+ outcome.set("irrelevant");
+end
+
+rule "MoreThen24IsImportant"
+ when
+ eval(amount > 24)
+ then
+ outcome.set("important");
+end
+
+rule "TwelveTempranillosIsImportant"
+ when
+ eval(product == "Tempranillo")
+ eval(amount > 12)
+ then
+ outcome.set("important");
+end
16 years, 4 months
JBoss JBPM SVN: r5942 - in jbpm4/trunk/modules: bpmn/src/main/resources/META-INF/services and 1 other directories.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-12-10 06:15:51 -0500 (Thu, 10 Dec 2009)
New Revision: 5942
Added:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/XPathScriptEngine.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/XPathScriptEngineFactory.java
Removed:
jbpm4/trunk/modules/bpmn/src/main/java/com/sun/script/xpath/
Modified:
jbpm4/trunk/modules/bpmn/src/main/resources/META-INF/services/javax.script.ScriptEngineFactory
Log:
JBPM-2632: move XpathScriptEngine
Modified: jbpm4/trunk/modules/bpmn/src/main/resources/META-INF/services/javax.script.ScriptEngineFactory
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/resources/META-INF/services/javax.script.ScriptEngineFactory 2009-12-10 09:09:01 UTC (rev 5941)
+++ jbpm4/trunk/modules/bpmn/src/main/resources/META-INF/services/javax.script.ScriptEngineFactory 2009-12-10 11:15:51 UTC (rev 5942)
@@ -1 +1 @@
-com.sun.script.xpath.XPathScriptEngineFactory
\ No newline at end of file
+org.jbpm.pvm.internal.script.XPathScriptEngineFactory
\ No newline at end of file
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/XPathScriptEngine.java (from rev 5938, jbpm4/trunk/modules/bpmn/src/main/java/com/sun/script/xpath/XPathScriptEngine.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/XPathScriptEngine.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/XPathScriptEngine.java 2009-12-10 11:15:51 UTC (rev 5942)
@@ -0,0 +1,458 @@
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met: Redistributions of source code
+ * must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of
+ * conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution. Neither the name of the Sun Microsystems nor the names of
+ * is contributors may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * XPathScriptEngine.java
+ * @author A. Sundararajan
+ */
+
+package org.jbpm.pvm.internal.script;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.script.AbstractScriptEngine;
+import javax.script.Bindings;
+import javax.script.Compilable;
+import javax.script.CompiledScript;
+import javax.script.Invocable;
+import javax.script.ScriptContext;
+import javax.script.ScriptEngine;
+import javax.script.ScriptEngineFactory;
+import javax.script.ScriptException;
+import javax.script.SimpleBindings;
+import javax.xml.XMLConstants;
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpression;
+import javax.xml.xpath.XPathFactory;
+import javax.xml.xpath.XPathFunction;
+import javax.xml.xpath.XPathFunctionResolver;
+import javax.xml.xpath.XPathVariableResolver;
+
+import org.w3c.dom.Document;
+import org.xml.sax.InputSource;
+
+public class XPathScriptEngine extends AbstractScriptEngine implements Compilable {
+
+ // my factory, may be null
+ private ScriptEngineFactory factory;
+ private XPathFactory xpathFactory;
+
+ // special context variables for XPath result type and input
+ public static final String XPATH_RESULT_TYPE = "com.sun.script.xpath.resultType";
+ public static final String XPATH_INPUT_SRC = "com.sun.script.xpath.inputSource";
+
+ // XML namespace prefixes and URIs.
+ public static final String XMLNS_COLON = "xmlns:";
+ public static final String XPATH_CONTEXT_PREFIX = "context";
+ public static final String XPATH_CONTEXT_URI = "http://www.sun.com/java/jsr223/xpath/context";
+
+ private Document objectData;
+
+ public XPathScriptEngine() {
+ xpathFactory = XPathFactory.newInstance();
+ }
+
+ // my implementation for CompiledScript
+ private class XPathCompiledScript extends CompiledScript {
+
+ private XPathExpression expr;
+
+ XPathCompiledScript(XPathExpression expr) {
+ this.expr = expr;
+ }
+
+ public ScriptEngine getEngine() {
+ return XPathScriptEngine.this;
+ }
+
+ public Object eval(ScriptContext ctx) throws ScriptException {
+ return evalXPath(expr, ctx);
+ }
+ }
+
+ public CompiledScript compile(String script) throws ScriptException {
+ XPathExpression expr = compileXPath(script, context);
+ return new XPathCompiledScript(expr);
+ }
+
+ public CompiledScript compile(Reader reader) throws ScriptException {
+ return compile(readFully(reader));
+ }
+
+ public Object eval(String str, ScriptContext ctx) throws ScriptException {
+ XPathExpression expr = compileXPath(str, ctx);
+ return evalXPath(expr, ctx);
+ }
+
+ public Object eval(Reader reader, ScriptContext ctx) throws ScriptException {
+ return eval(readFully(reader), ctx);
+ }
+
+ public ScriptEngineFactory getFactory() {
+ synchronized (this) {
+ if (factory == null) {
+ factory = new XPathScriptEngineFactory();
+ }
+ }
+ return factory;
+ }
+
+ public Bindings createBindings() {
+ return new SimpleBindings();
+ }
+
+ void setFactory(ScriptEngineFactory factory) {
+ this.factory = factory;
+ }
+
+ // Internals only below this point
+
+ // find a variable of given qname in given context
+ private static Object findVariable(QName qname, ScriptContext ctx) {
+ String name;
+ int scope;
+
+ if (XPATH_CONTEXT_URI.equals(qname.getNamespaceURI())) {
+ name = qname.getLocalPart();
+ synchronized (ctx) {
+ scope = ctx.getAttributesScope(name);
+ if (scope != -1) {
+ return ctx.getAttribute(name, scope);
+ } // else fallthru
+ }
+ }
+ if (qname.getPrefix() == null || "".equals(qname.getPrefix())) {
+ name = qname.getLocalPart();
+ } else {
+ name = qname.getPrefix() + ":" + qname.getLocalPart();
+ }
+ synchronized (ctx) {
+ scope = ctx.getAttributesScope(name);
+ if (scope != -1) {
+ return ctx.getAttribute(name, scope);
+ } // else fallthru
+ }
+ return null;
+ }
+
+ private static void collectNamespaces(Map<String, String> map, Bindings scope) {
+ for (String key : scope.keySet()) {
+ if (key.startsWith(XMLNS_COLON)) {
+ Object uri = scope.get(key);
+ // collect all variables starting with "xmlns:" and
+ // collect the prefix to URI mappings.
+ String prefix = key.substring(XMLNS_COLON.length());
+ if (uri instanceof String) {
+ String tmp = (String) uri;
+ if (tmp.length() != 0) {
+ map.put(prefix, tmp);
+ }
+ }
+ }
+ }
+ }
+
+ private static NamespaceContext makeNamespaceContext(ScriptContext ctx) {
+ // namespace prefix-to-URI mappings
+ final Map<String, String> namespaces = new HashMap<String, String>();
+ for (int scope : ctx.getScopes()) {
+ Bindings bind = ctx.getBindings(scope);
+ if (bind != null) {
+ // TODO: See what needs to be done....
+ // collectNamespaces(namespaces, bind);
+ }
+ }
+
+ // look for mapping for default XML namespace
+ Object def = ctx.getAttribute(XMLConstants.XMLNS_ATTRIBUTE);
+ if (def instanceof String) {
+ namespaces.put(XMLConstants.DEFAULT_NS_PREFIX, (String) def);
+ }
+
+ // standard required mappings by XPath standard
+ namespaces.put(XMLConstants.XML_NS_PREFIX, XMLConstants.XML_NS_URI);
+ namespaces.put(XMLConstants.XMLNS_ATTRIBUTE, XMLConstants.XMLNS_ATTRIBUTE_NS_URI);
+
+ // add prefix mapping for XPATH_CONTEXT_PREFIX
+ namespaces.put(XPATH_CONTEXT_PREFIX, XPATH_CONTEXT_URI);
+
+ return new NamespaceContext() {
+
+ public String getNamespaceURI(String prefix) {
+ if (prefix == null) {
+ throw new IllegalArgumentException();
+ }
+ String uri = namespaces.get(prefix);
+ if (uri == null) {
+ return XMLConstants.NULL_NS_URI;
+ } else {
+ return uri;
+ }
+ }
+
+ public String getPrefix(String namespaceURI) {
+ if (namespaceURI == null) {
+ throw new IllegalArgumentException();
+ }
+ for (String prefix : namespaces.keySet()) {
+ String uri = namespaces.get(prefix);
+ if (namespaceURI.equals(uri)) {
+ return prefix;
+ }
+ }
+ return null;
+ }
+
+ public Iterator getPrefixes(String namespaceURI) {
+ if (namespaceURI == null) {
+ throw new IllegalArgumentException();
+ }
+ List list = new ArrayList();
+ for (String prefix : namespaces.keySet()) {
+ String uri = namespaces.get(prefix);
+ if (namespaceURI.equals(uri)) {
+ list.add(prefix);
+ }
+ }
+ return Collections.unmodifiableList(list).iterator();
+ }
+ };
+ }
+
+ private static XPathFunction makeXPathFunction(final Constructor ctr, int arity) {
+ if (ctr.getParameterTypes().length != arity) {
+ return null;
+ }
+ return new XPathFunction() {
+
+ public Object evaluate(List args) {
+ try {
+ return ctr.newInstance(args.toArray());
+ } catch (Exception exp) {
+ throw new RuntimeException(exp);
+ }
+ }
+ };
+ }
+
+ private static XPathFunction makeXPathFunction(final Method method, int arity) {
+ int modifiers = method.getModifiers();
+ int numArgs = method.getParameterTypes().length;
+ if (Modifier.isStatic(modifiers) && numArgs == arity) {
+ // static method. expose "as is".
+ return new XPathFunction() {
+
+ public Object evaluate(List args) {
+ try {
+ return method.invoke(null, args.toArray());
+ } catch (Exception exp) {
+ throw new RuntimeException(exp);
+ }
+ }
+ };
+ } else if ((numArgs + 1) == arity) {
+ // instance method. treat the first arg as 'this'
+ return new XPathFunction() {
+
+ public Object evaluate(List args) {
+ List tmp = args.subList(1, args.size());
+ try {
+ return method.invoke(args.get(0), tmp.toArray());
+ } catch (Exception exp) {
+ throw new RuntimeException(exp);
+ }
+ }
+ };
+ } else {
+ return null;
+ }
+ }
+
+ private static XPathFunction makeXPathFunction(final String funcName, final Invocable invocable) {
+ return new XPathFunction() {
+
+ public Object evaluate(List args) {
+ try {
+ return invocable.invokeFunction(funcName, args.toArray());
+ } catch (Exception exp) {
+ throw new RuntimeException(exp);
+ }
+ }
+ };
+ }
+
+ // make a XPathFunction from given object
+ private static XPathFunction makeXPathFunction(QName qname, Object obj, int arity) {
+ if (obj == null) {
+ return null;
+ } else if (obj instanceof XPathFunction) {
+ // already XPathFunction - just return
+ return (XPathFunction) obj;
+ } else if (obj instanceof Method) {
+ // a Method object. wrap as XPathFunction
+ return makeXPathFunction((Method) obj, arity);
+ } else if (obj instanceof Constructor) {
+ // a Constructor object. wrap as XPathFunction
+ return makeXPathFunction((Constructor) obj, arity);
+ } else if (obj instanceof Invocable) {
+ // wrap a script function as XPathFunction. Using this,
+ // scripts from other languages (for eg. JavaScript) can use
+ // this engine and pass script functions as XPathFunction extensions
+
+ return makeXPathFunction(qname.getLocalPart(), (Invocable) obj);
+ } else {
+ // can't map the object as XPathFunction.
+ return null;
+ }
+ }
+
+ // Internals only below this point
+ private XPathExpression compileXPath(String str, final ScriptContext ctx) throws ScriptException {
+ // JSR-223 requirement
+ ctx.setAttribute("context", ctx, ScriptContext.ENGINE_SCOPE);
+ try {
+ XPath xpath = xpathFactory.newXPath();
+ xpath.setXPathVariableResolver(new XPathVariableResolver() {
+
+ public Object resolveVariable(QName qname) {
+ return findVariable(qname, ctx);
+ }
+ });
+
+ xpath.setXPathFunctionResolver(new XPathFunctionResolver() {
+
+ public XPathFunction resolveFunction(QName qname, int arity) {
+ Object obj = findVariable(qname, ctx);
+ return makeXPathFunction(qname, obj, arity);
+ }
+ });
+ xpath.setNamespaceContext(makeNamespaceContext(ctx));
+ // xpath.setNamespaceContext(new BpmnFunctionResolver());
+ // xpath.setXPathFunctionResolver(new BpmnFunctionResolver());
+ int begin = str.indexOf("getObjectData") > -1 ? 14 : 0;
+ if (begin > 0) {
+ String objectDataRef = str.substring(begin + 1, str.indexOf(")") - 1);
+
+ objectData = (Document) ctx.getAttribute(objectDataRef);
+ // ctx.setAttribute(XPATH_INPUT_SRC, objectData , 100);
+
+ ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+ Source xmlSource = new DOMSource(objectData);
+ Result outputTarget = new StreamResult(outputStream);
+ TransformerFactory.newInstance().newTransformer().transform(xmlSource, outputTarget);
+ InputStream is = new ByteArrayInputStream(outputStream.toByteArray());
+ ctx.setReader(new InputStreamReader(is));
+
+ str = str.substring(str.indexOf(")") + 1);
+ }
+ XPathExpression xpe = xpath.compile(str);
+ return xpe;
+ } catch (Exception exp) {
+ throw new ScriptException(exp);
+ }
+ }
+
+ private Object getVariable(ScriptContext ctx, String name) {
+ synchronized (ctx) {
+ int scope = ctx.getAttributesScope(name);
+ if (scope != -1) {
+ return ctx.getAttribute(name, scope);
+ }
+ }
+ return null;
+ }
+ private Object evalXPath(XPathExpression expr, final ScriptContext ctx) throws ScriptException {
+
+ try {
+ Object resultType = getVariable(ctx, XPATH_RESULT_TYPE);
+ Object input = getVariable(ctx, XPATH_INPUT_SRC);
+
+ InputSource src;
+ if (input == null) {
+ // no input specified, use context reader
+ src = new InputSource(ctx.getReader());
+ } else {
+ // explicit InputSource specified
+ if (input instanceof InputSource) {
+ src = (InputSource) input;
+ } else if (input instanceof String) {
+ src = new InputSource((String) input);
+ } else if (input instanceof Reader) {
+ src = new InputSource((Reader) input);
+ } else if (input instanceof InputStream) {
+ src = new InputSource((InputStream) input);
+ } else {
+ // some other object input type specified (Node/NodeList)
+ src = null;
+ }
+ }
+
+ resultType = XPathConstants.BOOLEAN;
+
+ if (resultType instanceof QName) {
+ return (src != null) ? expr.evaluate(src, (QName) resultType) : expr.evaluate(input, (QName) resultType);
+ } else {
+ return (src != null) ? expr.evaluate(src) : expr.evaluate(input);
+ }
+ } catch (Exception exp) {
+ throw new ScriptException(exp);
+ }
+ }
+
+ private String readFully(Reader reader) throws ScriptException {
+ char[] arr = new char[8 * 1024]; // 8K at a time
+ StringBuilder buf = new StringBuilder();
+ int numChars;
+ try {
+ while ((numChars = reader.read(arr, 0, arr.length)) > 0) {
+ buf.append(arr, 0, numChars);
+ }
+ } catch (IOException exp) {
+ throw new ScriptException(exp);
+ }
+ return buf.toString();
+ }
+}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/XPathScriptEngineFactory.java (from rev 5938, jbpm4/trunk/modules/bpmn/src/main/java/com/sun/script/xpath/XPathScriptEngineFactory.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/XPathScriptEngineFactory.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/XPathScriptEngineFactory.java 2009-12-10 11:15:51 UTC (rev 5942)
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met: Redistributions of source code
+ * must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of
+ * conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution. Neither the name of the Sun Microsystems nor the names of
+ * is contributors may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * XPathScriptEngineFactory.java
+ * @author A. Sundararajan
+ */
+
+package org.jbpm.pvm.internal.script;
+
+import javax.script.*;
+import java.util.*;
+
+public class XPathScriptEngineFactory implements ScriptEngineFactory {
+ public String getEngineName() {
+ return "xpath";
+ }
+
+ public String getEngineVersion() {
+ return "1.0";
+ }
+
+ public List<String> getExtensions() {
+ return extensions;
+ }
+
+ public String getLanguageName() {
+ return "jaxp";
+ }
+
+ public String getLanguageVersion() {
+ return "1.4";
+ }
+
+ public String getMethodCallSyntax(String obj, String m, String... args) {
+ throw new UnsupportedOperationException("getMethodCallSyntax");
+ }
+
+ public List<String> getMimeTypes() {
+ return mimeTypes;
+ }
+
+ public List<String> getNames() {
+ return names;
+ }
+
+ public String getOutputStatement(String str) {
+ throw new UnsupportedOperationException("getOutputStatement");
+ }
+
+ public String getParameter(String key) {
+ if (key.equals(ScriptEngine.ENGINE)) {
+ return getEngineName();
+ } else if (key.equals(ScriptEngine.ENGINE_VERSION)) {
+ return getEngineVersion();
+ } else if (key.equals(ScriptEngine.NAME)) {
+ return getEngineName();
+ } else if (key.equals(ScriptEngine.LANGUAGE)) {
+ return getLanguageName();
+ } else if (key.equals(ScriptEngine.LANGUAGE_VERSION)) {
+ return getLanguageVersion();
+ } else if (key.equals("THREADING")) {
+ return "MULTITHREADED";
+ } else {
+ return null;
+ }
+ }
+
+ public String getProgram(String... statements) {
+ throw new UnsupportedOperationException("getProgram");
+ }
+
+ public ScriptEngine getScriptEngine() {
+ XPathScriptEngine engine = new XPathScriptEngine();
+ engine.setFactory(this);
+ return engine;
+ }
+
+ private static List<String> names;
+ private static List<String> extensions;
+ private static List<String> mimeTypes;
+ static {
+ names = new ArrayList<String>(1);
+ names.add("xpath");
+ names = Collections.unmodifiableList(names);
+ extensions = names;
+ mimeTypes = new ArrayList<String>(0);
+ mimeTypes = Collections.unmodifiableList(mimeTypes);
+ }
+}
16 years, 4 months
JBoss JBPM SVN: r5941 - projects/jsf-console/tags.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-12-10 04:09:01 -0500 (Thu, 10 Dec 2009)
New Revision: 5941
Added:
projects/jsf-console/tags/jsf-console-3.2.8.GA/
Log:
JBPM-2678: tag jsf-console 3.2.8
Copied: projects/jsf-console/tags/jsf-console-3.2.8.GA (from rev 5940, projects/jsf-console/branches/jsf-console-3.2-soa)
16 years, 4 months
JBoss JBPM SVN: r5940 - in jbpm3/branches/jbpm-3.2-soa/modules/distribution: scripts and 1 other directory.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-12-10 03:31:20 -0500 (Thu, 10 Dec 2009)
New Revision: 5940
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/distribution/pom.xml
jbpm3/branches/jbpm-3.2-soa/modules/distribution/scripts/antrun-installer.xml
Log:
JBPM-2678: move soa console replacement to package phase as prepare-package seems to be skipped
take out unnecessary disablement of automatic schema creation property
Modified: jbpm3/branches/jbpm-3.2-soa/modules/distribution/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/distribution/pom.xml 2009-12-10 08:26:13 UTC (rev 5939)
+++ jbpm3/branches/jbpm-3.2-soa/modules/distribution/pom.xml 2009-12-10 08:31:20 UTC (rev 5940)
@@ -263,7 +263,7 @@
<executions>
<execution>
<id>soa-console</id>
- <phase>prepare-package</phase>
+ <phase>package</phase>
<goals>
<goal>run</goal>
</goals>
@@ -272,7 +272,6 @@
<!-- replace jsf-console.war with the SOA platform build -->
<property name="project.build.assembly.lib"
value="${project.build.assemblyDirectory}/lib" />
- <echo>**** Replacing jsf-console with SOA-P build ****</echo>
<copy file="${project.build.assembly.lib}/jsf-console-soa.war"
tofile="${project.build.assembly.lib}/jsf-console.war"
overwrite="yes" />
Modified: jbpm3/branches/jbpm-3.2-soa/modules/distribution/scripts/antrun-installer.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/distribution/scripts/antrun-installer.xml 2009-12-10 08:26:13 UTC (rev 5939)
+++ jbpm3/branches/jbpm-3.2-soa/modules/distribution/scripts/antrun-installer.xml 2009-12-10 08:31:20 UTC (rev 5940)
@@ -63,7 +63,6 @@
<property name="db2.cfg.xml"
value="${project.build.assembly.resources}/jbpm-jpdl-config/hibernate.cfg.db2.xml" />
<macro-disable file="${db2.cfg.xml}" section="JDBC connection properties" />
- <macro-disable file="${db2.cfg.xml}" section="Automatic schema creation" />
<macro-enable file="${db2.cfg.xml}" section="DataSource properties" />
<macro-enable file="${db2.cfg.xml}" section="JTA transaction properties" />
@@ -77,35 +76,30 @@
<property name="mssql.cfg.xml"
value="${project.build.assembly.resources}/jbpm-jpdl-config/hibernate.cfg.mssql.xml" />
<macro-disable file="${mssql.cfg.xml}" section="JDBC connection properties" />
- <macro-disable file="${mssql.cfg.xml}" section="Automatic schema creation" />
<macro-enable file="${mssql.cfg.xml}" section="DataSource properties" />
<macro-enable file="${mssql.cfg.xml}" section="JTA transaction properties" />
<property name="mysql.cfg.xml"
value="${project.build.assembly.resources}/jbpm-jpdl-config/hibernate.cfg.mysql.xml" />
<macro-disable file="${mysql.cfg.xml}" section="JDBC connection properties" />
- <macro-disable file="${mysql.cfg.xml}" section="Automatic schema creation" />
<macro-enable file="${mysql.cfg.xml}" section="DataSource properties" />
<macro-enable file="${mysql.cfg.xml}" section="JTA transaction properties" />
<property name="oracle.cfg.xml"
value="${project.build.assembly.resources}/jbpm-jpdl-config/hibernate.cfg.oracle.xml" />
<macro-disable file="${oracle.cfg.xml}" section="JDBC connection properties" />
- <macro-disable file="${oracle.cfg.xml}" section="Automatic schema creation" />
<macro-enable file="${oracle.cfg.xml}" section="DataSource properties" />
<macro-enable file="${oracle.cfg.xml}" section="JTA transaction properties" />
<property name="postgresql.cfg.xml"
value="${project.build.assembly.resources}/jbpm-jpdl-config/hibernate.cfg.postgresql.xml" />
<macro-disable file="${postgresql.cfg.xml}" section="JDBC connection properties" />
- <macro-disable file="${postgresql.cfg.xml}" section="Automatic schema creation" />
<macro-enable file="${postgresql.cfg.xml}" section="DataSource properties" />
<macro-enable file="${postgresql.cfg.xml}" section="JTA transaction properties" />
<property name="sybase.cfg.xml"
value="${project.build.assembly.resources}/jbpm-jpdl-config/hibernate.cfg.sybase.xml" />
<macro-disable file="${sybase.cfg.xml}" section="JDBC connection properties" />
- <macro-disable file="${sybase.cfg.xml}" section="Automatic schema creation" />
<macro-enable file="${sybase.cfg.xml}" section="DataSource properties" />
<macro-enable file="${sybase.cfg.xml}" section="JTA transaction properties" />
16 years, 4 months
JBoss JBPM SVN: r5939 - in projects/jsf-console/branches/jsf-console-3.2-soa: console/src/main/webapp/WEB-INF and 2 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-12-10 03:26:13 -0500 (Thu, 10 Dec 2009)
New Revision: 5939
Removed:
projects/jsf-console/branches/jsf-console-3.2-soa/gpd-deployer/src/main/java/org/jbpm/web/BootstrapListener.java
Modified:
projects/jsf-console/branches/jsf-console-3.2-soa/console/pom.xml
projects/jsf-console/branches/jsf-console-3.2-soa/console/src/main/webapp/WEB-INF/web.xml
projects/jsf-console/branches/jsf-console-3.2-soa/soa/src/main/webapp/WEB-INF/web.xml
Log:
JBPM-2678: correct soa overlay configuration
remove unused bootstrap listener
Modified: projects/jsf-console/branches/jsf-console-3.2-soa/console/pom.xml
===================================================================
--- projects/jsf-console/branches/jsf-console-3.2-soa/console/pom.xml 2009-12-10 04:36:26 UTC (rev 5938)
+++ projects/jsf-console/branches/jsf-console-3.2-soa/console/pom.xml 2009-12-10 08:26:13 UTC (rev 5939)
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- ====================================================================== -->
-<!-- jBPM: Workflow in Java -->
-<!-- -->
-<!-- Distributable under LGPL license. -->
-<!-- See terms of license at http://www.gnu.org. -->
-<!-- ====================================================================== -->
+ <!-- ====================================================================== -->
+ <!-- jBPM: Workflow in Java -->
+ <!-- -->
+ <!-- Distributable under LGPL license. -->
+ <!-- See terms of license at http://www.gnu.org. -->
+ <!-- ====================================================================== -->
-<!-- $Id$ -->
+ <!-- $Id$ -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
@@ -73,6 +73,15 @@
<configuration>
<classifier>soa</classifier>
<primaryArtifact>false</primaryArtifact>
+ <overlays>
+ <overlay>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>soa-webapp</artifactId>
+ </overlay>
+ <overlay>
+ <!-- empty groupId/artifactId means the current build -->
+ </overlay>
+ </overlays>
</configuration>
</plugin>
</plugins>
Modified: projects/jsf-console/branches/jsf-console-3.2-soa/console/src/main/webapp/WEB-INF/web.xml
===================================================================
--- projects/jsf-console/branches/jsf-console-3.2-soa/console/src/main/webapp/WEB-INF/web.xml 2009-12-10 04:36:26 UTC (rev 5938)
+++ projects/jsf-console/branches/jsf-console-3.2-soa/console/src/main/webapp/WEB-INF/web.xml 2009-12-10 08:26:13 UTC (rev 5939)
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
-<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<servlet>
- <description>
- Enable the JSF servlet. See faces-config.xml for Faces-specific configuration.
- </description>
+ <description>Enable the JSF servlet. See faces-config.xml for Faces-specific configuration.</description>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
@@ -41,7 +40,8 @@
</welcome-file-list>
<!--
- This role list should be changed to include all the relevant roles for your environment.
+ This role list should be changed to include all the relevant roles for your
+ environment.
-->
<security-role>
<role-name>admin</role-name>
@@ -51,9 +51,9 @@
</security-role>
<!--
- Security constraints - optionally customize the role name to require a login before access is
- allowed to the application. Also, be sure to edit jboss-web.xml to configure the security domain
- if you are deploying inside JBoss AS.
+ Security constraints - optionally customize the role name to require a login
+ before access is allowed. Also, be sure to edit jboss-web.xml to configure
+ the security domain if you are deploying inside JBoss AS.
-->
<security-constraint>
<web-resource-collection>
@@ -102,52 +102,33 @@
</listener>
<!== Job executor launcher -->
- <!-- Bootstrap listener ==>
<listener>
- <description>
- Builds the Hibernate session factory on initialization.
- This will create the database tables in new installations,
- provided the hibernate.hbm2ddl.auto property is set.
- </description>
- <listener-class>org.jbpm.web.BootstrapListener</listener-class>
- </listener>
- <!== Bootstrap listener -->
-
- <listener>
- <description>
- Closes the jBPM configuration on destruction, releasing resources.
+ <description>Closes the jBPM configuration on destruction, releasing resources.
This listener should appear after the job executor launcher,
- to avoid reopening the configuration.
- </description>
+ to avoid reopening the configuration.</description>
<listener-class>org.jbpm.web.JbpmConfigurationCloser</listener-class>
</listener>
<resource-ref>
- <description>
- Logical name of the data source that provides connections to the persistence service.
+ <description>Logical name of the data source that provides connections to the persistence service.
Must match the hibernate.connection.datasource property in the Hibernate
- configuration file.
- </description>
+ configuration file.</description>
<res-ref-name>jdbc/JbpmDataSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
- <description>
- Logical name of the factory that provides JMS connections to the message service.
- Required for processes that contain asynchronous continuations.
- </description>
+ <description>Logical name of the factory that provides JMS connections to the message service.
+ Required for processes that contain asynchronous continuations.</description>
<res-ref-name>jms/JbpmConnectionFactory</res-ref-name>
<res-type>javax.jms.ConnectionFactory</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<ejb-local-ref>
- <description>
- Link to the local entity bean that implements the scheduler service.
- Required for processes that contain timers.
- </description>
+ <description>Link to the local entity bean that implements the scheduler service.
+ Required for processes that contain timers.</description>
<ejb-ref-name>ejb/TimerEntityBean</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>org.jbpm.ejb.LocalTimerEntityHome</local-home>
@@ -155,11 +136,9 @@
</ejb-local-ref>
<message-destination-ref>
- <description>
- The message service sends job messages to the queue referenced here. To ensure
+ <description>The message service sends job messages to the queue referenced here. To ensure
this is the same queue from which the JobListenerBean receives messages, the
- message-destination-link element points to a common logical destination, JobQueue.
- </description>
+ message-destination-link element points to a common logical destination, JobQueue.</description>
<message-destination-ref-name>jms/JobQueue</message-destination-ref-name>
<message-destination-type>javax.jms.Queue</message-destination-type>
<message-destination-usage>Produces</message-destination-usage>
Deleted: projects/jsf-console/branches/jsf-console-3.2-soa/gpd-deployer/src/main/java/org/jbpm/web/BootstrapListener.java
===================================================================
--- projects/jsf-console/branches/jsf-console-3.2-soa/gpd-deployer/src/main/java/org/jbpm/web/BootstrapListener.java 2009-12-10 04:36:26 UTC (rev 5938)
+++ projects/jsf-console/branches/jsf-console-3.2-soa/gpd-deployer/src/main/java/org/jbpm/web/BootstrapListener.java 2009-12-10 08:26:13 UTC (rev 5939)
@@ -1,81 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.web;
-
-import org.jbpm.JbpmConfiguration;
-import org.jbpm.JbpmContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.servlet.ServletContextListener;
-import javax.servlet.ServletContextEvent;
-
-/**
- * Eagerly initializes the hibernate session factory.
- * <p>
- * Building the session factory in advance prevents the webapp from making a
- * noticeable pause upon the first login. This is particularly desirable in
- * applications configured to create the database schema on startup by setting
- * property <code>hibernate.hbm2ddl.auto</code> to <code>create</code>.
- * </p>
- * <h3>Configuration</h3> Servlet context initialization parameters
- * <table border="1">
- * <tr>
- * <th>Name</th>
- * <th>Description</th>
- * <th>Default value</th>
- * </tr>
- * <tr>
- * <td>jbpm.configuration.resource</td>
- * <td>name of classpath resource containing the configuration</td>
- * <td>jbpm.cfg.xml</td>
- * </tr>
- * </table>
- *
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class BootstrapListener implements ServletContextListener {
-
- private static final Log log = LogFactory.getLog(BootstrapListener.class);
-
- public void contextInitialized(ServletContextEvent event) {
- String jbpmCfgResource = event.getServletContext()
- .getInitParameter("jbpm.configuration.resource");
- JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance(jbpmCfgResource);
-
- JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
- try {
- log.info("bootstrap hibernate session factory");
- jbpmContext.getSessionFactory();
- }
- catch (RuntimeException e) {
- jbpmContext.setRollbackOnly();
- throw e;
- }
- finally {
- jbpmContext.close();
- }
- }
-
- public void contextDestroyed(ServletContextEvent servletContextEvent) {
- }
-}
Modified: projects/jsf-console/branches/jsf-console-3.2-soa/soa/src/main/webapp/WEB-INF/web.xml
===================================================================
--- projects/jsf-console/branches/jsf-console-3.2-soa/soa/src/main/webapp/WEB-INF/web.xml 2009-12-10 04:36:26 UTC (rev 5938)
+++ projects/jsf-console/branches/jsf-console-3.2-soa/soa/src/main/webapp/WEB-INF/web.xml 2009-12-10 08:26:13 UTC (rev 5939)
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
-<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<servlet>
- <description>
- Enable the JSF servlet. See faces-config.xml for Faces-specific configuration.
- </description>
+ <description>Enable the JSF servlet. See faces-config.xml for Faces-specific configuration.</description>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
@@ -41,7 +40,8 @@
</welcome-file-list>
<!--
- This role list should be changed to include all the relevant roles for your environment.
+ This role list should be changed to include all the relevant roles for your
+ environment.
-->
<security-role>
<role-name>admin</role-name>
@@ -51,9 +51,9 @@
</security-role>
<!--
- Security constraints - optionally customize the role name to require a login before access is
- allowed to the application. Also, be sure to edit jboss-web.xml to configure the security domain
- if you are deploying inside JBoss AS.
+ Security constraints - optionally customize the role name to require a login
+ before access is allowed. Also, be sure to edit jboss-web.xml to configure
+ the security domain if you are deploying inside JBoss AS.
-->
<security-constraint>
<web-resource-collection>
@@ -103,49 +103,32 @@
<!== Job executor launcher -->
<listener>
- <description>
- Builds the Hibernate session factory on initialization.
- This will create the database tables in new installations,
- provided the hibernate.hbm2ddl.auto property is set.
- </description>
- <listener-class>org.jbpm.web.BootstrapListener</listener-class>
- </listener>
-
- <listener>
- <description>
- Closes the jBPM configuration on destruction, releasing resources.
+ <description>Closes the jBPM configuration on destruction, releasing resources.
This listener should appear after the job executor launcher,
- to avoid reopening the configuration.
- </description>
+ to avoid reopening the configuration.</description>
<listener-class>org.jbpm.web.JbpmConfigurationCloser</listener-class>
</listener>
<resource-ref>
- <description>
- Logical name of the data source that provides connections to the persistence service.
+ <description>Logical name of the data source that provides connections to the persistence service.
Must match the hibernate.connection.datasource property in the Hibernate
- configuration file.
- </description>
+ configuration file.</description>
<res-ref-name>jdbc/JbpmDataSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
- <description>
- Logical name of the factory that provides JMS connections to the message service.
- Required for processes that contain asynchronous continuations.
- </description>
+ <description>Logical name of the factory that provides JMS connections to the message service.
+ Required for processes that contain asynchronous continuations.</description>
<res-ref-name>jms/JbpmConnectionFactory</res-ref-name>
<res-type>javax.jms.ConnectionFactory</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<ejb-local-ref>
- <description>
- Link to the local entity bean that implements the scheduler service.
- Required for processes that contain timers.
- </description>
+ <description>Link to the local entity bean that implements the scheduler service.
+ Required for processes that contain timers.</description>
<ejb-ref-name>ejb/TimerEntityBean</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>org.jbpm.ejb.LocalTimerEntityHome</local-home>
@@ -153,11 +136,9 @@
</ejb-local-ref>
<message-destination-ref>
- <description>
- The message service sends job messages to the queue referenced here. To ensure
+ <description>The message service sends job messages to the queue referenced here. To ensure
this is the same queue from which the JobListenerBean receives messages, the
- message-destination-link element points to a common logical destination, JobQueue.
- </description>
+ message-destination-link element points to a common logical destination, JobQueue.</description>
<message-destination-ref-name>jms/JobQueue</message-destination-ref-name>
<message-destination-type>javax.jms.Queue</message-destination-type>
<message-destination-usage>Produces</message-destination-usage>
16 years, 4 months
JBoss JBPM SVN: r5938 - in jbpm4/trunk: modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test and 12 other directories.
by do-not-reply@jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-12-09 23:36:26 -0500 (Wed, 09 Dec 2009)
New Revision: 5938
Added:
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/build.xml
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/ejb/
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/ejb/EjbTest.java
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/JmsTest.java
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/jbpm-test-destinations-service.xml
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/ejb/
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/ejb/process.jpdl.xml
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/map/
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/map/process.jpdl.xml
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/object/
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/object/process.jpdl.xml
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/text/
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/text/process.jpdl.xml
Removed:
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/EjbTest.java
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/JmsTest.java
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/jbpm-destinations-service.xml
Modified:
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.classpath
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/pom.xml
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/cactus.properties
jbpm4/trunk/qa/build.xml
jbpm4/trunk/qa/hudson-jbpm4-enterprise.bat
jbpm4/trunk/qa/hudson-jbpm4-enterprise.sh
Log:
setup of the enterprise test suite continued
Modified: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.classpath
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.classpath 2009-12-10 02:22:31 UTC (rev 5937)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.classpath 2009-12-10 04:36:26 UTC (rev 5938)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Added: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/build.xml
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/build.xml (rev 0)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/build.xml 2009-12-10 04:36:26 UTC (rev 5938)
@@ -0,0 +1,16 @@
+<project name="test" basedir=".">
+ <property name="deploy.dir" value="/Users/koen/Temp/jboss-5.0.0.GA/server/default/deploy/jbpm"/>
+ <target name="deploy-beans">
+ <mkdir dir="${deploy.dir}"/>
+ <jar destfile="jbpm-test-enterprise-ejb.jar" basedir="../test-enterprise-ejb/target/classes"/>
+ <copy file="src/test/resources/jbpm-destinations-service.xml" todir="${deploy.dir}"/>
+ <copy file="jbpm-test-enterprise-ejb.jar" todir="${deploy.dir}"/>
+ </target>
+ <target name="deploy-webapp">
+ <copy todir="stagedir/WEB-INF/classes">
+ <fileset dir="target/test-classes"/>
+ </copy>
+ <war destfile="jbpm-test-enterprise-suite.war" basedir="stagedir"/>
+ <copy file="jbpm-test-enterprise-suite.war" todir="${deploy.dir}"/>
+ </target>
+</project>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/build.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/pom.xml 2009-12-10 02:22:31 UTC (rev 5937)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/pom.xml 2009-12-10 04:36:26 UTC (rev 5938)
@@ -38,19 +38,82 @@
<artifactId>cactus.core</artifactId>
</dependency>
<dependency>
- <groupId>aspectj</groupId>
- <artifactId>aspectjrt</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1</version>
- </dependency>
- <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
+ <profiles>
+
+ <profile>
+ <id>enterprise</id>
+ <properties>
+ <skipTests>true</skipTests>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy.libs</id>
+ <phase>package</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>target/jbpm.test.webapp.libs</outputDirectory>
+ <artifactItems>
+ <artifactItem>
+ <groupId>aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ </artifactItem>
+ <artifactItem>
+ <groupId>cactus</groupId>
+ <artifactId>cactus.core</artifactId>
+ </artifactItem>
+ <artifactItem>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1</version>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>runtest</id>
+ <dependencies>
+ <dependency>
+ <groupId>apache-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>3.1</version>
+ </dependency>
+ <dependency>
+ <groupId>cactus</groupId>
+ <artifactId>cactus.core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ </profiles>
+
</project>
Deleted: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/EjbTest.java
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/EjbTest.java 2009-12-10 02:22:31 UTC (rev 5937)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/EjbTest.java 2009-12-10 04:36:26 UTC (rev 5938)
@@ -1,20 +0,0 @@
-package org.jbpm.test;
-
-import org.apache.cactus.ServletTestSuite;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-
-public class EjbTest extends TestCase {
-
- public static Test suite() {
- ServletTestSuite servletTestSuite = new ServletTestSuite();
- servletTestSuite.addTestSuite(EjbTest.class);
- return servletTestSuite;
- }
-
- public void testEjbInvocation() {
- throw new RuntimeException();
- }
-
-}
Deleted: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/JmsTest.java
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/JmsTest.java 2009-12-10 02:22:31 UTC (rev 5937)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/JmsTest.java 2009-12-10 04:36:26 UTC (rev 5938)
@@ -1,16 +0,0 @@
-package org.jbpm.test;
-
-import org.apache.cactus.ServletTestSuite;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-
-public class JmsTest extends TestCase {
-
- public static Test suite() {
- ServletTestSuite servletTestSuite = new ServletTestSuite();
- servletTestSuite.addTestSuite(JmsTest.class);
- return servletTestSuite;
- }
-
-}
Copied: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/ejb/EjbTest.java (from rev 5934, jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/EjbTest.java)
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/ejb/EjbTest.java (rev 0)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/ejb/EjbTest.java 2009-12-10 04:36:26 UTC (rev 5938)
@@ -0,0 +1,26 @@
+package org.jbpm.test.ejb;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+
+import org.apache.cactus.ServletTestSuite;
+import org.jbpm.test.enterprise.stateless.bean.Calculator;
+
+public class EjbTest extends TestCase {
+
+ public static Test suite() {
+ ServletTestSuite servletTestSuite = new ServletTestSuite();
+ servletTestSuite.addTestSuite(EjbTest.class);
+ return servletTestSuite;
+ }
+
+ public void testEjbInvocation() throws Exception {
+ Context context = new InitialContext();
+ Calculator calculator = (Calculator)context.lookup("CalculatorBean/local");
+ assertEquals(59, calculator.add(24, 35));
+ }
+
+}
Property changes on: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/ejb/EjbTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/JmsTest.java (from rev 5934, jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/JmsTest.java)
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/JmsTest.java (rev 0)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/JmsTest.java 2009-12-10 04:36:26 UTC (rev 5938)
@@ -0,0 +1,16 @@
+package org.jbpm.test.jms;
+
+import org.apache.cactus.ServletTestSuite;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+
+public class JmsTest extends TestCase {
+
+ public static Test suite() {
+ ServletTestSuite servletTestSuite = new ServletTestSuite();
+ servletTestSuite.addTestSuite(JmsTest.class);
+ return servletTestSuite;
+ }
+
+}
Property changes on: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/java/org/jbpm/test/jms/JmsTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/cactus.properties
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/cactus.properties 2009-12-10 02:22:31 UTC (rev 5937)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/cactus.properties 2009-12-10 04:36:26 UTC (rev 5938)
@@ -1 +1 @@
-cactus.contextURL=http://localhost:8080/jbpm-test-enterprise-suite
+cactus.contextURL=http://localhost:8080/jbpm-test-webapp
Deleted: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/jbpm-destinations-service.xml
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/jbpm-destinations-service.xml 2009-12-10 02:22:31 UTC (rev 5937)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/jbpm-destinations-service.xml 2009-12-10 04:36:26 UTC (rev 5938)
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.messaging.destination:service=Queue,name=jbpm-test"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
-</server>
\ No newline at end of file
Copied: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/jbpm-test-destinations-service.xml (from rev 5934, jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/jbpm-destinations-service.xml)
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/jbpm-test-destinations-service.xml (rev 0)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/jbpm-test-destinations-service.xml 2009-12-10 04:36:26 UTC (rev 5938)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=jbpm-test"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+</server>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/jbpm-test-destinations-service.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/ejb/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/ejb/process.jpdl.xml (rev 0)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/ejb/process.jpdl.xml 2009-12-10 04:36:26 UTC (rev 5938)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="EJB" xmlns="http://jbpm.org/4.3/jpdl">
+
+ <start g="20,20,48,48">
+ <transition to="calculate" />
+ </start>
+
+ <ejb name="calculate"
+ jndi="CalculatorBean"
+ method="add"
+ var="answer"
+ g="96,16,83,52">
+
+ <arg><int value="25"/></arg>
+ <arg><int value="38"/></arg>
+
+ <transition to="wait" />
+ </java>
+
+ <state name="wait" g="352,17,88,52"/>
+
+</process>
Property changes on: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/ejb/process.jpdl.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/map/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/map/process.jpdl.xml (rev 0)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/map/process.jpdl.xml 2009-12-10 04:36:26 UTC (rev 5938)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="JMS map" xmlns="http://jbpm.org/4.3/jpdl">
+
+ <start g="20,20,48,48">
+ <transition to="send message" />
+ </start>
+
+ <jms name="send message"
+ connectionFactory="ConnectionFactory"
+ destination="queue/test-jbpm"
+ g="96,16,83,52">
+ <message type="map">
+ <entry name="x" value="foo"/>
+ <entry name="y" value="bar"/>
+ </message>
+ <transition to="wait" />
+ </java>
+
+ <state name="wait" g="352,17,88,52"/>
+
+</process>
Property changes on: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/map/process.jpdl.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/object/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/object/process.jpdl.xml (rev 0)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/object/process.jpdl.xml 2009-12-10 04:36:26 UTC (rev 5938)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="JMS object" xmlns="http://jbpm.org/4.3/jpdl">
+
+ <start g="20,20,48,48">
+ <transition to="send message" />
+ </start>
+
+ <jms name="send message"
+ connectionFactory="ConnectionFactory"
+ destination="queue/test-jbpm"
+ g="96,16,83,52">
+ <message type="object">
+ ${object}
+ </message>
+ <transition to="wait" />
+ </java>
+
+ <state name="wait" g="352,17,88,52"/>
+
+</process>
Property changes on: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/object/process.jpdl.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/text/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/text/process.jpdl.xml (rev 0)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/text/process.jpdl.xml 2009-12-10 04:36:26 UTC (rev 5938)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="JMS text" xmlns="http://jbpm.org/4.3/jpdl">
+
+ <start g="20,20,48,48">
+ <transition to="send message" />
+ </start>
+
+ <jms name="send message"
+ connectionFactory="ConnectionFactory"
+ destination="queue/test-jbpm"
+ g="96,16,83,52">
+ <message type="text">
+ This is the body
+ </message>
+ <transition to="wait" />
+ </java>
+
+ <state name="wait" g="352,17,88,52"/>
+
+</process>
Property changes on: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/src/test/resources/org/jbpm/test/jms/text/process.jpdl.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/qa/build.xml
===================================================================
--- jbpm4/trunk/qa/build.xml 2009-12-10 02:22:31 UTC (rev 5937)
+++ jbpm4/trunk/qa/build.xml 2009-12-10 04:36:26 UTC (rev 5938)
@@ -176,8 +176,8 @@
<ant antfile="${jbpm.home}/install/build.xml" target="create.jbpm.schema" />
<!-- to build the jbpm test webapp we start by copying the user webapp -->
- <mkdir dir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war" />
- <copy todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war">
+ <mkdir dir="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war" />
+ <copy todir="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war">
<fileset dir="${jbpm.home}/install/generated/user-webapp"/>
</copy>
@@ -187,30 +187,38 @@
</copy>
<!-- customize the configuration for the jbpm-test-webapp -->
- <copy todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war" overwrite="true">
+ <copy todir="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war" overwrite="true">
<fileset dir="cactus.webapp.cfg" />
</copy>
<!-- delete the jbpm configuration files -->
- <delete dir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/classes" />
- <delete file="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib/jta.jar" />
+ <delete dir="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war/WEB-INF/classes" />
+ <delete file="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war/WEB-INF/lib/jta.jar" />
<!-- copy the test classes to the test web app -->
<copy file="../modules/test-enterprise/test-enterprise-suite/target/jbpm-test-enterprise-suite-${jbpm.version}.jar"
- todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib" />
+ todir="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war/WEB-INF/lib" />
<!-- add junit.jar -->
<copy file="${jbpm.home}/lib/junit.jar"
- todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib" />
+ todir="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war/WEB-INF/lib" />
<!-- add the cactus libs -->
- <copy todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib">
- <fileset dir="../modules/test-cactus/target/jbpm.test.webapp.libs" />
+ <copy todir="${jboss.home}/server/default/deploy/jbpm-test/jbpm-test-webapp.war/WEB-INF/lib">
+ <fileset dir="../modules/test-enterprise/test-enterprise-suite/target/jbpm.test.webapp.libs" />
</copy>
+
+ <!-- create the test queue -->
+ <copy file="../modules/test-enterprise/test-enterprise-suite/src/test/resources/jbpm-test-destinations-service.xml"
+ todir="${jboss.home}/server/default/deploy/jbpm-test" />
+
+ <!-- deploy the test ejbs -->
+ <copy file="../modules/test-enterprise/test-enterprise-ejb/target/jbpm-test-enterprise-ejb-${jbpm.version}.jar"
+ todir="${jboss.home}/server/default/deploy/jbpm-test"/>
- <!-- start jboss
+ <!-- start jboss -->
<ant antfile="${jbpm.home}/install/build.xml" target="start.jboss" />
- -->
+
</target>
Modified: jbpm4/trunk/qa/hudson-jbpm4-enterprise.bat
===================================================================
--- jbpm4/trunk/qa/hudson-jbpm4-enterprise.bat 2009-12-10 02:22:31 UTC (rev 5937)
+++ jbpm4/trunk/qa/hudson-jbpm4-enterprise.bat 2009-12-10 04:36:26 UTC (rev 5938)
@@ -8,7 +8,7 @@
cmd /C mvn -U -Pdistro,enterprise clean install
cmd /C ant -f qa/build.xml %ANT_PROPERTIES% testsuite.enterprise.setup
-rem cd modules/test-enterprise-suite
+rem cd modules/test-enterprise/test-enterprise-suite
rem mvn -Pruntest test
rem cd ../..
Modified: jbpm4/trunk/qa/hudson-jbpm4-enterprise.sh
===================================================================
--- jbpm4/trunk/qa/hudson-jbpm4-enterprise.sh 2009-12-10 02:22:31 UTC (rev 5937)
+++ jbpm4/trunk/qa/hudson-jbpm4-enterprise.sh 2009-12-10 04:36:26 UTC (rev 5938)
@@ -6,15 +6,11 @@
ANT_PROPERTIES="-Djboss.version=$JBOSS_VERSION -Djbpm.parent.dir=$WORKSPACE -Djboss.distro.dir=$SOURCE_REPO/jboss"
echo ANT_PROPERTIES=${ANT_PROPERTIES}
-#echo just in case the previous run didnt complete ok, we stop jboss
-#ant -f modules/distro/src/main/files/install/build.xml $ANT_PROPERTIES reinstall.jboss
-#ant -f modules/distro/src/main/files/install/build.xml $ANT_PROPERTIES stop.jboss
-
-mvn -U -Pdistro,integration clean install
+mvn -U -Pdistro,enterprise clean install
ant -f qa/build.xml $ANT_PROPERTIES testsuite.enterprise.setup
-cd modules/test-enterprise-suite
-mvn -Pruntest test
-cd ../..
+#cd modules/test-enterprise/test-enterprise-suite
+#mvn -Pruntest test
+#cd ../../..
#ant -f qa/build.xml $ANT_PROPERTIES testsuite.enterprise.teardown
16 years, 4 months
JBoss JBPM SVN: r5937 - projects/jsf-console/branches/jsf-console-3.2-soa/soa/src/main/webapp/WEB-INF.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-12-09 21:22:31 -0500 (Wed, 09 Dec 2009)
New Revision: 5937
Modified:
projects/jsf-console/branches/jsf-console-3.2-soa/soa/src/main/webapp/WEB-INF/web.xml
Log:
JBPM-2678: port jsf-console changes to soa overlay
Modified: projects/jsf-console/branches/jsf-console-3.2-soa/soa/src/main/webapp/WEB-INF/web.xml
===================================================================
--- projects/jsf-console/branches/jsf-console-3.2-soa/soa/src/main/webapp/WEB-INF/web.xml 2009-12-09 15:01:23 UTC (rev 5936)
+++ projects/jsf-console/branches/jsf-console-3.2-soa/soa/src/main/webapp/WEB-INF/web.xml 2009-12-10 02:22:31 UTC (rev 5937)
@@ -24,13 +24,13 @@
</servlet-mapping>
<context-param>
- <description> Use Documents Saved as *.xhtml </description>
+ <description>Use Documents Saved as *.xhtml</description>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<context-param>
- <description> Facelets debug output </description>
+ <description>Facelets debug output</description>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>false</param-value>
</context-param>
@@ -40,25 +40,6 @@
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
- <servlet>
- <description>
- Server counterpart for the Graphical Process Designer deployment feature.
- GPD WARNING. The SOA distribution of jBPM is tuned for production deployment
- and maps this servlet to a URL pattern in the secured area. In consequence,
- the upload servlet is no longer able to accept GPD deployment requests,
- as GPD does not support authentication.
- To reenable GPD deployment, map the servlet to the path expected by the GPD,
- namely "/upload/*".
- </description>
- <servlet-name>GPD Deployer Servlet</servlet-name>
- <servlet-class>org.jbpm.web.ProcessUploadServlet</servlet-class>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>GPD Deployer Servlet</servlet-name>
- <url-pattern>/app/upload/*</url-pattern>
- </servlet-mapping>
-
<!--
This role list should be changed to include all the relevant roles for your environment.
-->
16 years, 4 months
JBoss JBPM SVN: r5936 - in jbpm4/trunk: qa and 1 other directory.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-12-09 10:01:23 -0500 (Wed, 09 Dec 2009)
New Revision: 5936
Added:
jbpm4/trunk/qa/hudson-jbpm4-enterprise.bat
Modified:
jbpm4/trunk/pom.xml
jbpm4/trunk/qa/build.xml
Log:
enterprise test suite enhancements
Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml 2009-12-09 03:22:10 UTC (rev 5935)
+++ jbpm4/trunk/pom.xml 2009-12-09 15:01:23 UTC (rev 5936)
@@ -145,6 +145,11 @@
</dependency>
<dependency>
<groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-test-enterprise-ejb</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-spi</artifactId>
<version>${version}</version>
</dependency>
@@ -701,6 +706,15 @@
</modules>
</profile>
+ <!-- PROFILE ENTERPRISE -->
+ <profile>
+ <id>enterprise</id>
+ <modules>
+ <module>modules/test-enterprise/test-enterprise-ejb</module>
+ <module>modules/test-enterprise/test-enterprise-suite</module>
+ </modules>
+ </profile>
+
<!-- PROFILE LOAD -->
<profile>
<id>load</id>
Modified: jbpm4/trunk/qa/build.xml
===================================================================
--- jbpm4/trunk/qa/build.xml 2009-12-09 03:22:10 UTC (rev 5935)
+++ jbpm4/trunk/qa/build.xml 2009-12-09 15:01:23 UTC (rev 5936)
@@ -44,9 +44,9 @@
<!-- ####################################### -->
- <!-- ### MAIN SETUP AND TEARDOWN TARGETS ### -->
+ <!-- ### MAIN SETUP AND TEARDOWN TARGETS ### -->
<!-- ####################################### -->
-
+
<!-- DB SETUP -->
<target name="testsuite.db.setup"
depends="reinstall.jbpm">
@@ -61,16 +61,16 @@
<!-- TOMCAT SETUP -->
<target name="testsuite.tomcat.setup"
- depends="reinstall.jbpm">
+ depends="reinstall.jbpm">
<ant antfile="${jbpm.home}/install/build.xml" target="reinstall.tomcat" />
<ant antfile="${jbpm.home}/install/build.xml" target="create.user.webapp" />
<ant antfile="${jbpm.home}/install/build.xml" target="internal.install.and.start.hsqldb.if.needed" />
<ant antfile="${jbpm.home}/install/build.xml" target="create.jbpm.schema" />
- <!-- to build the jbpm test webapp we start by copying the user webapp -->
- <mkdir dir="${tomcat.home}/webapps/jbpm-test-webapp" />
+ <!-- to build the jbpm test webapp we start by copying the user webapp -->
+ <mkdir dir="${tomcat.home}/webapps/jbpm-test-webapp" />
<copy todir="${tomcat.home}/webapps/jbpm-test-webapp">
- <fileset dir="${jbpm.home}/install/generated/user-webapp"/>
+ <fileset dir="${jbpm.home}/install/generated/user-webapp"/>
</copy>
<!-- customize the configuration for the jbpm-test-webapp -->
@@ -78,14 +78,14 @@
<fileset dir="cactus.webapp.cfg" />
</copy>
- <!-- add examples.jar -->
- <ant antfile="${jbpm.home}/examples/build.xml" target="examples.jar" />
+ <!-- add examples.jar -->
+ <ant antfile="${jbpm.home}/examples/build.xml" target="examples.jar" />
<copy file="${jbpm.home}/examples/target/examples.jar" todir="${tomcat.home}/webapps/jbpm-test-webapp/WEB-INF/lib" />
<!-- add junit.jar -->
<copy file="${jbpm.home}/lib/junit.jar" todir="${tomcat.home}/webapps/jbpm-test-webapp/WEB-INF/lib" />
- <!-- add the cactus libs -->
+ <!-- add the cactus libs -->
<copy todir="${tomcat.home}/webapps/jbpm-test-webapp/WEB-INF/lib">
<fileset dir="../modules/test-cactus/target/jbpm.test.webapp.libs" />
</copy>
@@ -95,14 +95,14 @@
<!-- start tomcat -->
<ant antfile="${jbpm.home}/install/build.xml" target="start.tomcat" />
- </target>
+ </target>
<!-- TOMCAT TEARDOWN -->
<target name="testsuite.tomcat.teardown">
<ant antfile="${jbpm.home}/install/build.xml" target="stop.tomcat" />
<ant antfile="${jbpm.home}/install/build.xml" target="drop.jbpm.schema" />
<ant antfile="${jbpm.home}/install/build.xml" target="internal.stop.hsqldb.server.if.needed" />
- </target>
+ </target>
<!-- JBOSS SETUP -->
<target name="testsuite.jboss.setup"
@@ -112,7 +112,7 @@
<ant antfile="${jbpm.home}/install/build.xml" target="install.jbpm.into.jboss" />
<ant antfile="${jbpm.home}/install/build.xml" target="create.user.webapp" />
- <ant antfile="${jbpm.home}/install/build.xml" target="internal.install.and.start.hsqldb.if.needed" />
+ <ant antfile="${jbpm.home}/install/build.xml" target="internal.install.and.start.hsqldb.if.needed" />
<ant antfile="${jbpm.home}/install/build.xml" target="create.jbpm.schema" />
<ant antfile="${jbpm.home}/examples/build.xml" target="examples.jar" />
@@ -135,9 +135,9 @@
<copy todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war" overwrite="true">
<fileset dir="cactus.webapp.cfg" />
</copy>
-
- <!-- delete the jbpm configuration files -->
- <delete dir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/classes" />
+
+ <!-- delete the jbpm configuration files -->
+ <delete dir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/classes" />
<delete file="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib/jta.jar" />
<!-- add examples.jar -->
@@ -163,83 +163,80 @@
<ant antfile="${jbpm.home}/install/build.xml" target="drop.jbpm.schema" />
<ant antfile="${jbpm.home}/install/build.xml" target="internal.stop.hsqldb.server.if.needed" />
</target>
-
+
<!-- ENTERPRISE SETUP -->
<target name="testsuite.enterprise.setup"
- depends="reinstall.jbpm"
- description="reinstalls jbpm, reinstalls jboss, installs jbpm into jboss, starts jboss and then creates the jbpm schema">
+ depends="reinstall.jbpm"
+ description="reinstalls jbpm, reinstalls jboss, installs jbpm into jboss, starts jboss and then creates the jbpm schema">
<ant antfile="${jbpm.home}/install/build.xml" target="reinstall.jboss" />
- <ant antfile="${jbpm.home}/install/build.xml" target="install.jbpm.into.jboss" />
- <ant antfile="${jbpm.home}/install/build.xml" target="create.user.webapp" />
+ <ant antfile="${jbpm.home}/install/build.xml" target="install.jbpm.into.jboss" />
+ <ant antfile="${jbpm.home}/install/build.xml" target="create.user.webapp" />
- <ant antfile="${jbpm.home}/install/build.xml" target="internal.install.and.start.hsqldb.if.needed" />
- <ant antfile="${jbpm.home}/install/build.xml" target="create.jbpm.schema" />
+ <ant antfile="${jbpm.home}/install/build.xml" target="internal.install.and.start.hsqldb.if.needed" />
+ <ant antfile="${jbpm.home}/install/build.xml" target="create.jbpm.schema" />
- <ant antfile="${jbpm.home}/examples/build.xml" target="examples.jar" />
- <mkdir dir="${jboss.server.config.dir}/deploy/jbpm/userlibs" />
- <copy file="${jbpm.home}/examples/target/examples.jar"
- todir="${jboss.server.config.dir}/deploy/jbpm/userlibs" />
+ <!-- to build the jbpm test webapp we start by copying the user webapp -->
+ <mkdir dir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war" />
+ <copy todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war">
+ <fileset dir="${jbpm.home}/install/generated/user-webapp"/>
+ </copy>
- <!-- to build the jbpm test webapp we start by copying the user webapp -->
- <mkdir dir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war" />
- <copy todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war">
- <fileset dir="${jbpm.home}/install/generated/user-webapp"/>
- </copy>
+ <!-- customize the jbpm configuration for the testsuite -->
+ <copy todir="${jboss.home}/server/default/deploy/jbpm/jbpm-service.sar" overwrite="true">
+ <fileset dir="jboss.jbpm.cfg" />
+ </copy>
- <!-- customize the jbpm configuration for the testsuite -->
- <copy todir="${jboss.home}/server/default/deploy/jbpm/jbpm-service.sar" overwrite="true">
- <fileset dir="jboss.jbpm.cfg" />
- </copy>
-
- <!-- customize the configuration for the jbpm-test-webapp -->
- <copy todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war" overwrite="true">
- <fileset dir="cactus.webapp.cfg" />
- </copy>
-
+ <!-- customize the configuration for the jbpm-test-webapp -->
+ <copy todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war" overwrite="true">
+ <fileset dir="cactus.webapp.cfg" />
+ </copy>
+
<!-- delete the jbpm configuration files -->
- <delete dir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/classes" />
- <delete file="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib/jta.jar" />
+ <delete dir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/classes" />
+ <delete file="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib/jta.jar" />
- <!-- add examples.jar -->
- <ant antfile="${jbpm.home}/examples/build.xml" target="examples.jar" />
- <copy file="${jbpm.home}/examples/target/examples.jar" todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib" />
-
- <!-- add junit.jar -->
- <copy file="${jbpm.home}/lib/junit.jar" todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib" />
+ <!-- copy the test classes to the test web app -->
+ <copy file="../modules/test-enterprise/test-enterprise-suite/target/jbpm-test-enterprise-suite-${jbpm.version}.jar"
+ todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib" />
+
+ <!-- add junit.jar -->
+ <copy file="${jbpm.home}/lib/junit.jar"
+ todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib" />
- <!-- add the cactus libs -->
- <copy todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib">
- <fileset dir="../modules/test-cactus/target/jbpm.test.webapp.libs" />
- </copy>
+ <!-- add the cactus libs -->
+ <copy todir="${jboss.home}/server/default/deploy/jbpm-test-webapp.war/WEB-INF/lib">
+ <fileset dir="../modules/test-cactus/target/jbpm.test.webapp.libs" />
+ </copy>
- <!-- start jboss -->
- <ant antfile="${jbpm.home}/install/build.xml" target="start.jboss" />
+ <!-- start jboss
+ <ant antfile="${jbpm.home}/install/build.xml" target="start.jboss" />
+ -->
</target>
-
+
<!-- ENTERPRISE TEARDOWN -->
<target name="testsuite.enterprise.teardown"
- description="drops the jbpm schema and stops jboss">
+ description="drops the jbpm schema and stops jboss">
<ant antfile="${jbpm.home}/install/build.xml" target="stop.jboss" />
- <ant antfile="${jbpm.home}/install/build.xml" target="drop.jbpm.schema" />
- <ant antfile="${jbpm.home}/install/build.xml" target="internal.stop.hsqldb.server.if.needed" />
+ <ant antfile="${jbpm.home}/install/build.xml" target="drop.jbpm.schema" />
+ <ant antfile="${jbpm.home}/install/build.xml" target="internal.stop.hsqldb.server.if.needed" />
</target>
-
-
+
+
<!-- ################ -->
<!-- ### UPGRADE ### -->
<!-- ################ -->
<property name="old.jbpm.home" value="${jbpm.parent.dir}/jbpm-${old.jbpm.version}" />
<target name="testsuite.upgrade.setup" depends="reinstall.jbpm">
<fail message="old.jbpm.version is a mandatory property" unless="old.jbpm.version" />
- <!-- install old jbpm version -->
+ <!-- install old jbpm version -->
<delete dir="${old.jbpm.home}" />
<unzip src="upgrade/target/jbpm-distro-${old.jbpm.version}.jar" dest="${jbpm.parent.dir}" />
<!-- copy the oracle driver jar -->
- <antcall target="copy.oracle.driver" />
+ <antcall target="copy.oracle.driver" />
<!-- create jdbc properties files for PVM2 based on the originals -->
<delete dir="upgrade/target/jdbc" />
- <mkdir dir="upgrade/target/jdbc" />
+ <mkdir dir="upgrade/target/jdbc" />
<copy todir="upgrade/target/jdbc">
<fileset dir="jdbc" />
</copy>
@@ -251,18 +248,18 @@
<copy todir="upgrade/target/jdbc" overwrite="true" failonerror="false">
<fileset dir="${user.home}/.jbpm4/jdbc" />
</copy>
- <!-- install the jbpm-test-upgrade lib -->
+ <!-- install the jbpm-test-upgrade lib -->
<delete dir="upgrade/target/jbpm-test-upgrade" />
<mkdir dir="upgrade/target/jbpm-test-upgrade" />
<unzip dest="upgrade/target/jbpm-test-upgrade" src="upgrade/target/jbpm-test-upgrade.jar" />
- <delete file="upgrade/target/jbpm-test-upgrade/hibernate.properties" />
+ <delete file="upgrade/target/jbpm-test-upgrade/hibernate.properties" />
<!-- create jbpm schema using the old jbpm distro -->
<condition property="is.old.jbpm.40">
<equals arg1="${old.jbpm.version}" arg2="4.0" />
</condition>
<antcall target="create.jbpm.schema.in.jbpm.40" />
<antcall target="create.jbpm.schema.in.jbpm.41plus" />
- <!-- start couple of processes using the old jbpm version -->
+ <!-- start couple of processes using the old jbpm version -->
<copy todir="upgrade/target/jbpm-test-upgrade" overwrite="true">
<fileset dir="upgrade/cfg" />
</copy>
@@ -277,15 +274,15 @@
</fileset>
</classpath>
</java>
- <!-- upgrade -->
+ <!-- upgrade -->
<copy todir="${jbpm.home}/install/jdbc" overwrite="true">
<fileset dir="upgrade/target/jdbc" />
</copy>
- <ant antfile="${jbpm.home}/install/build.xml" target="upgrade.jbpm.schema" inheritall="false">
- <property name="database" value="${database}" />
+ <ant antfile="${jbpm.home}/install/build.xml" target="upgrade.jbpm.schema" inheritall="false">
+ <property name="database" value="${database}" />
<property name="tx" value="standalone.testsuite" />
<!--property name="logging" value="debug" /-->
- </ant>
+ </ant>
</target>
<target name="copy.oracle.driver" if="is.oracle">
@@ -295,19 +292,19 @@
<target name="start.hsqldb" if="is.hsqldb">
<delete dir="upgrade/target/hsqldb" />
- <mkdir dir="upgrade/target/hsqldb" />
- <java classname="org.hsqldb.Server" dir="upgrade/target/hsqldb" fork="true">
- <arg line="-address localhost -port 1701 -dbname.0 jbpmDatabase" />
- <classpath>
+ <mkdir dir="upgrade/target/hsqldb" />
+ <java classname="org.hsqldb.Server" dir="upgrade/target/hsqldb" fork="true">
+ <arg line="-address localhost -port 1701 -dbname.0 jbpmDatabase" />
+ <classpath>
<fileset dir="upgrade/target">
<include name="hsqldb.jar"/>
</fileset>
- </classpath>
- </java>
+ </classpath>
+ </java>
</target>
-
+
<target name="stop.hsqldb" if="is.hsqldb">
- <property file="upgrade/target/jdbc/${database}.properties" />
+ <property file="upgrade/target/jdbc/${database}.properties" />
<path id="hsqldb.classpath">
<fileset dir="upgrade/target">
<include name="hsqldb.jar"/>
@@ -317,9 +314,9 @@
password="${jdbc.password}"
url="${jdbc.url}"
userid="${jdbc.username}"
- onerror="continue"
- autocommit="true"
- classpathref="hsqldb.classpath">SHUTDOWN</sql>
+ onerror="continue"
+ autocommit="true"
+ classpathref="hsqldb.classpath">SHUTDOWN</sql>
</target>
<target name="create.jbpm.schema.in.jbpm.40" if="is.old.jbpm.40">
@@ -328,22 +325,22 @@
<copy todir="${old.jbpm.home}/db/jdbc">
<fileset dir="upgrade/target/jdbc" />
</copy>
- <replace file="upgrade/target/jbpm-test-upgrade/jbpm.cfg.xml">
- <replacetoken><![CDATA[<import resource="jbpm.businesscalendar.cfg.xml" />]]></replacetoken>
- <replacevalue></replacevalue>
- </replace>
- <ant antfile="${old.jbpm.home}/db/build.xml" target="create.jbpm.schema" inheritall="false">
- <property name="database" value="${database}" />
- </ant>
+ <replace file="upgrade/target/jbpm-test-upgrade/jbpm.cfg.xml">
+ <replacetoken><![CDATA[<import resource="jbpm.businesscalendar.cfg.xml" />]]></replacetoken>
+ <replacevalue></replacevalue>
+ </replace>
+ <ant antfile="${old.jbpm.home}/db/build.xml" target="create.jbpm.schema" inheritall="false">
+ <property name="database" value="${database}" />
+ </ant>
<copy file="${old.jbpm.home}/db/hibernate.cfg/${database}.hibernate.cfg.xml"
- tofile="upgrade/target/jbpm-test-upgrade/jbpm.hibernate.cfg.xml"
- overwrite="true">
- <filterset filtersfile="upgrade/target/jdbc/${database}.properties" />
+ tofile="upgrade/target/jbpm-test-upgrade/jbpm.hibernate.cfg.xml"
+ overwrite="true">
+ <filterset filtersfile="upgrade/target/jdbc/${database}.properties" />
</copy>
</target>
<target name="create.jbpm.schema.in.jbpm.41plus" unless="is.old.jbpm.40">
- <echo message="creating schema in jbpm 4.1+" />
+ <echo message="creating schema in jbpm 4.1+" />
<!-- copy the PVM2 jdbc properties files in the old jbpm distro -->
<copy todir="${old.jbpm.home}/install/jdbc">
<fileset dir="upgrade/target/jdbc" />
@@ -360,7 +357,7 @@
<target name="testsuite.upgrade.teardown">
<ant antfile="${jbpm.home}/install/build.xml" target="drop.jbpm.schema" inheritall="false" />
- <antcall target="stop.hsqldb" />
+ <antcall target="stop.hsqldb" />
</target>
<!-- ############################################ -->
Added: jbpm4/trunk/qa/hudson-jbpm4-enterprise.bat
===================================================================
--- jbpm4/trunk/qa/hudson-jbpm4-enterprise.bat (rev 0)
+++ jbpm4/trunk/qa/hudson-jbpm4-enterprise.bat 2009-12-09 15:01:23 UTC (rev 5936)
@@ -0,0 +1,15 @@
+@echo off
+rem runs the jboss integration test suite
+
+set MAVEN_OPTS=-Xms1024m -Xmx1024m
+set ANT_PROPERTIES="-Djboss.version=5.1.0.GA"
+echo ANT_PROPERTIES=%ANT_PROPERTIES%
+
+cmd /C mvn -U -Pdistro,enterprise clean install
+cmd /C ant -f qa/build.xml %ANT_PROPERTIES% testsuite.enterprise.setup
+
+rem cd modules/test-enterprise-suite
+rem mvn -Pruntest test
+rem cd ../..
+
+rem ant -f qa/build.xml %ANT_PROPERTIES% testsuite.enterprise.teardown
16 years, 4 months
JBoss JBPM SVN: r5935 - in jbpm4/trunk/modules/test-enterprise: test-enterprise-suite and 1 other directories.
by do-not-reply@jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-12-08 22:22:10 -0500 (Tue, 08 Dec 2009)
New Revision: 5935
Added:
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.classpath
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.project
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.settings/
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.settings/org.eclipse.jdt.core.prefs
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.settings/org.maven.ide.eclipse.prefs
Modified:
jbpm4/trunk/modules/test-enterprise/test-enterprise-ejb/
jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/
Log:
initial upload of the jbpm-test-enterprise-suite module
Property changes on: jbpm4/trunk/modules/test-enterprise/test-enterprise-ejb
___________________________________________________________________
Name: svn:ignore
+ target
Property changes on: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite
___________________________________________________________________
Name: svn:ignore
+ target
Added: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.classpath
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.classpath (rev 0)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.classpath 2009-12-09 03:22:10 UTC (rev 5935)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Property changes on: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.project
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.project (rev 0)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.project 2009-12-09 03:22:10 UTC (rev 5935)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jbpm-test-enterprise-suite</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Property changes on: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.settings/org.eclipse.jdt.core.prefs 2009-12-09 03:22:10 UTC (rev 5935)
@@ -0,0 +1,5 @@
+#Tue Dec 08 20:19:26 EST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.source=1.5
Property changes on: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.settings/org.maven.ide.eclipse.prefs 2009-12-09 03:22:10 UTC (rev 5935)
@@ -0,0 +1,9 @@
+#Tue Dec 08 20:19:22 EST 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=true
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
Property changes on: jbpm4/trunk/modules/test-enterprise/test-enterprise-suite/.settings/org.maven.ide.eclipse.prefs
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 4 months