JBoss JBPM SVN: r5046 - in jbpm4/branches/jimma/modules/migration: src/main/java/org/jbpm/jpdl/internal/convert and 9 other directories.
by do-not-reply@jboss.org
Author: jim.ma
Date: 2009-06-17 03:48:06 -0400 (Wed, 17 Jun 2009)
New Revision: 5046
Added:
jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/ActionConverterTypes.java
jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterParser.java
jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReader.java
jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/NodeConverterTypes.java
jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Problem.java
jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/ProblemListener.java
jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/
jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/Action.java
jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/
jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/EndState.java
jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Fork.java
jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Join.java
jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Node.java
jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/StartState.java
jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/State.java
jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/TaskNode.java
jbpm4/branches/jimma/modules/migration/src/main/resources/action.converter.types.xml
jbpm4/branches/jimma/modules/migration/src/main/resources/node.converter.types.xml
jbpm4/branches/jimma/modules/migration/src/main/resources/org/
jbpm4/branches/jimma/modules/migration/src/main/resources/org/jbpm/
jbpm4/branches/jimma/modules/migration/src/main/resources/org/jbpm/jpdl/
jbpm4/branches/jimma/modules/migration/src/main/resources/org/jbpm/jpdl/xml/
jbpm4/branches/jimma/modules/migration/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.0.xsd
jbpm4/branches/jimma/modules/migration/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.1.xsd
jbpm4/branches/jimma/modules/migration/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.2.xsd
jbpm4/branches/jimma/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReaderTest.java
Modified:
jbpm4/branches/jimma/modules/migration/pom.xml
jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/ConvertException.java
jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/ProblemCollector.java
jbpm4/branches/jimma/modules/migration/src/main/xsd/jpdl-4.0.xsd
jbpm4/branches/jimma/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/JpdlConverterTest.java
Log:
Updated jbpm4 to 4.0-SNAPSHOT;Intitial commit for the converter based on trim down jpdl3XmlReader which can process simple.xml and busniesstrip.xml
Modified: jbpm4/branches/jimma/modules/migration/pom.xml
===================================================================
--- jbpm4/branches/jimma/modules/migration/pom.xml 2009-06-16 19:46:36 UTC (rev 5045)
+++ jbpm4/branches/jimma/modules/migration/pom.xml 2009-06-17 07:48:06 UTC (rev 5046)
@@ -38,7 +38,7 @@
<parent>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
Added: jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/ActionConverterTypes.java
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/ActionConverterTypes.java (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/ActionConverterTypes.java 2009-06-17 07:48:06 UTC (rev 5046)
@@ -0,0 +1,104 @@
+/*
+ * 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.convert;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.dom4j.DocumentException;
+import org.dom4j.Element;
+import org.dom4j.io.SAXReader;
+import org.jbpm.jpdl.internal.convert.action.Action;
+import org.jbpm.jpdl.internal.convert.node.Node;
+
+public class ActionConverterTypes {
+
+ public static Set<Class<? extends Action>> getActionTypes() {
+ return actionNames.keySet();
+ }
+
+ public static Set<String> getActionNames() {
+ return actionTypes.keySet();
+ }
+
+ public static Class<? extends Action> getActionType(String name) {
+ return actionTypes.get(name);
+ }
+
+ public static String getActionName(Class<? extends Action> type) {
+ return actionNames.get(type);
+ }
+
+ public static boolean hasActionName(String name) {
+ return actionTypes.containsKey(name);
+ }
+
+ private static SAXReader reader = new SAXReader();
+ static final Log log = LogFactory.getLog(ActionConverterTypes.class);
+ static Map<String, Class<? extends Action>> actionTypes = initialiseActionTypes();
+ static Map<Class<? extends Action>, String> actionNames = NodeConverterTypes.createInverseMapping(actionTypes);
+
+ static Map<String, Class<? extends Action>> initialiseActionTypes() {
+ Map<String, Class<? extends Action>> types = new HashMap<String, Class<? extends Action>>();
+
+ InputStream actionTypesStream = ActionConverterTypes.class
+ .getClassLoader().getResourceAsStream(
+ "action.converter.types.xml");
+
+ Element actionTypesElement = null;
+ try {
+ actionTypesElement = reader.read(actionTypesStream)
+ .getRootElement();
+ } catch (DocumentException e1) {
+ log.error("Failed to parse the action.converter.types.xml", e1);
+ }
+
+ Iterator<?> actionTypeIterator = actionTypesElement
+ .elementIterator("action-type");
+ while (actionTypeIterator.hasNext()) {
+ Element actionTypeElement = (Element) actionTypeIterator.next();
+
+ String elementTag = actionTypeElement.attributeValue("element");
+ String className = actionTypeElement.attributeValue("class");
+ try {
+ Class<?> actionClass = ActionConverterTypes.class.forName(className);
+ types.put(elementTag, actionClass.asSubclass(Action.class));
+
+ } catch (Exception e) {
+ // NOTE that Error's are not caught because that might halt the
+ // JVM and mask the original Error.
+ if (log.isDebugEnabled()) {
+ log.debug("action '" + elementTag
+ + "' will not be available. class '" + className
+ + "' couldn't be loaded");
+ }
+ }
+ }
+ return types;
+ }
+
+}
Modified: jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/ConvertException.java
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/ConvertException.java 2009-06-16 19:46:36 UTC (rev 5045)
+++ jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/ConvertException.java 2009-06-17 07:48:06 UTC (rev 5046)
@@ -21,23 +21,26 @@
*/
package org.jbpm.jpdl.internal.convert;
-public class ConvertException extends Exception {
- private static final long serialVersionUID = 1L;
+import java.util.Collections;
+import java.util.List;
- public ConvertException() {
- super();
- }
+public class ConvertException extends RuntimeException {
- public ConvertException(String msg) {
- super(msg);
- }
-
-
- public ConvertException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public ConvertException(Throwable cause) {
- super(cause);
- }
+ private static final long serialVersionUID = 1L;
+
+ protected List problems = null;
+
+ public ConvertException(List problems) {
+ super(problems.toString());
+ this.problems = problems;
+ }
+ public ConvertException(String msg) {
+ this(Collections.singletonList(new Problem(Problem.LEVEL_ERROR, msg)));
+ }
+ public ConvertException(String msg, Throwable e ) {
+ this(Collections.singletonList(new Problem(Problem.LEVEL_ERROR, msg, e)));
+ }
+ public List getProblems() {
+ return problems;
+ }
}
Added: jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterParser.java
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterParser.java (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterParser.java 2009-06-17 07:48:06 UTC (rev 5046)
@@ -0,0 +1,173 @@
+/*
+ * 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.convert;
+
+import java.io.Serializable;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.dom4j.Document;
+import org.dom4j.io.SAXReader;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.XMLReader;
+
+
+/**
+ * Validate an XML document using JAXP techniques and an XML Schema. This helper
+ * class wraps the processing of a schema to aid in schema validation throughout
+ * the product.
+ *
+ * @author Tom Baeyens
+ * @author Jim Rigsbee
+ */
+public class Jpdl3ConverterParser implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ static SAXParserFactory saxParserFactory = createSaxParserFactory();
+ private static Set schemaResources = getDefaultSchemaResources();
+ private static Object schemaSource;
+
+ public static Document parse(InputSource inputSource, ProblemListener problemListener) throws Exception {
+ Document document = null;
+ SAXReader saxReader = createSaxReader(problemListener);
+ document = saxReader.read(inputSource);
+ return document;
+ }
+
+ public static SAXReader createSaxReader(ProblemListener problemListener) throws Exception {
+ XMLReader xmlReader = createXmlReader();
+ SAXReader saxReader = new SAXReader(xmlReader);
+ saxReader.setErrorHandler(new JpdlErrorHandler(problemListener));
+ return saxReader;
+ }
+
+ public static XMLReader createXmlReader() throws Exception {
+ SAXParser saxParser = saxParserFactory.newSAXParser();
+ XMLReader xmlReader = saxParser.getXMLReader();
+
+ try {
+ saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
+ } catch (SAXException e){
+ log.warn("couldn't set schema language property", e);
+ }
+
+ try {
+ saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", getSchemaSource());
+ } catch (SAXException e){
+ log.warn("couldn't set schema source property", e);
+ }
+
+ try {
+ xmlReader.setFeature("http://apache.org/xml/features/validation/dynamic", true);
+ } catch (SAXException e){
+ log.warn("couldn't set dynamic validation feature", e);
+ }
+ return xmlReader;
+ }
+
+ private static Object getSchemaSource() {
+ if (schemaSource == null) {
+ List schemaLocations = new ArrayList(schemaResources.size());
+ for (Iterator i = schemaResources.iterator(); i.hasNext();) {
+ String schemaResource = (String) i.next();
+ URL schemaURL = Jpdl3ConverterParser.class.getClassLoader().getResource(schemaResource);
+ if (schemaURL != null) {
+ String schemaLocation = schemaURL.toString();
+ if(log.isDebugEnabled()){
+ log.debug("schema resource found: " + schemaResource);
+ }
+ schemaLocations.add(schemaLocation);
+ }
+ }
+ schemaSource = schemaLocations.toArray(new String[schemaLocations.size()]);
+ }
+ return schemaSource;
+ }
+
+ static class JpdlErrorHandler implements ErrorHandler, Serializable {
+
+ private ProblemListener problemListener = null;
+
+ private static final long serialVersionUID = 1L;
+
+ JpdlErrorHandler(ProblemListener problemListener) {
+ this.problemListener = problemListener;
+ }
+
+ public void warning(SAXParseException pe) {
+ addProblem(Problem.LEVEL_WARNING, pe);
+ }
+
+ public void error(SAXParseException pe) {
+ addProblem(Problem.LEVEL_ERROR, pe);
+ }
+
+ public void fatalError(SAXParseException pe) {
+ addProblem(Problem.LEVEL_FATAL, pe);
+ }
+
+ private void addProblem(int level, SAXParseException pe) {
+ Problem problem = new Problem(level, pe.getMessage(), pe);
+ problem.setResource(pe.getSystemId());
+ int line = pe.getLineNumber();
+ if (line != -1) problem.setLine(new Integer(line));
+ problemListener.addProblem(problem);
+ }
+ }
+
+ public static void addSchemaResource(String resource) {
+ schemaResources.add(resource);
+ schemaSource = null;
+ }
+
+ private static Set getDefaultSchemaResources() {
+ Set schemaResources = new HashSet();
+ schemaResources.add("org/jbpm/jpdl/xml/jpdl-3.0.xsd");
+ schemaResources.add("org/jbpm/jpdl/xml/jpdl-3.1.xsd");
+ schemaResources.add("org/jbpm/jpdl/xml/jpdl-3.2.xsd");
+ schemaResources.add("org/jbpm/jpdl/xml/jpdl-3.3.xsd");
+ schemaResources.add("org/jboss/seam/pageflow-2.0.xsd");
+ return schemaResources;
+ }
+
+ private static SAXParserFactory createSaxParserFactory() {
+ SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
+ saxParserFactory.setValidating(true);
+ saxParserFactory.setNamespaceAware(true);
+ return saxParserFactory;
+ }
+
+ private static final Log log = LogFactory.getLog(Jpdl3ConverterParser.class);
+}
Added: jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReader.java
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReader.java (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReader.java 2009-06-17 07:48:06 UTC (rev 5046)
@@ -0,0 +1,825 @@
+/*
+ * 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.convert;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+
+import org.jbpm.graph.def.Transition;
+import org.jbpm.jpdl.internal.convert.action.Action;
+import org.jbpm.jpdl.internal.convert.node.Node;
+import org.jbpm.jpdl.internal.convert.node.TaskNode;
+import org.jbpm.jpdl.internal.convert.node.StartState;
+import org.jbpm.jpdl.internal.convert.util.EventsConverter;
+import org.jbpm.jpdl.internal.convert.util.TransitionConverter;
+import org.jbpm.jpdl4.model.ObjectFactory;
+import org.jbpm.jpdl4.model.On;
+import org.jbpm.jpdl4.model.Process;
+import org.jbpm.jpdl4.model.WireObjectType;
+import org.jbpm.taskmgmt.def.Task;
+import org.xml.sax.InputSource;
+
+import bsh.This;
+
+public class Jpdl3ConverterReader implements ProblemListener {
+ private static final Log logger = LogFactory.getLog(JpdlConverter.class);
+ private static String JPDL4NS = "http://jbpm.org/4.0/jpdl";
+ private static final long serialVersionUID = 1L;
+ protected Document document;
+ protected InputSource inputSource = null;
+ protected List<Problem> problems = new ArrayList<Problem>();
+ protected ProblemListener problemListener = null;
+ //the return converted jpdl4 dom model
+ protected Document jpdl4Document = null;
+ protected String initialNodeName = null;
+ protected Collection<Object[]> unresolvedTransitionDestinations = null;
+ protected Collection<Object[]> unresolvedActionReferences = null;
+ protected Map<String,Element> nodeCollection = new java.util.concurrent.ConcurrentHashMap<String, Element>();
+ protected Map<String,Element> swimlanesCollection = new java.util.concurrent.ConcurrentHashMap<String, Element>();
+ //for autonumbering anonymous timers.
+ private int timerNumber;
+
+ public Jpdl3ConverterReader(InputSource inputSource)
+ {
+ this.inputSource = inputSource;
+ }
+
+ public Jpdl3ConverterReader(InputSource inputSource, ProblemListener problemListener)
+ {
+ this.inputSource = inputSource;
+ this.problemListener = problemListener;
+ }
+
+ public Jpdl3ConverterReader(Reader reader)
+ {
+ this(new InputSource(reader));
+ }
+
+ public void close() throws IOException
+ {
+ InputStream byteStream = inputSource.getByteStream();
+ if (byteStream != null)
+ byteStream.close();
+ else
+ {
+ Reader charStream = inputSource.getCharacterStream();
+ if (charStream != null)
+ charStream.close();
+ }
+ document = null;
+ }
+
+ public Document getJpdl4Document()
+ {
+ return jpdl4Document;
+ }
+
+ public void addProblem(Problem problem)
+ {
+ problems.add(problem);
+ if (problemListener != null)
+ problemListener.addProblem(problem);
+ }
+
+ public void addError(String description)
+ {
+ log.error("invalid process xml: " + description);
+ addProblem(new Problem(Problem.LEVEL_ERROR, description));
+ }
+
+ public void addError(String description, Throwable exception)
+ {
+ log.error("invalid process xml: " + description, exception);
+ addProblem(new Problem(Problem.LEVEL_ERROR, description, exception));
+ }
+
+ public void addWarning(String description)
+ {
+ log.warn("process xml warning: " + description);
+ addProblem(new Problem(Problem.LEVEL_WARNING, description));
+ }
+
+ public Document readAndConvert()
+ {
+ // create a new definition
+ jpdl4Document = DocumentHelper.createDocument();
+
+ // initialize lists
+ problems = new ArrayList<Problem>();
+ unresolvedTransitionDestinations = new ArrayList<Object[]>();
+ unresolvedActionReferences = new ArrayList<Object[]>();
+
+ try
+ {
+ // parse the document into a dom tree
+ document = Jpdl3ConverterParser.parse(inputSource, this);
+
+ //set encoding
+ jpdl4Document.setXMLEncoding(document.getXMLEncoding());
+
+ Element root = document.getRootElement();
+
+ // read the process name
+ parseProcessDefinitionAttributes(root, jpdl4Document);
+
+ // get the process description
+ String description = root.elementTextTrim("description");
+ if (description != null)
+ {
+ jpdl4Document.getRootElement().addComment(description);
+ }
+
+ // first pass: read most content
+ readSwimlanes(root, jpdl4Document.getRootElement());
+ readActions(root, null, null);
+ readNodes(root, jpdl4Document.getRootElement());
+
+ /* readEvents(root, jpdl4Document);
+ readExceptionHandlers(root, jpdl4Document);
+ */
+ readTasks(root, jpdl4Document.getRootElement());
+
+ // second pass processing
+ resolveTransitionDestinations();
+ resolveActionReferences();
+ verifySwimlaneAssignments();
+
+ }
+ catch (Exception e)
+ {
+ log.error("couldn't parse process definition", e);
+ addProblem(new Problem(Problem.LEVEL_ERROR, "couldn't parse process definition", e));
+ }
+
+ if (Problem.containsProblemsOfLevel(problems, Problem.LEVEL_ERROR))
+ {
+ throw new ConvertException(problems);
+ }
+
+ if (problems != null)
+ {
+ for (Problem problem : problems)
+ {
+ log.warn("process parse warning: " + problem.getDescription());
+ }
+ }
+
+ return jpdl4Document;
+ }
+ //DONE!
+ protected Element parseProcessDefinitionAttributes(Element root, Document doc)
+ {
+
+ Element element = doc.addElement("process", JPDL4NS);
+ element.addAttribute("name", root.attributeValue("name"));
+ initialNodeName = root.attributeValue("initial");
+ return element;
+ }
+
+ protected void readSwimlanes(Element processDefinitionElement, Element jpdl4Element)
+ {
+ Iterator<?> iter = processDefinitionElement.elementIterator("swimlane");
+
+ while (iter.hasNext())
+ {
+ Element swimlaneElement = (Element)iter.next();
+ String swimlaneName = swimlaneElement.attributeValue("name");
+ if (swimlaneName == null)
+ {
+ addWarning("there's a swimlane without a name");
+ }
+ else
+ {
+ Element swimlane4 = jpdl4Element.addElement("swimlane");
+ swimlane4.addAttribute("name", swimlaneName);
+ Element assignmentElement = swimlaneElement.element("assignment");
+ swimlanesCollection.put(swimlaneName, swimlane4);
+ if (assignmentElement != null)
+ {
+
+ if ((assignmentElement.attribute("actor-id") != null)) {
+ swimlane4.addAttribute("assignee", assignmentElement.attributeValue("actor-id"));
+ }
+ if (assignmentElement.attribute("pooled-actors") != null) {
+ swimlane4.addAttribute("candidate-users" ,assignmentElement.attributeValue("pooled-actors"));
+
+ }
+ else
+ {
+ //readAssignmentDelegation(assignmentElement, swimlane4);
+ //swimlane.setAssignmentDelegation(assignmentDelegation);
+ }
+ }
+ }
+ }
+ }
+
+ public void readNodes(Element element, Element jpdl4doc)
+ {
+ Iterator<?> nodeElementIter = element.elementIterator();
+ while (nodeElementIter.hasNext())
+ {
+ Element nodeElement = (Element)nodeElementIter.next();
+ String nodeName = nodeElement.getName();
+ // get the node type
+ Class<?> nodeType = NodeConverterTypes.getNodeType(nodeName);
+ if (nodeType != null)
+ {
+
+ Node node = null;
+ try
+ {
+ // create a new instance
+ node = (Node)nodeType.newInstance();
+ }
+ catch (Exception e)
+ {
+ log.error("couldn't instantiate node '" + nodeName + "', of type '" + nodeType.getName() + "'", e);
+ continue;
+ }
+ //Implement it
+ List starts = jpdl4doc.elements("start-state");
+
+ // check for duplicate start-states
+ if ((node instanceof StartState) && !starts.isEmpty())
+ {
+ addError("max one start-state allowed in a process");
+
+ } else if (node instanceof TaskNode) {
+ readTasks(nodeElement, jpdl4doc);
+
+ } else {
+ // read the common node parts of the element
+ node.setNodeElement(nodeElement);
+ node.createConvertedElement(jpdl4doc);
+ readNode(nodeElement,node.getConvertedElement());
+
+ // if the node is parsable
+ // (meaning: if the node has special configuration to parse, other then the
+ // common node data)
+ node.read(this);
+
+ }
+ }
+ }
+ }
+
+ public void readTasks(Element element, Element jpdl4Element)
+ {
+ List<?> elements = element.elements("task");
+ Element[] tasks = elements.toArray(new Element[0]);
+
+ if (tasks != null && tasks.length > 0) {
+ for (int i = 0 ; i < tasks.length; i++) {
+ Element tmpTask = tasks[i];
+ Element task4 = readTask(tmpTask, jpdl4Element);
+ if (i ==0 ) {
+ task4.addAttribute("name", element.attributeValue("name"));
+ }
+ if (i+1 < tasks.length) {
+ Element newTransistion = task4.addElement("transition");
+ String to = tasks[i+1].attributeValue("name");
+ newTransistion.addAttribute("name", to);
+ newTransistion.addAttribute("to", "to");
+ } else {
+ //The last task node
+ List<Element> transitions = element.elements("transition");
+ for (Element trans : transitions) {
+ Element transElement = task4.addElement("transition");
+ String transName = trans.attributeValue("name") == null ? trans.attributeValue("to") :trans.attributeValue("name");
+ transElement.addAttribute("name", transName);
+ transElement.addAttribute("to", trans.attributeValue("to"));
+ }
+
+ }
+ }
+ }
+ }
+
+ public Element readTask(Element taskElement, Element jpdlElement)
+ {
+ // get the task name
+ Element task4 = jpdlElement.addElement("task");
+ String name = taskElement.attributeValue("name");
+ if (name != null)
+ {
+ task4.attributeValue("name", name);
+ }
+
+ // get the task description
+ String description = taskElement.elementTextTrim("description");
+ if (description != null)
+ {
+ task4.addComment(description);
+ }
+
+ // get the condition
+ //TODO: Revisit it to see when the this will be invoked and how to
+ /*String condition = taskElement.elementTextTrim("condition");
+ if (condition != null)
+ {
+ task.setCondition(condition);
+ }
+ else
+ {
+ task.setCondition(taskElement.attributeValue("condition"));
+ }*/
+
+ // parse common subelements
+ //TODO: convert the task timer
+ //readTaskTimers(taskElement, task);
+ //readEvents(taskElement, task);
+ //readExceptionHandlers(taskElement, task);
+
+ // TODO:duedate and priority
+ /*String duedateText = taskElement.attributeValue("duedate");
+ if (duedateText == null)
+ {
+ duedateText = taskElement.attributeValue("dueDate");
+ }
+ task.setDueDate(duedateText);
+ String priorityText = taskElement.attributeValue("priority");
+ if (priorityText != null)
+ {
+ task.setPriority(Task.parsePriority(priorityText));
+ }
+
+ // if this task is in the context of a taskNode, associate them
+ if (taskNode != null)
+ {
+ taskNode.addTask(task);
+ }
+*/
+ // TODO: blocking
+ /* String blockingText = taskElement.attributeValue("blocking");
+ if (blockingText != null)
+ {
+ if (("true".equalsIgnoreCase(blockingText)) || ("yes".equalsIgnoreCase(blockingText)) || ("on".equalsIgnoreCase(blockingText)))
+ {
+ task.setBlocking(true);
+ }
+ }*/
+
+ //TODO: signalling
+ /*String signallingText = taskElement.attributeValue("signalling");
+ if (signallingText != null)
+ {
+ if (("false".equalsIgnoreCase(signallingText)) || ("no".equalsIgnoreCase(signallingText)) || ("off".equalsIgnoreCase(signallingText)))
+ {
+ task.setSignalling(false);
+ }
+ }*/
+
+ // assignment
+ String swimlaneName = taskElement.attributeValue("swimlane");
+ Element assignmentElement = taskElement.element("assignment");
+
+ // if there is a swimlane attribute specified
+ if (swimlaneName != null)
+ {
+ Element swimLane = swimlanesCollection.get(swimlaneName);
+ if (swimLane == null)
+ {
+ addWarning("task references unknown swimlane '" + swimlaneName + "':" + taskElement.asXML());
+ }
+ else
+ {
+ task4.addAttribute("swimlane", swimlaneName);
+ }
+
+ // else if there is a direct assignment specified
+ }
+ else if (assignmentElement != null)
+ {
+ if ((assignmentElement.attribute("actor-id") != null) || (assignmentElement.attribute("pooled-actors") != null))
+ {
+ String actorid = assignmentElement.attributeValue("actor-id");
+ String pooledactors = assignmentElement.attributeValue("pooled-actors");
+ if (actorid != null) {
+ task4.addAttribute("assignee", actorid);
+ }
+ if (pooledactors != null) {
+ task4.addAttribute("candidate-groups", pooledactors);
+ }
+
+ }
+ else
+ {
+ readAssignmentDelegation(assignmentElement, task4);
+ }
+
+ // if no assignment or swimlane is specified
+ }
+ else
+ {
+ // the user has to manage assignment manually, so we better inform him/her.
+ log.info("process xml information: no swimlane or assignment specified for task '" + taskElement.asXML() + "'");
+ }
+
+ //TODO:notify
+ /*String notificationsText = taskElement.attributeValue("notify");
+ if (notificationsText != null
+ && ("true".equalsIgnoreCase(notificationsText) || "on".equalsIgnoreCase(notificationsText) || "yes".equalsIgnoreCase(notificationsText)))
+ {
+ String notificationEvent = Event.EVENTTYPE_TASK_ASSIGN;
+ Event event = task.getEvent(notificationEvent);
+ if (event == null)
+ {
+ event = new Event(notificationEvent);
+ task.addEvent(event);
+ }
+ Delegation delegation = createMailDelegation(notificationEvent, null, null, null, null);
+ Action action = new Action(delegation);
+ action.setProcessDefinition(processDefinition);
+ action.setName(task.getName());
+ event.addAction(action);
+ }*/
+
+ //TODO: task controller
+/* Element taskControllerElement = taskElement.element("controller");
+ if (taskControllerElement != null)
+ {
+ task.setTaskController(readTaskController(taskControllerElement));
+ }*/
+ return task4;
+ }
+
+
+
+
+ protected void readAssignmentDelegation(Element assignmentElement, Element task4)
+ {
+ //TODO:Ask question about this, How to convert the ExpressionAssignmentHandler
+ String expression = assignmentElement.attributeValue("expression");
+ String actorId = assignmentElement.attributeValue("actor-id");
+ String pooledActors = assignmentElement.attributeValue("pooled-actors");
+
+ if (expression != null)
+ {
+ //How to convert default assignmenthandler
+ //assignmentDelegation.setClassName("org.jbpm.identity.assignment.ExpressionAssignmentHandler");
+ //assignmentDelegation.setConfiguration("<expression>" + expression + "</expression>");
+
+ }
+ else if ((actorId != null) || (pooledActors != null))
+ {
+ //TODO:Ask question
+ task4.addComment("Please Update the Assignment handler to jpdl4");
+ Element assignmentHandler = task4.addElement("assignment-handler");
+ assignmentHandler.addAttribute("class", "org.jbpm.taskmgmt.assignment.ActorAssignmentHandler");
+
+ String configuration = "";
+ if (actorId != null)
+ {
+ configuration += "<actorId>" + actorId + "</actorId>";
+ }
+ if (pooledActors != null)
+ {
+ configuration += "<pooledActors>" + pooledActors + "</pooledActors>";
+ }
+ //TODO:Set actorId and pooledActors
+
+ }
+ else
+ {
+ String claz = assignmentElement.attributeValue("class");
+ Element assignmentHandler = task4.addElement("assignment-handler");
+ assignmentHandler.addAttribute("class", claz);
+ }
+
+ }
+ /*
+ protected TaskController readTaskController(Element taskControllerElement)
+ {
+ return null;
+ }
+
+ public List<VariableAccess> readVariableAccesses(Element element)
+ {
+ return null;
+ }
+
+ public void readStartStateTask(Element startTaskElement, StartState startState)
+ {
+ }
+*/
+ public void readNode(Element nodeElement, Element jpdl4Element)
+ {
+
+ // get the node name
+ String name = nodeElement.attributeValue("name");
+ if (name != null)
+ {
+ jpdl4Element.addAttribute("name", name);
+ nodeCollection.put(name, jpdl4Element);
+ }
+
+ // get the node description
+ String description = nodeElement.elementTextTrim("description");
+ if (description != null)
+ {
+ jpdl4Element.addComment(description);
+ }
+
+ //TODO:Convert Async
+
+/* String asyncText = nodeElement.attributeValue("async");
+ if ("true".equalsIgnoreCase(asyncText))
+ {
+ node.setAsync(true);
+ }
+ else if ("exclusive".equalsIgnoreCase(asyncText))
+ {
+ node.setAsync(true);
+ node.setAsyncExclusive(true);
+ }
+*/
+ // parse common subelements
+ readNodeTimers(nodeElement, jpdl4Element);
+ //readEvents(nodeElement, jpdl4Element);
+ //readExceptionHandlers(nodeElement, jpdl4Element);
+
+ // save the transitions and parse them at the end
+ addUnresolvedTransitionDestination(nodeElement, jpdl4Element);
+ }
+
+ protected void readNodeTimers(Element nodeElement, Element jpdl4Element)
+ {
+ Iterator<?> iter = nodeElement.elementIterator("timer");
+ while (iter.hasNext())
+ {
+ Element timerElement = (Element)iter.next();
+ readNodeTimer(timerElement, jpdl4Element);
+ }
+ }
+
+ protected void readNodeTimer(Element timerElement, Element jpdl4Element)
+ {
+ //TODO: convert node timer ...
+ }
+
+
+ //* instantiate {@link CreateTimerAction} object from configured class in action.types.xml (if configured). If not the default jbpm class is used.
+
+/* private CreateTimerAction instantiateCreateTimerAction()
+ {
+
+ }*/
+
+
+ //instantiate {@link CancelTimerAction} object from configured class in action.types.xml (if configured). If not the default jbpm class is used.*/
+
+ /* private CancelTimerAction instantiateCancelTimerAction()
+ {
+ }*/
+
+ private String generateTimerName()
+ {
+ return "timer-" + (timerNumber++);
+ }
+/*
+ protected void readTaskTimers(Element taskElement, Task task)
+ {
+ }
+
+ protected void readTaskTimer(Element timerElement, Task task)
+ {
+ }
+
+ protected void readEvents(Element parentElement, Element jpdl4doc)
+ {
+ }
+
+
+ */
+ public void readActions(Element eventElement, Element jpdl4Element, String eventType)
+ { // for all the elements in the event element
+ Iterator<?> nodeElementIter = eventElement.elementIterator();
+ while (nodeElementIter.hasNext())
+ {
+ Element actionElement = (Element)nodeElementIter.next();
+ String actionName = actionElement.getName();
+ if (ActionConverterTypes.hasActionName(actionName))
+ {
+ Element action4 = createAction(actionElement, jpdl4Element);
+ /*if ((graphElement != null) && (eventType != null))
+ {
+ // add the action to the event
+ addAction(graphElement, eventType, action);
+ }*/
+ }
+ }
+ }
+ /*
+ protected void addAction(GraphElement graphElement, String eventType, Action action)
+ {
+ Event event = graphElement.getEvent(eventType);
+ if (event == null)
+ {
+ event = new Event(eventType);
+ graphElement.addEvent(event);
+ }
+ event.addAction(action);
+ }*/
+
+
+ public Element readSingleAction(Element nodeElement)
+ {
+ return null;
+ }
+
+ public Element createAction(Element actionElement, Element jpdl4Element)
+ {
+ // create a new instance of the action
+ Action action = null;
+ String actionName = actionElement.getName();
+ Class<? extends Action> actionType = ActionConverterTypes.getActionType(actionName);
+ try
+ {
+ action = actionType.newInstance();
+ }
+ catch (Exception e)
+ {
+ log.error("couldn't instantiate action '" + actionName + "', of type '" + actionType.getName() + "'", e);
+ }
+
+ // read the common node parts of the action
+ Element action4 = action.createConvertedElement(actionElement, jpdl4Element);
+ //Remove readAction cause there is no need to read the common thing for jpdl4 script or java element
+ //readAction(actionElement, action4, action);
+ action.read(actionElement, this);
+ return action4;
+ }
+
+/*
+ protected void readExceptionHandlers(Element graphElementElement, GraphElement graphElement)
+ {
+ //
+ }
+
+ protected void readExceptionHandler(Element exceptionHandlerElement, GraphElement graphElement)
+ {
+ // create the exception handler
+
+ }
+*/
+ // transition destinations are parsed in a second pass //////////////////////
+
+ public void addUnresolvedTransitionDestination(Element nodeElement, Element jpdl4Element)
+ {
+ unresolvedTransitionDestinations.add(new Object[]{nodeElement, jpdl4Element});
+ }
+
+ public void resolveTransitionDestinations()
+ {
+ for (Object[] unresolvedTransition : unresolvedTransitionDestinations)
+ {
+ Element nodeElement = (Element)unresolvedTransition[0];
+ Element jpdl4Element = (Element)unresolvedTransition[1];
+ resolveTransitionDestinations(nodeElement.elements("transition"), jpdl4Element);
+ }
+ }
+
+ public void resolveTransitionDestinations(List<?> transitionElements, Element jpdl4Element)
+ {
+ for (Object transitionElement : transitionElements)
+ {
+ resolveTransitionDestination((Element)transitionElement, jpdl4Element);
+ }
+ }
+
+ /*
+ * creates the transition object and configures it by the read attributes
+ * @return the created <code>org.jbpm.graph.def.Transition</code> object (useful, if you want to override this method to read additional configuration properties)
+ */
+ public void resolveTransitionDestination(Element transitionElement, Element jpdl4Element)
+ {
+ Element transition4 = jpdl4Element.addElement("transition");
+ transition4.addAttribute("name", transitionElement.attributeValue("name"));
+ if (transitionElement.elementTextTrim("description") != null) {
+ transition4.addComment(transitionElement.elementTextTrim("description"));
+ }
+ //Get condition from jpdl3 element
+ String condition = transitionElement.attributeValue("condition");
+ if (condition == null)
+ {
+ Element conditionElement = transitionElement.element("condition");
+ if (conditionElement != null)
+ {
+ condition = conditionElement.getTextTrim();
+ // for backwards compatibility
+ if ((condition == null) || (condition.length() == 0))
+ {
+ condition = conditionElement.attributeValue("expression");
+ }
+ }
+ }
+
+
+ if (condition != null && condition.length() > 0) {
+ Element condition4 = transition4.addElement("condition");
+ condition4.addAttribute("expr", condition);
+ }
+
+
+ // set destinationNode of the transition
+ String toName = transitionElement.attributeValue("to");
+ if (toName == null)
+ {
+ addWarning("node '" + transitionElement.getPath() + "' has a transition without a 'to'-attribute to specify its destinationNode");
+ }
+ else
+ {
+ //TODO: Add the function to check if the transistion node exists
+
+ Element to = this.findNode(toName);
+ if (to == null)
+ {
+ addWarning("transition to='" + toName + "' on node '" + transitionElement.getName() + "' cannot be resolved");
+ }
+
+ transition4.addAttribute("to", toName);
+ }
+
+ // read the actions
+ readActions(transitionElement, transition4, "");
+
+ //readExceptionHandlers(transitionElement, transition);
+ }
+
+ // action references are parsed in a second pass ////////////////////////////
+
+ public void addUnresolvedActionReference(Element actionElemen)
+ {
+ //unresolvedActionReferences.add(new Object[] { actionElemen});
+ }
+
+ public void resolveActionReferences()
+ {
+
+ }
+
+ // verify swimlane assignments in second pass ///////////////////////////////
+ public void verifySwimlaneAssignments()
+ {
+ //
+ }
+
+ // mail delegations /////////////////////////////////////////////////////////
+
+ public void createMailDelegation(String template, String actors, String to, String subject, String text)
+ {
+ //
+ }
+
+ public String getProperty(String property, Element element)
+ {
+ String value = element.attributeValue(property);
+ if (value == null)
+ {
+ Element propertyElement = element.element(property);
+ if (propertyElement != null)
+ {
+ value = propertyElement.getText();
+ }
+ }
+ return value;
+ }
+ //New added method
+ private Element findNode(String name) {
+ return nodeCollection.get(name);
+ }
+
+ private static final Log log = LogFactory.getLog(Jpdl3ConverterReader.class);
+}
Added: jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/NodeConverterTypes.java
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/NodeConverterTypes.java (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/NodeConverterTypes.java 2009-06-17 07:48:06 UTC (rev 5046)
@@ -0,0 +1,100 @@
+/*
+ * 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.convert;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.dom4j.DocumentException;
+import org.dom4j.Element;
+import org.jbpm.jpdl.internal.convert.node.Node;
+import org.dom4j.io.SAXReader;
+
+
+public class NodeConverterTypes {
+
+ public static Set<String> getNodeTypes() {
+ return nodeTypes.keySet();
+ }
+
+ public static Set<Class<? extends Node>> getNodeNames() {
+ return nodeNames.keySet();
+ }
+
+ public static Class<? extends Node> getNodeType(String name) {
+ return nodeTypes.get(name);
+ }
+
+ public static String getNodeName(Class<? extends Node> type) {
+ return nodeNames.get(type);
+ }
+
+ private static final Log log = LogFactory.getLog(NodeConverterTypes.class);
+ private static SAXReader reader = new SAXReader();
+ static Map<String, Class<? extends Node>> nodeTypes = initialiseNodeTypes();
+ static Map<Class<? extends Node>, String> nodeNames = createInverseMapping(nodeTypes);
+
+ static Map<String, Class<? extends Node>> initialiseNodeTypes() {
+ Map<String, Class<? extends Node>> types = new HashMap<String, Class<? extends Node>>();
+ InputStream nodeTypesStream = NodeConverterTypes.class.getClassLoader().getResourceAsStream("node.converter.types.xml");
+ Element nodeTypesElement = null;
+ try {
+ nodeTypesElement = reader.read(nodeTypesStream).getRootElement();
+ } catch (DocumentException e1) {
+ log.error("Failed to parse the node.converter.types.xml", e1);
+ }
+ Iterator<?> nodeTypeIterator = nodeTypesElement.elementIterator("node-type");
+ while(nodeTypeIterator.hasNext()) {
+ Element nodeTypeElement = (Element) nodeTypeIterator.next();
+
+ String elementTag = nodeTypeElement.attributeValue("element");
+ String className = nodeTypeElement.attributeValue("class");
+ try {
+ Class<?> nodeClass = NodeConverterTypes.class.forName(className);
+ types.put(elementTag, nodeClass.asSubclass(Node.class));
+
+ } catch (Exception e) {
+ if (!"org.jboss.seam.jbpm.Page".equals(className)) {
+ if(log.isDebugEnabled())
+ {
+ log.debug("node '"+elementTag+"' will not be available. class '"+className+"' couldn't be loaded");
+ }
+ }
+ }
+ }
+
+ return types;
+ }
+
+ public static <K, V> Map<V, K> createInverseMapping(Map<K, V> map) {
+ Map<V, K> inverse = new HashMap<V, K>();
+ for (Map.Entry<K, V> entry : map.entrySet()) {
+ inverse.put(entry.getValue(), entry.getKey());
+ }
+ return inverse;
+ }
+ }
Added: jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Problem.java
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Problem.java (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Problem.java 2009-06-17 07:48:06 UTC (rev 5046)
@@ -0,0 +1,117 @@
+/*
+ * 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.convert;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.Iterator;
+
+public class Problem implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final int LEVEL_FATAL = 1;
+ public static final int LEVEL_ERROR = 2;
+ public static final int LEVEL_WARNING = 3;
+ public static final int LEVEL_INFO = 4;
+
+ static String getTypeDescription(int level) {
+ if (level==LEVEL_FATAL) return "FATAL";
+ if (level==LEVEL_ERROR) return "ERROR";
+ if (level==LEVEL_WARNING) return "WARNING";
+ if (level==LEVEL_INFO) return "INFO";
+ return null;
+ }
+
+ protected int level;
+ protected String description;
+ protected String resource;
+ protected String folder;
+ protected Integer line;
+ protected Throwable exception;
+
+ public Problem(int level, String description) {
+ this.level = level;
+ this.description = description;
+ }
+
+ public Problem(int level, String description, Throwable exception) {
+ this.level = level;
+ this.description = description;
+ this.exception = exception;
+ }
+
+ public String toString() {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("["+getTypeDescription(level)+"]");
+ if (description!=null) buffer.append(" "+description);
+ if (resource!=null) buffer.append(" at "+resource);
+ if (line!=null) buffer.append(" line "+line);
+ if (folder!=null) buffer.append(" in "+folder);
+ return buffer.toString();
+ }
+
+ public static boolean containsProblemsOfLevel(Collection c, int level) {
+ Iterator iter = c.iterator();
+ while (iter.hasNext()) {
+ Problem problem = (Problem) iter.next();
+ if (problem.level <= level) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+ public void setDescription(String description) {
+ this.description = description;
+ }
+ public Throwable getException() {
+ return exception;
+ }
+ public void setException(Throwable exception) {
+ this.exception = exception;
+ }
+ public String getFolder() {
+ return folder;
+ }
+ public void setFolder(String folder) {
+ this.folder = folder;
+ }
+ public Integer getLine() {
+ return line;
+ }
+ public void setLine(Integer line) {
+ this.line = line;
+ }
+ public String getResource() {
+ return resource;
+ }
+ public void setResource(String resource) {
+ this.resource = resource;
+ }
+ public int getLevel() {
+ return level;
+ }
+}
Modified: jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/ProblemCollector.java
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/ProblemCollector.java 2009-06-16 19:46:36 UTC (rev 5045)
+++ jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/ProblemCollector.java 2009-06-17 07:48:06 UTC (rev 5046)
@@ -1,3 +1,24 @@
+/*
+ * 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.convert;
import org.jbpm.jpdl.xml.ProblemListener;
Added: jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/ProblemListener.java
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/ProblemListener.java (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/ProblemListener.java 2009-06-17 07:48:06 UTC (rev 5046)
@@ -0,0 +1,29 @@
+/*
+ * 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.convert;
+
+import java.io.Serializable;
+
+public interface ProblemListener extends Serializable {
+
+ void addProblem(Problem problem);
+}
Added: jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/Action.java
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/Action.java (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/Action.java 2009-06-17 07:48:06 UTC (rev 5046)
@@ -0,0 +1,87 @@
+/*
+ * 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.convert.action;
+
+import org.dom4j.Element;
+import org.jbpm.jpdl.internal.convert.Jpdl3ConverterReader;
+
+public class Action {
+
+ protected Element convertedElement = null;
+ protected boolean isPropagationAllowed = true;
+ protected boolean isAsync = false;
+ protected boolean isAsyncExclusive = false;
+
+ public Action() {
+
+ }
+
+ public Element createConvertedElement(Element actionElement, Element jpdl4Doc) {
+ String expression = actionElement.attributeValue("expression");
+
+ if (expression != null) {
+ convertedElement = jpdl4Doc.addElement("script");
+
+ }
+
+ if (actionElement.attributeValue("class")!=null) {
+ convertedElement = jpdl4Doc.addElement("java");
+
+ }
+
+ return convertedElement;
+ }
+
+ public void read(Element actionElement, Jpdl3ConverterReader jpdlReader) {
+ String expression = actionElement.attributeValue("expression");
+ if (expression!=null) {
+ convertedElement.addAttribute("expr", "expression");
+ convertedElement.addAttribute("lang", "juel");
+
+ } else if (actionElement.attribute("ref-name")!=null) {
+ //TODO: action reference ...
+ //jpdlReader.addUnresolvedActionReference(actionElement, this);
+ } else if (actionElement.attribute("class")!=null) {
+ convertedElement.addAttribute("class", actionElement.attributeValue("class"));
+ convertedElement.addAttribute("method", "execute");
+
+ } else {
+ jpdlReader.addWarning("action does not have class nor ref-name attribute "+actionElement.asXML());
+ }
+ //TODO: propagate...
+ String acceptPropagatedEvents = actionElement.attributeValue("accept-propagated-events");
+ if ("false".equalsIgnoreCase(acceptPropagatedEvents)
+ || "no".equalsIgnoreCase(acceptPropagatedEvents)
+ || "off".equalsIgnoreCase(acceptPropagatedEvents)) {
+ isPropagationAllowed = false;
+ }
+ //TODO:Async
+ String asyncText = actionElement.attributeValue("async");
+ if ("true".equalsIgnoreCase(asyncText)) {
+ isAsync = true;
+ } else if ("exclusive".equalsIgnoreCase(asyncText)) {
+ isAsync = true;
+ isAsyncExclusive = true;
+ }
+ }
+
+}
Added: jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/EndState.java
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/EndState.java (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/EndState.java 2009-06-17 07:48:06 UTC (rev 5046)
@@ -0,0 +1,37 @@
+/*
+ * 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.convert.node;
+
+import org.dom4j.Element;
+import org.jbpm.jpdl.internal.convert.Jpdl3ConverterReader;
+
+public class EndState extends Node {
+ public Element createConvertedElement(Element jpdl4Doc) {
+ convertedElement = jpdl4Doc.addElement("end");
+ return convertedElement;
+ }
+
+ public void read(Jpdl3ConverterReader reader) {
+
+
+ }
+}
\ No newline at end of file
Added: jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Fork.java
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Fork.java (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Fork.java 2009-06-17 07:48:06 UTC (rev 5046)
@@ -0,0 +1,43 @@
+/*
+ * 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.convert.node;
+
+
+import org.dom4j.Element;
+import org.jbpm.jpdl.internal.convert.Jpdl3ConverterReader;
+
+public class Fork extends Node {
+ public Element createConvertedElement(Element jpdl4Doc) {
+ convertedElement = jpdl4Doc.addElement("fork");
+ return convertedElement;
+ }
+
+ public void read(Jpdl3ConverterReader reader) {
+ /*Element startTaskElement = nodeElement.element("task");
+ if (startTaskElement!=null) {
+ reader.addWarning("Unsupported start task conversion");
+ // delegate the parsing of the start-state task to the jpdlReader
+ //reader.readStartStateTask(startTaskElement, this);
+ }*/
+
+ }
+}
Added: jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Join.java
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Join.java (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Join.java 2009-06-17 07:48:06 UTC (rev 5046)
@@ -0,0 +1,37 @@
+/*
+ * 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.convert.node;
+
+
+import org.dom4j.Element;
+import org.jbpm.jpdl.internal.convert.Jpdl3ConverterReader;
+
+public class Join extends Node {
+ public Element createConvertedElement(Element jpdl4Doc) {
+ convertedElement = jpdl4Doc.addElement("join");
+ return convertedElement;
+ }
+
+ public void read(Jpdl3ConverterReader reader) {
+
+ }
+}
Added: jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Node.java
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Node.java (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/Node.java 2009-06-17 07:48:06 UTC (rev 5046)
@@ -0,0 +1,52 @@
+/*
+ * 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.convert.node;
+
+import org.dom4j.Element;
+import org.jbpm.jpdl.internal.convert.Jpdl3ConverterReader;
+import org.jbpm.jpdl.internal.convert.action.Action;
+
+public class Node {
+ protected Element convertedElement = null;
+ protected Element nodeElement = null;
+ protected Action action = new Action();
+ public Element createConvertedElement(Element jpdl4Doc) {
+ Element actionElement = nodeElement.element("action");
+ convertedElement= action.createConvertedElement(actionElement, jpdl4Doc);
+ return convertedElement;
+ }
+
+ public void read(Jpdl3ConverterReader reader) {
+ //TODO:implement it
+ Element actionElement = nodeElement.element("action");
+ action.read(actionElement, reader);
+ }
+
+ public Element getConvertedElement() {
+ return convertedElement;
+ }
+
+ //set the jpdl3 element
+ public void setNodeElement(Element ele) {
+ this.nodeElement = ele;
+ }
+}
Added: jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/StartState.java
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/StartState.java (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/StartState.java 2009-06-17 07:48:06 UTC (rev 5046)
@@ -0,0 +1,43 @@
+/*
+ * 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.convert.node;
+
+
+import org.dom4j.Element;
+import org.jbpm.jpdl.internal.convert.Jpdl3ConverterReader;
+
+public class StartState extends Node {
+ public Element createConvertedElement(Element jpdl4Doc) {
+ convertedElement = jpdl4Doc.addElement("start");
+ return convertedElement;
+ }
+
+ public void read(Jpdl3ConverterReader reader) {
+ Element startTaskElement = nodeElement.element("task");
+ if (startTaskElement!=null) {
+ reader.addWarning("Unsupported start task conversion");
+ // delegate the parsing of the start-state task to the jpdlReader
+ //reader.readStartStateTask(startTaskElement, this);
+ }
+
+ }
+}
Added: jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/State.java
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/State.java (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/State.java 2009-06-17 07:48:06 UTC (rev 5046)
@@ -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.jpdl.internal.convert.node;
+
+import org.dom4j.Element;
+import org.jbpm.jpdl.internal.convert.Jpdl3ConverterReader;
+
+public class State extends Node {
+ public Element createConvertedElement(Element jpdl4Doc) {
+ convertedElement = jpdl4Doc.addElement("state");
+ return convertedElement;
+ }
+
+ public void read(Jpdl3ConverterReader reader) {
+
+ }
+ }
\ No newline at end of file
Added: jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/TaskNode.java
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/TaskNode.java (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/TaskNode.java 2009-06-17 07:48:06 UTC (rev 5046)
@@ -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.jpdl.internal.convert.node;
+
+import org.dom4j.Element;
+import org.jbpm.jpdl.internal.convert.Jpdl3ConverterReader;
+
+public class TaskNode extends Node {
+ public Element createConvertedElement(Element jpdl4Doc) {
+ convertedElement = jpdl4Doc.addElement("task");
+ return convertedElement;
+ }
+
+ public void read(Jpdl3ConverterReader reader) {
+
+ }
+}
\ No newline at end of file
Added: jbpm4/branches/jimma/modules/migration/src/main/resources/action.converter.types.xml
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/resources/action.converter.types.xml (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/main/resources/action.converter.types.xml 2009-06-17 07:48:06 UTC (rev 5046)
@@ -0,0 +1,7 @@
+<action-types>
+ <action-type element="action" class="org.jbpm.jpdl.internal.convert.action.Action" />
+ <action-type element="create-timer" class="org.jbpm.scheduler.def.CreateTimerAction" />
+ <action-type element="cancel-timer" class="org.jbpm.scheduler.def.CancelTimerAction" />
+ <action-type element="script" class="org.jbpm.graph.action.Script" />
+ <action-type element="mail" class="org.jbpm.graph.action.MailAction" />
+</action-types>
\ No newline at end of file
Added: jbpm4/branches/jimma/modules/migration/src/main/resources/node.converter.types.xml
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/resources/node.converter.types.xml (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/main/resources/node.converter.types.xml 2009-06-17 07:48:06 UTC (rev 5046)
@@ -0,0 +1,19 @@
+<node-types>
+ <node-type element="start-state" class="org.jbpm.jpdl.internal.convert.node.StartState" />
+ <node-type element="end-state" class="org.jbpm.jpdl.internal.convert.node.EndState" />
+ <node-type element="node" class="org.jbpm.jpdl.internal.convert.node.Node" />
+ <node-type element="state" class="org.jbpm.jpdl.internal.convert.node.State" />
+ <node-type element="task-node" class="org.jbpm.jpdl.internal.convert.node.TaskNode" />
+ <node-type element="fork" class="org.jbpm.jpdl.internal.convert.node.Fork" />
+ <node-type element="join" class="org.jbpm.jpdl.internal.convert.node.Join" />
+ <node-type element="decision" class="org.jbpm.jpdl.internal.convert.node.Decision" />
+ <node-type element="process-state" class="org.jbpm.jpdl.internal.convert.node.ProcessState" />
+ <node-type element="super-state" class="org.jbpm.jpdl.internal.convert.node.SuperState" />
+ <node-type element="mail-node" class="org.jbpm.jpdl.internal.convert.node.MailNode" />
+ <!--node-type element="merge" class="org.jbpm.jpdl.internal.convert.node.Merge" />
+ <node-type element="milestone-node" class="oorg.jbpm.jpdl.internal.convert.node.MilestoneNode" />
+ <node-type element="interleave-start" class="org.jbpm.jpdl.internal.convert.node.InterleaveStart" />
+ <node-type element="interleave-end" class="org.jbpm.jpdl.internal.convert.node.InterleaveEnd"/>
+ <node-type element="page" class="org.jboss.seam.pageflow.Page" />
+ <node-type element="start-page" class="org.jboss.seam.pageflow.Page" /-->
+</node-types>
\ No newline at end of file
Added: jbpm4/branches/jimma/modules/migration/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.0.xsd
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.0.xsd (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.0.xsd 2009-06-17 07:48:06 UTC (rev 5046)
@@ -0,0 +1,866 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- edited with XMLSPY v2004 rel. 4 U (http://www.xmlspy.com) by Jim Rigsbee (private) -->
+<xs:schema targetNamespace="http://jbpm.org/3/jpdl" elementFormDefault="qualified" attributeFormDefault="unqualified" version="3.0" xmlns="http://jbpm.org/3/jpdl" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="process-definition" type="process-definition-v3.0">
+ <xs:annotation>
+ <xs:documentation>jBPM Process Definition Language (JPDL) version 3.0 </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:simpleType name="configType">
+ <xs:annotation>
+ <xs:documentation>Indicates how to use the metadata within a handler</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="field"/>
+ <xs:enumeration value="bean"/>
+ <xs:enumeration value="constructor"/>
+ <xs:enumeration value="configuration-property"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="duedateType">
+ <xs:annotation>
+ <xs:documentation>Expression that indicates when a timer is due to fire</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:string">
+ <xs:pattern value="\p{N}+([ ]+business)?[ ]+((second)|(seconds)|(minute)|(minutes)|(hour)|(hours)|(day)|(days)|(week)|(weeks)|(month)|(months)|(year)|(years))([ ]+(and)[ ]+\p{N}+([ ]+business)?[ ]+((second)|(seconds)|(minute)|(minutes)|(hour)|(hours)|(day)|(days)|(week)|(weeks)|(month)|(months)|(year)|(years)))*"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="booleanType">
+ <xs:annotation>
+ <xs:documentation>Yes, no, true, false, on, and off</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="yes"/>
+ <xs:enumeration value="no"/>
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ <xs:enumeration value="on"/>
+ <xs:enumeration value="off"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="accessType">
+ <xs:annotation>
+ <xs:documentation>Defines how a variable may be accessed</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="read"/>
+ <xs:enumeration value="read,required"/>
+ <xs:enumeration value="read,write"/>
+ <xs:enumeration value="read,write,required"/>
+ <xs:enumeration value="write"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="repeatType">
+ <xs:annotation>
+ <xs:documentation>Defines if and when to repeat a timer</xs:documentation>
+ </xs:annotation>
+ <xs:union memberTypes="duedateType booleanType"/>
+ </xs:simpleType>
+ <xs:element name="action">
+ <xs:annotation>
+ <xs:documentation>Defines custom behavior</xs:documentation>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>The name of the action. When actions are given names, they can be looked up from the process definition. This can be useful for runtime actions and declaring actions only once.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="class" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>Either a class or ref-name must be specified.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="ref-name" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>Either a class or ref-name must be specified. The content of this action is not processed if a referenced action is specified.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="accept-propagated-events" type="booleanType" use="optional" default="true">
+ <xs:annotation>
+ <xs:documentation>If set to false, the action will only be executed on events that were fired on this action's element.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="config-type" type="configType" use="optional">
+ <xs:annotation>
+ <xs:documentation>Specifies how the action object should be constructed and how the content of this element should be used as configuration information for the action object.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="assignment">
+ <xs:annotation>
+ <xs:documentation>Controls the behavior of assigning a task to an identity.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>The content of the assignment element can be used as configuration information for your custom assignment handler implementations. This allows the creation of reusable delegation classes.</xs:documentation>
+ </xs:annotation>
+ </xs:any>
+ </xs:sequence>
+ <xs:attribute name="class" type="xs:string" use="required">
+ <xs:annotation>
+ <xs:documentation>The fully qualified class name of an implementation of org.jbpm.taskmgmt.def.AssignmentHandler.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="config-type" type="configType" use="optional">
+ <xs:annotation>
+ <xs:documentation>Specifies how the assignment handler object should be constructed and how the content of this element should be used as configuration information for that object.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="expression" type="xs:string" use="optional"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="cancel-timer">
+ <xs:annotation>
+ <xs:documentation>Cancels a timer previously set with create-timer</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string" use="required">
+ <xs:annotation>
+ <xs:documentation>The name of the timer to be cancelled.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="create-timer">
+ <xs:annotation>
+ <xs:documentation>See documentation for the timer element.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:choice>
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>The name of the timer. This name can be used later in a cancel-timer element.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="duedate" type="duedateType" use="required">
+ <xs:annotation>
+ <xs:documentation>The duration that specifies the time period between the creation of the timer and the execution of the timer. This can be expressed in business hours, minutes, etc. See the documentation for syntax for this attribute.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="repeat" type="repeatType" use="optional">
+ <xs:annotation>
+ <xs:documentation>yes, true, or duration. After a timer has been executed on the duedate, this repeat attribute specifies the duration between repeating timer executions until the node is left. If yes or true are specified then the value of duedate is used.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="transition" type="xs:string" use="optional"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="decision">
+ <xs:annotation>
+ <xs:documentation>Defines a decision to be made in the processing path</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:annotation>
+ <xs:documentation>Either a handler or transitions with conditions should be specified. The decision will look for the first transition for which the condition evaluates to true. A transition without a condition is considered to evaluate to true (to model the 'otherwise' branch. See the condition element.</xs:documentation>
+ </xs:annotation>
+ <xs:element name="handler" minOccurs="0">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>The content of the handler element can be used as configuration information for your custom decision handler implementations. This allows the creation of reusable delegation classes.</xs:documentation>
+ </xs:annotation>
+ </xs:any>
+ </xs:sequence>
+ <xs:attribute name="class" type="xs:string" use="required">
+ <xs:annotation>
+ <xs:documentation>The fully qualified class name of an implementation of org.jbpm.graph.node.DecisionHandler.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="config-type" type="configType" use="optional">
+ <xs:annotation>
+ <xs:documentation>Specifies how the decision handler object should be constructed and how the content of this element should be used as configuration information for that object.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="transition" minOccurs="0" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="condition" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>A beanshell script that evaluates to true or false.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="action" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="script" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="create-timer" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="cancel-timer" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:choice>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required">
+ <xs:annotation>
+ <xs:documentation>The name of the transition. Note that each transition leaving a node must have a distinct name.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="to" type="xs:string" use="required">
+ <xs:annotation>
+ <xs:documentation>The hierarchical name of the destination node. See documentation for an description of hierarchical names.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element ref="event" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="timer" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="end-state">
+ <xs:annotation>
+ <xs:documentation>Marks the end of a processing path.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="event" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>Event types supported: node-enter, before-signal</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ </xs:choice>
+ <xs:attribute name="type" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="node-enter"/>
+ <xs:enumeration value="before-signal"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="event">
+ <xs:annotation>
+ <xs:documentation>Supported event types: node-enter, node-leave, before-signal, after-signal.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ </xs:choice>
+ <xs:attribute name="type" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="node-enter"/>
+ <xs:enumeration value="node-leave"/>
+ <xs:enumeration value="before-signal"/>
+ <xs:enumeration value="after-signal"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="exception-handler">
+ <xs:annotation>
+ <xs:documentation>A list of exception handlers that applies to all exceptions thrown by delegation classes within this node.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:choice maxOccurs="unbounded">
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ </xs:choice>
+ <xs:attribute name="exception-class" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>Specifies the fully qualified class name of the java throwable class that should match this exception handler. If this attribute is not specified it matches all exceptions derived from java.lang.Throwable.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="fork">
+ <xs:annotation>
+ <xs:documentation>Defines a point in the processing path where multiple execution paths will run in parallel.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="script" minOccurs="0"/>
+ <xs:element ref="transition" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="event" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="timer" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="join">
+ <xs:annotation>
+ <xs:documentation>Defines a point in the processing path where multiple execution paths merge into one path.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="transition" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="event" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="timer" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="node">
+ <xs:annotation>
+ <xs:documentation>A generic node allowing custom behavior.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:choice minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>A custom action that represents the behaviour for this node</xs:documentation>
+ </xs:annotation>
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ </xs:choice>
+ <xs:element ref="transition" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="event" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="timer" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="process-state">
+ <xs:annotation>
+ <xs:documentation>A node that allows execution of another subordinate process.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="sub-process">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string" use="required">
+ <xs:annotation>
+ <xs:documentation>The name of the subordinate process definition to be executed within the enclosing process.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="version" type="xs:integer" use="optional">
+ <xs:annotation>
+ <xs:documentation>The version of the deployed process-definition that is to be executed. If none is specified the latest version of the identified process will be used.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element ref="variable" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="transition" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="event" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>Supported event types: node-enter, node-leave, before-signal, after-signal, subprocess-created, subprocess-end.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ </xs:choice>
+ <xs:attribute name="type" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="node-enter"/>
+ <xs:enumeration value="node-leave"/>
+ <xs:enumeration value="before-signal"/>
+ <xs:enumeration value="after-signal"/>
+ <xs:enumeration value="subprocess-created"/>
+ <xs:enumeration value="subprocess-end"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element ref="timer" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="script">
+ <xs:annotation>
+ <xs:documentation>A beanshell script to execute. The script can be the content of this tag or you can specify one or more variables and a beanshell script in the expression tag.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence minOccurs="0">
+ <xs:element ref="variable" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="expression">
+ <xs:annotation>
+ <xs:documentation>The beanshell script.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>The name of the script action. When actions are given names, they can be looked up from the process definition. This can be useful for runtime actions and declaring actions only once.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="accept-propagated-events" type="booleanType" use="optional" default="true">
+ <xs:annotation>
+ <xs:documentation>If set to false the action will only be executed on events that were fired in this action's element.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="state">
+ <xs:annotation>
+ <xs:documentation>Represents a wait state in a process.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:choice minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>A custom action that represents the behaviour for this node</xs:documentation>
+ </xs:annotation>
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ </xs:choice>
+ <xs:element ref="transition" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="event" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="timer" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="super-state">
+ <xs:annotation>
+ <xs:documentation>Grouping mechanism for a named set of nodes.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>The nodes of the process definition. Note that a process without nodes is valid, but cannot be executed.</xs:documentation>
+ </xs:annotation>
+ <xs:element ref="state"/>
+ <xs:element ref="task-node"/>
+ <xs:element ref="super-state"/>
+ <xs:element ref="process-state"/>
+ <xs:element ref="node"/>
+ <xs:element ref="fork"/>
+ <xs:element ref="join"/>
+ <xs:element ref="decision"/>
+ <xs:element ref="end-state"/>
+ </xs:choice>
+ <xs:element ref="transition" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="event" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>Supports all event types except the process-start and end events.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ </xs:choice>
+ <xs:attribute name="type" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="node-enter"/>
+ <xs:enumeration value="node-leave"/>
+ <xs:enumeration value="before-signal"/>
+ <xs:enumeration value="after-signal"/>
+ <xs:enumeration value="superstate-enter"/>
+ <xs:enumeration value="superstate-leave"/>
+ <xs:enumeration value="task-create"/>
+ <xs:enumeration value="task-assign"/>
+ <xs:enumeration value="task-start"/>
+ <xs:enumeration value="task-end"/>
+ <xs:enumeration value="transition"/>
+ <xs:enumeration value="timer"/>
+ <xs:enumeration value="subprocess-created"/>
+ <xs:enumeration value="subprocess-end"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element ref="timer" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="swimlane">
+ <xs:annotation>
+ <xs:documentation>Groups tasks assigned to the same resource.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="assignment" minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="task">
+ <xs:annotation>
+ <xs:documentation>The tasks that should be created when execution arrives in this task node.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="assignment" minOccurs="0"/>
+ <xs:element name="controller" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>Controller supports the inclusion of one or more "variable" tags as children. It also supports custom XML for use with a custom controller class as indicated by config-type.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>This section can include "variable" elements to identify input and output variables involved in this task.</xs:documentation>
+ </xs:annotation>
+ </xs:any>
+ </xs:sequence>
+ <xs:attribute name="class" type="xs:string" use="optional"/>
+ <xs:attribute name="config-type" type="configType" use="optional">
+ <xs:annotation>
+ <xs:documentation>Specifies how the assignment handler object should be constructed and how the content of this element should be used as configuration information for that object.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="event" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>Supports events: task-create, task-assign, task-start, task-end.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ </xs:choice>
+ <xs:attribute name="type" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="task-create"/>
+ <xs:enumeration value="task-start"/>
+ <xs:enumeration value="task-assign"/>
+ <xs:enumeration value="task-end"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="timer" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>Specifies a timer that monitors the duration of an execution in this task.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:choice>
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>The name for this timer. Every timer should have a unique name. If a name is not specified then the name of the enclosing node is taken.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="duedate" type="duedateType" use="required">
+ <xs:annotation>
+ <xs:documentation>The duration that specifies the time period between the creation of the timer and the execution of the timer. This can be expressed in business hours, minutes, etc. See the documentation for syntax for this attribute.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="repeat" type="repeatType" use="optional">
+ <xs:annotation>
+ <xs:documentation>yes, true, or duration. After a timer has been executed on the duedate, this repeat attribute specifies the duration between repeating timer executions until the node is left. If yes or true are specified then the value of duedate is used.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="transition" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>A transition name to be taken after the timer executes, the timer event is fired and execution of any specified actions has completed.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="cancel-event" type="xs:string" use="optional" default="task-end">
+ <xs:annotation>
+ <xs:documentation>task-assign, task-start, task-end, or any combination of these specified as a comma separated list.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>Named tasks can be referenced and looked up via the TaskMgmtDefinition.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="blocking" type="booleanType" use="optional" default="false"/>
+ <xs:attribute name="signalling" type="booleanType" use="optional" default="true"/>
+ <xs:attribute name="description" type="xs:string" use="optional"/>
+ <xs:attribute name="duedate" type="duedateType" use="optional">
+ <xs:annotation>
+ <xs:documentation>The duration that specifies the time period between the creation of the timer and the execution of the timer. This can be expressed in business hours, minutes, etc. See the documentation for syntax for this attribute.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="swimlane" type="xs:string" use="optional"/>
+ <xs:attribute name="priority" use="optional" default="normal">
+ <xs:annotation>
+ <xs:documentation>This value can also be any integer where the lower the number the higher the priority.</xs:documentation>
+ </xs:annotation>
+ <xs:simpleType>
+ <xs:union>
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="highest"/>
+ <xs:enumeration value="high"/>
+ <xs:enumeration value="normal"/>
+ <xs:enumeration value="low"/>
+ <xs:enumeration value="lowest"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType>
+ <xs:restriction base="xs:int"/>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="task-node">
+ <xs:annotation>
+ <xs:documentation>A node which accepts a list of tasks to be executed.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="task" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="transition" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="event" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="timer" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="signal" use="optional" default="last">
+ <xs:annotation>
+ <xs:documentation>Signal specifies the effect of task completion on the process execution continuation.</xs:documentation>
+ </xs:annotation>
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="unsynchronized"/>
+ <xs:enumeration value="never"/>
+ <xs:enumeration value="first"/>
+ <xs:enumeration value="first-wait"/>
+ <xs:enumeration value="last"/>
+ <xs:enumeration value="last-wait"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="create-tasks" type="booleanType" use="optional" default="true">
+ <xs:annotation>
+ <xs:documentation>Can be set to false when a runtime calculation has to determine which of the tasks have to be created. In that case, add an action on node-enter, create the tasks in the action, and set create-tasks to false.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="end-tasks" type="booleanType" use="optional" default="false">
+ <xs:annotation>
+ <xs:documentation>Can be set to true, in which all the tasks that are still open are ended on the node-leave event.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="timer">
+ <xs:annotation>
+ <xs:documentation>Specifies a timer that monitors the duration of an execution in this node.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:choice>
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>The name for this timer. Every timer should have a unique name. If a name is not specified then the name of the enclosing node is taken.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="duedate" type="duedateType" use="required">
+ <xs:annotation>
+ <xs:documentation>The duration that specifies the time period between the creation of the timer and the execution of the timer. This can be expressed in business hours, minutes, etc. See the documentation for syntax for this attribute.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="repeat" type="repeatType" use="optional">
+ <xs:annotation>
+ <xs:documentation>yes, true, or duration. After a timer has been executed on the duedate, this repeat attribute specifies the duration between repeating timer executions until the node is left. If yes or true are specified then the value of duedate is used.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="transition" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>A transition name to be taken after the timer executes, the timer event is fired and execution of any specified actions has completed.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="transition">
+ <xs:annotation>
+ <xs:documentation>The leaving transitions. Each transition leaving a node must have a distinct name. At most one transition can have no name. The first transition specified is the default transition: the path taken when the node is left without specifying a transition.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ </xs:choice>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>The name of the transition. Note that each transition leaving a node must have a distinct name.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="to" type="xs:string" use="required">
+ <xs:annotation>
+ <xs:documentation>The hierarchical name of the destination node. See documentation for an description of hierarchical names.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="variable">
+ <xs:annotation>
+ <xs:documentation>Input and Output variables for the node. Input variables are specified by access "read". If you have assigned variables during the script evaluation, the variables with "write" access allows you to store the values in the process instance. It does not matter whether the variables existed prior to this action.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>User defined metadata.</xs:documentation>
+ </xs:annotation>
+ </xs:any>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="access" type="accessType" use="optional" default="read,write"/>
+ <xs:attribute name="mapped-name" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>Defaults to the process variable name as given by the name attribute.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:complexType name="process-definition-v3.0">
+ <xs:annotation>
+ <xs:documentation>Version 3.0 of the PDL schema</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element ref="swimlane" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="start-state" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>The start state of the process. Note that a process without a start-state is valid, but cannot be executed.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="task" minOccurs="0"/>
+ <xs:element ref="transition" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="event" minOccurs="0" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ </xs:choice>
+ <xs:attribute name="type" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="node-leave"/>
+ <xs:enumeration value="after-signal"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="optional"/>
+ <xs:attribute name="swimlane" type="xs:string" use="optional"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>The nodes of the process definition. Note that a process without nodes is valid, but cannot be executed.</xs:documentation>
+ </xs:annotation>
+ <xs:element ref="state"/>
+ <xs:element ref="task-node"/>
+ <xs:element ref="super-state"/>
+ <xs:element ref="process-state"/>
+ <xs:element ref="node"/>
+ <xs:element ref="fork"/>
+ <xs:element ref="join"/>
+ <xs:element ref="decision"/>
+ <xs:element ref="end-state"/>
+ </xs:choice>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>Globally defined actions that can be referenced from events and transitions. </xs:documentation>
+ </xs:annotation>
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ </xs:choice>
+ <xs:element ref="task" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="event" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>Supports all event types. Uniquely supports process-start and process-end.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ </xs:choice>
+ <xs:attribute name="type" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="node-enter"/>
+ <xs:enumeration value="node-leave"/>
+ <xs:enumeration value="before-signal"/>
+ <xs:enumeration value="after-signal"/>
+ <xs:enumeration value="superstate-enter"/>
+ <xs:enumeration value="superstate-leave"/>
+ <xs:enumeration value="task-create"/>
+ <xs:enumeration value="task-assign"/>
+ <xs:enumeration value="task-start"/>
+ <xs:enumeration value="task-end"/>
+ <xs:enumeration value="transition"/>
+ <xs:enumeration value="timer"/>
+ <xs:enumeration value="subprocess-created"/>
+ <xs:enumeration value="subprocess-end"/>
+ <xs:enumeration value="process-start"/>
+ <xs:enumeration value="process-end"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element ref="exception-handler" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="optional">
+ <xs:annotation>
+ <xs:documentation>the name of the process</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+</xs:schema>
Added: jbpm4/branches/jimma/modules/migration/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.1.xsd
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.1.xsd (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.1.xsd 2009-06-17 07:48:06 UTC (rev 5046)
@@ -0,0 +1,456 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xs:schema xmlns= "urn:jbpm.org:jpdl-3.1"
+ targetNamespace="urn:jbpm.org:jpdl-3.1"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified">
+
+ <!-- PROCESS-DEFINITION -->
+ <!-- ################## -->
+ <xs:element name="process-definition">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="swimlane" />
+ <xs:element ref="start-state" />
+ <xs:group ref="node-elements"/>
+ <xs:group ref="action-elements" />
+ <xs:element ref="event" />
+ <xs:element ref="exception-handler" />
+ <xs:element ref="task" />
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- SWIMLANE -->
+ <!-- ######## -->
+ <xs:element name="swimlane">
+ <xs:complexType>
+ <xs:sequence minOccurs="0" maxOccurs="1">
+ <xs:element ref="assignment"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- NODES -->
+ <!-- ##### -->
+ <xs:element name="start-state">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="task"/>
+ <xs:element ref="transition"/>
+ <xs:element ref="event"/>
+ <xs:element ref="exception-handler"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="end-state">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="event"/>
+ <xs:element ref="exception-handler"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="decision">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="handler" type="delegation" />
+ <xs:element ref="event"/>
+ <xs:element ref="exception-handler"/>
+ <xs:element name="transition">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="condition">
+ <xs:complexType mixed="true">
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:attribute name="expression" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+ <xs:group ref="action-elements"/>
+ <xs:element ref="exception-handler"/>
+ </xs:choice>
+ <xs:attribute name="to" type="xs:string" use="required" />
+ <xs:attribute name="name" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="expression" type="xs:string" />
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="fork">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="script" />
+ <xs:group ref="node-content-elements" />
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="join">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="node-content-elements" />
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="node">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:choice minOccurs="0">
+ <xs:group ref="action-elements" />
+ </xs:choice>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="node-content-elements" />
+ </xs:choice>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="process-state">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="sub-process">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string" use="required" />
+ <xs:attribute name="version" type="xs:integer" />
+ </xs:complexType>
+ </xs:element>
+ <xs:element ref="variable" />
+ <xs:group ref="node-content-elements" />
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="state">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="node-content-elements"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="super-state">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="node-elements"/>
+ <xs:group ref="node-content-elements"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="task-node">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="task" />
+ <xs:group ref="node-content-elements" />
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="create-tasks" type="booleanType" default="true" />
+ <xs:attribute name="end-tasks" type="booleanType" default="false" />
+ <xs:attribute name="signal" default="last">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="unsynchronized"/>
+ <xs:enumeration value="never"/>
+ <xs:enumeration value="first"/>
+ <xs:enumeration value="first-wait"/>
+ <xs:enumeration value="last"/>
+ <xs:enumeration value="last-wait"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- TRANSITION -->
+ <!-- ########## -->
+ <xs:element name="transition">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="action-elements"/>
+ <xs:element ref="exception-handler" />
+ </xs:choice>
+ <xs:attribute name="to" type="xs:string" use="required" />
+ <xs:attribute name="name" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- ACTIONS -->
+ <!-- ####### -->
+ <xs:element name="action">
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:attribute name="class" type="xs:string" />
+ <xs:attribute name="config-type" default="field">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="field"/>
+ <xs:enumeration value="bean"/>
+ <xs:enumeration value="constructor"/>
+ <xs:enumeration value="configuration-property"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="ref-name" type="xs:string" />
+ <xs:attribute name="accept-propagated-events" type="booleanType" default="true" />
+ <xs:attribute name="expression" type="xs:string" />
+ <xs:attribute name="async" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="cancel-timer">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string" use="required" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="create-timer">
+ <xs:complexType>
+ <xs:choice>
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ </xs:choice>
+ <xs:attribute name="duedate" type="xs:string" use="required" />
+ <xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="repeat" type="xs:string" />
+ <xs:attribute name="transition" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="script">
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="accept-propagated-events" type="booleanType" default="true" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- EVENT -->
+ <!-- ##### -->
+ <xs:element name="event">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="action-elements"/>
+ </xs:choice>
+ <xs:attribute name="type" use="required">
+ <xs:simpleType>
+ <xs:union>
+ <xs:simpleType>
+ <xs:restriction base="xs:string"/>
+ </xs:simpleType>
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="node-enter"/>
+ <xs:enumeration value="node-leave"/>
+ <xs:enumeration value="process-start"/>
+ <xs:enumeration value="process-end"/>
+ <xs:enumeration value="task-create"/>
+ <xs:enumeration value="task-assign"/>
+ <xs:enumeration value="task-start"/>
+ <xs:enumeration value="task-end"/>
+ <xs:enumeration value="before-signal"/>
+ <xs:enumeration value="after-signal"/>
+ <xs:enumeration value="superstate-enter"/>
+ <xs:enumeration value="superstate-leave"/>
+ <xs:enumeration value="timer-create"/>
+ <xs:enumeration value="subprocess-created"/>
+ <xs:enumeration value="subprocess-end"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- EXCEPTION-HANDLER -->
+ <!-- ################# -->
+ <xs:element name="exception-handler">
+ <xs:complexType>
+ <xs:choice minOccurs="1" maxOccurs="unbounded">
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ </xs:choice>
+ <xs:attribute name="exception-class" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- TASK -->
+ <!-- #### -->
+ <xs:element name="task">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="assignment"/>
+ <xs:element ref="controller"/>
+ <xs:element ref="event"/>
+ <xs:element ref="timer"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="blocking" type="booleanType" default="false"/>
+ <xs:attribute name="signalling" type="booleanType" default="true"/>
+ <xs:attribute name="description" type="xs:string" />
+ <xs:attribute name="duedate" type="xs:string" />
+ <xs:attribute name="swimlane" type="xs:string" />
+ <xs:attribute name="priority" type="priorityType" default="normal" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="controller" type="delegation" />
+
+ <xs:element name="assignment">
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="delegation">
+ <xs:attribute name="expression" type="xs:string" />
+ <xs:attribute name="actor-id" type="xs:string" />
+ <xs:attribute name="pooled-actors" type="xs:string" />
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- TIMER -->
+ <!-- ##### -->
+ <xs:element name="timer">
+ <xs:complexType>
+ <xs:choice>
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ </xs:choice>
+ <xs:attribute name="duedate" type="xs:string" use="required" />
+ <xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="repeat" type="xs:string" />
+ <xs:attribute name="transition" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="variable">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="access" type="xs:string" default="read,write"/>
+ <xs:attribute name="mapped-name" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- TYPES AND GROUPS -->
+ <!-- ################ -->
+ <xs:complexType name="delegation" mixed="true">
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:attribute name="class" type="xs:string" />
+ <xs:attribute name="config-type" default="field">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="field"/>
+ <xs:enumeration value="bean"/>
+ <xs:enumeration value="constructor"/>
+ <xs:enumeration value="configuration-property"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+
+ <xs:simpleType name="configType">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="field"/>
+ <xs:enumeration value="bean"/>
+ <xs:enumeration value="constructor"/>
+ <xs:enumeration value="configuration-property"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="booleanType">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="yes"/>
+ <xs:enumeration value="no"/>
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ <xs:enumeration value="on"/>
+ <xs:enumeration value="off"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="priorityType">
+ <xs:union>
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="highest"/>
+ <xs:enumeration value="high"/>
+ <xs:enumeration value="normal"/>
+ <xs:enumeration value="low"/>
+ <xs:enumeration value="lowest"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType>
+ <xs:restriction base="xs:int"/>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+
+ <xs:group name="node-elements">
+ <xs:choice>
+ <xs:element ref="node"/>
+ <xs:element ref="state"/>
+ <xs:element ref="task-node"/>
+ <xs:element ref="super-state"/>
+ <xs:element ref="process-state"/>
+ <xs:element ref="fork"/>
+ <xs:element ref="join"/>
+ <xs:element ref="decision"/>
+ <xs:element ref="end-state"/>
+ </xs:choice>
+ </xs:group>
+
+ <xs:group name="action-elements">
+ <xs:choice>
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ </xs:choice>
+ </xs:group>
+
+ <xs:group name="node-content-elements">
+ <xs:choice>
+ <xs:element ref="event"/>
+ <xs:element ref="exception-handler"/>
+ <xs:element ref="timer"/>
+ <xs:element ref="transition"/>
+ </xs:choice>
+ </xs:group>
+
+</xs:schema>
Added: jbpm4/branches/jimma/modules/migration/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.2.xsd
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.2.xsd (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.2.xsd 2009-06-17 07:48:06 UTC (rev 5046)
@@ -0,0 +1,499 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xs:schema xmlns= "urn:jbpm.org:jpdl-3.2"
+ targetNamespace="urn:jbpm.org:jpdl-3.2"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified">
+
+ <!-- PROCESS-DEFINITION -->
+ <!-- ################## -->
+ <xs:element name="process-definition">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="description" />
+ <xs:element ref="swimlane" />
+ <xs:element ref="start-state" />
+ <xs:group ref="node-elements"/>
+ <xs:group ref="action-elements" />
+ <xs:element ref="event" />
+ <xs:element ref="exception-handler" />
+ <xs:element ref="task" />
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- SWIMLANE -->
+ <!-- ######## -->
+ <xs:element name="swimlane">
+ <xs:complexType>
+ <xs:sequence minOccurs="0" maxOccurs="1">
+ <xs:element ref="assignment"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- NODES -->
+ <!-- ##### -->
+ <xs:element name="start-state">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="description" />
+ <xs:element ref="task"/>
+ <xs:element ref="transition"/>
+ <xs:element ref="event"/>
+ <xs:element ref="exception-handler"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="end-state">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="description" />
+ <xs:element ref="event"/>
+ <xs:element ref="exception-handler"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="end-complete-process" type="booleanType" use="optional" default="false"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="decision">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="description" />
+ <xs:element name="handler" type="delegation" />
+ <xs:element ref="event"/>
+ <xs:element ref="exception-handler"/>
+ <xs:element ref="transition"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="expression" type="xs:string" />
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="fork">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="script" />
+ <xs:group ref="node-content-elements" />
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="join">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="node-content-elements" />
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="node">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:choice minOccurs="0" maxOccurs="1">
+ <xs:group ref="action-elements" />
+ </xs:choice>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="node-content-elements" />
+ </xs:choice>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="process-state">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="sub-process">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string"
+ use="required" />
+ <xs:attribute name="version" type="xs:integer" />
+ <xs:attribute name="binding" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+ <xs:element ref="variable" />
+ <xs:group ref="node-content-elements" />
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required" />
+ <xs:attribute name="async" type="xs:string" default="false" />
+ <xs:attribute name="binding" type="bindingType"></xs:attribute>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="state">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="node-content-elements"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="super-state">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="node-elements"/>
+ <xs:group ref="node-content-elements"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="task-node">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="task" />
+ <xs:group ref="node-content-elements" />
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="create-tasks" type="booleanType" default="true" />
+ <xs:attribute name="end-tasks" type="booleanType" default="false" />
+ <xs:attribute name="signal" default="last">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="unsynchronized"/>
+ <xs:enumeration value="never"/>
+ <xs:enumeration value="first"/>
+ <xs:enumeration value="first-wait"/>
+ <xs:enumeration value="last"/>
+ <xs:enumeration value="last-wait"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="mail-node">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="subject" />
+ <xs:element ref="text" />
+ <xs:group ref="node-content-elements"/>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ <xs:attribute name="template" type="xs:string"/>
+ <xs:attribute name="actors" type="xs:string"/>
+ <xs:attribute name="to" type="xs:string"/>
+ <xs:attribute name="subject" type="xs:string"/>
+ <xs:attribute name="text" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+
+ <!-- TRANSITION -->
+ <!-- ########## -->
+ <xs:element name="transition">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="description" />
+ <xs:element name="condition">
+ <xs:complexType mixed="true">
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:attribute name="expression" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+ <xs:group ref="action-elements"/>
+ <xs:element ref="exception-handler" />
+ </xs:choice>
+ <xs:attribute name="to" type="xs:string" use="required" />
+ <xs:attribute name="name" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- ACTIONS -->
+ <!-- ####### -->
+ <xs:element name="action">
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:attribute name="class" type="xs:string" />
+ <xs:attribute name="config-type" default="field" type="xs:string" />
+ <xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="ref-name" type="xs:string" />
+ <xs:attribute name="accept-propagated-events" type="booleanType" default="true" />
+ <xs:attribute name="expression" type="xs:string" />
+ <xs:attribute name="async" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="cancel-timer">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string" use="required" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="create-timer">
+ <xs:complexType>
+ <xs:choice minOccurs="0">
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ </xs:choice>
+ <xs:attribute name="duedate" type="xs:string" use="required" />
+ <xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="repeat" type="xs:string" />
+ <xs:attribute name="transition" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="script">
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="accept-propagated-events" type="booleanType" default="true" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="mail">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="subject" />
+ <xs:element ref="text" />
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="async" type="xs:string" default="false" />
+ <xs:attribute name="template" type="xs:string"/>
+ <xs:attribute name="actors" type="xs:string"/>
+ <xs:attribute name="to" type="xs:string"/>
+ <xs:attribute name="subject" type="xs:string"/>
+ <xs:attribute name="text" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- EVENT -->
+ <!-- ##### -->
+ <xs:element name="event">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="action-elements"/>
+ </xs:choice>
+ <xs:attribute name="type" use="required">
+ <xs:simpleType>
+ <xs:union>
+ <xs:simpleType>
+ <xs:restriction base="xs:string"/>
+ </xs:simpleType>
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="node-enter"/>
+ <xs:enumeration value="node-leave"/>
+ <xs:enumeration value="process-start"/>
+ <xs:enumeration value="process-end"/>
+ <xs:enumeration value="task-create"/>
+ <xs:enumeration value="task-assign"/>
+ <xs:enumeration value="task-start"/>
+ <xs:enumeration value="task-end"/>
+ <xs:enumeration value="before-signal"/>
+ <xs:enumeration value="after-signal"/>
+ <xs:enumeration value="superstate-enter"/>
+ <xs:enumeration value="superstate-leave"/>
+ <xs:enumeration value="timer-create"/>
+ <xs:enumeration value="subprocess-created"/>
+ <xs:enumeration value="subprocess-end"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- EXCEPTION-HANDLER -->
+ <!-- ################# -->
+ <xs:element name="exception-handler">
+ <xs:complexType>
+ <xs:choice minOccurs="1" maxOccurs="unbounded">
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ </xs:choice>
+ <xs:attribute name="exception-class" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- TASK -->
+ <!-- #### -->
+ <xs:element name="task">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="description" />
+ <xs:element ref="assignment"/>
+ <xs:element ref="controller"/>
+ <xs:element ref="event"/>
+ <xs:element ref="timer"/>
+ <xs:element name="reminder">
+ <xs:complexType>
+ <xs:attribute name="duedate" type="xs:string" use="required" />
+ <xs:attribute name="repeat" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="blocking" type="booleanType" default="false"/>
+ <xs:attribute name="signalling" type="booleanType" default="true"/>
+ <xs:attribute name="description" type="xs:string" />
+ <xs:attribute name="duedate" type="xs:string" />
+ <xs:attribute name="swimlane" type="xs:string" />
+ <xs:attribute name="priority" type="priorityType" default="normal" />
+ <xs:attribute name="notify" type="booleanType" default="false"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="controller" type="delegation" />
+
+ <xs:element name="assignment">
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="delegation">
+ <xs:attribute name="expression" type="xs:string" />
+ <xs:attribute name="actor-id" type="xs:string" />
+ <xs:attribute name="pooled-actors" type="xs:string" />
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- TIMER -->
+ <!-- ##### -->
+ <xs:element name="timer">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="1">
+ <xs:group ref="action-elements" />
+ </xs:choice>
+ <xs:attribute name="duedate" type="xs:string" use="required" />
+ <xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="repeat" type="xs:string" />
+ <xs:attribute name="transition" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="variable">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="access" type="xs:string" default="read,write"/>
+ <xs:attribute name="mapped-name" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+
+ <!-- MAIL -->
+ <!-- #### -->
+ <xs:element name="to" type="xs:string"/>
+ <xs:element name="recipients" type="xs:string"/>
+ <xs:element name="subject" type="xs:string"/>
+ <xs:element name="text" type="xs:string"/>
+ <xs:element name="template" type="xs:string"/>
+
+ <!-- TYPES AND GROUPS -->
+ <!-- ################ -->
+
+ <xs:element name="description" type="xs:string" />
+
+ <xs:complexType name="delegation" mixed="true">
+ <xs:sequence>
+ <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:attribute name="class" type="xs:string" />
+ <xs:attribute name="config-type" default="field" type="xs:string" />
+ </xs:complexType>
+
+ <xs:simpleType name="configType">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="field"/>
+ <xs:enumeration value="bean"/>
+ <xs:enumeration value="constructor"/>
+ <xs:enumeration value="configuration-property"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="booleanType">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="yes"/>
+ <xs:enumeration value="no"/>
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ <xs:enumeration value="on"/>
+ <xs:enumeration value="off"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="priorityType">
+ <xs:union>
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="highest"/>
+ <xs:enumeration value="high"/>
+ <xs:enumeration value="normal"/>
+ <xs:enumeration value="low"/>
+ <xs:enumeration value="lowest"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType>
+ <xs:restriction base="xs:int"/>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+
+ <xs:group name="node-elements">
+ <xs:choice>
+ <xs:element ref="node"/>
+ <xs:element ref="state"/>
+ <xs:element ref="task-node"/>
+ <xs:element ref="super-state"/>
+ <xs:element ref="process-state"/>
+ <xs:element ref="fork"/>
+ <xs:element ref="join"/>
+ <xs:element ref="decision"/>
+ <xs:element ref="end-state"/>
+ <xs:element ref="mail-node"/>
+ </xs:choice>
+ </xs:group>
+
+ <xs:group name="action-elements">
+ <xs:choice>
+ <xs:element ref="action"/>
+ <xs:element ref="script"/>
+ <xs:element ref="create-timer"/>
+ <xs:element ref="cancel-timer"/>
+ <xs:element ref="mail"/>
+ </xs:choice>
+ </xs:group>
+
+ <xs:group name="node-content-elements">
+ <xs:choice>
+ <xs:element ref="description" />
+ <xs:element ref="event"/>
+ <xs:element ref="exception-handler"/>
+ <xs:element ref="timer"/>
+ <xs:element ref="transition"/>
+ </xs:choice>
+ </xs:group>
+
+ <xs:simpleType name="bindingType">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="late"></xs:enumeration>
+ <xs:enumeration value="early"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+</xs:schema>
Modified: jbpm4/branches/jimma/modules/migration/src/main/xsd/jpdl-4.0.xsd
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/xsd/jpdl-4.0.xsd 2009-06-16 19:46:36 UTC (rev 5045)
+++ jbpm4/branches/jimma/modules/migration/src/main/xsd/jpdl-4.0.xsd 2009-06-17 07:48:06 UTC (rev 5046)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://jbpm.org/4/jpdl"
- xmlns:tns="http://jbpm.org/4/jpdl"
+ targetNamespace="http://jbpm.org/4.0/jpdl"
+ xmlns:tns="http://jbpm.org/4.0/jpdl"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
@@ -239,6 +239,18 @@
<element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
</sequence>
<attributeGroup ref="tns:activityAttributes" />
+ <attribute name="multiplicity" type="int" />
+ <attribute name="lockmode" default="upgrade">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="none"/>
+ <enumeration value="read"/>
+ <enumeration value="upgrade"/>
+ <enumeration value="upgrade_nowait"/>
+ <enumeration value="write"/>
+ </restriction>
+ </simpleType>
+ </attribute>
</complexType>
</element>
@@ -313,23 +325,6 @@
</complexType>
</element>
- <!-- ~~~ ESB ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <element name="esb">
- <annotation><documentation>Invokes a service over the ESB.
- </documentation></annotation>
- <complexType>
- <complexContent>
- <extension base="tns:esbType">
- <sequence>
- <element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
- </sequence>
- <attributeGroup ref="tns:activityAttributes" />
- </extension>
- </complexContent>
- </complexType>
- </element>
-
<!-- ~~~ TASK ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<element name="task">
<annotation><documentation>Creates a task in the task component.
@@ -373,8 +368,8 @@
</documentation></annotation>
<complexType>
<sequence minOccurs="0" maxOccurs="unbounded">
- <element ref="tns:variable" minOccurs="0" maxOccurs="unbounded" />
- <element ref="tns:out-variable" minOccurs="0" maxOccurs="unbounded" />
+ <element name="parameter-in" type="tns:parameterType" minOccurs="0" maxOccurs="unbounded" />
+ <element name="parameter-out" type="tns:parameterType" minOccurs="0" maxOccurs="unbounded" />
<element ref="tns:timer" minOccurs="0" maxOccurs="unbounded"/>
<element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
<annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
@@ -421,9 +416,9 @@
</complexType>
</element>
- <!-- ~~~ SUPER-STATE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <!-- ~~~ group ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!--
- <element name="super-state">
+ <element name="group">
<annotation><documentation>Scope enclosing a number of activities.
</documentation></annotation>
<complexType>
@@ -444,6 +439,141 @@
<group name="wireObjectGroup">
<choice>
+ <!-- SPECIAL OBJECTS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <element name="null">
+ <annotation><documentation>the null value
+ </documentation></annotation>
+ </element>
+ <element name="ref">
+ <annotation><documentation>A reference to an object in the current environment</documentation></annotation>
+ <complexType>
+ <attribute name="object" type="string" use="required">
+ <annotation><documentation>The name of the referred object</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+ <element name="env-ref">
+ <annotation><documentation>The current environment.
+ </documentation></annotation>
+ </element>
+ <element name="jndi">
+ <annotation><documentation>A lookup from JNDI through the InitialContext
+ </documentation></annotation>
+ <complexType>
+ <attribute name="jndi-name" type="string" use="required" />
+ </complexType>
+ </element>
+
+ <!-- COLLECTIONS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <element name="list">
+ <annotation><documentation>A java.util.List</documentation></annotation>
+ <complexType>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <group ref="tns:wireObjectGroup" />
+ </choice>
+ <attribute name="class" type="string" default="java.util.ArrayList">
+ <annotation><documentation>Implementation class for this list.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="synchronized" type="tns:booleanValueType" default="false">
+ <annotation><documentation>Indicates if this collection should be synchronized
+ with Collections.synchronizedList(List)</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="map">
+ <annotation><documentation>A java.util.Map</documentation></annotation>
+ <complexType>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element name="entry">
+ <complexType>
+ <choice minOccurs="0">
+ <element name="key" minOccurs="0">
+ <complexType>
+ <group ref="tns:wireObjectGroup" />
+ </complexType>
+ </element>
+ <element name="value" minOccurs="0">
+ <complexType>
+ <group ref="tns:wireObjectGroup" />
+ </complexType>
+ </element>
+ </choice>
+ </complexType>
+ </element>
+ </choice>
+ <attribute name="class" type="string" default="java.util.HashMap">
+ <annotation><documentation>Implementation class for this map.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="synchronized" type="tns:booleanValueType" default="false">
+ <annotation><documentation>Indicates if this collection should be synchronized
+ with Collections.synchronizedList(List)</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="set">
+ <annotation><documentation>A java.util.Set
+ </documentation></annotation>
+ <complexType>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <group ref="tns:wireObjectGroup" />
+ </choice>
+ <attribute name="name" type="string">
+ <annotation><documentation>The name of the object. It's optional and serves
+ as an id to refer to this object from other object declarations. This name can
+ also be used lookup the object programmatically.</documentation></annotation>
+ </attribute>
+ <attribute name="class" type="string" default="java.util.HashList">
+ <annotation><documentation>Implementation class for this set.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="synchronized" type="tns:booleanValueType" default="false">
+ <annotation><documentation>Indicates if this collection should be synchronized
+ with Collections.synchronizedSet(Set)</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="properties">
+ <annotation><documentation>A java.util.Properties</documentation></annotation>
+ <complexType>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element name="property">
+ <complexType>
+ <attribute name="name" type="string" use="required" />
+ <attribute name="value" type="string" use="required" />
+ </complexType>
+ </element>
+ </choice>
+ <attribute name="file" type="string">
+ <annotation><documentation>A file on the file system</documentation></annotation>
+ </attribute>
+ <attribute name="resource" type="string">
+ <annotation><documentation>A file as a resource in the classpath</documentation></annotation>
+ </attribute>
+ <attribute name="url" type="string">
+ <annotation><documentation>the contents is fetched by loading a url</documentation></annotation>
+ </attribute>
+ <attribute name="is-xml" type="tns:booleanValueType">
+ <annotation><documentation>optionally indicates if the content of referenced file in attributes
+ 'file', 'resource' or 'url' is XML. The default is the
+ plain properties format with a space or the equals character (=) separating key and value on
+ each line.</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <!-- OBJECT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <element name="object" type="tns:wireObjectType" />
+
+ <!-- BASIC TYPES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
<element name="string">
<complexType>
<attribute name="name">
@@ -454,34 +584,240 @@
</attribute>
</complexType>
</element>
- <element name="object" type="tns:wireObjectType" />
+
+ <element name="byte">
+ <annotation><documentation>A java.lang.Byte</documentation></annotation>
+ <complexType>
+ <attribute name="name" type="string">
+ <annotation><documentation>The name of the object. It's optional and serves
+ as an id to refer to this object from other object declarations. This name can
+ also be used lookup the object programmatically.</documentation></annotation>
+ </attribute>
+ <attribute name="value" type="byte" use="required" />
+ </complexType>
+ </element>
+ <element name="char">
+ <annotation><documentation>A java.lang.Character</documentation></annotation>
+ <complexType>
+ <attribute name="name" type="string">
+ <annotation><documentation>The name of the object. It's optional and serves
+ as an id to refer to this object from other object declarations. This name can
+ also be used lookup the object programmatically.</documentation></annotation>
+ </attribute>
+ <attribute name="value" use="required">
+ <simpleType>
+ <restriction base="string">
+ <maxLength value="1" />
+ </restriction>
+ </simpleType>
+ </attribute>
+ </complexType>
+ </element>
+ <element name="double">
+ <annotation><documentation>A java.lang.Double</documentation></annotation>
+ <complexType>
+ <attribute name="name" type="string">
+ <annotation><documentation>The name of the object. It's optional and serves
+ as an id to refer to this object from other object declarations. This name can
+ also be used lookup the object programmatically.</documentation></annotation>
+ </attribute>
+ <attribute name="value" type="double" use="required" />
+ </complexType>
+ </element>
+ <element name="false">
+ <annotation><documentation>java.lang.Boolean.FALSE
+ </documentation></annotation>
+ <complexType>
+ <attribute name="name" type="string">
+ <annotation><documentation>The name of the object. It's optional and serves
+ as an id to refer to this object from other object declarations. This name can
+ also be used lookup the object programmatically.</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+ <element name="float">
+ <annotation><documentation>A java.lang.Float
+ </documentation></annotation>
+ <complexType>
+ <attribute name="name" type="string">
+ <annotation><documentation>The name of the object. It's optional and serves
+ as an id to refer to this object from other object declarations. This name can
+ also be used lookup the object programmatically.</documentation></annotation>
+ </attribute>
+ <attribute name="value" type="float" use="required" />
+ </complexType>
+ </element>
+ <element name="int">
+ <annotation><documentation>A java.lang.Integer
+ </documentation></annotation>
+ <complexType>
+ <attribute name="name" type="string">
+ <annotation><documentation>The name of the object. It's optional and serves
+ as an id to refer to this object from other object declarations. This name can
+ also be used lookup the object programmatically.</documentation></annotation>
+ </attribute>
+ <attribute name="value" type="int" use="required"/>
+ </complexType>
+ </element>
+ <element name="long">
+ <annotation><documentation>A java.lang.Long</documentation></annotation>
+ <complexType>
+ <attribute name="name" type="string">
+ <annotation><documentation>The name of the object. It's optional and serves
+ as an id to refer to this object from other object declarations. This name can
+ also be used lookup the object programmatically.</documentation></annotation>
+ </attribute>
+ <attribute name="value" type="long" use="required"/>
+ </complexType>
+ </element>
+ <element name="short">
+ <annotation><documentation>a java.lang.Short
+ </documentation></annotation>
+ <complexType>
+ <attribute name="name" type="string">
+ <annotation><documentation>The name of the object. It's optional and serves
+ as an id to refer to this object from other object declarations. This name can
+ also be used lookup the object programmatically.</documentation></annotation>
+ </attribute>
+ <attribute name="value" type="short" use="required"/>
+ </complexType>
+ </element>
+ <element name="true">
+ <annotation><documentation>java.lang.Boolean.TRUE
+ </documentation></annotation>
+ <complexType>
+ <attribute name="name" type="string">
+ <annotation><documentation>The name of the object. It's optional and serves
+ as an id to refer to this object from other object declarations. This name can
+ also be used lookup the object programmatically.</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+
</choice>
</group>
<complexType name="wireObjectType">
- <sequence>
- <element name="field" minOccurs="0" maxOccurs="unbounded">
- <annotation><documentation>Field injections from the environment
- invocation.</documentation></annotation>
- <complexType >
+ <annotation><documentation>Any java object that will be created by reflection. .
+ <p>There are three main ways to create an object: by constructor or by a factory
+ object or a static factory method.</p>
+ <p><b>Using the constructor</b>: Then the <code>class</code> attribute must provide the
+ fully qualified class name. In case another constructor then the default is
+ targetted, a <code>constructor</code> child element can be provided.
+ The <code>factory</code> attribute should not be provided for using a constructor.
+ </p>
+ <p><b>Using a factory</b>: Then the <code>factory</code> attribute or one
+ <code>factory</code> element must be provided along with the attribute
+ <code>method</code>.
+ </p>
+ <p><b>Using a static factory method</b>: Then the <code>class</code> and
+ <code>method</code> attributes should be specified. There should be no
+ reference to a <code>factory</code> attribute of element.
+ </p>
+ <p><b>Construction and initialization</b>: all objects (constructor and factory)
+ are build in two phases: construction and initialisation phase. During construction
+ all is done until a pointer is obtained to the object. In initialisation, operations
+ are applied to the object until it is ready to be used. The separation between
+ construction and initialisation is made to allow for bidirectional references. In
+ that case, at least one of both ends can not be fully initialised before it is injected
+ into the other end.
+ </p>
+ <p><b>Operations</b>: after construction, various operations can be applied to objects
+ like e.g. direct field injection, injection through setters, method invocation,
+ enlist with the standard transaction, subscribe the object as a listener to an observable
+ </p>
+ <p><b>Arguments</b>: There are two different places for arguments. The <code>arg</code>
+ elements for the factory method invocation should be placed as child elements under the
+ <code>object</code> element. The <code>arg</code> elements for the constructor should be
+ placed as child elements under the <code>constructor</code> element.
+ </p>
+ </documentation></annotation>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element name="factory">
+ <annotation><documentation>Contains one element that describes the factory object.</documentation></annotation>
+ <complexType>
<group ref="tns:wireObjectGroup" />
- <attribute name="name" type="string">
- <annotation><documentation>Name of the field in which the value should be injected.
- </documentation></annotation>
+ </complexType>
+ </element>
+ <element name="constructor">
+ <annotation><documentation>Specifies the arguments to use for a non-default constructor.</documentation></annotation>
+ <complexType>
+ <choice maxOccurs="unbounded">
+ <element name="arg" type="tns:argType" />
+ </choice>
+ </complexType>
+ </element>
+ <element name="arg" type="tns:argType">
+ <annotation><documentation>The factory method arguments.</documentation></annotation>
+ </element>
+ <element name="field">
+ <annotation><documentation>Injects a value into a member field of this object.
+ Exactly one child element must specify the value.
+ </documentation></annotation>
+ <complexType>
+ <group ref="tns:wireObjectGroup" />
+ <attribute name="name">
+ <annotation><documentation>The member field name</documentation></annotation>
</attribute>
</complexType>
</element>
- </sequence>
- <attribute name="object" type="string">
- <annotation><documentation>Name of the object in the environment
+ <element name="property">
+ <annotation><documentation>Injects a value through a setter method.
+ Exactly one child element must specify the value.
+ </documentation></annotation>
+ <complexType>
+ <group ref="tns:wireObjectGroup" />
+ <attribute name="name">
+ <annotation><documentation>The name of the property (without the 'set' prefix)</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+ <element name="invoke">
+ <annotation><documentation>Invokes a method</documentation></annotation>
+ <complexType>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element name="arg" type="tns:argType" />
+ </choice>
+ <attribute name="method" type="string" use="required">
+ <annotation><documentation>the method name</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+ </choice>
+ <attribute name="class" type="string">
+ <annotation><documentation>The fully qualified class name</documentation></annotation>
+ </attribute>
+ <attribute name="expr" type="string">
+ <annotation><documentation>The class to instantiate.
</documentation></annotation>
</attribute>
- <attribute name="class" type="string">
+ <attribute name="lang" type="string">
<annotation><documentation>The class to instantiate.
</documentation></annotation>
</attribute>
- <attribute name="name" type="string">
- <annotation><documentation>The name of this object.
+ <attribute name="factory" type="string">
+ <annotation><documentation>The name of the factory object</documentation></annotation>
+ </attribute>
+ <attribute name="method" type="string">
+ <annotation><documentation>The factory method name</documentation></annotation>
+ </attribute>
+ <attribute name="auto-wire" type="string">
+ <annotation><documentation>Indicates if the member fields and setter properties
+ should be automatically wired based on matching the property names and types with the
+ object names and types</documentation></annotation>
+ </attribute>
+ </complexType>
+
+ <complexType name="argType">
+ <annotation><documentation>The method arguments.
+ Each 'arg' element should have exactly one child element
+ that represents the value of the argument.
+ </documentation></annotation>
+ <attribute name="type" type="string">
+ <annotation><documentation>The java class name representing
+ the type of the method. This is optional and can be used to
+ indicate the appropriate method in case of method overloading.
</documentation></annotation>
</attribute>
</complexType>
@@ -508,6 +844,16 @@
<annotation><documentation>The class to instantiate.
</documentation></annotation>
</attribute>
+ <attribute name="expr" type="string">
+ <annotation><documentation>Expression that resolves to the target object
+ on which the method should be invoked.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="lang" type="string">
+ <annotation><documentation>The language in which attribute 'expr' is to be
+ resolved.
+ </documentation></annotation>
+ </attribute>
<attribute name="var" type="string">
<annotation><documentation>The variable name to store the return value
</documentation></annotation>
@@ -561,38 +907,6 @@
</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="activityAttributes">
<attribute name="name" type="string">
<annotation><documentation>The id of this activity. The name should be unique
@@ -602,6 +916,16 @@
<annotation><documentation>Graphical information used by process designer tool.
</documentation></annotation>
</attribute>
+ <attribute name="async">
+ <annotation><documentation>Graphical information used by process designer tool.
+ </documentation></annotation>
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="true" />
+ <enumeration value="exclusive" />
+ </restriction>
+ </simpleType>
+ </attribute>
</attributeGroup>
<attributeGroup name="assignmentAttributes">
@@ -686,34 +1010,27 @@
</complexType>
</element>
- <element name="variable">
- <complexType>
- <attribute name="name" type="string">
- <annotation><documentation>The name of the variable.
- </documentation></annotation>
- </attribute>
- <attribute name="init" type="string">
- <annotation><documentation>An expression for which the resulting
- value will be used as initial value for the variable.
- </documentation></annotation>
- </attribute>
- </complexType>
- </element>
+ <complexType name="parameterType">
+ <attribute name="subvar" type="string">
+ <annotation><documentation>The name of the sub process variable.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="expr" type="string">
+ <annotation><documentation>An expression for which the resulting
+ value will be used as value.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="lang" type="string">
+ <annotation><documentation>Language of the expression.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="var" type="string">
+ <annotation><documentation>Name of the process variable
+ in the super process execution..
+ </documentation></annotation>
+ </attribute>
+ </complexType>
- <element name="out-variable">
- <complexType>
- <attribute name="name" type="string">
- <annotation><documentation>The name of the variable.
- </documentation></annotation>
- </attribute>
- <attribute name="init" type="string">
- <annotation><documentation>An expression that will be resolved in the
- inner scope and for which the resulting value will be set as a variable
- in the outer scope.
- </documentation></annotation>
- </attribute>
- </complexType>
- </element>
<element name="timer">
<complexType>
@@ -749,7 +1066,6 @@
<element name="sql" type="tns:qlType" />
<element name="java" type="tns:javaType" />
<element name="script" type="tns:scriptType" />
- <element name="esb" type="tns:esbType" />
</choice>
</group>
@@ -768,7 +1084,7 @@
<annotation><documentation>Reference to the email template</documentation></annotation>
</attribute>
</complexType>
-
+
<complexType name="taskType" >
<!--
<sequence>
@@ -816,42 +1132,16 @@
</attribute>
-->
</complexType>
-
- <!--
- <element name="timer">
- <annotation><documentation>A timer that will be bound to the most inner enclosing scope.
- Timers can give a signal to an activity instance. The signal will correspond to a transition
- or to an event being fired.
- </documentation></annotation>
- <complexType>
- <choice minOccurs="0" maxOccurs="unbounded">
- <group ref="tns:eventListenerGroup">
- <annotation><documentation>An inline list of event listeners
- on a timer is a short cut for defining the event separately.
- </documentation></annotation>
- </group>
- </choice>
- <attribute name="duedate" type="string" use="required" />
- <attribute name="signal" type="string" use="required">
- <annotation><documentation>Refers to the signal that will be used.
- If inline event listeners are declared, the signal name can not be
- the same as an event that is declared in this scope.
- </documentation></annotation>
- </attribute>
- <attribute name="repeat" type="string" />
- </complexType>
- </element>
- <simpleType name="priorityType">
+ <simpleType name="booleanValueType">
<restriction base="string">
- <enumeration value="highest"/>
- <enumeration value="high"/>
- <enumeration value="normal"/>
- <enumeration value="low"/>
- <enumeration value="lowest"/>
+ <enumeration value="true" />
+ <enumeration value="on" />
+ <enumeration value="enabled" />
+ <enumeration value="false" />
+ <enumeration value="off" />
+ <enumeration value="disabled" />
</restriction>
</simpleType>
- -->
-
</schema>
Added: jbpm4/branches/jimma/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReaderTest.java
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReaderTest.java (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReaderTest.java 2009-06-17 07:48:06 UTC (rev 5046)
@@ -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.jpdl.internal.convert;
+
+import java.io.InputStream;
+import java.util.List;
+
+import org.dom4j.Document;
+import org.jbpm.api.Problem;
+import org.jbpm.jpdl.internal.xml.JpdlParser;
+import org.junit.Assert;
+import org.junit.Test;
+import org.xml.sax.InputSource;
+
+public class Jpdl3ConverterReaderTest {
+
+ @Test
+ public void testSimpleProcesss() throws Exception {
+ testConvert("simple.xml");
+ }
+
+ @Test
+ public void testBusinessTrip() throws Exception {
+ testConvert("businesstrip.xml");
+ }
+
+ public void testConvert(String resourcefile) throws Exception {
+ InputStream inputStream = getClass().getClassLoader().getResourceAsStream(resourcefile);
+ //Convert to process file to jpdl4
+ InputSource ins = new InputSource(inputStream);
+ Jpdl3ConverterReader converter = new Jpdl3ConverterReader(ins);
+ Document doc = converter.readAndConvert();
+ //System.out.println(doc.asXML());
+
+ List<Problem> problems = new JpdlParser().createParse().setString(doc.asXML()).execute().getProblems();
+ Assert.assertEquals(problems.toString(), 0, problems.size());
+ }
+}
Modified: jbpm4/branches/jimma/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/JpdlConverterTest.java
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/JpdlConverterTest.java 2009-06-16 19:46:36 UTC (rev 5045)
+++ jbpm4/branches/jimma/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/JpdlConverterTest.java 2009-06-17 07:48:06 UTC (rev 5046)
@@ -27,6 +27,7 @@
import org.jbpm.api.Problem;
import org.jbpm.jpdl.internal.xml.JpdlParser;
import org.junit.Assert;
+import org.junit.Ignore;
import org.junit.Test;
public class JpdlConverterTest {
@@ -46,12 +47,12 @@
public void testDescision() throws Exception {
testConvert("testDecision.xml");
}
- @Test
+ @Ignore
public void testEvent() throws Exception {
testConvert("process-event.xml");
}
- @Test
+ @Ignore
public void testTimer() throws Exception {
testConvert("timer.xml");
}
16 years, 10 months
JBoss JBPM SVN: r5045 - jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-06-16 15:46:36 -0400 (Tue, 16 Jun 2009)
New Revision: 5045
Removed:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/JtaTransaction.java
Log:
JBPM-2322 enabled module test-db in the integration test suite
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/JtaTransaction.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/JtaTransaction.java 2009-06-16 19:43:57 UTC (rev 5044)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/JtaTransaction.java 2009-06-16 19:46:36 UTC (rev 5045)
@@ -1,85 +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.tx;
-
-import javax.naming.InitialContext;
-import javax.transaction.Status;
-import javax.transaction.Synchronization;
-import javax.transaction.SystemException;
-import javax.transaction.TransactionManager;
-import javax.transaction.UserTransaction;
-
-import org.jbpm.api.JbpmException;
-import org.jbpm.api.env.Transaction;
-
-
-/**
- * @author Tom Baeyens
- */
-public class JtaTransaction implements Transaction {
-
- protected String userTransactionJndiName = "java:comp/UserTransaction";
- protected String transactionManagerJndiName = "java:/TransactionManager";
-
- public boolean isRollbackOnly() {
- try {
- return getUserTransaction().getStatus()==Status.STATUS_MARKED_ROLLBACK;
- } catch (SystemException e) {
- throw new JbpmException("couldn't get status of user transaction", e);
- }
- }
-
- public void setRollbackOnly() {
- try {
- getUserTransaction().setRollbackOnly();
- } catch (Exception e) {
- throw new JbpmException("couldn't set user transaction to rollback only", e);
- }
- }
-
- public void registerSynchronization(Synchronization synchronization) {
- try {
- getJeeTransaction().registerSynchronization(synchronization);
- } catch (Exception e) {
- throw new JbpmException("couldn't register synchronization", e);
- }
- }
-
- protected UserTransaction getUserTransaction() {
- try {
- InitialContext initialContext = new InitialContext();
- return (UserTransaction) initialContext.lookup(userTransactionJndiName);
- } catch (Exception e) {
- throw new JbpmException("couldn't lookup user transaction at "+userTransactionJndiName, e);
- }
- }
-
- protected javax.transaction.Transaction getJeeTransaction() {
- try {
- InitialContext initialContext = new InitialContext();
- TransactionManager transactionManager = (TransactionManager) initialContext.lookup(transactionManagerJndiName);
- return transactionManager.getTransaction();
- } catch (Exception e) {
- throw new JbpmException("couldn't get transaction from transaction manager "+userTransactionJndiName, e);
- }
- }
-}
16 years, 10 months
JBoss JBPM SVN: r5044 - in jbpm4/trunk: modules/distro/src/main/files/jboss and 23 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-06-16 15:43:57 -0400 (Tue, 16 Jun 2009)
New Revision: 5044
Added:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaStatusHelper.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/tx/jta/JtaTransactionInterceptor.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/JtaTransactionInterceptorBinding.java
jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/
jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jboss.idm/
jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jboss.idm/jbpm.cfg.xml
jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/
jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.cfg.xml
jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.properties
jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.templates.examples.xml
Removed:
jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.integration.test.cfg.xml
jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml
jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.properties
jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.templates.examples.xml
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/wire/binding/JtaTransactionInterceptorBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaStatusHelper.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/tx/jta/JtaTransactionInterceptor.java
jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jboss.idm/
jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jboss.idm/jbpm.cfg.xml
jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/
jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.cfg.xml
jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.properties
jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.templates.examples.xml
Modified:
jbpm4/trunk/modules/distro/pom.xml
jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml
jbpm4/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-enterprise.jar/META-INF/ejb-jar.xml
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EjbRemoteCommandService.java
jbpm4/trunk/modules/examples/pom.xml
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/repository/JpdlDeployer.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetResourceAsStreamCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentClassLoader.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/RepositorySession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JbossIdmIdentitySessionDescriptor.java
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.tx.jta.cfg.xml
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.wire.bindings.xml
jbpm4/trunk/modules/test-db/pom.xml
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/async/AsyncBasicsTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/EventListenerTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java
jbpm4/trunk/qa/build.xml
Log:
JBPM-2322 enabled module test-db in the integration test suite
Modified: jbpm4/trunk/modules/distro/pom.xml
===================================================================
--- jbpm4/trunk/modules/distro/pom.xml 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/distro/pom.xml 2009-06-16 19:43:57 UTC (rev 5044)
@@ -212,7 +212,7 @@
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
- <id>get.oracle.driver.lib</id>
+ <id>get.oracle.driver.and.junit.lib</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
@@ -225,8 +225,14 @@
<version>${oracle.version}</version>
<destFileName>ojdbc14.jar</destFileName>
</artifactItem>
+ <artifactItem>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <destFileName>junit.jar</destFileName>
+ </artifactItem>
</artifactItems>
- <outputDirectory>target/oracle</outputDirectory>
+ <outputDirectory>target/libs</outputDirectory>
</configuration>
</execution>
</executions>
Modified: jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml 2009-06-16 19:43:57 UTC (rev 5044)
@@ -22,9 +22,9 @@
<property name="jboss.server.configuration" value="default" />
<property name="jboss.server.config.dir" value="${jboss.home}/server/${jboss.server.configuration}" />
<property name="jboss.server.data.dir" value="${jboss.home}/server/${jboss.server.configuration}/data" />
-
<property name="jbossidm.version" value="1.0.0.Alpha8" />
<property name="jbossidm.home" value="${jbpm.parent.dir}/jbossidm-${jbossidm.version}" />
+
<!-- for SNAPSHOT temporarily -->
<property name="jbossidm.distro.url" value="http://repository.jboss.com/maven2/org/jboss/identity/idm/jbossidm/${jbos..." />
<property name="jbossidm.distro.path" value="${jbpm.parent.dir}/idm-assembly-${jbossidm.version}.zip" />
@@ -255,24 +255,6 @@
overwrite="true" />
</target>
- <!-- ### THE JBOSS INTEGRATION TEST SPECIFICS ####################### -->
- <target name="internal.install.jbpm.into.jboss.integrationtestspecifics">
- <copy todir="${jboss.server.config.dir}/deploy/jbpm/jbpm-service.sar" overwrite="true">
- <fileset dir="${jbpm.home}/jboss/jbpm.cfg.integration.tests" />
- </copy>
- <antcall target="internal.install.idm.into.jboss.integrationtestspecifics" />
- <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" />
- </target>
-
- <target name="internal.install.idm.into.jboss.integrationtestspecifics" if="jbpm.identity.idm">
- <copy file="${jbpm.home}/jboss/jbpm.cfg.idm/jbpm.integration.test.cfg.xml"
- tofile="${jboss.server.config.dir}/deploy/jbpm/jbpm-service.sar/jbpm.cfg.xml"
- overwrite="true" />
- </target>
-
<!-- ### THE HSQLDB SPECIFIC PART ####################################### -->
<target name="internal.install.jbpm.into.jboss.db.hsqldb" />
Modified: jbpm4/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-enterprise.jar/META-INF/ejb-jar.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-enterprise.jar/META-INF/ejb-jar.xml 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-enterprise.jar/META-INF/ejb-jar.xml 2009-06-16 19:43:57 UTC (rev 5044)
@@ -20,7 +20,7 @@
<local>org.jbpm.enterprise.internal.ejb.LocalCommandExecutor</local>
<ejb-class>org.jbpm.enterprise.internal.ejb.CommandExecutorSLSB</ejb-class>
<session-type>Stateless</session-type>
- <transaction-type>Container</transaction-type>
+ <transaction-type>Bean</transaction-type>
<ejb-local-ref>
<description>
@@ -150,13 +150,13 @@
<assembly-descriptor>
- <container-transaction>
+ <!-- container-transaction>
<method>
<ejb-name>CommandExecutor</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
- </container-transaction>
+ </container-transaction -->
<container-transaction>
<method>
Deleted: jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.integration.test.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.integration.test.cfg.xml 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.integration.test.cfg.xml 2009-06-16 19:43:57 UTC (rev 5044)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jbpm-configuration>
-
- <import resource="jbpm.default.cfg.xml" />
- <import resource="jbpm.tx.jta.cfg.xml" />
- <import resource="jbpm.jpdl.cfg.xml" />
- <import resource="jbpm.jboss.idm.cfg.xml" />
-
- <import resource="jbpm.mail.templates.examples.xml" />
-
- <!-- Job executor is excluded for running the example test cases.
- To enable timers and messages in production use, this should be included.
- import resource="jbpm.jobexecutor.cfg.xml" / -->
-
-</jbpm-configuration>
Deleted: jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml 2009-06-16 19:43:57 UTC (rev 5044)
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jbpm-configuration>
-
- <import resource="jbpm.default.cfg.xml" />
- <import resource="jbpm.tx.jta.cfg.xml" />
- <import resource="jbpm.jpdl.cfg.xml" />
- <import resource="jbpm.identity.cfg.xml" />
-
- <import resource="jbpm.mail.templates.examples.xml" />
-
-</jbpm-configuration>
Deleted: jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.properties
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.properties 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.properties 2009-06-16 19:43:57 UTC (rev 5044)
@@ -1,3 +0,0 @@
-mail.smtp.host localhost
-mail.smtp.port 2525
-mail.from noreply(a)jbpm.org
\ No newline at end of file
Deleted: jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.templates.examples.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.templates.examples.xml 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.templates.examples.xml 2009-06-16 19:43:57 UTC (rev 5044)
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jbpm-configuration>
-
- <process-engine-context>
-
- <mail-template name="rectify-template">
- <to addresses="${addressee}" />
- <cc users="bb" groups="innerparty" />
- <bcc groups="thinkpol" />
- <subject>rectify ${newspaper}</subject>
- <text>${newspaper} ${date} ${details}</text>
- </mail-template>
-
- </process-engine-context>
-
-</jbpm-configuration>
\ No newline at end of file
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EjbRemoteCommandService.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EjbRemoteCommandService.java 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EjbRemoteCommandService.java 2009-06-16 19:43:57 UTC (rev 5044)
@@ -68,7 +68,7 @@
return (T) result;
} catch (Exception e) {
- throw new JbpmException("couldn't execute remote command", e);
+ throw new JbpmException("couldn't execute remote command: "+e.getMessage(), e);
}
}
}
Deleted: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/wire/binding/JtaTransactionInterceptorBinding.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/wire/binding/JtaTransactionInterceptorBinding.java 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/wire/binding/JtaTransactionInterceptorBinding.java 2009-06-16 19:43:57 UTC (rev 5044)
@@ -1,65 +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.enterprise.internal.wire.binding;
-
-import org.jbpm.enterprise.internal.jta.JtaTransactionInterceptor;
-import org.jbpm.pvm.internal.util.XmlUtil;
-import org.jbpm.pvm.internal.wire.Descriptor;
-import org.jbpm.pvm.internal.wire.binding.PropertiesBinding;
-import org.jbpm.pvm.internal.wire.binding.WireInterceptorBinding;
-import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.StringDescriptor;
-import org.jbpm.pvm.internal.xml.Parse;
-import org.jbpm.pvm.internal.xml.Parser;
-import org.w3c.dom.Element;
-
-/**
- * Mapping between a <code>jta-transaction-interceptor</code> element and a
- * {@link JtaTransactionInterceptor} object.
- *
- * @author Alejandro Guizar
- */
-public class JtaTransactionInterceptorBinding extends WireInterceptorBinding {
-
- private static final PropertiesBinding propertiesBinding = new PropertiesBinding();
-
- public JtaTransactionInterceptorBinding() {
- super("jta-transaction-interceptor");
- }
-
- public Object parse(Element element, Parse parse, Parser parser) {
- ObjectDescriptor descriptor = new ObjectDescriptor(JtaTransactionInterceptor.class);
- // user transaction jndi name
- String userTransactionName = XmlUtil.attribute(element, "user-transaction-name");
- if (userTransactionName != null) {
- descriptor.addInjection("userTransactionName", new StringDescriptor(userTransactionName));
- }
- // jndi properties
- Element jndiPropertiesElement = XmlUtil.element(element, "jndi-properties");
- if (jndiPropertiesElement != null) {
- descriptor.addInjection("jndiProperties", (Descriptor) propertiesBinding.parse(
- jndiPropertiesElement, parse, parser));
- }
- return descriptor;
- }
-
-}
Modified: jbpm4/trunk/modules/examples/pom.xml
===================================================================
--- jbpm4/trunk/modules/examples/pom.xml 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/examples/pom.xml 2009-06-16 19:43:57 UTC (rev 5044)
@@ -183,16 +183,6 @@
<configuration>
<failIfNoTests>false</failIfNoTests>
<trimStackTrace>false</trimStackTrace>
- <excludes>
- <!-- https://jira.jboss.org/jira/browse/JBPM-2147 -->
- <!-- https://jira.jboss.org/jira/browse/JBPM-2200
- <exclude>org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java</exclude>
- <exclude>org/jbpm/examples/task/candidates/TaskCandidatesTest.java</exclude>
- <exclude>org/jbpm/examples/mail/template/TemplateMailTest.java</exclude>
- <exclude>org/jbpm/examples/mail/inline/InlineMailTest.java</exclude>
- <exclude>org/jbpm/examples/eventlistener/EventListenerTest.java</exclude>
- -->
- </excludes>
</configuration>
</plugin>
</plugins>
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/repository/JpdlDeployer.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/repository/JpdlDeployer.java 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/repository/JpdlDeployer.java 2009-06-16 19:43:57 UTC (rev 5044)
@@ -21,6 +21,7 @@
*/
package org.jbpm.jpdl.internal.repository;
+import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.List;
@@ -51,7 +52,8 @@
for (String resourceName: deployment.getResourceNames()) {
if (resourceName.endsWith(".jpdl.xml")) {
- InputStream inputStream = deployment.getResourceAsStream(resourceName);
+ byte[] bytes = deployment.getBytes(resourceName);
+ InputStream inputStream = new ByteArrayInputStream(bytes);
Parse parse = jpdlParser.createParse();
parse.setProblems(deployment.getProblems());
parse.setInputStream(inputStream);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java 2009-06-16 19:43:57 UTC (rev 5044)
@@ -98,7 +98,7 @@
* transaction. */
protected void handleJobExecutionException(Environment environment, JobImpl<?> job, Throwable exception) {
Transaction transaction = environment.get(Transaction.class);
- transaction.setRollbackOnly();
+ // transaction.setRollbackOnly();
CommandService commandService = (CommandService) environment.get(CommandService.class);
JobExceptionHandler jobExceptionHandler = new JobExceptionHandler(job.getDbid(), exception, commandService);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetResourceAsStreamCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetResourceAsStreamCmd.java 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetResourceAsStreamCmd.java 2009-06-16 19:43:57 UTC (rev 5044)
@@ -30,7 +30,7 @@
/**
* @author Tom Baeyens
*/
-public class GetResourceAsStreamCmd extends AbstractCommand<InputStream> {
+public class GetResourceAsStreamCmd extends AbstractCommand<byte[]> {
private static final long serialVersionUID = 1L;
@@ -42,8 +42,8 @@
this.resourceName = resourceName;
}
- public InputStream execute(Environment environment) {
+ public byte[] execute(Environment environment) {
RepositorySession repositorySession = environment.get(RepositorySession.class);
- return repositorySession.getResourceAsStream(deploymentDbid, resourceName);
+ return repositorySession.getBytes(deploymentDbid, resourceName);
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentClassLoader.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentClassLoader.java 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentClassLoader.java 2009-06-16 19:43:57 UTC (rev 5044)
@@ -21,6 +21,7 @@
*/
package org.jbpm.pvm.internal.repository;
+import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
@@ -46,8 +47,9 @@
public URL findResource(String name) {
URL url = null;
- InputStream inputStream = deployment.getResourceAsStream(name);
- if (inputStream!=null) {
+ byte[] bytes = deployment.getBytes(name);
+ if (bytes!=null) {
+ InputStream inputStream = new ByteArrayInputStream(bytes);
try {
url = new URL(null, "jbpm://"+deployment.getDbid()+"/"+name, new BytesUrlStreamHandler(inputStream));
} catch (MalformedURLException e) {
@@ -84,9 +86,10 @@
Class clazz = null;
String fileName = name.replace( '.', '/' ) + ".class";
- InputStream inputStream = deployment.getResourceAsStream(fileName);
- if (inputStream!=null) {
+ byte[] bytes = deployment.getBytes(fileName);
+ if (bytes!=null) {
try {
+ InputStream inputStream = new ByteArrayInputStream(bytes);
byte[] classBytes = IoUtil.readBytes(inputStream);
clazz = defineClass(name, classBytes, 0, classBytes.length);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java 2009-06-16 19:43:57 UTC (rev 5044)
@@ -21,7 +21,6 @@
*/
package org.jbpm.pvm.internal.repository;
-import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
@@ -41,7 +40,6 @@
import org.jbpm.api.env.Environment;
import org.jbpm.pvm.internal.cmd.DeployCmd;
import org.jbpm.pvm.internal.lob.Lob;
-import org.jbpm.pvm.internal.session.RepositorySession;
import org.jbpm.pvm.internal.stream.ByteArrayStreamInput;
import org.jbpm.pvm.internal.stream.FileStreamInput;
import org.jbpm.pvm.internal.stream.InputStreamInput;
@@ -156,12 +154,11 @@
return resources.keySet();
}
- public InputStream getResourceAsStream(String resourceName) {
+ public byte[] getBytes(String resourceName) {
if (resources!=null) {
Lob lob = resources.get(resourceName);
if (lob!=null) {
- byte[] bytes = lob.extractBytes();
- return new ByteArrayInputStream(bytes);
+ return lob.extractBytes();
}
}
return null;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java 2009-06-16 19:43:57 UTC (rev 5044)
@@ -21,6 +21,7 @@
*/
package org.jbpm.pvm.internal.repository;
+import java.io.ByteArrayInputStream;
import java.io.InputStream;
import org.jbpm.api.Deployment;
@@ -64,7 +65,11 @@
}
public InputStream getResourceAsStream(long deploymentDbid, String resource) {
- return commandService.execute(new GetResourceAsStreamCmd(deploymentDbid, resource));
+ byte[] bytes = commandService.execute(new GetResourceAsStreamCmd(deploymentDbid, resource));
+ if (bytes!=null) {
+ return new ByteArrayInputStream(bytes);
+ }
+ return null;
}
public ProcessDefinitionQuery createProcessDefinitionQuery() {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java 2009-06-16 19:43:57 UTC (rev 5044)
@@ -139,12 +139,12 @@
return object;
}
- public InputStream getResourceAsStream(long deploymentDbid, String resourceName) {
+ public byte[] getBytes(long deploymentDbid, String resourceName) {
DeploymentImpl deployment = getDeployment(deploymentDbid);
if (deployment==null) {
return null;
}
- return deployment.getResourceAsStream(resourceName);
+ return deployment.getBytes(resourceName);
}
// queries //////////////////////////////////////////////////////////////////
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/RepositorySession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/RepositorySession.java 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/RepositorySession.java 2009-06-16 19:43:57 UTC (rev 5044)
@@ -21,8 +21,6 @@
*/
package org.jbpm.pvm.internal.session;
-import java.io.InputStream;
-
import org.jbpm.api.Deployment;
import org.jbpm.api.client.ClientProcessDefinition;
import org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl;
@@ -37,7 +35,7 @@
Object getObject(long deploymentDbid, String objectName);
- InputStream getResourceAsStream(long deploymentDbid, String resourceName);
+ byte[] getBytes(long deploymentDbid, String resourceName);
/** create a process definition query */
ProcessDefinitionQueryImpl createProcessDefinitionQuery();
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta (from rev 5043, jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta)
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaStatusHelper.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaStatusHelper.java 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaStatusHelper.java 2009-06-16 19:43:57 UTC (rev 5044)
@@ -1,57 +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.tx.jta;
-
-import javax.transaction.Status;
-
-
-/**
- * @author Tom Baeyens
- */
-public abstract class JtaStatusHelper {
-
- public static String toString(int txStatus) {
- if (txStatus==Status.STATUS_ACTIVE) {
- return "STATUS_ACTIVE";
- } else if (txStatus==Status.STATUS_COMMITTED) {
- return "STATUS_COMMITTED";
- } else if (txStatus==Status.STATUS_COMMITTING) {
- return "STATUS_COMMITTING";
- } else if (txStatus==Status.STATUS_MARKED_ROLLBACK) {
- return "STATUS_MARKED_ROLLBACK";
- } else if (txStatus==Status.STATUS_NO_TRANSACTION) {
- return "STATUS_NO_TRANSACTION";
- } else if (txStatus==Status.STATUS_PREPARED) {
- return "STATUS_PREPARED";
- } else if (txStatus==Status.STATUS_PREPARING) {
- return "STATUS_PREPARING";
- } else if (txStatus==Status.STATUS_ROLLEDBACK) {
- return "STATUS_ROLLEDBACK";
- } else if (txStatus==Status.STATUS_ROLLING_BACK) {
- return "STATUS_ROLLING_BACK";
- } else if (txStatus==Status.STATUS_UNKNOWN) {
- return "STATUS_UNKNOWN";
- } else {
- return "unknown";
- }
- }
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaStatusHelper.java (from rev 5043, jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaStatusHelper.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaStatusHelper.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaStatusHelper.java 2009-06-16 19:43:57 UTC (rev 5044)
@@ -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.tx.jta;
+
+import javax.transaction.Status;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public abstract class JtaStatusHelper {
+
+ public static String toString(int txStatus) {
+ if (txStatus==Status.STATUS_ACTIVE) {
+ return "STATUS_ACTIVE";
+ } else if (txStatus==Status.STATUS_COMMITTED) {
+ return "STATUS_COMMITTED";
+ } else if (txStatus==Status.STATUS_COMMITTING) {
+ return "STATUS_COMMITTING";
+ } else if (txStatus==Status.STATUS_MARKED_ROLLBACK) {
+ return "STATUS_MARKED_ROLLBACK";
+ } else if (txStatus==Status.STATUS_NO_TRANSACTION) {
+ return "STATUS_NO_TRANSACTION";
+ } else if (txStatus==Status.STATUS_PREPARED) {
+ return "STATUS_PREPARED";
+ } else if (txStatus==Status.STATUS_PREPARING) {
+ return "STATUS_PREPARING";
+ } else if (txStatus==Status.STATUS_ROLLEDBACK) {
+ return "STATUS_ROLLEDBACK";
+ } else if (txStatus==Status.STATUS_ROLLING_BACK) {
+ return "STATUS_ROLLING_BACK";
+ } else if (txStatus==Status.STATUS_UNKNOWN) {
+ return "STATUS_UNKNOWN";
+ } else {
+ return "unknown";
+ }
+ }
+}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransaction.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransaction.java 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransaction.java 2009-06-16 19:43:57 UTC (rev 5044)
@@ -1,134 +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.tx.jta;
-
-import javax.naming.InitialContext;
-import javax.transaction.Status;
-import javax.transaction.Synchronization;
-import javax.transaction.SystemException;
-import javax.transaction.TransactionManager;
-import javax.transaction.UserTransaction;
-
-import org.jbpm.api.JbpmException;
-import org.jbpm.api.env.Transaction;
-
-
-/**
- * @author Tom Baeyens
- */
-public class JtaTransaction implements Transaction {
-
- protected String userTransactionJndiName = "java:comp/UserTransaction";
- protected String transactionManagerJndiName = "java:/TransactionManager";
-
- public boolean isRollbackOnly() {
- try {
- return lookupJeeUserTransaction().getStatus()==Status.STATUS_MARKED_ROLLBACK;
- } catch (SystemException e) {
- throw new JbpmException("couldn't get status of user transaction: "+e.getMessage(), e);
- }
- }
-
- public void setRollbackOnly() {
- try {
- lookupJeeUserTransaction().setRollbackOnly();
- } catch (Exception e) {
- throw new JbpmException("couldn't set user transaction to rollback only: "+e.getMessage(), e);
- }
- }
-
- public void registerSynchronization(Synchronization synchronization) {
- try {
- lookupJeeTransaction().registerSynchronization(synchronization);
- } catch (Exception e) {
- throw new JbpmException("couldn't register synchronization: "+e.getMessage(), e);
- }
- }
-
- public void begin() {
- try {
- lookupJeeUserTransaction().begin();
- } catch (Exception e) {
- throw new JbpmException("couldn't begin transaction: "+e.getMessage(), e);
- }
- }
-
- public void rollback() {
- try {
- lookupJeeUserTransaction().rollback();
- } catch (Exception e) {
- throw new JbpmException("couldn't rollback: "+e.getMessage(), e);
- }
- }
-
- public void commit() {
- try {
- lookupJeeUserTransaction().commit();
- } catch (Exception e) {
- throw new JbpmException("couldn't commit: "+e.getMessage(), e);
- }
- }
-
- public javax.transaction.Transaction suspend() {
- try {
- return lookupJeeTransactionManager().suspend();
- } catch (Exception e) {
- throw new JbpmException("couldn't suspend: "+e.getMessage(), e);
- }
- }
-
- public void resume(javax.transaction.Transaction transaction) {
- try {
- lookupJeeTransactionManager().resume(transaction);
- } catch (Exception e) {
- throw new JbpmException("couldn't resume: "+e.getMessage(), e);
- }
- }
-
- // lookups //////////////////////////////////////////////////////////////////
-
- public UserTransaction lookupJeeUserTransaction() {
- return (UserTransaction) lookupFromJndi(userTransactionJndiName);
- }
-
- public javax.transaction.Transaction lookupJeeTransaction() {
- try {
- TransactionManager transactionManager = lookupJeeTransactionManager();
- return transactionManager.getTransaction();
- } catch (Exception e) {
- throw new JbpmException("couldn't get transaction from transaction manager "+transactionManagerJndiName+": "+e.getMessage(), e);
- }
- }
-
- public TransactionManager lookupJeeTransactionManager() {
- return (TransactionManager) lookupFromJndi(transactionManagerJndiName);
- }
-
- public static Object lookupFromJndi(String jndiName) {
- try {
- InitialContext initialContext = new InitialContext();
- return initialContext.lookup(jndiName);
- } catch (Exception e) {
- throw new JbpmException("couldn't lookup '"+jndiName+"' from jndi: "+e.getMessage()+": "+e.getMessage(), e);
- }
- }
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransaction.java (from rev 5043, jbpm4/branches/tbaeyens/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 (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransaction.java 2009-06-16 19:43:57 UTC (rev 5044)
@@ -0,0 +1,134 @@
+/*
+ * 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.jta;
+
+import javax.naming.InitialContext;
+import javax.transaction.Status;
+import javax.transaction.Synchronization;
+import javax.transaction.SystemException;
+import javax.transaction.TransactionManager;
+import javax.transaction.UserTransaction;
+
+import org.jbpm.api.JbpmException;
+import org.jbpm.api.env.Transaction;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class JtaTransaction implements Transaction {
+
+ protected String userTransactionJndiName = "java:comp/UserTransaction";
+ protected String transactionManagerJndiName = "java:/TransactionManager";
+
+ public boolean isRollbackOnly() {
+ try {
+ return lookupJeeUserTransaction().getStatus()==Status.STATUS_MARKED_ROLLBACK;
+ } catch (SystemException e) {
+ throw new JbpmException("couldn't get status of user transaction: "+e.getMessage(), e);
+ }
+ }
+
+ public void setRollbackOnly() {
+ try {
+ lookupJeeUserTransaction().setRollbackOnly();
+ } catch (Exception e) {
+ throw new JbpmException("couldn't set user transaction to rollback only: "+e.getMessage(), e);
+ }
+ }
+
+ public void registerSynchronization(Synchronization synchronization) {
+ try {
+ lookupJeeTransaction().registerSynchronization(synchronization);
+ } catch (Exception e) {
+ throw new JbpmException("couldn't register synchronization: "+e.getMessage(), e);
+ }
+ }
+
+ public void begin() {
+ try {
+ lookupJeeUserTransaction().begin();
+ } catch (Exception e) {
+ throw new JbpmException("couldn't begin transaction: "+e.getMessage(), e);
+ }
+ }
+
+ public void rollback() {
+ try {
+ lookupJeeUserTransaction().rollback();
+ } catch (Exception e) {
+ throw new JbpmException("couldn't rollback: "+e.getMessage(), e);
+ }
+ }
+
+ public void commit() {
+ try {
+ lookupJeeUserTransaction().commit();
+ } catch (Exception e) {
+ throw new JbpmException("couldn't commit: "+e.getMessage(), e);
+ }
+ }
+
+ public javax.transaction.Transaction suspend() {
+ try {
+ return lookupJeeTransactionManager().suspend();
+ } catch (Exception e) {
+ throw new JbpmException("couldn't suspend: "+e.getMessage(), e);
+ }
+ }
+
+ public void resume(javax.transaction.Transaction transaction) {
+ try {
+ lookupJeeTransactionManager().resume(transaction);
+ } catch (Exception e) {
+ throw new JbpmException("couldn't resume: "+e.getMessage(), e);
+ }
+ }
+
+ // lookups //////////////////////////////////////////////////////////////////
+
+ public UserTransaction lookupJeeUserTransaction() {
+ return (UserTransaction) lookupFromJndi(userTransactionJndiName);
+ }
+
+ public javax.transaction.Transaction lookupJeeTransaction() {
+ try {
+ TransactionManager transactionManager = lookupJeeTransactionManager();
+ return transactionManager.getTransaction();
+ } catch (Exception e) {
+ throw new JbpmException("couldn't get transaction from transaction manager "+transactionManagerJndiName+": "+e.getMessage(), e);
+ }
+ }
+
+ public TransactionManager lookupJeeTransactionManager() {
+ return (TransactionManager) lookupFromJndi(transactionManagerJndiName);
+ }
+
+ public static Object lookupFromJndi(String jndiName) {
+ try {
+ InitialContext initialContext = new InitialContext();
+ return initialContext.lookup(jndiName);
+ } catch (Exception e) {
+ throw new JbpmException("couldn't lookup '"+jndiName+"' from jndi: "+e.getMessage()+": "+e.getMessage(), e);
+ }
+ }
+}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransactionInterceptor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransactionInterceptor.java 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransactionInterceptor.java 2009-06-16 19:43:57 UTC (rev 5044)
@@ -1,91 +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.tx.jta;
-
-import javax.transaction.Status;
-import javax.transaction.SystemException;
-import javax.transaction.Transaction;
-import javax.transaction.UserTransaction;
-
-import org.jbpm.api.JbpmException;
-import org.jbpm.api.cmd.Command;
-import org.jbpm.api.env.Environment;
-import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.svc.Interceptor;
-
-
-/**
- * @author Tom Baeyens
- */
-public class JtaTransactionInterceptor extends Interceptor {
-
- private static Log log = Log.getLog(JtaTransactionInterceptor.class.getName());
-
- public <T> T execute(Command<T> command) {
- JtaTransaction jtaTransaction = Environment.getFromCurrent(JtaTransaction.class);
-
- UserTransaction userTransaction = jtaTransaction.lookupJeeUserTransaction();
-
- int status = -1;
- try {
- status = userTransaction.getStatus();
- } catch (SystemException e) {
- throw new JbpmException("couldn't get transaction status: "+e.getMessage(), e);
- }
- log.debug("jta transaction status: "+JtaStatusHelper.toString(status));
-
- if ( (status != Status.STATUS_NO_TRANSACTION)
- && (status != Status.STATUS_COMMITTED)
- && (status != Status.STATUS_ROLLEDBACK)
- ) {
- throw new JbpmException("invalid transaction state: "+JtaStatusHelper.toString(status));
- }
-
- Transaction suspendedTransaction = null;
- if ((status == Status.STATUS_COMMITTED) || (status == Status.STATUS_ROLLEDBACK)) {
- suspendedTransaction = jtaTransaction.suspend();
- }
-
- Object returnValue = null;
-
- try {
- jtaTransaction.begin();
-
- returnValue = next.execute(command);
-
- jtaTransaction.commit();
-
- } catch (RuntimeException e) {
- jtaTransaction.rollback();
- throw e;
-
- } finally {
-
- if (suspendedTransaction!=null) {
- jtaTransaction.resume(suspendedTransaction);
- }
- }
-
- return (T) returnValue;
- }
-
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransactionInterceptor.java (from rev 5043, jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransactionInterceptor.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransactionInterceptor.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransactionInterceptor.java 2009-06-16 19:43:57 UTC (rev 5044)
@@ -0,0 +1,91 @@
+/*
+ * 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.jta;
+
+import javax.transaction.Status;
+import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+import javax.transaction.UserTransaction;
+
+import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.env.Environment;
+import org.jbpm.internal.log.Log;
+import org.jbpm.pvm.internal.svc.Interceptor;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class JtaTransactionInterceptor extends Interceptor {
+
+ private static Log log = Log.getLog(JtaTransactionInterceptor.class.getName());
+
+ public <T> T execute(Command<T> command) {
+ JtaTransaction jtaTransaction = Environment.getFromCurrent(JtaTransaction.class);
+
+ UserTransaction userTransaction = jtaTransaction.lookupJeeUserTransaction();
+
+ int status = -1;
+ try {
+ status = userTransaction.getStatus();
+ } catch (SystemException e) {
+ throw new JbpmException("couldn't get transaction status: "+e.getMessage(), e);
+ }
+ log.debug("jta transaction status: "+JtaStatusHelper.toString(status));
+
+ if ( (status != Status.STATUS_NO_TRANSACTION)
+ && (status != Status.STATUS_COMMITTED)
+ && (status != Status.STATUS_ROLLEDBACK)
+ ) {
+ throw new JbpmException("invalid transaction state: "+JtaStatusHelper.toString(status));
+ }
+
+ Transaction suspendedTransaction = null;
+ if ((status == Status.STATUS_COMMITTED) || (status == Status.STATUS_ROLLEDBACK)) {
+ suspendedTransaction = jtaTransaction.suspend();
+ }
+
+ Object returnValue = null;
+
+ try {
+ jtaTransaction.begin();
+
+ returnValue = next.execute(command);
+
+ jtaTransaction.commit();
+
+ } catch (RuntimeException e) {
+ jtaTransaction.rollback();
+ throw e;
+
+ } finally {
+
+ if (suspendedTransaction!=null) {
+ jtaTransaction.resume(suspendedTransaction);
+ }
+ }
+
+ return (T) returnValue;
+ }
+
+}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/JtaTransactionInterceptorBinding.java (from rev 5043, jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/JtaTransactionInterceptorBinding.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/JtaTransactionInterceptorBinding.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/JtaTransactionInterceptorBinding.java 2009-06-16 19:43:57 UTC (rev 5044)
@@ -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.pvm.internal.wire.binding;
+
+import org.jbpm.pvm.internal.tx.jta.JtaTransactionInterceptor;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
+import org.jbpm.pvm.internal.xml.Parse;
+import org.jbpm.pvm.internal.xml.Parser;
+import org.w3c.dom.Element;
+
+/**
+ * Mapping between a <code>jta-transaction-interceptor</code> element and a
+ * {@link JtaTransactionInterceptor} object.
+ *
+ * @author Alejandro Guizar
+ */
+public class JtaTransactionInterceptorBinding extends WireInterceptorBinding {
+
+ public JtaTransactionInterceptorBinding() {
+ super("jta-transaction-interceptor");
+ }
+
+ public Object parse(Element element, Parse parse, Parser parser) {
+ return new ObjectDescriptor(JtaTransactionInterceptor.class);
+ }
+
+}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionBinding.java 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionBinding.java 2009-06-16 19:43:57 UTC (rev 5044)
@@ -22,8 +22,8 @@
package org.jbpm.pvm.internal.wire.binding;
import org.jbpm.api.env.Transaction;
-import org.jbpm.pvm.internal.tx.JtaTransaction;
import org.jbpm.pvm.internal.tx.StandardTransaction;
+import org.jbpm.pvm.internal.tx.jta.JtaTransaction;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JbossIdmIdentitySessionDescriptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JbossIdmIdentitySessionDescriptor.java 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JbossIdmIdentitySessionDescriptor.java 2009-06-16 19:43:57 UTC (rev 5044)
@@ -28,8 +28,8 @@
import org.jbpm.api.env.Environment;
import org.jbpm.pvm.internal.identity.impl.IdentitySessionResource;
import org.jbpm.pvm.internal.identity.impl.JBossIdmIdentitySessionImpl;
-import org.jbpm.pvm.internal.tx.JtaTransaction;
import org.jbpm.pvm.internal.tx.StandardTransaction;
+import org.jbpm.pvm.internal.tx.jta.JtaTransaction;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.WireDefinition;
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.tx.jta.cfg.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.tx.jta.cfg.xml 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.tx.jta.cfg.xml 2009-06-16 19:43:57 UTC (rev 5044)
@@ -4,8 +4,8 @@
<process-engine-context>
<command-service>
+ <environment-interceptor />
<jta-transaction-interceptor />
- <environment-interceptor />
</command-service>
</process-engine-context>
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.wire.bindings.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.wire.bindings.xml 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.wire.bindings.xml 2009-06-16 19:43:57 UTC (rev 5044)
@@ -78,6 +78,7 @@
<binding class="org.jbpm.pvm.internal.wire.binding.RetryInterceptorBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.StandardTransactionInterceptorBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.SerializeInterceptorBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.JtaTransactionInterceptorBinding" />
<!-- operation -->
<binding class="org.jbpm.pvm.internal.wire.binding.PropertyBinding" />
@@ -90,7 +91,6 @@
<binding class="org.jbpm.enterprise.internal.wire.binding.EjbTimerSessionBinding" />
<binding class="org.jbpm.enterprise.internal.wire.binding.EjbLocalCommandServiceBinding" />
<binding class="org.jbpm.enterprise.internal.wire.binding.EjbRemoteCommandServiceBinding" />
- <binding class="org.jbpm.enterprise.internal.wire.binding.JtaTransactionInterceptorBinding" />
<!-- jpdl bindings -->
<binding class="org.jbpm.jpdl.internal.xml.JpdlDeployerBinding" />
Modified: jbpm4/trunk/modules/test-db/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-db/pom.xml 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/test-db/pom.xml 2009-06-16 19:43:57 UTC (rev 5044)
@@ -54,6 +54,30 @@
</dependency>
</dependencies>
+
+ <build>
+ <plugins>
+ <!-- this create jar file of code from src/test/java so modules with tests can share code -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ <configuration>
+ <excludes>
+ <exclude>jbpm.*</exclude>
+ <exclude>logging.properties</exclude>
+ <exclude>META-INF/*</exclude>
+ </excludes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
<profiles>
@@ -104,26 +128,8 @@
</build>
</profile>
- <!--
- skip tests if this is an integration test run
- (only examples and test-db are part of the integration test runs)
- -->
+ <!-- -Djboss.bind.address -->
<profile>
- <id>integration.test</id>
- <activation>
- <property>
- <name>jboss.bind.address</name>
- </property>
- </activation>
- <properties>
- <skipTests>true</skipTests>
- </properties>
- </profile>
-
-
-
- <!-- -Djboss.bind.address
- <profile>
<id>integration.tests</id>
<activation>
<property>
@@ -137,6 +143,7 @@
<artifactId>jbpm-enterprise</artifactId>
<scope>test</scope>
</dependency>
+ <!-- AS 5 Integration tests -->
<dependency>
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-as-client</artifactId>
@@ -165,10 +172,10 @@
<configuration>
<tasks>
<copy todir="target/test-classes" overwrite="true" failonerror="false">
- <fileset dir="../../qa/jbossremote" />
+ <fileset dir="../distro/src/main/files/jboss/jbpm.cfg.remote.client" />
</copy>
<copy todir="target/test-classes" overwrite="true" failonerror="false">
- <fileset dir="${user.home}/.jbpm4/qa/jbossremote" />
+ <fileset dir="${user.home}/.jbpm4/jbpm.cfg.remote.client" />
</copy>
</tasks>
</configuration>
@@ -180,15 +187,13 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<failIfNoTests>false</failIfNoTests>
- <trimStackTrace>false</trimStackTrace>
- <excludes>
- </excludes>
+ <trimStackTrace>false</trimStackTrace>
</configuration>
</plugin>
</plugins>
</build>
- </profile
--->
+ </profile>
+
</profiles>
</project>
\ No newline at end of file
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/async/AsyncBasicsTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/async/AsyncBasicsTest.java 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/async/AsyncBasicsTest.java 2009-06-16 19:43:57 UTC (rev 5044)
@@ -21,10 +21,14 @@
*/
package org.jbpm.test.async;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.jbpm.api.Execution;
import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.activity.ActivityBehaviour;
+import org.jbpm.api.activity.ActivityExecution;
import org.jbpm.api.job.Job;
import org.jbpm.test.JbpmTestCase;
@@ -34,42 +38,43 @@
*/
public class AsyncBasicsTest extends JbpmTestCase {
- static boolean doneSomething;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- doneSomething = false;
+ public static class DoABit implements ActivityBehaviour {
+ public void execute(ActivityExecution execution) {
+ execution.setVariable("done", "a bit");
+ }
}
-
- public static class Do {
- public void something() {
- doneSomething = true;
+ public static class DoALot implements ActivityBehaviour {
+ public void execute(ActivityExecution execution) {
+ execution.setVariable("done", "a lot");
}
}
- public void testAsyncWaitStatesSequence() {
+ public void testAsyncAutomaticSequence() {
deployJpdlXmlString(
"<process name='TwoAsyncStates'>" +
" <start>" +
" <transition to='a' />" +
" </start>" +
- " <java name='a' continue='async' class='"+Do.class.getName()+"' method='something'>" +
+ " <custom name='a' continue='async' class='"+DoABit.class.getName()+"'>" +
" <transition to='b' />" +
- " </java>" +
- " <java name='b' continue='async' class='"+Do.class.getName()+"' method='something'>" +
+ " </custom>" +
+ " <custom name='b' continue='async' class='"+DoALot.class.getName()+"'>" +
" <transition to='end' />" +
- " </java>" +
- " <end name='end' />" +
+ " </custom>" +
+ " <state name='end' />" +
"</process>"
);
- ProcessInstance processInstance = executionService.startProcessInstanceByKey("TwoAsyncStates");
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("done", "nothing");
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("TwoAsyncStates", variables);
+ String processInstanceId = processInstance.getId();
+
assertEquals(Execution.STATE_ASYNC, processInstance.getState());
+
+ assertEquals("nothing", executionService.getVariable(processInstanceId, "done"));
- assertFalse(doneSomething);
-
List<Job> jobs = managementService
.createJobQuery()
.processInstanceId(processInstance.getId())
@@ -81,8 +86,7 @@
managementService.executeJob(job.getDbid());
- assertTrue(doneSomething);
- doneSomething = false;
+ assertEquals("a bit", executionService.getVariable(processInstanceId, "done"));
processInstance = executionService.findProcessInstanceById(processInstance.getId());
assertEquals(Execution.STATE_ASYNC, processInstance.getState());
@@ -98,9 +102,10 @@
managementService.executeJob(job.getDbid());
- assertTrue(doneSomething);
- processInstance = executionService.findProcessInstanceById(processInstance.getId());
- assertNull(processInstance);
+ assertEquals("a lot", executionService.getVariable(processInstanceId, "done"));
+
+ processInstance = executionService.findProcessInstanceById(processInstanceId);
+ assertTrue(processInstance.isActive("end"));
}
public void testAsyncTransitions() {
@@ -109,21 +114,24 @@
" <start>" +
" <transition to='a' />" +
" </start>" +
- " <java name='a' class='"+Do.class.getName()+"' method='something'>" +
+ " <custom name='a' class='"+DoABit.class.getName()+"'>" +
" <transition continue='async' to='b' />" +
- " </java>" +
- " <java name='b' class='"+Do.class.getName()+"' method='something'>" +
+ " </custom>" +
+ " <custom name='b' class='"+DoALot.class.getName()+"'>" +
" <transition continue='async' to='end' />" +
- " </java>" +
- " <end name='end' />" +
+ " </custom>" +
+ " <state name='end' />" +
"</process>"
);
- ProcessInstance processInstance = executionService.startProcessInstanceByKey("TwoAsyncStates");
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("done", "nothing");
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("TwoAsyncStates", variables);
+ String processInstanceId = processInstance.getId();
+
assertEquals(Execution.STATE_ASYNC, processInstance.getState());
- assertTrue(doneSomething);
- doneSomething = false;
+ assertEquals("a bit", executionService.getVariable(processInstanceId, "done"));
List<Job> jobs = managementService
.createJobQuery()
@@ -136,7 +144,7 @@
managementService.executeJob(job.getDbid());
- assertTrue(doneSomething);
+ assertEquals("a lot", executionService.getVariable(processInstanceId, "done"));
processInstance = executionService.findProcessInstanceById(processInstance.getId());
assertEquals(Execution.STATE_ASYNC, processInstance.getState());
@@ -152,8 +160,8 @@
managementService.executeJob(job.getDbid());
- processInstance = executionService.findProcessInstanceById(processInstance.getId());
- assertNull(processInstance);
+ processInstance = executionService.findProcessInstanceById(processInstanceId);
+ assertTrue(processInstance.isActive("end"));
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/EventListenerTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/EventListenerTest.java 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/EventListenerTest.java 2009-06-16 19:43:57 UTC (rev 5044)
@@ -22,9 +22,12 @@
package org.jbpm.test.eventlistener;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.jbpm.api.Execution;
+import org.jbpm.api.ProcessInstance;
import org.jbpm.api.listener.EventListener;
import org.jbpm.api.listener.EventListenerExecution;
import org.jbpm.test.JbpmTestCase;
@@ -35,18 +38,10 @@
*/
public class EventListenerTest extends JbpmTestCase {
- static boolean isInvoked = false;
- static List<Integer> order;
-
- protected void setUp() throws Exception {
- super.setUp();
- isInvoked = false;
- }
-
public static class ProcessStartListener implements EventListener {
private static final long serialVersionUID = 1L;
public void notify(EventListenerExecution execution) {
- isInvoked = true;
+ execution.setVariable("isInvoked", "true");
}
}
@@ -63,40 +58,15 @@
"</process>"
);
- executionService.startProcessInstanceByKey("ICL");
+ String processInstanceId = executionService.startProcessInstanceByKey("ICL").getId();
- assertTrue("process start listener not invoked", isInvoked);
+ assertEquals("true", executionService.getVariable(processInstanceId, "isInvoked"));
}
- public static class ProcessEndListener implements EventListener {
- private static final long serialVersionUID = 1L;
- public void notify(EventListenerExecution execution) {
- isInvoked = true;
- }
- }
-
- public void testProcessEndListener() {
- deployJpdlXmlString(
- "<process name='Insurance claim' key='ICL'>" +
- " <on event='end'>" +
- " <event-listener class='"+ProcessEndListener.class.getName()+"' />" +
- " </on>" +
- " <start>" +
- " <transition to='end' />" +
- " </start>" +
- " <end name='end' />" +
- "</process>"
- );
-
- executionService.startProcessInstanceByKey("ICL");
-
- assertTrue("process end listener not invoked", isInvoked);
- }
-
public static class ActivityStartListener implements EventListener {
private static final long serialVersionUID = 1L;
public void notify(EventListenerExecution execution) {
- isInvoked = true;
+ execution.setVariable("isInvoked", "true");
}
}
@@ -112,19 +82,19 @@
" </on>" +
" <transition to='end' />" +
" </state>" +
- " <end name='end' />" +
+ " <state name='end' />" +
"</process>"
);
- executionService.startProcessInstanceByKey("ICL");
+ String processInstanceId = executionService.startProcessInstanceByKey("ICL").getId();
- assertTrue("activity start listener not invoked", isInvoked);
+ assertEquals("true", executionService.getVariable(processInstanceId, "isInvoked"));
}
public static class ActivityEndListener implements EventListener {
private static final long serialVersionUID = 1L;
public void notify(EventListenerExecution execution) {
- isInvoked = true;
+ execution.setVariable("isInvoked", "true");
}
}
@@ -140,29 +110,29 @@
" </on>" +
" <transition to='end' />" +
" </state>" +
- " <end name='end' />" +
+ " <state name='end' />" +
"</process>"
);
- Execution execution = executionService.startProcessInstanceByKey("ICL");
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("ICL");
+ String processInstanceId = processInstance.getId();
- assertFalse("activity end listener invoked too early", isInvoked);
+ assertNull(executionService.getVariable(processInstanceId, "isInvoked"));
- executionService.signalExecutionById(execution.getId());
+ executionService.signalExecutionById(processInstance.getId());
- assertTrue("activity end listener not invoked", isInvoked);
+ assertEquals("true", executionService.getVariable(processInstanceId, "isInvoked"));
}
public static class TransitionListener implements EventListener {
private static final long serialVersionUID = 1L;
public void notify(EventListenerExecution execution) {
assertNotNull(execution.getTransition());
- isInvoked = true;
+ execution.setVariable("isInvoked", "true");
}
}
public void testTransitionListener() {
- order = new ArrayList<Integer>();
deployJpdlXmlString(
"<process name='Insurance claim' key='ICL'>" +
" <start>" +
@@ -170,25 +140,26 @@
" <event-listener class='"+TransitionListener.class.getName()+"' />" +
" </transition>" +
" </start>" +
- " <end name='end' />" +
+ " <state name='end' />" +
"</process>"
);
- executionService.startProcessInstanceByKey("ICL");
+ String processInstanceId = executionService.startProcessInstanceByKey("ICL").getId();
- assertTrue("transition listener not invoked", isInvoked);
+ assertEquals("true", executionService.getVariable(processInstanceId, "isInvoked"));
}
public static class OrderListener implements EventListener {
private static final long serialVersionUID = 1L;
int i;
public void notify(EventListenerExecution execution) {
+ List<Integer> order = (List<Integer>) execution.getVariable("order");
order.add(i);
+ execution.setVariable("order", order);
}
}
public void testEventOrdering() {
- order = new ArrayList<Integer>();
deployJpdlXmlString(
"<process name='Insurance claim' key='ICL'>" +
" <start>" +
@@ -210,11 +181,13 @@
" </event-listener>" +
" </transition>" +
" </start>" +
- " <end name='end' />" +
+ " <state name='end' />" +
"</process>"
);
- executionService.startProcessInstanceByKey("ICL");
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("order", new ArrayList<Integer>());
+ String processInstanceId = executionService.startProcessInstanceByKey("ICL", variables).getId();
List<Integer> expectedOrder = new ArrayList<Integer>();
expectedOrder.add(1);
@@ -223,6 +196,6 @@
expectedOrder.add(4);
expectedOrder.add(5);
- assertEquals(expectedOrder, order);
+ assertEquals(expectedOrder, executionService.getVariable(processInstanceId, "order"));
}
}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java 2009-06-16 19:43:57 UTC (rev 5044)
@@ -33,52 +33,34 @@
*/
public class TaskHandlerTest extends JbpmTestCase {
- static boolean isExecutionCreateTaskCalled;
- static boolean isExecutionSignalledCalled;
- static boolean isTaskCancelCalled;
- static boolean isTaskCompleteCalled;
- static boolean isSubTaskCompleteCalled;
- static boolean isTaskVariableUpdateCalled;
-
- public void setUp() throws Exception {
- super.setUp();
-
- isExecutionCreateTaskCalled = false;
- isExecutionSignalledCalled = false;
- isTaskCancelCalled = false;
- isTaskCompleteCalled = false;
- isSubTaskCompleteCalled = false;
- isTaskVariableUpdateCalled = false;
- }
-
public static class ReviewHandler extends TaskHandler {
public boolean executionCreateTask(OpenTask task) {
- isExecutionCreateTaskCalled = true;
+ task.getExecution().setVariable("isExecutionCreateTaskCalled", "true");
return super.executionCreateTask(task);
}
public void executionSignal(OpenTask task) {
- isExecutionSignalledCalled = true;
+ task.getExecution().setVariable("isExecutionSignalledCalled", "true");
super.executionSignal(task);
}
public void taskCancel(OpenTask task, String reason) {
- isTaskCancelCalled = true;
+ task.getExecution().setVariable("isTaskCancelCalled", "true");
super.taskCancel(task, reason);
}
public void taskComplete(OpenTask task, String outcome) {
- isTaskCompleteCalled = true;
+ task.getExecution().setVariable("isTaskCompleteCalled", "true");
super.taskComplete(task, outcome);
}
public void taskSubTaskComplete(OpenTask task, OpenTask subTask, String outcome) {
- isSubTaskCompleteCalled = true;
+ task.getExecution().setVariable("isSubTaskCompleteCalled", "true");
super.taskSubTaskComplete(task, subTask, outcome);
}
public void taskVariableUpdate(OpenTask task, String key, Object value) {
- isTaskVariableUpdateCalled = true;
+ task.getExecution().setVariable("isTaskVariableUpdateCalled", "true");
super.taskVariableUpdate(task, key, value);
}
}
@@ -97,26 +79,26 @@
"</process>"
);
- executionService.startProcessInstanceByKey("TaskHandler");
+ String processInstanceId = executionService.startProcessInstanceByKey("TaskHandler").getId();
- assertTrue(isExecutionCreateTaskCalled);
+ assertEquals("true", executionService.getVariable(processInstanceId, "isExecutionCreateTaskCalled"));
Task task = taskService.createTaskQuery().list().get(0);
long taskDbid = task.getDbid();
taskService.setVariable(taskDbid, "checked", "true");
- assertTrue(isExecutionCreateTaskCalled);
+ assertEquals("true", executionService.getVariable(processInstanceId, "isExecutionCreateTaskCalled"));
Task subTask = taskService.newTask(taskDbid);
long subTaskDbid = taskService.saveTask(subTask);
taskService.completeTask(subTaskDbid);
- assertTrue(isSubTaskCompleteCalled);
+ assertEquals("true", executionService.getVariable(processInstanceId, "isSubTaskCompleteCalled"));
taskService.completeTask(taskDbid);
- assertTrue(isTaskCompleteCalled);
+ assertEquals("true", executionService.getVariable(processInstanceId, "isTaskCompleteCalled"));
}
public void testTaskHandlerCancelScenario() {
@@ -133,14 +115,14 @@
"</process>"
);
- executionService.startProcessInstanceByKey("TaskHandler");
+ String processInstanceId = executionService.startProcessInstanceByKey("TaskHandler").getId();
Task task = taskService.createTaskQuery().list().get(0);
long taskDbid = task.getDbid();
taskService.deleteTask(taskDbid);
- assertTrue(isTaskCancelCalled);
+ assertEquals("true", executionService.getVariable(processInstanceId, "isTaskCancelCalled"));
}
public void testTaskHandlerExecutionSignalScenario() {
@@ -162,6 +144,6 @@
executionService.signalExecutionById(executionId);
- assertTrue(isExecutionSignalledCalled);
+ assertEquals("true", executionService.getVariable(executionId, "isExecutionSignalledCalled"));
}
}
Modified: jbpm4/trunk/qa/build.xml
===================================================================
--- jbpm4/trunk/qa/build.xml 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/qa/build.xml 2009-06-16 19:43:57 UTC (rev 5044)
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="jbpm.qa">
-
- <!-- DEVELOPER SPECIFIC CONFIGURATIONS -->
- <property file="${user.home}/.jbpm4/build.properties" />
-
+
+ <!-- DEVELOPER SPECIFIC CONFIGURATIONS -->
+ <property file="${user.home}/.jbpm4/build.properties" />
+
<fail message="property jbpm.parent.dir must be specified" unless="jbpm.parent.dir" />
<!-- CONFIGURABLE PROPERTIES -->
@@ -33,50 +33,72 @@
<echo message="jbpm.version...... ${jbpm.version}" />
<echo message="jbpm.home......... ${jbpm.home}" />
<echo message="jbpm.distro.path.. ${jbpm.distro.path}" />
- <echo message="jbossidm.home .... ${jbossidm.home}" />
+ <echo message="jbossidm.home .... ${jbossidm.home}" />
</target>
- <!-- TARGETS -->
- <target name="delete.jbpm.installation"
- description="deletes ${jbpm.home}">
- <delete dir="${jbpm.home}" />
- </target>
+ <!-- TARGETS -->
+ <target name="delete.jbpm.installation"
+ description="deletes ${jbpm.home}">
+ <delete dir="${jbpm.home}" />
+ </target>
- <target name="install.jbpm"
- description="unzips the jbpm distro file in the ${jbpm.parent.dir}">
- <unzip src="${jbpm.distro.path}" dest="${jbpm.parent.dir}" />
- </target>
+ <target name="install.jbpm"
+ description="unzips the jbpm distro file in the ${jbpm.parent.dir}">
+ <unzip src="${jbpm.distro.path}" dest="${jbpm.parent.dir}" />
+ </target>
<target name="reinstall.jbpm"
- depends="delete.jbpm.installation, install.jbpm"
+ depends="delete.jbpm.installation, install.jbpm"
description="deletes the jbpm installation and then reinstalls jbpm"/>
- <target name="integration.testrun.setup"
- depends="log.properties, reinstall.jbpm, post.install"
- description="reinstalls jbpm, reinstalls jboss, installs jbpm into jboss, starts jboss and then creates the jbpm schema">
+ <target name="integration.testrun.setup"
+ depends="log.properties, reinstall.jbpm, post.install"
+ description="reinstalls jbpm, reinstalls jboss, installs jbpm into jboss, starts jboss and then creates the jbpm schema">
<ant antfile="${jbpm.home}/jboss/build.xml" target="reinstall.jboss" />
- <!-- initializing the schema into db -->
- <antcall target="drop.jbossidm.schema" />
- <antcall target="create.jbossidm.schema" />
+ <!-- initializing the schema into db -->
+ <antcall target="drop.jbossidm.schema" />
+ <antcall target="create.jbossidm.schema" />
<ant antfile="${jbpm.home}/jboss/build.xml" target="install.jbpm.into.jboss" />
- <ant antfile="${jbpm.home}/jboss/build.xml" target="internal.install.jbpm.into.jboss.integrationtestspecifics" />
- <antcall target="enable.jboss.debug" />
+ <antcall target="internal.tweak.jbpm.installation.for.integration.testrun" />
+ <antcall target="internal.enable.jboss.debug" />
<ant antfile="${jbpm.home}/jboss/build.xml" target="start.jboss" />
<ant antfile="${jbpm.home}/db/build.xml" target="drop.jbpm.schema" />
<ant antfile="${jbpm.home}/db/build.xml" target="create.jbpm.schema" />
- </target>
+ </target>
+
+ <target name="internal.tweak.jbpm.installation.for.integration.testrun">
+ <copy todir="${jboss.server.config.dir}/deploy/jbpm/jbpm-service.sar" overwrite="true">
+ <fileset dir="jbpm.cfg.jboss.testsuite/jbpm.identity" />
+ </copy>
+ <antcall target="internal.install.idm.into.jboss.integrationtestspecifics" />
+ <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" />
+ <copy file="../modules/test-db/target/jbpm-test-db-${jbpm.version}-tests.jar"
+ todir="${jboss.server.config.dir}/deploy/jbpm/userlibs" />
+ <copy file="../modules/distro/target/libs/junit.jar"
+ todir="${jboss.server.config.dir}/deploy/jbpm/userlibs"/>
+ </target>
+
+ <target name="internal.install.idm.into.jboss.integrationtestspecifics" if="jbpm.identity.idm">
+ <copy todir="${jboss.server.config.dir}/deploy/jbpm/jbpm-service.sar" overwrite="true">
+ <fileset dir="jbpm.cfg.jboss.testsuite/jboss.idm" />
+ </copy>
+ </target>
- <target name="enable.jboss.debug" if="jbpm.debug">
+
+ <target name="internal.enable.jboss.debug" if="jbpm.debug">
<replace file="${jboss.home}/bin/run.bat"
- token="rem set JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"
- value="set JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"/>
- <copy file="jboss/jboss-log4j.xml" todir="${jboss.server.config.dir}/conf" overwrite="true" />
+ token="rem set JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"
+ value="set JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"/>
+ <copy file="jboss/jboss-log4j.xml" todir="${jboss.server.config.dir}/conf" overwrite="true" />
</target>
- <target name="post.install">
- <!-- overwrite the default jdbc properties in the distro with those specified in the qa jdbc directory -->
+ <target name="post.install">
+ <!-- overwrite the default jdbc properties in the distro with those specified in the qa jdbc directory -->
<copy file="jdbc/${database}.properties"
todir="${jbpm.home}/db/jdbc"
overwrite="true"
@@ -86,18 +108,18 @@
todir="${jbpm.home}/db/jdbc"
overwrite="true"
failonerror="false" />
- <!-- copy the oracle jar as it is not allowed to be part of our distro -->
- <copy file="../modules/distro/target/oracle/ojdbc14.jar"
+ <!-- copy the oracle jar as it is not allowed to be part of our distro -->
+ <copy file="../modules/distro/target/libs/ojdbc14.jar"
todir="${jbpm.home}/lib"/>
<!-- copy the jdbc configuration and oracle jar to jbossidm -->
- <antcall target="copy.jbossidm.jdbc.configuration" />
+ <antcall target="copy.jbossidm.jdbc.configuration" />
- </target>
+ </target>
- <condition property="identity.component.idm">
- <equals arg1="${identity.component}" arg2="jboss.idm"/>
- </condition>
+ <condition property="identity.component.idm">
+ <equals arg1="${identity.component}" arg2="jboss.idm"/>
+ </condition>
<target name="copy.jbossidm.jdbc.configuration" if="identity.component.idm">
<copy file="../modules/distro/target/oracle/ojdbc14.jar"
@@ -109,9 +131,9 @@
</target>
<target name="integration.testrun.teardown"
- description="drops the jbpm schema and stops jboss">
+ description="drops the jbpm schema and stops jboss">
<ant antfile="${jbpm.home}/db/build.xml" target="drop.jbpm.schema" />
- <antcall target="drop.jbossidm.schema" />
+ <antcall target="drop.jbossidm.schema" />
<ant antfile="${jbpm.home}/jboss/build.xml" target="stop.jboss" />
</target>
Copied: jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite (from rev 5043, jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite)
Copied: jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jboss.idm (from rev 5043, jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jboss.idm)
Deleted: jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jboss.idm/jbpm.cfg.xml
===================================================================
--- jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jboss.idm/jbpm.cfg.xml 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jboss.idm/jbpm.cfg.xml 2009-06-16 19:43:57 UTC (rev 5044)
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jbpm-configuration>
-
- <import resource="jbpm.default.cfg.xml" />
- <import resource="jbpm.tx.jta.cfg.xml" />
- <import resource="jbpm.jpdl.cfg.xml" />
- <import resource="jbpm.jboss.idm.cfg.xml" />
-
- <import resource="jbpm.mail.templates.examples.xml" />
-
-</jbpm-configuration>
Copied: jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jboss.idm/jbpm.cfg.xml (from rev 5043, jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jboss.idm/jbpm.cfg.xml)
===================================================================
--- jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jboss.idm/jbpm.cfg.xml (rev 0)
+++ jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jboss.idm/jbpm.cfg.xml 2009-06-16 19:43:57 UTC (rev 5044)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <import resource="jbpm.default.cfg.xml" />
+ <import resource="jbpm.tx.jta.cfg.xml" />
+ <import resource="jbpm.jpdl.cfg.xml" />
+ <import resource="jbpm.jboss.idm.cfg.xml" />
+
+ <import resource="jbpm.mail.templates.examples.xml" />
+
+</jbpm-configuration>
Copied: jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity (from rev 5043, jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jbpm.identity)
Deleted: jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.cfg.xml
===================================================================
--- jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.cfg.xml 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.cfg.xml 2009-06-16 19:43:57 UTC (rev 5044)
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jbpm-configuration>
-
- <import resource="jbpm.default.cfg.xml" />
- <import resource="jbpm.tx.jta.cfg.xml" />
- <import resource="jbpm.jpdl.cfg.xml" />
- <import resource="jbpm.identity.cfg.xml" />
-
- <import resource="jbpm.mail.templates.examples.xml" />
-
-</jbpm-configuration>
Copied: jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.cfg.xml (from rev 5043, jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.cfg.xml)
===================================================================
--- jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.cfg.xml (rev 0)
+++ jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.cfg.xml 2009-06-16 19:43:57 UTC (rev 5044)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <import resource="jbpm.default.cfg.xml" />
+ <import resource="jbpm.tx.jta.cfg.xml" />
+ <import resource="jbpm.jpdl.cfg.xml" />
+ <import resource="jbpm.identity.cfg.xml" />
+
+ <import resource="jbpm.mail.templates.examples.xml" />
+
+</jbpm-configuration>
Deleted: jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.properties
===================================================================
--- jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.properties 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.properties 2009-06-16 19:43:57 UTC (rev 5044)
@@ -1,3 +0,0 @@
-mail.smtp.host localhost
-mail.smtp.port 2525
-mail.from noreply(a)jbpm.org
\ No newline at end of file
Copied: jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.properties (from rev 5043, jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.properties)
===================================================================
--- jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.properties (rev 0)
+++ jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.properties 2009-06-16 19:43:57 UTC (rev 5044)
@@ -0,0 +1,3 @@
+mail.smtp.host localhost
+mail.smtp.port 2525
+mail.from noreply(a)jbpm.org
\ No newline at end of file
Deleted: jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.templates.examples.xml
===================================================================
--- jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.templates.examples.xml 2009-06-16 19:08:55 UTC (rev 5043)
+++ jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.templates.examples.xml 2009-06-16 19:43:57 UTC (rev 5044)
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jbpm-configuration>
-
- <process-engine-context>
-
- <mail-template name="rectify-template">
- <to addresses="${addressee}" />
- <cc users="bb" groups="innerparty" />
- <bcc groups="thinkpol" />
- <subject>rectify ${newspaper}</subject>
- <text>${newspaper} ${date} ${details}</text>
- </mail-template>
-
- </process-engine-context>
-
-</jbpm-configuration>
\ No newline at end of file
Copied: jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.templates.examples.xml (from rev 5043, jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.templates.examples.xml)
===================================================================
--- jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.templates.examples.xml (rev 0)
+++ jbpm4/trunk/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.templates.examples.xml 2009-06-16 19:43:57 UTC (rev 5044)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <process-engine-context>
+
+ <mail-template name="rectify-template">
+ <to addresses="${addressee}" />
+ <cc users="bb" groups="innerparty" />
+ <bcc groups="thinkpol" />
+ <subject>rectify ${newspaper}</subject>
+ <text>${newspaper} ${date} ${details}</text>
+ </mail-template>
+
+ </process-engine-context>
+
+</jbpm-configuration>
\ No newline at end of file
16 years, 10 months
JBoss JBPM SVN: r5043 - in jbpm4/branches/tbaeyens/modules: pvm/src/main/java/org/jbpm/pvm/internal/cmd and 2 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-06-16 15:08:55 -0400 (Tue, 16 Jun 2009)
New Revision: 5043
Removed:
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/SerializableByteArrayInputStream.java
Modified:
jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/repository/JpdlDeployer.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetResourceAsStreamCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentClassLoader.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/RepositorySession.java
Log:
fixed test-db test suite for integration run
Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/repository/JpdlDeployer.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/repository/JpdlDeployer.java 2009-06-16 16:15:35 UTC (rev 5042)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/repository/JpdlDeployer.java 2009-06-16 19:08:55 UTC (rev 5043)
@@ -21,6 +21,7 @@
*/
package org.jbpm.jpdl.internal.repository;
+import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.List;
@@ -51,7 +52,8 @@
for (String resourceName: deployment.getResourceNames()) {
if (resourceName.endsWith(".jpdl.xml")) {
- InputStream inputStream = deployment.getResourceAsStream(resourceName);
+ byte[] bytes = deployment.getBytes(resourceName);
+ InputStream inputStream = new ByteArrayInputStream(bytes);
Parse parse = jpdlParser.createParse();
parse.setProblems(deployment.getProblems());
parse.setInputStream(inputStream);
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetResourceAsStreamCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetResourceAsStreamCmd.java 2009-06-16 16:15:35 UTC (rev 5042)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetResourceAsStreamCmd.java 2009-06-16 19:08:55 UTC (rev 5043)
@@ -30,7 +30,7 @@
/**
* @author Tom Baeyens
*/
-public class GetResourceAsStreamCmd extends AbstractCommand<InputStream> {
+public class GetResourceAsStreamCmd extends AbstractCommand<byte[]> {
private static final long serialVersionUID = 1L;
@@ -42,8 +42,8 @@
this.resourceName = resourceName;
}
- public InputStream execute(Environment environment) {
+ public byte[] execute(Environment environment) {
RepositorySession repositorySession = environment.get(RepositorySession.class);
- return repositorySession.getResourceAsStream(deploymentDbid, resourceName);
+ return repositorySession.getBytes(deploymentDbid, resourceName);
}
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentClassLoader.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentClassLoader.java 2009-06-16 16:15:35 UTC (rev 5042)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentClassLoader.java 2009-06-16 19:08:55 UTC (rev 5043)
@@ -21,6 +21,7 @@
*/
package org.jbpm.pvm.internal.repository;
+import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
@@ -46,8 +47,9 @@
public URL findResource(String name) {
URL url = null;
- InputStream inputStream = deployment.getResourceAsStream(name);
- if (inputStream!=null) {
+ byte[] bytes = deployment.getBytes(name);
+ if (bytes!=null) {
+ InputStream inputStream = new ByteArrayInputStream(bytes);
try {
url = new URL(null, "jbpm://"+deployment.getDbid()+"/"+name, new BytesUrlStreamHandler(inputStream));
} catch (MalformedURLException e) {
@@ -84,9 +86,10 @@
Class clazz = null;
String fileName = name.replace( '.', '/' ) + ".class";
- InputStream inputStream = deployment.getResourceAsStream(fileName);
- if (inputStream!=null) {
+ byte[] bytes = deployment.getBytes(fileName);
+ if (bytes!=null) {
try {
+ InputStream inputStream = new ByteArrayInputStream(bytes);
byte[] classBytes = IoUtil.readBytes(inputStream);
clazz = defineClass(name, classBytes, 0, classBytes.length);
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java 2009-06-16 16:15:35 UTC (rev 5042)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java 2009-06-16 19:08:55 UTC (rev 5043)
@@ -154,12 +154,11 @@
return resources.keySet();
}
- public InputStream getResourceAsStream(String resourceName) {
+ public byte[] getBytes(String resourceName) {
if (resources!=null) {
Lob lob = resources.get(resourceName);
if (lob!=null) {
- byte[] bytes = lob.extractBytes();
- return new SerializableByteArrayInputStream(bytes);
+ return lob.extractBytes();
}
}
return null;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java 2009-06-16 16:15:35 UTC (rev 5042)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java 2009-06-16 19:08:55 UTC (rev 5043)
@@ -21,6 +21,7 @@
*/
package org.jbpm.pvm.internal.repository;
+import java.io.ByteArrayInputStream;
import java.io.InputStream;
import org.jbpm.api.Deployment;
@@ -64,7 +65,11 @@
}
public InputStream getResourceAsStream(long deploymentDbid, String resource) {
- return commandService.execute(new GetResourceAsStreamCmd(deploymentDbid, resource));
+ byte[] bytes = commandService.execute(new GetResourceAsStreamCmd(deploymentDbid, resource));
+ if (bytes!=null) {
+ return new ByteArrayInputStream(bytes);
+ }
+ return null;
}
public ProcessDefinitionQuery createProcessDefinitionQuery() {
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java 2009-06-16 16:15:35 UTC (rev 5042)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java 2009-06-16 19:08:55 UTC (rev 5043)
@@ -139,12 +139,12 @@
return object;
}
- public InputStream getResourceAsStream(long deploymentDbid, String resourceName) {
+ public byte[] getBytes(long deploymentDbid, String resourceName) {
DeploymentImpl deployment = getDeployment(deploymentDbid);
if (deployment==null) {
return null;
}
- return deployment.getResourceAsStream(resourceName);
+ return deployment.getBytes(resourceName);
}
// queries //////////////////////////////////////////////////////////////////
Deleted: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/SerializableByteArrayInputStream.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/SerializableByteArrayInputStream.java 2009-06-16 16:15:35 UTC (rev 5042)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/SerializableByteArrayInputStream.java 2009-06-16 19:08:55 UTC (rev 5043)
@@ -1,42 +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.repository;
-
-import java.io.ByteArrayInputStream;
-import java.io.Serializable;
-
-
-/**
- * @author Tom Baeyens
- */
-public class SerializableByteArrayInputStream extends ByteArrayInputStream implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- public SerializableByteArrayInputStream(byte[] buf) {
- super(buf);
- }
-
- Object readResolve() {
- return new ByteArrayInputStream(buf);
- }
-}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/RepositorySession.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/RepositorySession.java 2009-06-16 16:15:35 UTC (rev 5042)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/RepositorySession.java 2009-06-16 19:08:55 UTC (rev 5043)
@@ -21,8 +21,6 @@
*/
package org.jbpm.pvm.internal.session;
-import java.io.InputStream;
-
import org.jbpm.api.Deployment;
import org.jbpm.api.client.ClientProcessDefinition;
import org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl;
@@ -37,7 +35,7 @@
Object getObject(long deploymentDbid, String objectName);
- InputStream getResourceAsStream(long deploymentDbid, String resourceName);
+ byte[] getBytes(long deploymentDbid, String resourceName);
/** create a process definition query */
ProcessDefinitionQueryImpl createProcessDefinitionQuery();
16 years, 10 months
JBoss JBPM SVN: r5042 - in jbpm4/branches/tbaeyens: modules/distro/src/main/files/jboss and 13 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-06-16 12:15:35 -0400 (Tue, 16 Jun 2009)
New Revision: 5042
Added:
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/SerializableByteArrayInputStream.java
jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/
jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jboss.idm/
jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jboss.idm/jbpm.cfg.xml
jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/
jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.cfg.xml
jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.properties
jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.templates.examples.xml
Removed:
jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.integration.test.cfg.xml
jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml
jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.properties
jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.templates.examples.xml
Modified:
jbpm4/branches/tbaeyens/modules/distro/pom.xml
jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/build.xml
jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EjbRemoteCommandService.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/resources/jbpm.tx.jta.cfg.xml
jbpm4/branches/tbaeyens/modules/test-db/pom.xml
jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/async/AsyncBasicsTest.java
jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/eventlistener/EventListenerTest.java
jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java
jbpm4/branches/tbaeyens/qa/build.xml
Log:
test-db integration test fixes
Modified: jbpm4/branches/tbaeyens/modules/distro/pom.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/distro/pom.xml 2009-06-16 04:33:46 UTC (rev 5041)
+++ jbpm4/branches/tbaeyens/modules/distro/pom.xml 2009-06-16 16:15:35 UTC (rev 5042)
@@ -212,7 +212,7 @@
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
- <id>get.oracle.driver.lib</id>
+ <id>get.oracle.driver.and.junit.lib</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
@@ -225,8 +225,14 @@
<version>${oracle.version}</version>
<destFileName>ojdbc14.jar</destFileName>
</artifactItem>
+ <artifactItem>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <destFileName>junit.jar</destFileName>
+ </artifactItem>
</artifactItems>
- <outputDirectory>target/oracle</outputDirectory>
+ <outputDirectory>target/libs</outputDirectory>
</configuration>
</execution>
</executions>
Modified: jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/build.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/build.xml 2009-06-16 04:33:46 UTC (rev 5041)
+++ jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/build.xml 2009-06-16 16:15:35 UTC (rev 5042)
@@ -22,9 +22,9 @@
<property name="jboss.server.configuration" value="default" />
<property name="jboss.server.config.dir" value="${jboss.home}/server/${jboss.server.configuration}" />
<property name="jboss.server.data.dir" value="${jboss.home}/server/${jboss.server.configuration}/data" />
-
<property name="jbossidm.version" value="1.0.0.Alpha8" />
<property name="jbossidm.home" value="${jbpm.parent.dir}/jbossidm-${jbossidm.version}" />
+
<!-- for SNAPSHOT temporarily -->
<property name="jbossidm.distro.url" value="http://repository.jboss.com/maven2/org/jboss/identity/idm/jbossidm/${jbos..." />
<property name="jbossidm.distro.path" value="${jbpm.parent.dir}/idm-assembly-${jbossidm.version}.zip" />
@@ -255,24 +255,6 @@
overwrite="true" />
</target>
- <!-- ### THE JBOSS INTEGRATION TEST SPECIFICS ####################### -->
- <target name="internal.install.jbpm.into.jboss.integrationtestspecifics">
- <copy todir="${jboss.server.config.dir}/deploy/jbpm/jbpm-service.sar" overwrite="true">
- <fileset dir="${jbpm.home}/jboss/jbpm.cfg.integration.tests" />
- </copy>
- <antcall target="internal.install.idm.into.jboss.integrationtestspecifics" />
- <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" />
- </target>
-
- <target name="internal.install.idm.into.jboss.integrationtestspecifics" if="jbpm.identity.idm">
- <copy file="${jbpm.home}/jboss/jbpm.cfg.idm/jbpm.integration.test.cfg.xml"
- tofile="${jboss.server.config.dir}/deploy/jbpm/jbpm-service.sar/jbpm.cfg.xml"
- overwrite="true" />
- </target>
-
<!-- ### THE HSQLDB SPECIFIC PART ####################################### -->
<target name="internal.install.jbpm.into.jboss.db.hsqldb" />
Deleted: jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.integration.test.cfg.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.integration.test.cfg.xml 2009-06-16 04:33:46 UTC (rev 5041)
+++ jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.integration.test.cfg.xml 2009-06-16 16:15:35 UTC (rev 5042)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jbpm-configuration>
-
- <import resource="jbpm.default.cfg.xml" />
- <import resource="jbpm.tx.jta.cfg.xml" />
- <import resource="jbpm.jpdl.cfg.xml" />
- <import resource="jbpm.jboss.idm.cfg.xml" />
-
- <import resource="jbpm.mail.templates.examples.xml" />
-
- <!-- Job executor is excluded for running the example test cases.
- To enable timers and messages in production use, this should be included.
- import resource="jbpm.jobexecutor.cfg.xml" / -->
-
-</jbpm-configuration>
Deleted: jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml 2009-06-16 04:33:46 UTC (rev 5041)
+++ jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml 2009-06-16 16:15:35 UTC (rev 5042)
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jbpm-configuration>
-
- <import resource="jbpm.default.cfg.xml" />
- <import resource="jbpm.tx.jta.cfg.xml" />
- <import resource="jbpm.jpdl.cfg.xml" />
- <import resource="jbpm.identity.cfg.xml" />
-
- <import resource="jbpm.mail.templates.examples.xml" />
-
-</jbpm-configuration>
Deleted: jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.properties
===================================================================
--- jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.properties 2009-06-16 04:33:46 UTC (rev 5041)
+++ jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.properties 2009-06-16 16:15:35 UTC (rev 5042)
@@ -1,3 +0,0 @@
-mail.smtp.host localhost
-mail.smtp.port 2525
-mail.from noreply(a)jbpm.org
\ No newline at end of file
Deleted: jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.templates.examples.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.templates.examples.xml 2009-06-16 04:33:46 UTC (rev 5041)
+++ jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.templates.examples.xml 2009-06-16 16:15:35 UTC (rev 5042)
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jbpm-configuration>
-
- <process-engine-context>
-
- <mail-template name="rectify-template">
- <to addresses="${addressee}" />
- <cc users="bb" groups="innerparty" />
- <bcc groups="thinkpol" />
- <subject>rectify ${newspaper}</subject>
- <text>${newspaper} ${date} ${details}</text>
- </mail-template>
-
- </process-engine-context>
-
-</jbpm-configuration>
\ No newline at end of file
Modified: jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EjbRemoteCommandService.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EjbRemoteCommandService.java 2009-06-16 04:33:46 UTC (rev 5041)
+++ jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EjbRemoteCommandService.java 2009-06-16 16:15:35 UTC (rev 5042)
@@ -68,7 +68,7 @@
return (T) result;
} catch (Exception e) {
- throw new JbpmException("couldn't execute remote command", e);
+ throw new JbpmException("couldn't execute remote command: "+e.getMessage(), e);
}
}
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java 2009-06-16 04:33:46 UTC (rev 5041)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java 2009-06-16 16:15:35 UTC (rev 5042)
@@ -21,7 +21,6 @@
*/
package org.jbpm.pvm.internal.repository;
-import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
@@ -41,7 +40,6 @@
import org.jbpm.api.env.Environment;
import org.jbpm.pvm.internal.cmd.DeployCmd;
import org.jbpm.pvm.internal.lob.Lob;
-import org.jbpm.pvm.internal.session.RepositorySession;
import org.jbpm.pvm.internal.stream.ByteArrayStreamInput;
import org.jbpm.pvm.internal.stream.FileStreamInput;
import org.jbpm.pvm.internal.stream.InputStreamInput;
@@ -161,7 +159,7 @@
Lob lob = resources.get(resourceName);
if (lob!=null) {
byte[] bytes = lob.extractBytes();
- return new ByteArrayInputStream(bytes);
+ return new SerializableByteArrayInputStream(bytes);
}
}
return null;
Added: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/SerializableByteArrayInputStream.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/SerializableByteArrayInputStream.java (rev 0)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/SerializableByteArrayInputStream.java 2009-06-16 16:15:35 UTC (rev 5042)
@@ -0,0 +1,42 @@
+/*
+ * 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.repository;
+
+import java.io.ByteArrayInputStream;
+import java.io.Serializable;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class SerializableByteArrayInputStream extends ByteArrayInputStream implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ public SerializableByteArrayInputStream(byte[] buf) {
+ super(buf);
+ }
+
+ Object readResolve() {
+ return new ByteArrayInputStream(buf);
+ }
+}
Property changes on: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/SerializableByteArrayInputStream.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/resources/jbpm.tx.jta.cfg.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/resources/jbpm.tx.jta.cfg.xml 2009-06-16 04:33:46 UTC (rev 5041)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/resources/jbpm.tx.jta.cfg.xml 2009-06-16 16:15:35 UTC (rev 5042)
@@ -4,8 +4,8 @@
<process-engine-context>
<command-service>
+ <environment-interceptor />
<jta-transaction-interceptor />
- <environment-interceptor />
</command-service>
</process-engine-context>
Modified: jbpm4/branches/tbaeyens/modules/test-db/pom.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-db/pom.xml 2009-06-16 04:33:46 UTC (rev 5041)
+++ jbpm4/branches/tbaeyens/modules/test-db/pom.xml 2009-06-16 16:15:35 UTC (rev 5042)
@@ -54,6 +54,30 @@
</dependency>
</dependencies>
+
+ <build>
+ <plugins>
+ <!-- this create jar file of code from src/test/java so modules with tests can share code -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ <configuration>
+ <excludes>
+ <exclude>jbpm.*</exclude>
+ <exclude>logging.properties</exclude>
+ <exclude>META-INF/*</exclude>
+ </excludes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
<profiles>
Modified: jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/async/AsyncBasicsTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/async/AsyncBasicsTest.java 2009-06-16 04:33:46 UTC (rev 5041)
+++ jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/async/AsyncBasicsTest.java 2009-06-16 16:15:35 UTC (rev 5042)
@@ -21,10 +21,14 @@
*/
package org.jbpm.test.async;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.jbpm.api.Execution;
import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.activity.ActivityBehaviour;
+import org.jbpm.api.activity.ActivityExecution;
import org.jbpm.api.job.Job;
import org.jbpm.test.JbpmTestCase;
@@ -34,42 +38,43 @@
*/
public class AsyncBasicsTest extends JbpmTestCase {
- static boolean doneSomething;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- doneSomething = false;
+ public static class DoABit implements ActivityBehaviour {
+ public void execute(ActivityExecution execution) {
+ execution.setVariable("done", "a bit");
+ }
}
-
- public static class Do {
- public void something() {
- doneSomething = true;
+ public static class DoALot implements ActivityBehaviour {
+ public void execute(ActivityExecution execution) {
+ execution.setVariable("done", "a lot");
}
}
- public void testAsyncWaitStatesSequence() {
+ public void testAsyncAutomaticSequence() {
deployJpdlXmlString(
"<process name='TwoAsyncStates'>" +
" <start>" +
" <transition to='a' />" +
" </start>" +
- " <java name='a' continue='async' class='"+Do.class.getName()+"' method='something'>" +
+ " <custom name='a' continue='async' class='"+DoABit.class.getName()+"'>" +
" <transition to='b' />" +
- " </java>" +
- " <java name='b' continue='async' class='"+Do.class.getName()+"' method='something'>" +
+ " </custom>" +
+ " <custom name='b' continue='async' class='"+DoALot.class.getName()+"'>" +
" <transition to='end' />" +
- " </java>" +
- " <end name='end' />" +
+ " </custom>" +
+ " <state name='end' />" +
"</process>"
);
- ProcessInstance processInstance = executionService.startProcessInstanceByKey("TwoAsyncStates");
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("done", "nothing");
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("TwoAsyncStates", variables);
+ String processInstanceId = processInstance.getId();
+
assertEquals(Execution.STATE_ASYNC, processInstance.getState());
+
+ assertEquals("nothing", executionService.getVariable(processInstanceId, "done"));
- assertFalse(doneSomething);
-
List<Job> jobs = managementService
.createJobQuery()
.processInstanceId(processInstance.getId())
@@ -81,8 +86,7 @@
managementService.executeJob(job.getDbid());
- assertTrue(doneSomething);
- doneSomething = false;
+ assertEquals("a bit", executionService.getVariable(processInstanceId, "done"));
processInstance = executionService.findProcessInstanceById(processInstance.getId());
assertEquals(Execution.STATE_ASYNC, processInstance.getState());
@@ -98,9 +102,10 @@
managementService.executeJob(job.getDbid());
- assertTrue(doneSomething);
- processInstance = executionService.findProcessInstanceById(processInstance.getId());
- assertNull(processInstance);
+ assertEquals("a lot", executionService.getVariable(processInstanceId, "done"));
+
+ processInstance = executionService.findProcessInstanceById(processInstanceId);
+ assertTrue(processInstance.isActive("end"));
}
public void testAsyncTransitions() {
@@ -109,21 +114,24 @@
" <start>" +
" <transition to='a' />" +
" </start>" +
- " <java name='a' class='"+Do.class.getName()+"' method='something'>" +
+ " <custom name='a' class='"+DoABit.class.getName()+"'>" +
" <transition continue='async' to='b' />" +
- " </java>" +
- " <java name='b' class='"+Do.class.getName()+"' method='something'>" +
+ " </custom>" +
+ " <custom name='b' class='"+DoALot.class.getName()+"'>" +
" <transition continue='async' to='end' />" +
- " </java>" +
- " <end name='end' />" +
+ " </custom>" +
+ " <state name='end' />" +
"</process>"
);
- ProcessInstance processInstance = executionService.startProcessInstanceByKey("TwoAsyncStates");
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("done", "nothing");
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("TwoAsyncStates", variables);
+ String processInstanceId = processInstance.getId();
+
assertEquals(Execution.STATE_ASYNC, processInstance.getState());
- assertTrue(doneSomething);
- doneSomething = false;
+ assertEquals("a bit", executionService.getVariable(processInstanceId, "done"));
List<Job> jobs = managementService
.createJobQuery()
@@ -136,7 +144,7 @@
managementService.executeJob(job.getDbid());
- assertTrue(doneSomething);
+ assertEquals("a lot", executionService.getVariable(processInstanceId, "done"));
processInstance = executionService.findProcessInstanceById(processInstance.getId());
assertEquals(Execution.STATE_ASYNC, processInstance.getState());
@@ -152,8 +160,8 @@
managementService.executeJob(job.getDbid());
- processInstance = executionService.findProcessInstanceById(processInstance.getId());
- assertNull(processInstance);
+ processInstance = executionService.findProcessInstanceById(processInstanceId);
+ assertTrue(processInstance.isActive("end"));
}
Modified: jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/eventlistener/EventListenerTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/eventlistener/EventListenerTest.java 2009-06-16 04:33:46 UTC (rev 5041)
+++ jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/eventlistener/EventListenerTest.java 2009-06-16 16:15:35 UTC (rev 5042)
@@ -22,9 +22,12 @@
package org.jbpm.test.eventlistener;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.jbpm.api.Execution;
+import org.jbpm.api.ProcessInstance;
import org.jbpm.api.listener.EventListener;
import org.jbpm.api.listener.EventListenerExecution;
import org.jbpm.test.JbpmTestCase;
@@ -35,18 +38,10 @@
*/
public class EventListenerTest extends JbpmTestCase {
- static boolean isInvoked = false;
- static List<Integer> order;
-
- protected void setUp() throws Exception {
- super.setUp();
- isInvoked = false;
- }
-
public static class ProcessStartListener implements EventListener {
private static final long serialVersionUID = 1L;
public void notify(EventListenerExecution execution) {
- isInvoked = true;
+ execution.setVariable("isInvoked", "true");
}
}
@@ -63,40 +58,15 @@
"</process>"
);
- executionService.startProcessInstanceByKey("ICL");
+ String processInstanceId = executionService.startProcessInstanceByKey("ICL").getId();
- assertTrue("process start listener not invoked", isInvoked);
+ assertEquals("true", executionService.getVariable(processInstanceId, "isInvoked"));
}
- public static class ProcessEndListener implements EventListener {
- private static final long serialVersionUID = 1L;
- public void notify(EventListenerExecution execution) {
- isInvoked = true;
- }
- }
-
- public void testProcessEndListener() {
- deployJpdlXmlString(
- "<process name='Insurance claim' key='ICL'>" +
- " <on event='end'>" +
- " <event-listener class='"+ProcessEndListener.class.getName()+"' />" +
- " </on>" +
- " <start>" +
- " <transition to='end' />" +
- " </start>" +
- " <end name='end' />" +
- "</process>"
- );
-
- executionService.startProcessInstanceByKey("ICL");
-
- assertTrue("process end listener not invoked", isInvoked);
- }
-
public static class ActivityStartListener implements EventListener {
private static final long serialVersionUID = 1L;
public void notify(EventListenerExecution execution) {
- isInvoked = true;
+ execution.setVariable("isInvoked", "true");
}
}
@@ -112,19 +82,19 @@
" </on>" +
" <transition to='end' />" +
" </state>" +
- " <end name='end' />" +
+ " <state name='end' />" +
"</process>"
);
- executionService.startProcessInstanceByKey("ICL");
+ String processInstanceId = executionService.startProcessInstanceByKey("ICL").getId();
- assertTrue("activity start listener not invoked", isInvoked);
+ assertEquals("true", executionService.getVariable(processInstanceId, "isInvoked"));
}
public static class ActivityEndListener implements EventListener {
private static final long serialVersionUID = 1L;
public void notify(EventListenerExecution execution) {
- isInvoked = true;
+ execution.setVariable("isInvoked", "true");
}
}
@@ -140,29 +110,29 @@
" </on>" +
" <transition to='end' />" +
" </state>" +
- " <end name='end' />" +
+ " <state name='end' />" +
"</process>"
);
- Execution execution = executionService.startProcessInstanceByKey("ICL");
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("ICL");
+ String processInstanceId = processInstance.getId();
- assertFalse("activity end listener invoked too early", isInvoked);
+ assertNull(executionService.getVariable(processInstanceId, "isInvoked"));
- executionService.signalExecutionById(execution.getId());
+ executionService.signalExecutionById(processInstance.getId());
- assertTrue("activity end listener not invoked", isInvoked);
+ assertEquals("true", executionService.getVariable(processInstanceId, "isInvoked"));
}
public static class TransitionListener implements EventListener {
private static final long serialVersionUID = 1L;
public void notify(EventListenerExecution execution) {
assertNotNull(execution.getTransition());
- isInvoked = true;
+ execution.setVariable("isInvoked", "true");
}
}
public void testTransitionListener() {
- order = new ArrayList<Integer>();
deployJpdlXmlString(
"<process name='Insurance claim' key='ICL'>" +
" <start>" +
@@ -170,25 +140,26 @@
" <event-listener class='"+TransitionListener.class.getName()+"' />" +
" </transition>" +
" </start>" +
- " <end name='end' />" +
+ " <state name='end' />" +
"</process>"
);
- executionService.startProcessInstanceByKey("ICL");
+ String processInstanceId = executionService.startProcessInstanceByKey("ICL").getId();
- assertTrue("transition listener not invoked", isInvoked);
+ assertEquals("true", executionService.getVariable(processInstanceId, "isInvoked"));
}
public static class OrderListener implements EventListener {
private static final long serialVersionUID = 1L;
int i;
public void notify(EventListenerExecution execution) {
+ List<Integer> order = (List<Integer>) execution.getVariable("order");
order.add(i);
+ execution.setVariable("order", order);
}
}
public void testEventOrdering() {
- order = new ArrayList<Integer>();
deployJpdlXmlString(
"<process name='Insurance claim' key='ICL'>" +
" <start>" +
@@ -210,11 +181,13 @@
" </event-listener>" +
" </transition>" +
" </start>" +
- " <end name='end' />" +
+ " <state name='end' />" +
"</process>"
);
- executionService.startProcessInstanceByKey("ICL");
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("order", new ArrayList<Integer>());
+ String processInstanceId = executionService.startProcessInstanceByKey("ICL", variables).getId();
List<Integer> expectedOrder = new ArrayList<Integer>();
expectedOrder.add(1);
@@ -223,6 +196,6 @@
expectedOrder.add(4);
expectedOrder.add(5);
- assertEquals(expectedOrder, order);
+ assertEquals(expectedOrder, executionService.getVariable(processInstanceId, "order"));
}
}
Modified: jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java 2009-06-16 04:33:46 UTC (rev 5041)
+++ jbpm4/branches/tbaeyens/modules/test-db/src/test/java/org/jbpm/test/task/TaskHandlerTest.java 2009-06-16 16:15:35 UTC (rev 5042)
@@ -33,52 +33,34 @@
*/
public class TaskHandlerTest extends JbpmTestCase {
- static boolean isExecutionCreateTaskCalled;
- static boolean isExecutionSignalledCalled;
- static boolean isTaskCancelCalled;
- static boolean isTaskCompleteCalled;
- static boolean isSubTaskCompleteCalled;
- static boolean isTaskVariableUpdateCalled;
-
- public void setUp() throws Exception {
- super.setUp();
-
- isExecutionCreateTaskCalled = false;
- isExecutionSignalledCalled = false;
- isTaskCancelCalled = false;
- isTaskCompleteCalled = false;
- isSubTaskCompleteCalled = false;
- isTaskVariableUpdateCalled = false;
- }
-
public static class ReviewHandler extends TaskHandler {
public boolean executionCreateTask(OpenTask task) {
- isExecutionCreateTaskCalled = true;
+ task.getExecution().setVariable("isExecutionCreateTaskCalled", "true");
return super.executionCreateTask(task);
}
public void executionSignal(OpenTask task) {
- isExecutionSignalledCalled = true;
+ task.getExecution().setVariable("isExecutionSignalledCalled", "true");
super.executionSignal(task);
}
public void taskCancel(OpenTask task, String reason) {
- isTaskCancelCalled = true;
+ task.getExecution().setVariable("isTaskCancelCalled", "true");
super.taskCancel(task, reason);
}
public void taskComplete(OpenTask task, String outcome) {
- isTaskCompleteCalled = true;
+ task.getExecution().setVariable("isTaskCompleteCalled", "true");
super.taskComplete(task, outcome);
}
public void taskSubTaskComplete(OpenTask task, OpenTask subTask, String outcome) {
- isSubTaskCompleteCalled = true;
+ task.getExecution().setVariable("isSubTaskCompleteCalled", "true");
super.taskSubTaskComplete(task, subTask, outcome);
}
public void taskVariableUpdate(OpenTask task, String key, Object value) {
- isTaskVariableUpdateCalled = true;
+ task.getExecution().setVariable("isTaskVariableUpdateCalled", "true");
super.taskVariableUpdate(task, key, value);
}
}
@@ -97,26 +79,26 @@
"</process>"
);
- executionService.startProcessInstanceByKey("TaskHandler");
+ String processInstanceId = executionService.startProcessInstanceByKey("TaskHandler").getId();
- assertTrue(isExecutionCreateTaskCalled);
+ assertEquals("true", executionService.getVariable(processInstanceId, "isExecutionCreateTaskCalled"));
Task task = taskService.createTaskQuery().list().get(0);
long taskDbid = task.getDbid();
taskService.setVariable(taskDbid, "checked", "true");
- assertTrue(isExecutionCreateTaskCalled);
+ assertEquals("true", executionService.getVariable(processInstanceId, "isExecutionCreateTaskCalled"));
Task subTask = taskService.newTask(taskDbid);
long subTaskDbid = taskService.saveTask(subTask);
taskService.completeTask(subTaskDbid);
- assertTrue(isSubTaskCompleteCalled);
+ assertEquals("true", executionService.getVariable(processInstanceId, "isSubTaskCompleteCalled"));
taskService.completeTask(taskDbid);
- assertTrue(isTaskCompleteCalled);
+ assertEquals("true", executionService.getVariable(processInstanceId, "isTaskCompleteCalled"));
}
public void testTaskHandlerCancelScenario() {
@@ -133,14 +115,14 @@
"</process>"
);
- executionService.startProcessInstanceByKey("TaskHandler");
+ String processInstanceId = executionService.startProcessInstanceByKey("TaskHandler").getId();
Task task = taskService.createTaskQuery().list().get(0);
long taskDbid = task.getDbid();
taskService.deleteTask(taskDbid);
- assertTrue(isTaskCancelCalled);
+ assertEquals("true", executionService.getVariable(processInstanceId, "isTaskCancelCalled"));
}
public void testTaskHandlerExecutionSignalScenario() {
@@ -162,6 +144,6 @@
executionService.signalExecutionById(executionId);
- assertTrue(isExecutionSignalledCalled);
+ assertEquals("true", executionService.getVariable(executionId, "isExecutionSignalledCalled"));
}
}
Modified: jbpm4/branches/tbaeyens/qa/build.xml
===================================================================
--- jbpm4/branches/tbaeyens/qa/build.xml 2009-06-16 04:33:46 UTC (rev 5041)
+++ jbpm4/branches/tbaeyens/qa/build.xml 2009-06-16 16:15:35 UTC (rev 5042)
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="jbpm.qa">
-
- <!-- DEVELOPER SPECIFIC CONFIGURATIONS -->
- <property file="${user.home}/.jbpm4/build.properties" />
-
+
+ <!-- DEVELOPER SPECIFIC CONFIGURATIONS -->
+ <property file="${user.home}/.jbpm4/build.properties" />
+
<fail message="property jbpm.parent.dir must be specified" unless="jbpm.parent.dir" />
<!-- CONFIGURABLE PROPERTIES -->
@@ -33,50 +33,72 @@
<echo message="jbpm.version...... ${jbpm.version}" />
<echo message="jbpm.home......... ${jbpm.home}" />
<echo message="jbpm.distro.path.. ${jbpm.distro.path}" />
- <echo message="jbossidm.home .... ${jbossidm.home}" />
+ <echo message="jbossidm.home .... ${jbossidm.home}" />
</target>
- <!-- TARGETS -->
- <target name="delete.jbpm.installation"
- description="deletes ${jbpm.home}">
- <delete dir="${jbpm.home}" />
- </target>
+ <!-- TARGETS -->
+ <target name="delete.jbpm.installation"
+ description="deletes ${jbpm.home}">
+ <delete dir="${jbpm.home}" />
+ </target>
- <target name="install.jbpm"
- description="unzips the jbpm distro file in the ${jbpm.parent.dir}">
- <unzip src="${jbpm.distro.path}" dest="${jbpm.parent.dir}" />
- </target>
+ <target name="install.jbpm"
+ description="unzips the jbpm distro file in the ${jbpm.parent.dir}">
+ <unzip src="${jbpm.distro.path}" dest="${jbpm.parent.dir}" />
+ </target>
<target name="reinstall.jbpm"
- depends="delete.jbpm.installation, install.jbpm"
+ depends="delete.jbpm.installation, install.jbpm"
description="deletes the jbpm installation and then reinstalls jbpm"/>
- <target name="integration.testrun.setup"
- depends="log.properties, reinstall.jbpm, post.install"
- description="reinstalls jbpm, reinstalls jboss, installs jbpm into jboss, starts jboss and then creates the jbpm schema">
+ <target name="integration.testrun.setup"
+ depends="log.properties, reinstall.jbpm, post.install"
+ description="reinstalls jbpm, reinstalls jboss, installs jbpm into jboss, starts jboss and then creates the jbpm schema">
<ant antfile="${jbpm.home}/jboss/build.xml" target="reinstall.jboss" />
- <!-- initializing the schema into db -->
- <antcall target="drop.jbossidm.schema" />
- <antcall target="create.jbossidm.schema" />
+ <!-- initializing the schema into db -->
+ <antcall target="drop.jbossidm.schema" />
+ <antcall target="create.jbossidm.schema" />
<ant antfile="${jbpm.home}/jboss/build.xml" target="install.jbpm.into.jboss" />
- <ant antfile="${jbpm.home}/jboss/build.xml" target="internal.install.jbpm.into.jboss.integrationtestspecifics" />
- <antcall target="enable.jboss.debug" />
+ <antcall target="internal.tweak.jbpm.installation.for.integration.testrun" />
+ <antcall target="internal.enable.jboss.debug" />
<ant antfile="${jbpm.home}/jboss/build.xml" target="start.jboss" />
<ant antfile="${jbpm.home}/db/build.xml" target="drop.jbpm.schema" />
<ant antfile="${jbpm.home}/db/build.xml" target="create.jbpm.schema" />
- </target>
+ </target>
+
+ <target name="internal.tweak.jbpm.installation.for.integration.testrun">
+ <copy todir="${jboss.server.config.dir}/deploy/jbpm/jbpm-service.sar" overwrite="true">
+ <fileset dir="jbpm.cfg.jboss.testsuite/jbpm.identity" />
+ </copy>
+ <antcall target="internal.install.idm.into.jboss.integrationtestspecifics" />
+ <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" />
+ <copy file="../modules/test-db/target/jbpm-test-db-${jbpm.version}-tests.jar"
+ todir="${jboss.server.config.dir}/deploy/jbpm/userlibs" />
+ <copy file="../modules/distro/target/libs/junit.jar"
+ todir="${jboss.server.config.dir}/deploy/jbpm/userlibs"/>
+ </target>
+
+ <target name="internal.install.idm.into.jboss.integrationtestspecifics" if="jbpm.identity.idm">
+ <copy todir="${jboss.server.config.dir}/deploy/jbpm/jbpm-service.sar" overwrite="true">
+ <fileset dir="jbpm.cfg.jboss.testsuite/jboss.idm" />
+ </copy>
+ </target>
- <target name="enable.jboss.debug" if="jbpm.debug">
+
+ <target name="internal.enable.jboss.debug" if="jbpm.debug">
<replace file="${jboss.home}/bin/run.bat"
- token="rem set JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"
- value="set JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"/>
- <copy file="jboss/jboss-log4j.xml" todir="${jboss.server.config.dir}/conf" overwrite="true" />
+ token="rem set JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"
+ value="set JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"/>
+ <copy file="jboss/jboss-log4j.xml" todir="${jboss.server.config.dir}/conf" overwrite="true" />
</target>
- <target name="post.install">
- <!-- overwrite the default jdbc properties in the distro with those specified in the qa jdbc directory -->
+ <target name="post.install">
+ <!-- overwrite the default jdbc properties in the distro with those specified in the qa jdbc directory -->
<copy file="jdbc/${database}.properties"
todir="${jbpm.home}/db/jdbc"
overwrite="true"
@@ -86,32 +108,32 @@
todir="${jbpm.home}/db/jdbc"
overwrite="true"
failonerror="false" />
- <!-- copy the oracle jar as it is not allowed to be part of our distro -->
- <copy file="../modules/distro/target/oracle/ojdbc14.jar"
+ <!-- copy the oracle jar as it is not allowed to be part of our distro -->
+ <copy file="../modules/distro/target/libs/ojdbc14.jar"
todir="${jbpm.home}/lib"/>
<!-- copy the jdbc configuration and oracle jar to jbossidm -->
- <antcall target="copy.jbossidm.jdbc.configuration" />
+ <antcall target="copy.jbossidm.jdbc.configuration" />
- </target>
+ </target>
- <condition property="identity.component.idm">
- <equals arg1="${identity.component}" arg2="jboss.idm"/>
- </condition>
+ <condition property="identity.component.idm">
+ <equals arg1="${identity.component}" arg2="jboss.idm"/>
+ </condition>
- <target name="copy.jbossidm.jdbc.configuration" if="identity.component.idm">
- <copy file="../modules/distro/target/oracle/ojdbc14.jar"
- todir="${jbossidm.home}/lib" />
- <copy file="jdbc/${database}.properties"
- todir="${jbossidm.home}/db/jdbc"
- overwrite="true"
- failonerror="false" />
- </target>
+ <target name="copy.jbossidm.jdbc.configuration" if="identity.component.idm">
+ <copy file="../modules/distro/target/libs/ojdbc14.jar"
+ todir="${jbossidm.home}/lib" />
+ <copy file="jdbc/${database}.properties"
+ todir="${jbossidm.home}/db/jdbc"
+ overwrite="true"
+ failonerror="false" />
+ </target>
<target name="integration.testrun.teardown"
- description="drops the jbpm schema and stops jboss">
+ description="drops the jbpm schema and stops jboss">
<ant antfile="${jbpm.home}/db/build.xml" target="drop.jbpm.schema" />
- <antcall target="drop.jbossidm.schema" />
+ <antcall target="drop.jbossidm.schema" />
<ant antfile="${jbpm.home}/jboss/build.xml" target="stop.jboss" />
</target>
Copied: jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jboss.idm/jbpm.cfg.xml (from rev 5037, jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.integration.test.cfg.xml)
===================================================================
--- jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jboss.idm/jbpm.cfg.xml (rev 0)
+++ jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jboss.idm/jbpm.cfg.xml 2009-06-16 16:15:35 UTC (rev 5042)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <import resource="jbpm.default.cfg.xml" />
+ <import resource="jbpm.tx.jta.cfg.xml" />
+ <import resource="jbpm.jpdl.cfg.xml" />
+ <import resource="jbpm.jboss.idm.cfg.xml" />
+
+ <import resource="jbpm.mail.templates.examples.xml" />
+
+</jbpm-configuration>
Copied: jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.cfg.xml (from rev 5037, jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml)
===================================================================
--- jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.cfg.xml (rev 0)
+++ jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.cfg.xml 2009-06-16 16:15:35 UTC (rev 5042)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <import resource="jbpm.default.cfg.xml" />
+ <import resource="jbpm.tx.jta.cfg.xml" />
+ <import resource="jbpm.jpdl.cfg.xml" />
+ <import resource="jbpm.identity.cfg.xml" />
+
+ <import resource="jbpm.mail.templates.examples.xml" />
+
+</jbpm-configuration>
Property changes on: jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.properties (from rev 5037, jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.properties)
===================================================================
--- jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.properties (rev 0)
+++ jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.properties 2009-06-16 16:15:35 UTC (rev 5042)
@@ -0,0 +1,3 @@
+mail.smtp.host localhost
+mail.smtp.port 2525
+mail.from noreply(a)jbpm.org
\ No newline at end of file
Property changes on: jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.templates.examples.xml (from rev 5037, jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.templates.examples.xml)
===================================================================
--- jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.templates.examples.xml (rev 0)
+++ jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.templates.examples.xml 2009-06-16 16:15:35 UTC (rev 5042)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <process-engine-context>
+
+ <mail-template name="rectify-template">
+ <to addresses="${addressee}" />
+ <cc users="bb" groups="innerparty" />
+ <bcc groups="thinkpol" />
+ <subject>rectify ${newspaper}</subject>
+ <text>${newspaper} ${date} ${details}</text>
+ </mail-template>
+
+ </process-engine-context>
+
+</jbpm-configuration>
\ No newline at end of file
Property changes on: jbpm4/branches/tbaeyens/qa/jbpm.cfg.jboss.testsuite/jbpm.identity/jbpm.mail.templates.examples.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 10 months
JBoss JBPM SVN: r5041 - in jbpm4/trunk: modules/examples/src/test/java/org/jbpm/examples/mail/template and 4 other directories.
by do-not-reply@jboss.org
Author: jeff.yuchang
Date: 2009-06-16 00:33:46 -0400 (Tue, 16 Jun 2009)
New Revision: 5041
Modified:
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/mail/inline/InlineMailTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/mail/template/TemplateMailTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JBossIdmIdentitySessionImpl.java
jbpm4/trunk/qa/build.xml
Log:
* JBPM-2172 update identity api usage and idmIdentitySessionImpl class.
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/mail/inline/InlineMailTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/mail/inline/InlineMailTest.java 2009-06-15 19:36:52 UTC (rev 5040)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/mail/inline/InlineMailTest.java 2009-06-16 04:33:46 UTC (rev 5041)
@@ -45,6 +45,10 @@
public class InlineMailTest extends JbpmTestCase {
Wiser wiser = null;
+
+ String groupId1;
+
+ String groupId2;
protected void setUp() throws Exception {
super.setUp();
@@ -59,11 +63,11 @@
identityService.createUser("bb", "Big Brother", null, "bb@oceania");
identityService.createUser("obrien", null, "O'Brien", "obrien@miniluv");
identityService.createUser("charr", null, "Charrington", "charr@miniluv");
- identityService.createGroup("thinkpol");
- identityService.createGroup("innerparty");
- identityService.createMembership("obrien", "innerparty");
- identityService.createMembership("charr", "thinkpol");
- identityService.createMembership("obrien", "thinkpol");
+ groupId1 = identityService.createGroup("thinkpol");
+ groupId2 = identityService.createGroup("innerparty");
+ identityService.createMembership("obrien", groupId2);
+ identityService.createMembership("charr", groupId1);
+ identityService.createMembership("obrien", groupId1);
// start mail server
wiser = new Wiser();
@@ -75,12 +79,13 @@
wiser.stop();
// delete actors
- identityService.deleteGroup("thinkpol");
- identityService.deleteGroup("innerparty");
identityService.deleteUser("bb");
identityService.deleteUser("obrien");
identityService.deleteUser("charr");
-
+
+ identityService.deleteGroup(groupId1);
+ identityService.deleteGroup(groupId2);
+
super.tearDown();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/mail/template/TemplateMailTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/mail/template/TemplateMailTest.java 2009-06-15 19:36:52 UTC (rev 5040)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/mail/template/TemplateMailTest.java 2009-06-16 04:33:46 UTC (rev 5041)
@@ -45,6 +45,10 @@
public class TemplateMailTest extends JbpmTestCase {
Wiser wiser = null;
+
+ String group1;
+
+ String group2;
protected void setUp() throws Exception {
super.setUp();
@@ -59,11 +63,11 @@
identityService.createUser("bb", "Big Brother", null, "bb@oceania");
identityService.createUser("obrien", null, "O'Brien", "obrien@miniluv");
identityService.createUser("charr", null, "Charrington", "charr@miniluv");
- identityService.createGroup("thinkpol");
- identityService.createGroup("innerparty");
- identityService.createMembership("obrien", "innerparty");
- identityService.createMembership("charr", "thinkpol");
- identityService.createMembership("obrien", "thinkpol");
+ group1 = identityService.createGroup("thinkpol");
+ group2 = identityService.createGroup("innerparty");
+ identityService.createMembership("obrien", group2);
+ identityService.createMembership("charr", group1);
+ identityService.createMembership("obrien", group1);
// start mail server
wiser = new Wiser();
@@ -75,8 +79,8 @@
wiser.stop();
// delete actors
- identityService.deleteGroup("thinkpol");
- identityService.deleteGroup("innerparty");
+ identityService.deleteGroup(group1);
+ identityService.deleteGroup(group2);
identityService.deleteUser("bb");
identityService.deleteUser("obrien");
identityService.deleteUser("charr");
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java 2009-06-15 19:36:52 UTC (rev 5040)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/candidates/TaskCandidatesTest.java 2009-06-16 04:33:46 UTC (rev 5041)
@@ -34,18 +34,19 @@
public class TaskCandidatesTest extends JbpmTestCase {
long deploymentDbid;
+ String dept;
protected void setUp() throws Exception {
super.setUp();
// create identities
- identityService.createGroup("sales-dept");
+ dept = identityService.createGroup("sales-dept");
identityService.createUser("johndoe", "John", "Doe");
- identityService.createMembership("johndoe", "sales-dept");
+ identityService.createMembership("johndoe", dept, "developer");
identityService.createUser("joesmoe", "Joe", "Smoe");
- identityService.createMembership("joesmoe", "sales-dept");
+ identityService.createMembership("joesmoe", dept, "developer");
// deploy process
deploymentDbid = repositoryService.createDeployment()
@@ -58,7 +59,7 @@
repositoryService.deleteDeploymentCascade(deploymentDbid);
// delete identities
- identityService.deleteGroup("sales-dept");
+ identityService.deleteGroup(dept);
identityService.deleteUser("johndoe");
identityService.deleteUser("joesmoe");
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java 2009-06-15 19:36:52 UTC (rev 5040)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java 2009-06-16 04:33:46 UTC (rev 5041)
@@ -33,15 +33,18 @@
public class TaskSwimlaneTest extends JbpmTestCase {
long deploymentDbid;
+
+ String dept;
+
protected void setUp() throws Exception {
super.setUp();
// create identities
- identityService.createGroup("sales-dept");
+ dept = identityService.createGroup("sales-dept");
identityService.createUser("johndoe", "John", "Doe");
- identityService.createMembership("johndoe", "sales-dept");
+ identityService.createMembership("johndoe", dept, "developer");
// deploy process
deploymentDbid = repositoryService.createDeployment()
@@ -55,7 +58,7 @@
repositoryService.deleteDeploymentCascade(deploymentDbid);
// delete identities
- identityService.deleteGroup("sales-dept");
+ identityService.deleteGroup(dept);
identityService.deleteUser("johndoe");
super.tearDown();
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JBossIdmIdentitySessionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JBossIdmIdentitySessionImpl.java 2009-06-15 19:36:52 UTC (rev 5040)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JBossIdmIdentitySessionImpl.java 2009-06-16 04:33:46 UTC (rev 5041)
@@ -45,6 +45,8 @@
protected IdentitySession identitySession;
+ protected String MEMBER_ROLE = "jbpm_member_role";
+
public JBossIdmIdentitySessionImpl(IdentitySession identitySession) {
this.identitySession = identitySession;
}
@@ -64,8 +66,7 @@
if (businessEmail != null) {
attrs.add(new SimpleAttribute(P3PConstants.INFO_USER_BUSINESS_INFO_ONLINE_EMAIL, businessEmail));
}
-
-
+
identitySession.getAttributesManager().addAttributes(idUser, attrs.toArray(new Attribute[attrs.size()]));
return idUser.getId();
@@ -83,12 +84,7 @@
List<User> users = new ArrayList<User>();
for (org.jboss.identity.idm.api.User idUser : idUsers) {
- String name = idUser.getId();
- String givenName = getAttributeString(idUser, P3PConstants.INFO_USER_NAME_GIVEN);
- String familyName = getAttributeString(idUser, P3PConstants.INFO_USER_NAME_FAMILY);
-
- UserImpl user = new UserImpl(name, givenName, familyName);
- users.add(user);
+ users.add(getUserInfo(idUser));
}
return users;
@@ -102,12 +98,7 @@
try {
org.jboss.identity.idm.api.User idUser = identitySession.getPersistenceManager().findUser(userId);
if (idUser != null) {
- String name = idUser.getId();
- String givenName = getAttributeString(idUser, P3PConstants.INFO_USER_NAME_GIVEN);
- String familyName = getAttributeString(idUser, P3PConstants.INFO_USER_NAME_FAMILY);
-
- User user = new UserImpl(name, givenName, familyName);
- return user;
+ return getUserInfo(idUser);
}
return null;
} catch (IdentityException e) {
@@ -115,6 +106,17 @@
}
}
+private User getUserInfo(org.jboss.identity.idm.api.User idUser) throws IdentityException {
+ String name = idUser.getId();
+ String givenName = getAttributeString(idUser, P3PConstants.INFO_USER_NAME_GIVEN);
+ String familyName = getAttributeString(idUser, P3PConstants.INFO_USER_NAME_FAMILY);
+ String businessEmail = getAttributeString(idUser, P3PConstants.INFO_USER_BUSINESS_INFO_ONLINE_EMAIL);
+
+ UserImpl user = new UserImpl(name, givenName, familyName);
+ user.setBusinessEmail(businessEmail);
+ return user;
+}
+
public List<User> findUsersById(String... userIds) {
List<User> users = new ArrayList<User>();
for (String userId : userIds){
@@ -129,11 +131,13 @@
public List<User> findUsersByGroup(String groupId) {
try {
+ List<User> users = new ArrayList<User>();
org.jboss.identity.idm.api.Group idGroup = findIdmGroupById(groupId);
+ if (idGroup == null){
+ return users;
+ }
Collection<org.jboss.identity.idm.api.User> idusers =
identitySession.getRelationshipManager().findAssociatedUsers(idGroup, false);
- List<User> users = new ArrayList<User>();
-
for (org.jboss.identity.idm.api.User iduser : idusers) {
users.add(findUserById(iduser.getId()));
}
@@ -156,8 +160,11 @@
public String createGroup(String groupName, String groupType, String parentGroupId) {
try {
-
- org.jboss.identity.idm.api.Group group = identitySession.getPersistenceManager().createGroup(groupName, groupType);
+ String gtype = groupType;
+ if (gtype == null) {
+ gtype = Group.TYPE_UNIT;
+ }
+ org.jboss.identity.idm.api.Group group = identitySession.getPersistenceManager().createGroup(groupName, gtype);
String groupId = group.getId();
if (parentGroupId!=null) {
@@ -178,6 +185,9 @@
public Group findGroupById(String groupId) {
try {
org.jboss.identity.idm.api.Group idGroup = findIdmGroupById(groupId);
+ if (idGroup == null) {
+ return null;
+ }
GroupImpl group = new GroupImpl();
group.setId(idGroup.getId());
group.setType(idGroup.getGroupType());
@@ -223,15 +233,15 @@
public List<Group> findGroupsByUser(String userId) {
try {
- Collection<org.jboss.identity.idm.api.Group> idGroups = identitySession.getRelationshipManager().
- findAssociatedGroups(userId, null);
+ Collection<org.jboss.identity.idm.api.Group> idGroups = identitySession.getRoleManager()
+ .findGroupsWithRelatedRole(userId, null);
List<Group> groups = new ArrayList<Group>();
for (org.jboss.identity.idm.api.Group idGroup : idGroups) {
groups.add(findGroupById(idGroup.getId()));
}
return groups;
- } catch (IdentityException e) {
+ } catch (Exception e) {
throw new JbpmException("Couldn't get Groups by userId [" + userId + "]", e);
}
@@ -281,18 +291,14 @@
throw new JbpmException("user "+userId+" doesn't exist");
}
-
- if (role!=null) {
- RoleType roleType = identitySession.getRoleManager().getRoleType(role);
- if (roleType==null) {
- roleType = identitySession.getRoleManager().createRoleType(role);
- }
-
- identitySession.getRoleManager().createRole(roleType, idUser, group);
-
- } else {
- identitySession.getRelationshipManager().associateUser(group, idUser);
+ if (role == null) {
+ role = MEMBER_ROLE;
}
+ RoleType roleType = identitySession.getRoleManager().getRoleType(role);
+ if (roleType==null) {
+ roleType = identitySession.getRoleManager().createRoleType(role);
+ }
+ identitySession.getRoleManager().createRole(roleType, idUser, group);
} catch (Exception e) {
throw new JbpmException("couldn't create membership "+userId+", "+groupId+", "+role, e);
Modified: jbpm4/trunk/qa/build.xml
===================================================================
--- jbpm4/trunk/qa/build.xml 2009-06-15 19:36:52 UTC (rev 5040)
+++ jbpm4/trunk/qa/build.xml 2009-06-16 04:33:46 UTC (rev 5041)
@@ -102,10 +102,10 @@
<target name="copy.jbossidm.jdbc.configuration" if="identity.component.idm">
<copy file="../modules/distro/target/oracle/ojdbc14.jar"
todir="${jbossidm.home}/lib" />
- <copy file="jdbc/${database}.properties"
+ <!--copy file="jdbc/${database}.properties"
todir="${jbossidm.home}/db/jdbc"
overwrite="true"
- failonerror="false" />
+ failonerror="false" /-->
</target>
<target name="integration.testrun.teardown"
16 years, 10 months
JBoss JBPM SVN: r5040 - in jbpm3/branches/jbpm-3.2-soa: modules/core/src/test/java/org/jbpm/job/executor and 1 other directory.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-06-15 15:36:52 -0400 (Mon, 15 Jun 2009)
New Revision: 5040
Modified:
jbpm3/branches/jbpm-3.2-soa/hudson/profiles.xml.redhat.qa
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/job/executor/JobExecutorDbTest.java
Log:
JBPM-2292: Move jBPM3-SOA continuous integration to QA lab (RESOLVED)
switch to oracle instance at dev68
increase JobExecutorDbTest timeout to 5 minutes
Modified: jbpm3/branches/jbpm-3.2-soa/hudson/profiles.xml.redhat.qa
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/hudson/profiles.xml.redhat.qa 2009-06-15 13:34:13 UTC (rev 5039)
+++ jbpm3/branches/jbpm-3.2-soa/hudson/profiles.xml.redhat.qa 2009-06-15 19:36:52 UTC (rev 5040)
@@ -36,12 +36,12 @@
<jdbc.postgresql.username>jbpm3</jdbc.postgresql.username>
<jdbc.postgresql.password>jbpm3</jdbc.postgresql.password>
- <jdbc.oracle.server>dev01.qa.atl2.redhat.com</jdbc.oracle.server>
+ <jdbc.oracle.server>dev68.qa.atl2.redhat.com</jdbc.oracle.server>
<jdbc.oracle.port>1521</jdbc.oracle.port>
- <jdbc.oracle.database>QADB01</jdbc.oracle.database>
+ <jdbc.oracle.database>qadb01</jdbc.oracle.database>
<jdbc.oracle.url>jdbc:oracle:thin:@${jdbc.oracle.server}:${jdbc.oracle.port}:${jdbc.oracle.database}</jdbc.oracle.url>
- <jdbc.oracle.username>JBPM</jdbc.oracle.username>
- <jdbc.oracle.password>JBPM</jdbc.oracle.password>
+ <jdbc.oracle.username>jbpm3</jdbc.oracle.username>
+ <jdbc.oracle.password>jbpm3</jdbc.oracle.password>
</properties>
</profile>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/job/executor/JobExecutorDbTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/job/executor/JobExecutorDbTest.java 2009-06-15 13:34:13 UTC (rev 5039)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/job/executor/JobExecutorDbTest.java 2009-06-15 19:36:52 UTC (rev 5040)
@@ -16,7 +16,7 @@
public class JobExecutorDbTest extends AbstractDbTestCase {
static final int nbrOfConcurrentProcessExecutions = 20;
- static final int timeout = 60000;
+ static final int timeout = 5 * 60 * 1000;
static Set collectedResults = Collections.synchronizedSet(new TreeSet());
static List allocatedProcessIds = new Vector();
16 years, 10 months
JBoss JBPM SVN: r5039 - in jbpm4/trunk/modules: test-db/src/test/java/org/jbpm/test/activities and 1 other directory.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-06-15 09:34:13 -0400 (Mon, 15 Jun 2009)
New Revision: 5039
Added:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkJoinInSameTransactionTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/IncrementVariableActivity.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/PassThroughActivity.java
Modified:
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
Log:
JBPM-2286 : Added test case for fork/join in same transaction
Modified: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2009-06-15 12:02:58 UTC (rev 5038)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2009-06-15 13:34:13 UTC (rev 5039)
@@ -180,4 +180,12 @@
}
return null;
}
+
+ // execution helper methods //////////////////////////////////////////
+
+ public void assertProcessInstanceEnded(String processInstanceId) {
+ assertNull("Error: a process instance with id " + processInstanceId + " was found",
+ executionService.findProcessInstanceById(processInstanceId));
+ }
+
}
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkJoinInSameTransactionTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkJoinInSameTransactionTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkJoinInSameTransactionTest.java 2009-06-15 13:34:13 UTC (rev 5039)
@@ -0,0 +1,165 @@
+/*
+ * 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.activities;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * Test case for fork/join constructs in one transaction
+ *
+ * @author Joram Barrez
+ */
+public class ForkJoinInSameTransactionTest extends JbpmTestCase {
+
+ /**
+ * Test for JBPM-2286
+ */
+ public void testForkToJoinInOneTransaction() {
+ deployJpdlXmlString(
+ "<process name='ForkJoinInOneTransaction'>" +
+ " <start>" +
+ " <transition to='theFork' />" +
+ " </start>" +
+ " <fork name='theFork'>" +
+ " <transition to='theJoin' />" +
+ " <transition to='theJoin' />" +
+ " </fork>" +
+ " <join name='theJoin'>" +
+ " <transition to='end' />" +
+ " </join>" +
+ " <end name='end' />" +
+ "</process>"
+ );
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("ForkJoinInOneTransaction");
+ assertProcessInstanceEnded(processInstance.getId());
+ }
+
+ /**
+ * Test for JBPM-2286
+ */
+ public void testForkToJoinAfterStateInOneTransaction() {
+ deployJpdlXmlString(
+ "<process name='ForkJoinInOneTransaction'>" +
+ " <start>" +
+ " <transition to='wait' />" +
+ " </start>" +
+ " <state name='wait'>" +
+ " <transition name='go on' to='theFork' />" +
+ " </state>" +
+ " <fork name='theFork'>" +
+ " <transition to='theJoin' />" +
+ " <transition to='theJoin' />" +
+ " </fork>" +
+ " <join name='theJoin'>" +
+ " <transition to='end' />" +
+ " </join>" +
+ " <end name='end' />" +
+ "</process>"
+ );
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("ForkJoinInOneTransaction");
+ executionService.signalExecutionById(processInstance.getId(), "go on");
+ assertProcessInstanceEnded(processInstance.getId());
+ }
+
+ /**
+ * Test for JBPM-2286
+ */
+ public void testForkToJoinWithActivitiesInOneTransaction() {
+ deployJpdlXmlString(
+ "<process name='ForkJoinInOneTransaction'>" +
+ " <start>" +
+ " <transition to='theFork' />" +
+ " </start>" +
+ " <fork name='theFork'>" +
+ " <transition to='left' />" +
+ " <transition to='right' />" +
+ " </fork>" +
+ " <custom name='left' class='org.jbpm.test.activities.PassThroughActivity' >" +
+ " <transition to='theJoin' />" +
+ " </custom>" +
+ " <custom name='right' class='org.jbpm.test.activities.PassThroughActivity' >" +
+ " <transition to='theJoin' />" +
+ " </custom>" +
+ " <join name='theJoin'>" +
+ " <transition to='end' />" +
+ " </join>" +
+ " <end name='end' />" +
+ "</process>"
+ );
+
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("ForkJoinInOneTransaction");
+ assertProcessInstanceEnded(processInstance.getId());
+ }
+
+ /**
+ * Test for JBPM-2286
+ */
+ public void testForkToJoinInLoopInOneTransaction() {
+ deployJpdlXmlString(
+ "<process name='ForkJoinInOneTransaction'>" +
+ " <start>" +
+ " <transition to='checkLoop' />" +
+ " </start>" +
+ " <decision name='checkLoop'>" +
+ " <transition to='end'>" +
+ " <condition expr='#{testVar > 10}' />" +
+ " </transition>" +
+ " <transition to='theFork' />" +
+ " </decision>" +
+ " <fork name='theFork'>" +
+ " <transition to='left' />" +
+ " <transition to='right' />" +
+ " </fork>" +
+ " <custom name='left' class='org.jbpm.test.activities.PassThroughActivity' >" +
+ " <transition to='theJoin' />" +
+ " </custom>" +
+ " <custom name='right' class='org.jbpm.test.activities.PassThroughActivity' >" +
+ " <transition to='theJoin' />" +
+ " </custom>" +
+ " <join name='theJoin'>" +
+ " <transition to='incrementLoopVar' />" +
+ " </join>" +
+ " <custom name='incrementLoopVar' class='org.jbpm.test.activities.IncrementVariableActivity' >" +
+ " <transition to='checkLoop' />" +
+ " </custom>" +
+ " <end name='end' />" +
+ "</process>"
+ );
+
+ Map<String, Object> vars = new HashMap<String, Object>();
+ vars.put("testVar", new Integer(0));
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("ForkJoinInOneTransaction", vars);
+ assertProcessInstanceEnded(processInstance.getId());
+ }
+
+}
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/IncrementVariableActivity.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/IncrementVariableActivity.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/IncrementVariableActivity.java 2009-06-15 13:34:13 UTC (rev 5039)
@@ -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.test.activities;
+
+import java.util.Map;
+
+import org.jbpm.api.activity.ActivityExecution;
+import org.jbpm.api.activity.ExternalActivityBehaviour;
+
+
+/**
+ * Activity that increments the variable 'testVar' by one.
+ *
+ * @author Joram Barrez
+ */
+public class IncrementVariableActivity implements ExternalActivityBehaviour {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final String TEST_VAR = "testVar";
+
+ public void execute(ActivityExecution execution) throws Exception {
+
+ Integer testVar = (Integer) execution.getVariable(TEST_VAR);
+ testVar = testVar + 1;
+ execution.setVariable(TEST_VAR, testVar);
+
+ execution.takeDefaultTransition();
+ }
+
+ public void signal(ActivityExecution execution, String signalName, Map<String, ? > parameters) throws Exception {
+ execution.take(signalName);
+ }
+
+}
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/PassThroughActivity.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/PassThroughActivity.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/PassThroughActivity.java 2009-06-15 13:34:13 UTC (rev 5039)
@@ -0,0 +1,52 @@
+/*
+ * 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.activities;
+
+import java.util.Map;
+
+import org.jbpm.api.activity.ActivityExecution;
+import org.jbpm.api.activity.ExternalActivityBehaviour;
+
+
+/**
+ * Activity implementation that just takes the default transition.
+ *
+ * @author Joram Barrez
+ */
+public class PassThroughActivity implements ExternalActivityBehaviour {
+
+ private static final long serialVersionUID = 1L;
+
+
+ public void signal(ActivityExecution execution, String signalName, Map<String, ? > parameters) throws Exception {
+ execution.take(signalName);
+ }
+
+ public void execute(ActivityExecution execution) throws Exception {
+ execution.takeDefaultTransition();
+ }
+
+
+}
16 years, 10 months
JBoss JBPM SVN: r5038 - in jbpm4/branches/tbaeyens/modules: enterprise/src/main/java/org/jbpm/enterprise/internal/wire/binding and 8 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-06-15 08:02:58 -0400 (Mon, 15 Jun 2009)
New Revision: 5038
Added:
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaStatusHelper.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransaction.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransactionInterceptor.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/JtaTransactionInterceptorBinding.java
Removed:
jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/wire/binding/JtaTransactionInterceptorBinding.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/JtaTransaction.java
Modified:
jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-enterprise.jar/META-INF/ejb-jar.xml
jbpm4/branches/tbaeyens/modules/examples/pom.xml
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionBinding.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JbossIdmIdentitySessionDescriptor.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/resources/jbpm.wire.bindings.xml
jbpm4/branches/tbaeyens/modules/test-db/pom.xml
Log:
jta updates
Modified: jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-enterprise.jar/META-INF/ejb-jar.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-enterprise.jar/META-INF/ejb-jar.xml 2009-06-15 12:00:58 UTC (rev 5037)
+++ jbpm4/branches/tbaeyens/modules/distro/src/main/files/jboss/config.common/deploy/jbpm/jbpm-enterprise.jar/META-INF/ejb-jar.xml 2009-06-15 12:02:58 UTC (rev 5038)
@@ -20,7 +20,7 @@
<local>org.jbpm.enterprise.internal.ejb.LocalCommandExecutor</local>
<ejb-class>org.jbpm.enterprise.internal.ejb.CommandExecutorSLSB</ejb-class>
<session-type>Stateless</session-type>
- <transaction-type>Container</transaction-type>
+ <transaction-type>Bean</transaction-type>
<ejb-local-ref>
<description>
@@ -150,13 +150,13 @@
<assembly-descriptor>
- <container-transaction>
+ <!-- container-transaction>
<method>
<ejb-name>CommandExecutor</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
- </container-transaction>
+ </container-transaction -->
<container-transaction>
<method>
Deleted: jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/wire/binding/JtaTransactionInterceptorBinding.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/wire/binding/JtaTransactionInterceptorBinding.java 2009-06-15 12:00:58 UTC (rev 5037)
+++ jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/wire/binding/JtaTransactionInterceptorBinding.java 2009-06-15 12:02:58 UTC (rev 5038)
@@ -1,65 +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.enterprise.internal.wire.binding;
-
-import org.jbpm.enterprise.internal.jta.JtaTransactionInterceptor;
-import org.jbpm.pvm.internal.util.XmlUtil;
-import org.jbpm.pvm.internal.wire.Descriptor;
-import org.jbpm.pvm.internal.wire.binding.PropertiesBinding;
-import org.jbpm.pvm.internal.wire.binding.WireInterceptorBinding;
-import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.StringDescriptor;
-import org.jbpm.pvm.internal.xml.Parse;
-import org.jbpm.pvm.internal.xml.Parser;
-import org.w3c.dom.Element;
-
-/**
- * Mapping between a <code>jta-transaction-interceptor</code> element and a
- * {@link JtaTransactionInterceptor} object.
- *
- * @author Alejandro Guizar
- */
-public class JtaTransactionInterceptorBinding extends WireInterceptorBinding {
-
- private static final PropertiesBinding propertiesBinding = new PropertiesBinding();
-
- public JtaTransactionInterceptorBinding() {
- super("jta-transaction-interceptor");
- }
-
- public Object parse(Element element, Parse parse, Parser parser) {
- ObjectDescriptor descriptor = new ObjectDescriptor(JtaTransactionInterceptor.class);
- // user transaction jndi name
- String userTransactionName = XmlUtil.attribute(element, "user-transaction-name");
- if (userTransactionName != null) {
- descriptor.addInjection("userTransactionName", new StringDescriptor(userTransactionName));
- }
- // jndi properties
- Element jndiPropertiesElement = XmlUtil.element(element, "jndi-properties");
- if (jndiPropertiesElement != null) {
- descriptor.addInjection("jndiProperties", (Descriptor) propertiesBinding.parse(
- jndiPropertiesElement, parse, parser));
- }
- return descriptor;
- }
-
-}
Modified: jbpm4/branches/tbaeyens/modules/examples/pom.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/examples/pom.xml 2009-06-15 12:00:58 UTC (rev 5037)
+++ jbpm4/branches/tbaeyens/modules/examples/pom.xml 2009-06-15 12:02:58 UTC (rev 5038)
@@ -183,16 +183,6 @@
<configuration>
<failIfNoTests>false</failIfNoTests>
<trimStackTrace>false</trimStackTrace>
- <excludes>
- <!-- https://jira.jboss.org/jira/browse/JBPM-2147 -->
- <!-- https://jira.jboss.org/jira/browse/JBPM-2200
- <exclude>org/jbpm/examples/task/swimlane/TaskSwimlaneTest.java</exclude>
- <exclude>org/jbpm/examples/task/candidates/TaskCandidatesTest.java</exclude>
- <exclude>org/jbpm/examples/mail/template/TemplateMailTest.java</exclude>
- <exclude>org/jbpm/examples/mail/inline/InlineMailTest.java</exclude>
- <exclude>org/jbpm/examples/eventlistener/EventListenerTest.java</exclude>
- -->
- </excludes>
</configuration>
</plugin>
</plugins>
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java 2009-06-15 12:00:58 UTC (rev 5037)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java 2009-06-15 12:02:58 UTC (rev 5038)
@@ -98,7 +98,7 @@
* transaction. */
protected void handleJobExecutionException(Environment environment, JobImpl<?> job, Throwable exception) {
Transaction transaction = environment.get(Transaction.class);
- transaction.setRollbackOnly();
+ // transaction.setRollbackOnly();
CommandService commandService = (CommandService) environment.get(CommandService.class);
JobExceptionHandler jobExceptionHandler = new JobExceptionHandler(job.getDbid(), exception, commandService);
Deleted: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/JtaTransaction.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/JtaTransaction.java 2009-06-15 12:00:58 UTC (rev 5037)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/JtaTransaction.java 2009-06-15 12:02:58 UTC (rev 5038)
@@ -1,85 +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.tx;
-
-import javax.naming.InitialContext;
-import javax.transaction.Status;
-import javax.transaction.Synchronization;
-import javax.transaction.SystemException;
-import javax.transaction.TransactionManager;
-import javax.transaction.UserTransaction;
-
-import org.jbpm.api.JbpmException;
-import org.jbpm.api.env.Transaction;
-
-
-/**
- * @author Tom Baeyens
- */
-public class JtaTransaction implements Transaction {
-
- protected String userTransactionJndiName = "java:comp/UserTransaction";
- protected String transactionManagerJndiName = "java:/TransactionManager";
-
- public boolean isRollbackOnly() {
- try {
- return getUserTransaction().getStatus()==Status.STATUS_MARKED_ROLLBACK;
- } catch (SystemException e) {
- throw new JbpmException("couldn't get status of user transaction", e);
- }
- }
-
- public void setRollbackOnly() {
- try {
- getUserTransaction().setRollbackOnly();
- } catch (Exception e) {
- throw new JbpmException("couldn't set user transaction to rollback only", e);
- }
- }
-
- public void registerSynchronization(Synchronization synchronization) {
- try {
- getJeeTransaction().registerSynchronization(synchronization);
- } catch (Exception e) {
- throw new JbpmException("couldn't register synchronization", e);
- }
- }
-
- protected UserTransaction getUserTransaction() {
- try {
- InitialContext initialContext = new InitialContext();
- return (UserTransaction) initialContext.lookup(userTransactionJndiName);
- } catch (Exception e) {
- throw new JbpmException("couldn't lookup user transaction at "+userTransactionJndiName, e);
- }
- }
-
- protected javax.transaction.Transaction getJeeTransaction() {
- try {
- InitialContext initialContext = new InitialContext();
- TransactionManager transactionManager = (TransactionManager) initialContext.lookup(transactionManagerJndiName);
- return transactionManager.getTransaction();
- } catch (Exception e) {
- throw new JbpmException("couldn't get transaction from transaction manager "+userTransactionJndiName, e);
- }
- }
-}
Added: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaStatusHelper.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaStatusHelper.java (rev 0)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaStatusHelper.java 2009-06-15 12:02:58 UTC (rev 5038)
@@ -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.tx.jta;
+
+import javax.transaction.Status;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public abstract class JtaStatusHelper {
+
+ public static String toString(int txStatus) {
+ if (txStatus==Status.STATUS_ACTIVE) {
+ return "STATUS_ACTIVE";
+ } else if (txStatus==Status.STATUS_COMMITTED) {
+ return "STATUS_COMMITTED";
+ } else if (txStatus==Status.STATUS_COMMITTING) {
+ return "STATUS_COMMITTING";
+ } else if (txStatus==Status.STATUS_MARKED_ROLLBACK) {
+ return "STATUS_MARKED_ROLLBACK";
+ } else if (txStatus==Status.STATUS_NO_TRANSACTION) {
+ return "STATUS_NO_TRANSACTION";
+ } else if (txStatus==Status.STATUS_PREPARED) {
+ return "STATUS_PREPARED";
+ } else if (txStatus==Status.STATUS_PREPARING) {
+ return "STATUS_PREPARING";
+ } else if (txStatus==Status.STATUS_ROLLEDBACK) {
+ return "STATUS_ROLLEDBACK";
+ } else if (txStatus==Status.STATUS_ROLLING_BACK) {
+ return "STATUS_ROLLING_BACK";
+ } else if (txStatus==Status.STATUS_UNKNOWN) {
+ return "STATUS_UNKNOWN";
+ } else {
+ return "unknown";
+ }
+ }
+}
Property changes on: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaStatusHelper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransaction.java (from rev 5035, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/JtaTransaction.java)
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransaction.java (rev 0)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransaction.java 2009-06-15 12:02:58 UTC (rev 5038)
@@ -0,0 +1,134 @@
+/*
+ * 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.jta;
+
+import javax.naming.InitialContext;
+import javax.transaction.Status;
+import javax.transaction.Synchronization;
+import javax.transaction.SystemException;
+import javax.transaction.TransactionManager;
+import javax.transaction.UserTransaction;
+
+import org.jbpm.api.JbpmException;
+import org.jbpm.api.env.Transaction;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class JtaTransaction implements Transaction {
+
+ protected String userTransactionJndiName = "java:comp/UserTransaction";
+ protected String transactionManagerJndiName = "java:/TransactionManager";
+
+ public boolean isRollbackOnly() {
+ try {
+ return lookupJeeUserTransaction().getStatus()==Status.STATUS_MARKED_ROLLBACK;
+ } catch (SystemException e) {
+ throw new JbpmException("couldn't get status of user transaction: "+e.getMessage(), e);
+ }
+ }
+
+ public void setRollbackOnly() {
+ try {
+ lookupJeeUserTransaction().setRollbackOnly();
+ } catch (Exception e) {
+ throw new JbpmException("couldn't set user transaction to rollback only: "+e.getMessage(), e);
+ }
+ }
+
+ public void registerSynchronization(Synchronization synchronization) {
+ try {
+ lookupJeeTransaction().registerSynchronization(synchronization);
+ } catch (Exception e) {
+ throw new JbpmException("couldn't register synchronization: "+e.getMessage(), e);
+ }
+ }
+
+ public void begin() {
+ try {
+ lookupJeeUserTransaction().begin();
+ } catch (Exception e) {
+ throw new JbpmException("couldn't begin transaction: "+e.getMessage(), e);
+ }
+ }
+
+ public void rollback() {
+ try {
+ lookupJeeUserTransaction().rollback();
+ } catch (Exception e) {
+ throw new JbpmException("couldn't rollback: "+e.getMessage(), e);
+ }
+ }
+
+ public void commit() {
+ try {
+ lookupJeeUserTransaction().commit();
+ } catch (Exception e) {
+ throw new JbpmException("couldn't commit: "+e.getMessage(), e);
+ }
+ }
+
+ public javax.transaction.Transaction suspend() {
+ try {
+ return lookupJeeTransactionManager().suspend();
+ } catch (Exception e) {
+ throw new JbpmException("couldn't suspend: "+e.getMessage(), e);
+ }
+ }
+
+ public void resume(javax.transaction.Transaction transaction) {
+ try {
+ lookupJeeTransactionManager().resume(transaction);
+ } catch (Exception e) {
+ throw new JbpmException("couldn't resume: "+e.getMessage(), e);
+ }
+ }
+
+ // lookups //////////////////////////////////////////////////////////////////
+
+ public UserTransaction lookupJeeUserTransaction() {
+ return (UserTransaction) lookupFromJndi(userTransactionJndiName);
+ }
+
+ public javax.transaction.Transaction lookupJeeTransaction() {
+ try {
+ TransactionManager transactionManager = lookupJeeTransactionManager();
+ return transactionManager.getTransaction();
+ } catch (Exception e) {
+ throw new JbpmException("couldn't get transaction from transaction manager "+transactionManagerJndiName+": "+e.getMessage(), e);
+ }
+ }
+
+ public TransactionManager lookupJeeTransactionManager() {
+ return (TransactionManager) lookupFromJndi(transactionManagerJndiName);
+ }
+
+ public static Object lookupFromJndi(String jndiName) {
+ try {
+ InitialContext initialContext = new InitialContext();
+ return initialContext.lookup(jndiName);
+ } catch (Exception e) {
+ throw new JbpmException("couldn't lookup '"+jndiName+"' from jndi: "+e.getMessage()+": "+e.getMessage(), e);
+ }
+ }
+}
Property changes on: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransaction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransactionInterceptor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransactionInterceptor.java (rev 0)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransactionInterceptor.java 2009-06-15 12:02:58 UTC (rev 5038)
@@ -0,0 +1,91 @@
+/*
+ * 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.jta;
+
+import javax.transaction.Status;
+import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+import javax.transaction.UserTransaction;
+
+import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.env.Environment;
+import org.jbpm.internal.log.Log;
+import org.jbpm.pvm.internal.svc.Interceptor;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class JtaTransactionInterceptor extends Interceptor {
+
+ private static Log log = Log.getLog(JtaTransactionInterceptor.class.getName());
+
+ public <T> T execute(Command<T> command) {
+ JtaTransaction jtaTransaction = Environment.getFromCurrent(JtaTransaction.class);
+
+ UserTransaction userTransaction = jtaTransaction.lookupJeeUserTransaction();
+
+ int status = -1;
+ try {
+ status = userTransaction.getStatus();
+ } catch (SystemException e) {
+ throw new JbpmException("couldn't get transaction status: "+e.getMessage(), e);
+ }
+ log.debug("jta transaction status: "+JtaStatusHelper.toString(status));
+
+ if ( (status != Status.STATUS_NO_TRANSACTION)
+ && (status != Status.STATUS_COMMITTED)
+ && (status != Status.STATUS_ROLLEDBACK)
+ ) {
+ throw new JbpmException("invalid transaction state: "+JtaStatusHelper.toString(status));
+ }
+
+ Transaction suspendedTransaction = null;
+ if ((status == Status.STATUS_COMMITTED) || (status == Status.STATUS_ROLLEDBACK)) {
+ suspendedTransaction = jtaTransaction.suspend();
+ }
+
+ Object returnValue = null;
+
+ try {
+ jtaTransaction.begin();
+
+ returnValue = next.execute(command);
+
+ jtaTransaction.commit();
+
+ } catch (RuntimeException e) {
+ jtaTransaction.rollback();
+ throw e;
+
+ } finally {
+
+ if (suspendedTransaction!=null) {
+ jtaTransaction.resume(suspendedTransaction);
+ }
+ }
+
+ return (T) returnValue;
+ }
+
+}
Property changes on: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransactionInterceptor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/JtaTransactionInterceptorBinding.java (from rev 5035, jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/wire/binding/JtaTransactionInterceptorBinding.java)
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/JtaTransactionInterceptorBinding.java (rev 0)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/JtaTransactionInterceptorBinding.java 2009-06-15 12:02:58 UTC (rev 5038)
@@ -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.pvm.internal.wire.binding;
+
+import org.jbpm.pvm.internal.tx.jta.JtaTransactionInterceptor;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
+import org.jbpm.pvm.internal.xml.Parse;
+import org.jbpm.pvm.internal.xml.Parser;
+import org.w3c.dom.Element;
+
+/**
+ * Mapping between a <code>jta-transaction-interceptor</code> element and a
+ * {@link JtaTransactionInterceptor} object.
+ *
+ * @author Alejandro Guizar
+ */
+public class JtaTransactionInterceptorBinding extends WireInterceptorBinding {
+
+ public JtaTransactionInterceptorBinding() {
+ super("jta-transaction-interceptor");
+ }
+
+ public Object parse(Element element, Parse parse, Parser parser) {
+ return new ObjectDescriptor(JtaTransactionInterceptor.class);
+ }
+
+}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionBinding.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionBinding.java 2009-06-15 12:00:58 UTC (rev 5037)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TransactionBinding.java 2009-06-15 12:02:58 UTC (rev 5038)
@@ -22,8 +22,8 @@
package org.jbpm.pvm.internal.wire.binding;
import org.jbpm.api.env.Transaction;
-import org.jbpm.pvm.internal.tx.JtaTransaction;
import org.jbpm.pvm.internal.tx.StandardTransaction;
+import org.jbpm.pvm.internal.tx.jta.JtaTransaction;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JbossIdmIdentitySessionDescriptor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JbossIdmIdentitySessionDescriptor.java 2009-06-15 12:00:58 UTC (rev 5037)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JbossIdmIdentitySessionDescriptor.java 2009-06-15 12:02:58 UTC (rev 5038)
@@ -28,8 +28,8 @@
import org.jbpm.api.env.Environment;
import org.jbpm.pvm.internal.identity.impl.IdentitySessionResource;
import org.jbpm.pvm.internal.identity.impl.JBossIdmIdentitySessionImpl;
-import org.jbpm.pvm.internal.tx.JtaTransaction;
import org.jbpm.pvm.internal.tx.StandardTransaction;
+import org.jbpm.pvm.internal.tx.jta.JtaTransaction;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.WireDefinition;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/resources/jbpm.wire.bindings.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/resources/jbpm.wire.bindings.xml 2009-06-15 12:00:58 UTC (rev 5037)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/resources/jbpm.wire.bindings.xml 2009-06-15 12:02:58 UTC (rev 5038)
@@ -78,6 +78,7 @@
<binding class="org.jbpm.pvm.internal.wire.binding.RetryInterceptorBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.StandardTransactionInterceptorBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.SerializeInterceptorBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.JtaTransactionInterceptorBinding" />
<!-- operation -->
<binding class="org.jbpm.pvm.internal.wire.binding.PropertyBinding" />
@@ -90,7 +91,6 @@
<binding class="org.jbpm.enterprise.internal.wire.binding.EjbTimerSessionBinding" />
<binding class="org.jbpm.enterprise.internal.wire.binding.EjbLocalCommandServiceBinding" />
<binding class="org.jbpm.enterprise.internal.wire.binding.EjbRemoteCommandServiceBinding" />
- <binding class="org.jbpm.enterprise.internal.wire.binding.JtaTransactionInterceptorBinding" />
<!-- jpdl bindings -->
<binding class="org.jbpm.jpdl.internal.xml.JpdlDeployerBinding" />
Modified: jbpm4/branches/tbaeyens/modules/test-db/pom.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-db/pom.xml 2009-06-15 12:00:58 UTC (rev 5037)
+++ jbpm4/branches/tbaeyens/modules/test-db/pom.xml 2009-06-15 12:02:58 UTC (rev 5038)
@@ -104,26 +104,8 @@
</build>
</profile>
- <!--
- skip tests if this is an integration test run
- (only examples and test-db are part of the integration test runs)
- -->
+ <!-- -Djboss.bind.address -->
<profile>
- <id>integration.test</id>
- <activation>
- <property>
- <name>jboss.bind.address</name>
- </property>
- </activation>
- <properties>
- <skipTests>true</skipTests>
- </properties>
- </profile>
-
-
-
- <!-- -Djboss.bind.address
- <profile>
<id>integration.tests</id>
<activation>
<property>
@@ -137,6 +119,7 @@
<artifactId>jbpm-enterprise</artifactId>
<scope>test</scope>
</dependency>
+ <!-- AS 5 Integration tests -->
<dependency>
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-as-client</artifactId>
@@ -165,10 +148,10 @@
<configuration>
<tasks>
<copy todir="target/test-classes" overwrite="true" failonerror="false">
- <fileset dir="../../qa/jbossremote" />
+ <fileset dir="../distro/src/main/files/jboss/jbpm.cfg.remote.client" />
</copy>
<copy todir="target/test-classes" overwrite="true" failonerror="false">
- <fileset dir="${user.home}/.jbpm4/qa/jbossremote" />
+ <fileset dir="${user.home}/.jbpm4/jbpm.cfg.remote.client" />
</copy>
</tasks>
</configuration>
@@ -180,15 +163,13 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<failIfNoTests>false</failIfNoTests>
- <trimStackTrace>false</trimStackTrace>
- <excludes>
- </excludes>
+ <trimStackTrace>false</trimStackTrace>
</configuration>
</plugin>
</plugins>
</build>
- </profile
--->
+ </profile>
+
</profiles>
</project>
\ No newline at end of file
16 years, 10 months
JBoss JBPM SVN: r5037 - jbpm4/branches.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-06-15 08:00:58 -0400 (Mon, 15 Jun 2009)
New Revision: 5037
Added:
jbpm4/branches/tbaeyens/
Log:
creating tbaeyens branch
Copied: jbpm4/branches/tbaeyens (from rev 5036, jbpm4/trunk)
16 years, 10 months