[jbpm-commits] JBoss JBPM SVN: r3442 - in jbpm4/trunk: modules/api/src/main/resources and 5 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Fri Dec 19 05:21:29 EST 2008
Author: tom.baeyens at jboss.com
Date: 2008-12-19 05:21:29 -0500 (Fri, 19 Dec 2008)
New Revision: 3442
Added:
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/script/expression/
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/script/expression/ScriptExpressionTest.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/script/expression/process.jpdl.xml
Modified:
jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
jbpm4/trunk/modules/jpdl/pom.xml
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ScriptBinding.java
jbpm4/trunk/pom.xml
Log:
added script expression test and esb dependencies
Modified: jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
===================================================================
--- jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd 2008-12-19 09:20:00 UTC (rev 3441)
+++ jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd 2008-12-19 10:21:29 UTC (rev 3442)
@@ -343,7 +343,7 @@
<complexType name="scriptType">
<sequence>
- <element name="text" type="string">
+ <element name="text" type="string" minOccurs="0">
<annotation><documentation>The content of this expression element
is the script text that will be evaluated. This is mutually
exclusive with the expression attribute.</documentation></annotation>
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/script/expression/ScriptExpressionTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/script/expression/ScriptExpressionTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/script/expression/ScriptExpressionTest.java 2008-12-19 10:21:29 UTC (rev 3442)
@@ -0,0 +1,50 @@
+/*
+ * 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.script.expression;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jbpm.Execution;
+import org.jbpm.examples.script.text.Person;
+import org.jbpm.test.DbTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ScriptExpressionTest extends DbTestCase {
+
+ public void testScriptText() {
+ deployJpdlResource("org/jbpm/examples/script/expression/process.jpdl.xml");
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("person", new Person("Honolulu"));
+
+ Execution execution = executionService.startExecutionByKey("ScriptExpression", variables);
+ String executionId = execution.getId();
+
+ String text = (String) executionService.getVariable(executionId, "text");
+ assertTextPresent("Send packet to Honolulu", text);
+ }
+
+}
Property changes on: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/script/expression/ScriptExpressionTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/script/expression/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/script/expression/process.jpdl.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/script/expression/process.jpdl.xml 2008-12-19 10:21:29 UTC (rev 3442)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="ScriptExpression" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="invoke script" />
+ </start>
+
+ <script name="invoke script"
+ expr="Send packet to #{person.address}"
+ var="text">
+
+ <flow to="wait" />
+ </script>
+
+ <state name="wait" />
+
+</process>
Property changes on: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/script/expression/process.jpdl.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/jpdl/pom.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/pom.xml 2008-12-19 09:20:00 UTC (rev 3441)
+++ jbpm4/trunk/modules/jpdl/pom.xml 2008-12-19 10:21:29 UTC (rev 3442)
@@ -44,6 +44,14 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm4.dependencies.esb</groupId>
+ <artifactId>jbossesb-rosetta</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm4.dependencies.esb</groupId>
+ <artifactId>test-util</artifactId>
+ </dependency>
</dependencies>
<!-- Plugins -->
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ScriptBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ScriptBinding.java 2008-12-19 09:20:00 UTC (rev 3441)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ScriptBinding.java 2008-12-19 10:21:29 UTC (rev 3442)
@@ -41,12 +41,11 @@
}
public Object parse(Element element, Parse parse, Parser parser) {
- String script = null;
String language = null;
- String expr = XmlUtil.attribute(element, "expr");
+ String script = XmlUtil.attribute(element, "expr");
Element textElement = XmlUtil.element(element, "text");
- if(expr!=null) {
+ if(script!=null) {
ScriptManager scriptManager = Environment.getFromCurrent(ScriptManager.class);
language = scriptManager.getDefaultExpressionLanguage();
if (textElement!=null) {
Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml 2008-12-19 09:20:00 UTC (rev 3441)
+++ jbpm4/trunk/pom.xml 2008-12-19 10:21:29 UTC (rev 3442)
@@ -49,6 +49,7 @@
<hibernate.version>3.2.6.ga</hibernate.version>
<hsqldb.version>1.8.0.7</hsqldb.version>
<jboss.j2ee.version>4.2.1.GA</jboss.j2ee.version>
+ <jbossesb.version>4.4.0.GA</jbossesb.version>
<jsr233.version>2.0.3</jsr233.version>
<juel.version>2.1.0</juel.version>
<log4j.version>1.2.14</log4j.version>
@@ -56,12 +57,9 @@
<servlet-api.version>2.5</servlet-api.version>
<cactus.version>13-1.7.1</cactus.version>
<junit.version>3.8.1</junit.version>
-
+ <stax.api.version>1.0.1</stax.api.version>
<!--
<cactus.version>13-1.7.1</cactus.version>
- <jboss.seam.version>2.0.1.GA</jboss.seam.version>
- <clover.version>2.3.1</clover.version>
- <slf4j.version>1.5.3</slf4j.version>
-->
</properties>
@@ -111,6 +109,16 @@
<version>${jboss.j2ee.version}</version>
</dependency>
<dependency>
+ <groupId>org.jbpm.jbpm4.dependencies.esb</groupId>
+ <artifactId>jbossesb-rosetta</artifactId>
+ <version>${jbossesb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm4.dependencies.esb</groupId>
+ <artifactId>test-util</artifactId>
+ <version>${jbossesb.version}</version>
+ </dependency>
+ <dependency>
<groupId>juel</groupId>
<artifactId>juel</artifactId>
<version>${juel.version}</version>
More information about the jbpm-commits
mailing list