[jbpm-commits] JBoss JBPM SVN: r3476 - in jbpm4/trunk: modules/api/src/main/resources and 13 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Sat Dec 20 05:10:16 EST 2008
Author: tom.baeyens at jboss.com
Date: 2008-12-20 05:10:16 -0500 (Sat, 20 Dec 2008)
New Revision: 3476
Added:
jbpm4/trunk/modules/db/.classpath
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/EsbTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/JbpmMockCourier.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/esb/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/esb/process.jpdl.xml
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EsbActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EsbBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionEvaluator.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ExpressionDescriptor.java
Removed:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionCondition.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ExpressionConditionDescriptor.java
Modified:
jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
jbpm4/trunk/modules/db/pom.xml
jbpm4/trunk/modules/examples/.classpath
jbpm4/trunk/modules/jpdl/.classpath
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveBinding.java
jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.activities.xml
jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.hbm.xml
jbpm4/trunk/modules/pvm/pom.xml
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.wire.hbm.xml
jbpm4/trunk/pom.xml
Log:
added esb node
Modified: jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
===================================================================
--- jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd 2008-12-20 10:01:26 UTC (rev 3475)
+++ jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd 2008-12-20 10:10:16 UTC (rev 3476)
@@ -218,6 +218,21 @@
</complexContent>
</complexType>
</element>
+
+ <element name="esb">
+ <annotation><documentation>Invokes a service over the ESB.
+ </documentation></annotation>
+ <complexType>
+ <complexContent>
+ <extension base="tns:esbType">
+ <sequence>
+ <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ <attributeGroup ref="tns:nodeAttributes" />
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
<!--
<element name="process-state">
@@ -312,6 +327,32 @@
-->
</choice>
</group>
+
+ <group name="wireObjectGroup">
+ <choice>
+ <element name="string">
+ <complexType>
+ <attribute name="name">
+ <annotation><documentation>the name of the string object</documentation></annotation>
+ </attribute>
+ <attribute name="value">
+ <annotation><documentation>the actual string value</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+ <element name="object">
+ <complexType>
+ <attribute name="name">
+ <annotation><documentation>the name of the string object</documentation></annotation>
+ </attribute>
+ <attribute name="class">
+ <annotation><documentation>the fully qualified classname</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+ </choice>
+ </group>
+
<complexType name="javaType">
<sequence>
@@ -364,6 +405,38 @@
</attribute>
</complexType>
+ <complexType name="esbType">
+ <sequence>
+ <element name="part" minOccurs="0" maxOccurs="unbounded">
+ <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>
+ <complexType>
+ <choice minOccurs="0">
+ <group ref="tns:wireObjectGroup" />
+ </choice>
+ <attribute name="name" type="string">
+ <annotation><documentation>The name of the message body part.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="expr" type="string">
+ <annotation><documentation>The script text that will be evaluated and
+ used and the object in this message body part.
+ </documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+ </sequence>
+ <attribute name="category" type="string">
+ <annotation><documentation>The category of the service in the esb.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="service" type="string">
+ <annotation><documentation>The name of the service in the esb.
+ </documentation></annotation>
+ </attribute>
+ </complexType>
+
<attributeGroup name="nodeAttributes">
<attribute name="name" type="string">
<annotation><documentation>The id of this activity. The name should be unique
Added: jbpm4/trunk/modules/db/.classpath
===================================================================
--- jbpm4/trunk/modules/db/.classpath (rev 0)
+++ jbpm4/trunk/modules/db/.classpath 2008-12-20 10:10:16 UTC (rev 3476)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/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>
Modified: jbpm4/trunk/modules/db/pom.xml
===================================================================
--- jbpm4/trunk/modules/db/pom.xml 2008-12-20 10:01:26 UTC (rev 3475)
+++ jbpm4/trunk/modules/db/pom.xml 2008-12-20 10:10:16 UTC (rev 3476)
@@ -32,38 +32,21 @@
<artifactId>jbpm-api</artifactId>
<version>${version}</version>
</dependency>
-
<dependency>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-test-base</artifactId>
<version>${version}</version>
</dependency>
-
<dependency>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-jpdl</artifactId>
<version>${version}</version>
</dependency>
-
<dependency>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-pvm</artifactId>
<version>${version}</version>
</dependency>
-
- <!--
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>net.sourceforge.jtds</groupId>
- <artifactId>jtds</artifactId>
- <scope>runtime</scope>
- </dependency>
- -->
</dependencies>
<!-- Plugins -->
Modified: jbpm4/trunk/modules/examples/.classpath
===================================================================
--- jbpm4/trunk/modules/examples/.classpath 2008-12-20 10:01:26 UTC (rev 3475)
+++ jbpm4/trunk/modules/examples/.classpath 2008-12-20 10:10:16 UTC (rev 3476)
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <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/test-classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <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/test-classes"/>
+</classpath>
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/EsbTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/EsbTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/EsbTest.java 2008-12-20 10:10:16 UTC (rev 3476)
@@ -0,0 +1,68 @@
+/*
+ * 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.esb;
+
+import java.net.URI;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
+import org.jboss.internal.soa.esb.services.registry.MockRegistry;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.message.Message;
+import org.jbpm.Execution;
+import org.jbpm.test.DbTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class EsbTest extends DbTestCase {
+
+ public JbpmMockCourier courier;
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ MockCourierFactory.install();
+ MockRegistry.install();
+ EPR epr = new EPR(new URI("epr"));
+ courier = new JbpmMockCourier();
+ MockRegistry.register("orderProcessing", "bookSold", epr, courier);
+ }
+
+ public void testJavaInstantiate() {
+ deployJpdlResource("org/jbpm/examples/esb/process.jpdl.xml");
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("title", "Internetworking with TCP/IP");
+
+ Execution execution = executionService.startExecutionByKey("Esb", variables);
+
+ Message message = courier.getMessage();
+ Body body = message.getBody();
+ assertEquals("Internetworking with TCP/IP", body.get("bookTitle"));
+ assertEquals("deliver asap", body.get("goal"));
+ }
+
+}
Property changes on: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/EsbTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/JbpmMockCourier.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/JbpmMockCourier.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/JbpmMockCourier.java 2008-12-20 10:10:16 UTC (rev 3476)
@@ -0,0 +1,36 @@
+/*
+ * 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.esb;
+
+import org.jboss.internal.soa.esb.couriers.MockCourier;
+import org.jboss.soa.esb.message.Message;
+
+public class JbpmMockCourier extends MockCourier {
+
+ public JbpmMockCourier() {
+ super(true);
+ }
+
+ public Message getMessage() {
+ return message;
+ }
+}
Property changes on: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/JbpmMockCourier.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/esb/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/esb/process.jpdl.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/esb/process.jpdl.xml 2008-12-20 10:10:16 UTC (rev 3476)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="Esb" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="invoke esb service" />
+ </start>
+
+ <esb name="invoke esb service"
+ category="orderProcessing"
+ service="bookSold">
+
+ <part name="bookTitle" expr="#{title}" />
+ <part name="goal">
+ <string value="deliver asap" />
+ </part>
+
+ <flow to="wait" />
+ </esb>
+
+ <state name="wait" />
+
+</process>
Property changes on: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/esb/process.jpdl.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/jpdl/.classpath
===================================================================
--- jbpm4/trunk/modules/jpdl/.classpath 2008-12-20 10:01:26 UTC (rev 3475)
+++ jbpm4/trunk/modules/jpdl/.classpath 2008-12-20 10:10:16 UTC (rev 3476)
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <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"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <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"/>
+</classpath>
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EsbActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EsbActivity.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EsbActivity.java 2008-12-20 10:10:16 UTC (rev 3476)
@@ -0,0 +1,81 @@
+/*
+ * 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.activity;
+
+import org.jboss.soa.esb.client.ServiceInvoker;
+import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jbpm.activity.ActivityExecution;
+import org.jbpm.log.Log;
+import org.jbpm.pvm.internal.model.ExpressionEvaluator;
+import org.jbpm.pvm.internal.wire.Descriptor;
+import org.jbpm.pvm.internal.wire.WireContext;
+import org.jbpm.pvm.internal.wire.descriptor.ListDescriptor;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class EsbActivity extends JpdlActivity {
+
+ private static final long serialVersionUID = 1L;
+
+ private static Log log = Log.getLog(EsbActivity.class.getName());
+
+ protected String category = null;
+ protected String service = null;
+ protected ListDescriptor partsListDescriptor = null;
+
+ public void execute(ActivityExecution execution) throws Exception {
+ Message message = MessageFactory.getInstance().getMessage();
+ Body body = message.getBody();
+
+ if (partsListDescriptor!=null) {
+ WireContext wireContext = new WireContext();
+ for (Descriptor descriptor: partsListDescriptor.getValueDescriptors()) {
+ String name = descriptor.getName();
+
+ Object object = wireContext.create(descriptor, true);
+ if (object instanceof ExpressionEvaluator) {
+ ExpressionEvaluator expressionEvaluator = (ExpressionEvaluator) object;
+ object = expressionEvaluator.evaluateExpression(execution);
+ }
+ body.add(name, object);
+ }
+ }
+
+ ServiceInvoker invoker = new ServiceInvoker(category, service);
+ log.debug("sending "+message.getBody()+" to service "+service+" in category "+category+" over the esb");
+ invoker.deliverAsync(message);
+ }
+
+ public void setCategory(String category) {
+ this.category = category;
+ }
+ public void setService(String service) {
+ this.service = service;
+ }
+ public void setPartsListDescriptor(ListDescriptor partsListDescriptor) {
+ this.partsListDescriptor = partsListDescriptor;
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EsbActivity.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EsbBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EsbBinding.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EsbBinding.java 2008-12-20 10:10:16 UTC (rev 3476)
@@ -0,0 +1,95 @@
+/*
+ * 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.activity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jbpm.pvm.internal.util.XmlUtil;
+import org.jbpm.pvm.internal.wire.Descriptor;
+import org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.ExpressionDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.ListDescriptor;
+import org.jbpm.pvm.internal.wire.xml.WireParser;
+import org.jbpm.pvm.internal.xml.Parse;
+import org.jbpm.pvm.internal.xml.Parser;
+import org.w3c.dom.Element;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class EsbBinding extends JpdlActivityBinding {
+
+ public static final String TAG = "esb";
+ private static final WireParser wireParser = WireParser.getInstance();
+
+ public EsbBinding() {
+ super(TAG);
+ }
+
+ public Object parse(Element element, Parse parse, Parser parser) {
+ EsbActivity esbActivity = new EsbActivity();
+
+ String category = XmlUtil.attribute(element, "category", true, parse);
+ esbActivity.setCategory(category);
+
+ String service = XmlUtil.attribute(element, "service", true, parse);
+ esbActivity.setService(service);
+
+ List<Descriptor> partDescriptors = new ArrayList<Descriptor>();
+ List<Element> partElements = XmlUtil.elements(element, "part");
+ for (Element partElement: partElements) {
+ String name = XmlUtil.attribute(partElement, "name", true, parse);
+ AbstractDescriptor partDescriptor = getPartDescriptor(partElement, parse);
+ partDescriptor.setName(name);
+ partDescriptors.add(partDescriptor);
+ }
+ ListDescriptor partsListDescriptor = new ListDescriptor();
+ if (!partDescriptors.isEmpty()) {
+ partsListDescriptor.setValueDescriptors(partDescriptors);
+ }
+ esbActivity.setPartsListDescriptor(partsListDescriptor);
+
+ return esbActivity;
+ }
+
+ public AbstractDescriptor getPartDescriptor(Element partElement, Parse parse) {
+ String expression = XmlUtil.attribute(partElement, "expr");
+ Element descriptorElement = XmlUtil.element(partElement);
+
+ if ( ( (expression==null) && (descriptorElement==null) )
+ ||
+ ( (expression!=null) && (descriptorElement!=null) )
+ ) {
+ parse.addProblem("in <"+TAG+"...> an expr or exactly one child element is expected");
+ }
+
+ if (expression!=null) {
+ return new ExpressionDescriptor(expression, null);
+ }
+
+ AbstractDescriptor descriptor = (AbstractDescriptor) wireParser.parseElement(descriptorElement, parse, WireParser.CATEGORY_DESCRIPTOR);
+ return descriptor;
+ }
+
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EsbBinding.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveBinding.java 2008-12-20 10:01:26 UTC (rev 3475)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveBinding.java 2008-12-20 10:10:16 UTC (rev 3476)
@@ -23,12 +23,12 @@
import java.util.List;
-import org.jbpm.pvm.internal.model.ExpressionCondition;
+import org.jbpm.pvm.internal.model.ExpressionEvaluator;
import org.jbpm.pvm.internal.model.NodeImpl;
import org.jbpm.pvm.internal.model.TransitionImpl;
import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.pvm.internal.wire.binding.ObjectBinding;
-import org.jbpm.pvm.internal.wire.descriptor.ExpressionConditionDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.ExpressionDescriptor;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.internal.wire.descriptor.ReferenceDescriptor;
import org.jbpm.pvm.internal.wire.xml.WireParser;
@@ -89,8 +89,8 @@
if (conditionElement.hasAttribute("expr")) {
String expr = conditionElement.getAttribute("expr");
String lang = XmlUtil.attribute(conditionElement, "expr-lang");
- ExpressionConditionDescriptor expressionConditionDescriptor = new ExpressionConditionDescriptor(expr, lang);
- transition.setConditionDescriptor(expressionConditionDescriptor);
+ ExpressionDescriptor expressionDescriptor = new ExpressionDescriptor(expr, lang);
+ transition.setConditionDescriptor(expressionDescriptor);
} else if (conditionElement.hasAttribute("ref")) {
String expr = conditionElement.getAttribute("ref");
Modified: jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.activities.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.activities.xml 2008-12-20 10:01:26 UTC (rev 3475)
+++ jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.activities.xml 2008-12-20 10:10:16 UTC (rev 3476)
@@ -10,4 +10,5 @@
<activity binding="org.jbpm.jpdl.activity.SqlBinding" />
<activity binding="org.jbpm.jpdl.activity.JavaBinding" />
<activity binding="org.jbpm.jpdl.activity.ScriptBinding" />
+ <activity binding="org.jbpm.jpdl.activity.EsbBinding" />
</activities>
Modified: jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.hbm.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.hbm.xml 2008-12-20 10:01:26 UTC (rev 3475)
+++ jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.hbm.xml 2008-12-20 10:10:16 UTC (rev 3476)
@@ -72,6 +72,16 @@
<property name="language" column="TEXT2_" />
<property name="variableName" column="TEXT3_" />
</subclass>
+ <subclass name="org.jbpm.jpdl.activity.EsbActivity" discriminator-value="esb">
+ <property name="service" column="TEXT_" />
+ <property name="category" column="TEXT2_" />
+ <many-to-one name="partsListDescriptor"
+ column="PARTSDESCR_"
+ cascade="all"
+ class="org.jbpm.pvm.internal.wire.descriptor.ListDescriptor"
+ foreign-key="FK_ACT_PARTSDESCR"
+ index="IDX_ACT_PARTSDESCR" />
+ </subclass>
</class>
</hibernate-mapping>
\ No newline at end of file
Modified: jbpm4/trunk/modules/pvm/pom.xml
===================================================================
--- jbpm4/trunk/modules/pvm/pom.xml 2008-12-20 10:01:26 UTC (rev 3475)
+++ jbpm4/trunk/modules/pvm/pom.xml 2008-12-20 10:10:16 UTC (rev 3476)
@@ -89,38 +89,6 @@
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
-
-<!--
- <dependency>
- <groupId>com.cenqua.clover</groupId>
- <artifactId>clover</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam</artifactId>
- <exclusions>
- <exclusion>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.el</groupId>
- <artifactId>jboss-el</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>cactus</groupId>
- <artifactId>cactus</artifactId>
- <scope>test</scope>
- </dependency>
- -->
-
</dependencies>
<!-- Plugins -->
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionCondition.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionCondition.java 2008-12-20 10:01:26 UTC (rev 3475)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionCondition.java 2008-12-20 10:10:16 UTC (rev 3476)
@@ -1,47 +0,0 @@
-/*
- * 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.model;
-
-import org.jbpm.model.Condition;
-import org.jbpm.model.OpenExecution;
-import org.jbpm.pvm.internal.script.ScriptManager;
-
-/**
- * @author Tom Baeyens
- */
-public class ExpressionCondition implements Condition {
-
- private static final long serialVersionUID = 1L;
-
- protected String expr;
- protected String lang;
-
- public ExpressionCondition(String expr, String lang) {
- this.expr = expr;
- this.lang = lang;
- }
-
- public boolean evaluate(OpenExecution execution) {
- ScriptManager scriptManager = ScriptManager.getScriptManager();
- return (Boolean) scriptManager.evaluateExpression(expr, execution, lang);
- }
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionEvaluator.java (from rev 3439, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionCondition.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionEvaluator.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionEvaluator.java 2008-12-20 10:10:16 UTC (rev 3476)
@@ -0,0 +1,57 @@
+/*
+ * 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.model;
+
+import org.jbpm.model.Condition;
+import org.jbpm.model.OpenExecution;
+import org.jbpm.pvm.internal.script.ScriptManager;
+
+/**
+ * @author Tom Baeyens
+ */
+public class ExpressionEvaluator implements Condition {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String name;
+ protected String expr;
+ protected String lang;
+
+ public ExpressionEvaluator(String name, String expr, String lang) {
+ this.name = name;
+ this.expr = expr;
+ this.lang = lang;
+ }
+
+ public boolean evaluate(OpenExecution execution) {
+ return (Boolean) evaluateExpression(execution);
+ }
+
+ public Object evaluateExpression(OpenExecution execution) {
+ ScriptManager scriptManager = ScriptManager.getScriptManager();
+ return scriptManager.evaluateExpression(expr, execution, lang);
+ }
+
+ public String getName() {
+ return name;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionEvaluator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ExpressionConditionDescriptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ExpressionConditionDescriptor.java 2008-12-20 10:01:26 UTC (rev 3475)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ExpressionConditionDescriptor.java 2008-12-20 10:10:16 UTC (rev 3476)
@@ -1,50 +0,0 @@
-/*
- * 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.wire.descriptor;
-
-import org.jbpm.pvm.internal.model.ExpressionCondition;
-import org.jbpm.pvm.internal.wire.WireContext;
-
-
-/**
- * @author Tom Baeyens
- */
-public class ExpressionConditionDescriptor extends AbstractDescriptor {
-
- private static final long serialVersionUID = 1L;
-
- String expr;
- String lang;
-
- public ExpressionConditionDescriptor() {
- }
-
- public ExpressionConditionDescriptor(String expr, String lang) {
- this.expr = expr;
- this.lang = lang;
- }
-
- public Object construct(WireContext wireContext) {
- return new ExpressionCondition(expr, lang);
- }
-
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ExpressionDescriptor.java (from rev 3439, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ExpressionConditionDescriptor.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ExpressionDescriptor.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ExpressionDescriptor.java 2008-12-20 10:10:16 UTC (rev 3476)
@@ -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.pvm.internal.wire.descriptor;
+
+import org.jbpm.pvm.internal.model.ExpressionEvaluator;
+import org.jbpm.pvm.internal.wire.WireContext;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ExpressionDescriptor extends AbstractDescriptor {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String expr;
+ protected String lang;
+
+ public ExpressionDescriptor() {
+ }
+
+ public ExpressionDescriptor(String expr, String lang) {
+ this.expr = expr;
+ this.lang = lang;
+ }
+
+ public Object construct(WireContext wireContext) {
+ return new ExpressionEvaluator(getName(), expr, lang);
+ }
+
+}
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.wire.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.wire.hbm.xml 2008-12-20 10:01:26 UTC (rev 3475)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.wire.hbm.xml 2008-12-20 10:10:16 UTC (rev 3476)
@@ -124,7 +124,7 @@
</list>
</subclass>
- <subclass name="ExpressionConditionDescriptor" discriminator-value="expr">
+ <subclass name="ExpressionDescriptor" discriminator-value="expr">
<property name="expr" column="TEXT_" />
<property name="lang" column="METHOD_" />
</subclass>
Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml 2008-12-20 10:01:26 UTC (rev 3475)
+++ jbpm4/trunk/pom.xml 2008-12-20 10:10:16 UTC (rev 3476)
@@ -40,7 +40,6 @@
<module>modules/task</module>
<module>modules/test-base</module>
<module>modules/test-db</module>
- <module>modules/test-load</module>
<module>modules/test-pojo</module>
</modules>
@@ -158,28 +157,6 @@
<artifactId>cactus</artifactId>
<version>${cactus.version}</version>
</dependency>
-
-<!--
- <dependency>
- <groupId>com.cenqua.clover</groupId>
- <artifactId>clover</artifactId>
- <version>${clover.version}</version>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam</artifactId>
- <version>${jboss.seam.version}</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>${slf4j.version}</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>${slf4j.version}</version>
- </dependency>
- -->
</dependencies>
</dependencyManagement>
@@ -313,6 +290,14 @@
</profile>
<profile>
+ <id>load</id>
+ <modules>
+ <module>modules/db</module>
+ <module>modules/test-load</module>
+ </modules>
+ </profile>
+
+ <profile>
<id>skiptests</id>
<build>
<plugins>
@@ -458,7 +443,7 @@
</repository>
</repositories>
</profile>
-
+
<!-- -Ddatabase=mysql -->
<profile>
<id>mysql</id>
More information about the jbpm-commits
mailing list