JBoss JBPM SVN: r5742 - jbpm3/branches/jbpm-3.2-soa/hudson/hudson-home.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-10-14 20:04:47 -0400 (Wed, 14 Oct 2009)
New Revision: 5742
Modified:
jbpm3/branches/jbpm-3.2-soa/hudson/hudson-home/command.sh
Log:
[JBPM-2582] generate update scripts during CI
Modified: jbpm3/branches/jbpm-3.2-soa/hudson/hudson-home/command.sh
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/hudson/hudson-home/command.sh 2009-10-14 10:33:08 UTC (rev 5741)
+++ jbpm3/branches/jbpm-3.2-soa/hudson/hudson-home/command.sh 2009-10-15 00:04:47 UTC (rev 5742)
@@ -61,7 +61,7 @@
#
cd $JBPMDIR
export JAVA_HOME=$JAVA_BT_HOME
-MVN_CMD="mvn -U $MVN_OPTS -Pdistro,soa clean install"
+MVN_CMD="mvn -U $MVN_OPTS -Pdistro,soa,update clean install"
echo $MVN_CMD; $MVN_CMD; MVN_STATUS=$?
if [ $MVN_STATUS -ne 0 ]; then
echo maven exit status $MVN_STATUS
16 years, 6 months
JBoss JBPM SVN: r5741 - in jbpm4/trunk/modules: jpdl/src/main/java/org/jbpm/jpdl/internal/activity and 5 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-10-14 06:33:08 -0400 (Wed, 14 Oct 2009)
New Revision: 5741
Added:
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/AssignActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/AssignBinding.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/PassthroughActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/PassthroughBinding.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/RepositoryService.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlBinding.java
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/xml/JpdlParser.java
jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.bindings.xml
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/test/update/ProcessUpdateTest.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeInstanceImpl.java
Log:
JBPM-2578 adding ability to update a deployment resource for tweaking process behaviour for testing purposes
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/RepositoryService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/RepositoryService.java 2009-10-14 06:58:29 UTC (rev 5740)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/RepositoryService.java 2009-10-14 10:33:08 UTC (rev 5741)
@@ -91,7 +91,4 @@
/** the coordinates for the activity on
* {@link ProcessDefinition#getImageResourceName() the process image}. */
ActivityCoordinates getActivityCoordinates(String processDefinitionId, String activityName);
-
- /** update an existing deployment resource */
- void updateDeploymentResource(String deploymentId, String string, InputStream inputStream);
}
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/AssignActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/AssignActivity.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/AssignActivity.java 2009-10-14 10:33:08 UTC (rev 5741)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.activity;
+
+import org.jbpm.api.model.OpenExecution;
+import org.jbpm.pvm.internal.script.ScriptManager;
+import org.jbpm.pvm.internal.wire.Descriptor;
+import org.jbpm.pvm.internal.wire.WireContext;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class AssignActivity extends JpdlAutomaticActivity {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String expression;
+ protected String language;
+ protected String variableName;
+ protected Descriptor valueDescriptor;
+
+ void perform(OpenExecution execution) throws Exception {
+ Object value = null;
+
+ if (expression!=null) {
+ ScriptManager scriptManager = ScriptManager.getScriptManager();
+ value = scriptManager.evaluateExpression(expression, language);
+
+ } else if (valueDescriptor!=null) {
+ value = WireContext.create(valueDescriptor);
+ }
+
+ execution.setVariable(variableName, value);
+ }
+
+ public void setExpression(String expression) {
+ this.expression = expression;
+ }
+ public void setLanguage(String language) {
+ this.language = language;
+ }
+ public void setVariableName(String variableName) {
+ this.variableName = variableName;
+ }
+ public void setValueDescriptor(Descriptor valueDescriptor) {
+ this.valueDescriptor = valueDescriptor;
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/AssignActivity.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/AssignBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/AssignBinding.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/AssignBinding.java 2009-10-14 10:33:08 UTC (rev 5741)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.activity;
+
+import java.util.List;
+import java.util.Set;
+
+import org.jbpm.jpdl.internal.xml.JpdlParser;
+import org.jbpm.pvm.internal.util.XmlUtil;
+import org.jbpm.pvm.internal.wire.Descriptor;
+import org.jbpm.pvm.internal.wire.xml.WireParser;
+import org.jbpm.pvm.internal.xml.Parse;
+import org.w3c.dom.Element;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class AssignBinding extends JpdlBinding {
+
+ public AssignBinding() {
+ super("assign");
+ }
+
+ public Object parseJpdl(Element element, Parse parse, JpdlParser parser) {
+ AssignActivity assignActivity = new AssignActivity();
+
+ String variableName = XmlUtil.attribute(element, "var", true, parse);
+ assignActivity.setVariableName(variableName);
+
+ String expression = XmlUtil.attribute(element, "expr");
+ if (expression!=null) {
+ assignActivity.setExpression(expression);
+ assignActivity.setLanguage(XmlUtil.attribute(element, "lang"));
+
+ } else {
+
+ Set<String> descriptorTagNames = JpdlParser.wireParser.getBindings().getTagNames(WireParser.CATEGORY_DESCRIPTOR);
+ Descriptor valueDescriptor = null;
+ List<Element> assignContentElements = XmlUtil.elements(element);
+
+ for (int i=0; ((i<assignContentElements.size()) && (valueDescriptor==null)); i++) {
+ Element assignContentElement = assignContentElements.get(i);
+ String assignContentElementTagName = XmlUtil.getTagLocalName(assignContentElement);
+ if (descriptorTagNames.contains(assignContentElementTagName)) {
+ valueDescriptor = parser.parseDescriptor(element, parse);
+ }
+ }
+
+ assignActivity.setValueDescriptor(valueDescriptor);
+ }
+
+ return assignActivity;
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/AssignBinding.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlBinding.java 2009-10-14 06:58:29 UTC (rev 5740)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlBinding.java 2009-10-14 10:33:08 UTC (rev 5741)
@@ -32,7 +32,6 @@
import org.jbpm.pvm.internal.model.TransitionImpl;
import org.jbpm.pvm.internal.util.TagBinding;
import org.jbpm.pvm.internal.util.XmlUtil;
-import org.jbpm.pvm.internal.wire.xml.WireParser;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
import org.w3c.dom.Element;
@@ -43,8 +42,6 @@
*/
public abstract class JpdlBinding extends TagBinding {
- protected static final WireParser wireParser = JpdlParser.wireParser;
-
public JpdlBinding(String tagName) {
super(tagName, null, null);
}
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/PassthroughActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/PassthroughActivity.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/PassthroughActivity.java 2009-10-14 10:33:08 UTC (rev 5741)
@@ -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.activity;
+
+import org.jbpm.api.activity.ActivityBehaviour;
+import org.jbpm.api.activity.ActivityExecution;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class PassthroughActivity implements ActivityBehaviour {
+
+ private static final long serialVersionUID = 1L;
+
+ public void execute(ActivityExecution execution) throws Exception {
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/PassthroughActivity.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/PassthroughBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/PassthroughBinding.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/PassthroughBinding.java 2009-10-14 10:33:08 UTC (rev 5741)
@@ -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.jpdl.internal.activity;
+
+import org.jbpm.jpdl.internal.xml.JpdlParser;
+import org.jbpm.pvm.internal.xml.Parse;
+import org.w3c.dom.Element;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class PassthroughBinding extends JpdlBinding {
+
+ public PassthroughBinding() {
+ super("passthrough");
+ }
+
+ public Object parseJpdl(Element element, Parse parse, JpdlParser parser) {
+ return new PassthroughActivity();
+ }
+
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/PassthroughBinding.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-10-14 06:58:29 UTC (rev 5740)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/repository/JpdlDeployer.java 2009-10-14 10:33:08 UTC (rev 5741)
@@ -104,7 +104,7 @@
processElement.appendChild(clonedDescriptionElement);
}
- updateActivities(processDocument, processElement, processUpdateDescriptionElement);
+ updateActivities(processDocument, processElement, processUpdateElement);
try {
Transformer transformer = TransformerFactory.newInstance().newTransformer();
@@ -130,61 +130,71 @@
Map<String, Element> updateActivityMap = getActivityMap(updateContainerElement, activityNames);
for (String activityName: updateActivityMap.keySet()) {
+ Element updateActivity = updateActivityMap.get(activityName);
Element processActivity = processActivityMap.get(activityName);
- Element updateActivity = updateActivityMap.get(activityName);
- String updateTagName = XmlUtil.getTagLocalName(updateActivity);
-
- activityContainerElement.removeChild(processActivity);
- Element mergedActivityElement = processDocument.createElement(updateTagName);
- mergeAttributes(mergedActivityElement, processActivity.getAttributes());
- mergeAttributes(mergedActivityElement, updateActivity.getAttributes());
+ if (processActivity==null) {
+ throw new JbpmException("unmatching update activity "+activityName);
+ }
- Map<String, List<Element>> processActivityContents = getElementsByTagName(processActivity);
- Map<String, List<Element>> updateActivityContents = getElementsByTagName(updateActivity);
+ Node clonedUpdateActivity = updateActivity.cloneNode(true);
+ processDocument.adoptNode(clonedUpdateActivity);
+ activityContainerElement.insertBefore(clonedUpdateActivity, processActivity);
+ activityContainerElement.removeChild(processActivity);
- Set<String> allTagNames = new HashSet<String>(processActivityContents.keySet());
- allTagNames.addAll(updateActivityContents.keySet());
-
- for (String tagName: allTagNames) {
- List<Element> contentElements = processActivityContents.get(tagName);
- if (contentElements==null) {
- contentElements = new ArrayList<Element>();
- }
- List<Element> updateElements = updateActivityContents.get(tagName);
- for (int i=0; i<contentElements.size(); i++) {
- Element contentElement = contentElements.get(i);
- Element updateElement = (updateElements!=null && updateElements.size()>i ? updateElements.get(i) : null);
- if (updateElement!=null) {
- mergeAttributes(contentElement, updateElement.getAttributes());
- }
- }
- }
+// String updateTagName = XmlUtil.getTagLocalName(updateActivity);
+//
+// activityContainerElement.removeChild(processActivity);
+// Element mergedActivityElement = processDocument.createElement(updateTagName);
+//
+// mergeAttributes(mergedActivityElement, processActivity.getAttributes());
+// mergeAttributes(mergedActivityElement, updateActivity.getAttributes());
+//
+// Map<String, List<Element>> processActivityContents = getElementsByTagName(processActivity);
+// Map<String, List<Element>> updateActivityContents = getElementsByTagName(updateActivity);
+//
+// Set<String> allTagNames = new HashSet<String>(processActivityContents.keySet());
+// allTagNames.addAll(updateActivityContents.keySet());
+//
+// for (String tagName: allTagNames) {
+// List<Element> contentElements = processActivityContents.get(tagName);
+// if (contentElements==null) {
+// contentElements = new ArrayList<Element>();
+// }
+// List<Element> updateElements = updateActivityContents.get(tagName);
+// for (int i=0; i<contentElements.size(); i++) {
+// Element contentElement = contentElements.get(i);
+// Element updateElement = (updateElements!=null && updateElements.size()>i ? updateElements.get(i) : null);
+// if (updateElement!=null) {
+// mergeAttributes(contentElement, updateElement.getAttributes());
+// }
+// }
+// }
}
}
- public Map<String, List<Element>> getElementsByTagName(Element element) {
- Map<String, List<Element>> elementsByTagName = new HashMap<String, List<Element>>();
- for (Element contentElement: XmlUtil.elements(element)) {
- String tagName = XmlUtil.getTagLocalName(contentElement);
- List<Element> tagElements = elementsByTagName.get(tagName);
- if (tagElements==null) {
- tagElements = new ArrayList<Element>();
- elementsByTagName.put(tagName, tagElements);
- }
- tagElements.add(contentElement);
- }
- return elementsByTagName;
- }
+// public Map<String, List<Element>> getElementsByTagName(Element element) {
+// Map<String, List<Element>> elementsByTagName = new HashMap<String, List<Element>>();
+// for (Element contentElement: XmlUtil.elements(element)) {
+// String tagName = XmlUtil.getTagLocalName(contentElement);
+// List<Element> tagElements = elementsByTagName.get(tagName);
+// if (tagElements==null) {
+// tagElements = new ArrayList<Element>();
+// elementsByTagName.put(tagName, tagElements);
+// }
+// tagElements.add(contentElement);
+// }
+// return elementsByTagName;
+// }
- private void mergeAttributes(Element element, NamedNodeMap attributes) {
- for (int i=0; i<attributes.getLength(); i++) {
- Node attribute = attributes.item(i);
- String attributeName = attribute.getNodeName();
- String attributeValue = attribute.getNodeValue();
- element.setAttribute(attributeName, attributeValue);
- }
- }
+// private void mergeAttributes(Element element, NamedNodeMap attributes) {
+// for (int i=0; i<attributes.getLength(); i++) {
+// Node attribute = attributes.item(i);
+// String attributeName = attribute.getNodeName();
+// String attributeValue = attribute.getNodeValue();
+// element.setAttribute(attributeName, attributeValue);
+// }
+// }
protected Map<String, Element> getActivityMap(Element containerElement, Set<String> activityNames) {
Map<String, Element> activityMap = new HashMap<String, Element>();
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2009-10-14 06:58:29 UTC (rev 5740)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2009-10-14 10:33:08 UTC (rev 5741)
@@ -588,39 +588,6 @@
return taskDefinition;
}
- public ObjectDescriptor parseObjectDescriptor(Element element, Parse parse) {
- ObjectDescriptor objectDescriptor = new ObjectDescriptor();
-
- String className = XmlUtil.attribute(element, "class");
- if (className!=null) {
- objectDescriptor.setClassName(className);
-
- // read the operations elements
- List<Operation> operations = null;
- List<Element> elements = XmlUtil.elements(element);
-
- Set<String> operationTagNames = wireParser.getBindings().getTagNames(WireParser.CATEGORY_OPERATION);
- for (Element childElement: elements) {
- if (operationTagNames.contains(childElement.getTagName())) {
- Operation operation = (Operation) wireParser.parseElement(childElement, parse, WireParser.CATEGORY_OPERATION);
- if (operations==null) {
- operations = new ArrayList<Operation>();
- }
- operations.add(operation);
- }
- }
- objectDescriptor.setOperations(operations);
-
- // autowiring
- Boolean isAutoWireEnabled = XmlUtil.attributeBoolean(element, "auto-wire", false, parse);
- if (isAutoWireEnabled!=null) {
- objectDescriptor.setAutoWireEnabled(isAutoWireEnabled.booleanValue());
- }
- }
- return objectDescriptor;
- }
-
-
public List<VariableDefinitionImpl> parseVariableDefinitions(Element element, Parse parse, boolean initRequired) {
List<VariableDefinitionImpl> variableDefinitions = new ArrayList<VariableDefinitionImpl>();
@@ -754,7 +721,7 @@
public UserCodeReference parseUserCodeReference(Element element, Parse parse) {
UserCodeReference userCodeReference = new UserCodeReference();
- ObjectDescriptor objectDescriptor = (ObjectDescriptor) objectBinding.parse(element, parse, wireParser);
+ ObjectDescriptor objectDescriptor = parseObjectDescriptor(element, parse);
userCodeReference.setDescriptor(objectDescriptor);
if (objectDescriptor.getExpr()!=null) {
@@ -769,7 +736,15 @@
return userCodeReference;
}
-
+
+ public ObjectDescriptor parseObjectDescriptor(Element element, Parse parse) {
+ return (ObjectDescriptor) objectBinding.parse(element, parse, wireParser);
+ }
+
+ public Descriptor parseDescriptor(Element element, Parse parse) {
+ return (Descriptor) wireParser.parseElement(element, parse);
+ }
+
public Set<String> getActivityTagNames() {
return getBindings().getTagNames(CATEGORY_ACTIVITY);
}
Modified: jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.bindings.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.bindings.xml 2009-10-14 06:58:29 UTC (rev 5740)
+++ jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.bindings.xml 2009-10-14 10:33:08 UTC (rev 5741)
@@ -17,6 +17,8 @@
<activity binding="org.jbpm.jpdl.internal.activity.MailBinding" />
<activity binding="org.jbpm.jpdl.internal.activity.GroupBinding" />
<activity binding="org.jbpm.jpdl.internal.activity.CustomBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.AssignBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.PassthroughBinding" />
<eventlistener binding="org.jbpm.jpdl.internal.activity.EventListenerBinding" />
<eventlistener binding="org.jbpm.jpdl.internal.activity.JavaBinding" />
@@ -24,5 +26,6 @@
<eventlistener binding="org.jbpm.jpdl.internal.activity.SqlBinding" />
<eventlistener binding="org.jbpm.jpdl.internal.activity.ScriptBinding" />
<eventlistener binding="org.jbpm.jpdl.internal.activity.MailBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.AssignBinding" />
</bindings>
Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/test/update/ProcessUpdateTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/test/update/ProcessUpdateTest.java 2009-10-14 06:58:29 UTC (rev 5740)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/test/update/ProcessUpdateTest.java 2009-10-14 10:33:08 UTC (rev 5741)
@@ -25,6 +25,7 @@
import java.io.InputStream;
import org.jbpm.api.ProcessInstance;
+import org.jbpm.pvm.internal.repository.RepositoryServiceImpl;
import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.pvm.internal.xml.Parser;
import org.jbpm.test.JbpmTestCase;
@@ -92,18 +93,21 @@
updateJpdlXmlString(
deploymentId,
"<process-update>" +
- " <java name='getDataFromDb' expr='#{541}' />" +
+ " <assign name='getDataFromDb' expr='#{541}' var='nbrOfOrders'>" +
+ " <transition to='wait' />" +
+ " </assign>" +
"</process-update>"
);
ProcessInstance processInstance = executionService.startProcessInstanceByKey("ReplaceActivity");
processInstance.isActive("wait");
- assertEquals(541, executionService.getVariable(processInstance.getId(), "nbrOfOrders"));
+ assertEquals(541L, executionService.getVariable(processInstance.getId(), "nbrOfOrders"));
}
public void updateJpdlXmlString(String deploymentId, String xmlString) {
InputStream inputStream = new ByteArrayInputStream(xmlString.getBytes());
- repositoryService.updateDeploymentResource(deploymentId, "xmlstring.jpdl.xml", inputStream);
+ RepositoryServiceImpl repositoryServiceImpl = (RepositoryServiceImpl) repositoryService;
+ repositoryServiceImpl.updateDeploymentResource(deploymentId, "xmlstring.jpdl.xml", inputStream);
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeInstanceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeInstanceImpl.java 2009-10-14 06:58:29 UTC (rev 5740)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeInstanceImpl.java 2009-10-14 10:33:08 UTC (rev 5741)
@@ -151,6 +151,10 @@
}
public void setVariable(String key, Object value) {
+ if (key==null) {
+ throw new JbpmException("variableName is null");
+ }
+
Variable variable = getVariableObject(key);
// if there is already a variable instance and it doesn't support the current type...
if ( (variable!=null)
16 years, 6 months
JBoss JBPM SVN: r5740 - in jbpm3/branches/jbpm-3.2-soa: hudson and 1 other directory.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-10-14 02:58:29 -0400 (Wed, 14 Oct 2009)
New Revision: 5740
Modified:
jbpm3/branches/jbpm-3.2-soa/hudson/profiles.local.qa.xml
jbpm3/branches/jbpm-3.2-soa/hudson/profiles.redhat.qa.xml
jbpm3/branches/jbpm-3.2-soa/pom.xml
jbpm3/branches/jbpm-3.2-soa/profiles.example.xml
Log:
[JBPM-2582] Generate database update script correctly
Modified: jbpm3/branches/jbpm-3.2-soa/hudson/profiles.local.qa.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/hudson/profiles.local.qa.xml 2009-10-14 06:58:14 UTC (rev 5739)
+++ jbpm3/branches/jbpm-3.2-soa/hudson/profiles.local.qa.xml 2009-10-14 06:58:29 UTC (rev 5740)
@@ -50,11 +50,9 @@
<jdbc.sybase.port>5000</jdbc.sybase.port>
<jdbc.sybase.database>jbpmtest</jdbc.sybase.database>
<jdbc.sybase.url>jdbc:jtds:sybase://${jdbc.sybase.server}:${jdbc.sybase.port}/${jdbc.sybase.database}</jdbc.sybase.url>
- <!-- jconnect.url jdbc:sybase:Tds:${jdbc.sybase.server}:${jdbc.sybase.port}/${jdbc.sybase.database} -->
<jdbc.sybase.username>jbpmtest</jdbc.sybase.username>
<jdbc.sybase.password>jbpmtest</jdbc.sybase.password>
<jdbc.sybase.driver>net.sourceforge.jtds.jdbc.Driver</jdbc.sybase.driver>
- <!-- jconnect.driver com.sybase.jdbc3.jdbc.SybDriver -->
<jdbc.sybase.datasource>com.sybase.jdbc3.jdbc.SybXADataSource</jdbc.sybase.datasource>
</properties>
</profile>
Modified: jbpm3/branches/jbpm-3.2-soa/hudson/profiles.redhat.qa.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/hudson/profiles.redhat.qa.xml 2009-10-14 06:58:14 UTC (rev 5739)
+++ jbpm3/branches/jbpm-3.2-soa/hudson/profiles.redhat.qa.xml 2009-10-14 06:58:29 UTC (rev 5740)
@@ -50,11 +50,9 @@
<jdbc.sybase.port>5000</jdbc.sybase.port>
<jdbc.sybase.database>jbpm3</jdbc.sybase.database>
<jdbc.sybase.url>jdbc:jtds:sybase://${jdbc.sybase.server}:${jdbc.sybase.port}/${jdbc.sybase.database}</jdbc.sybase.url>
- <!-- jconnect.url jdbc:sybase:Tds:${jdbc.sybase.server}:${jdbc.sybase.port}/${jdbc.sybase.database} -->
<jdbc.sybase.username>jbpm3xa</jdbc.sybase.username>
<jdbc.sybase.password>jbpm3xa</jdbc.sybase.password>
<jdbc.sybase.driver>net.sourceforge.jtds.jdbc.Driver</jdbc.sybase.driver>
- <!-- jconnect.driver com.sybase.jdbc3.jdbc.SybDriver -->
<jdbc.sybase.datasource>com.sybase.jdbc3.jdbc.SybXADataSource</jdbc.sybase.datasource>
</properties>
</profile>
Modified: jbpm3/branches/jbpm-3.2-soa/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/pom.xml 2009-10-14 06:58:14 UTC (rev 5739)
+++ jbpm3/branches/jbpm-3.2-soa/pom.xml 2009-10-14 06:58:29 UTC (rev 5740)
@@ -248,8 +248,18 @@
<version>${sun.facelets.version}</version>
</dependency>
- <!-- Database Driver Versions -->
+ <!-- Database Drivers -->
<dependency>
+ <groupId>com.ibm</groupId>
+ <artifactId>db2jcc</artifactId>
+ <version>${db2jcc.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.ibm</groupId>
+ <artifactId>db2jcc_license_cu</artifactId>
+ <version>${db2jcc.version}</version>
+ </dependency>
+ <dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>${hsqldb.version}</version>
@@ -260,15 +270,30 @@
<version>${jtds.version}</version>
</dependency>
<dependency>
+ <groupId>com.microsoft.sqlserver</groupId>
+ <artifactId>msjdbc</artifactId>
+ <version>${msjdbc.version}</version>
+ </dependency>
+ <dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.connector.version}</version>
</dependency>
<dependency>
+ <groupId>com.oracle</groupId>
+ <artifactId>ojdbc14</artifactId>
+ <version>${ojdbc.version}</version>
+ </dependency>
+ <dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgresql.version}</version>
</dependency>
+ <dependency>
+ <groupId>com.sybase</groupId>
+ <artifactId>jconnect</artifactId>
+ <version>${jconnect.version}</version>
+ </dependency>
</dependencies>
</dependencyManagement>
@@ -424,13 +449,11 @@
<dependency>
<groupId>com.ibm</groupId>
<artifactId>db2jcc</artifactId>
- <version>${db2jcc.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.ibm</groupId>
<artifactId>db2jcc_license_cu</artifactId>
- <version>${db2jcc.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
@@ -479,7 +502,7 @@
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>msjdbc</artifactId>
- <version>${msjdbc.version}</version>
+ <scope>test</scope>
</dependency>
</dependencies>
</profile>
@@ -521,7 +544,6 @@
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
- <version>${ojdbc.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
@@ -575,7 +597,6 @@
<dependency>
<groupId>com.sybase</groupId>
<artifactId>jconnect</artifactId>
- <version>${jconnect.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Modified: jbpm3/branches/jbpm-3.2-soa/profiles.example.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/profiles.example.xml 2009-10-14 06:58:14 UTC (rev 5739)
+++ jbpm3/branches/jbpm-3.2-soa/profiles.example.xml 2009-10-14 06:58:29 UTC (rev 5740)
@@ -24,20 +24,23 @@
<jdbc.db2.url>jdbc:db2://${jdbc.db2.server}:${jdbc.db2.port}/${jdbc.db2.database}</jdbc.db2.url>
<jdbc.db2.username>jbpmtest</jdbc.db2.username>
<jdbc.db2.password>jbpmtest</jdbc.db2.password>
+ <jdbc.db2.driver>com.ibm.db2.jcc.DB2Driver</jdbc.db2.driver>
- <jdbc.mssql.server>localhost</jdbc.mssql.server>
+ <jdbc.mssql.server>dev30.qa.atl.jboss.com</jdbc.mssql.server>
<jdbc.mssql.port>3918</jdbc.mssql.port>
- <jdbc.mssql.database>jbpmtest</jdbc.mssql.database>
+ <jdbc.mssql.database>jbpm</jdbc.mssql.database>
<jdbc.mssql.url>jdbc:sqlserver://${jdbc.mssql.server}:${jdbc.mssql.port};databaseName=${jdbc.mssql.database}</jdbc.mssql.url>
- <jdbc.mssql.username>jbpmtest</jdbc.mssql.username>
- <jdbc.mssql.password>jbpmtest</jdbc.mssql.password>
+ <jdbc.mssql.username>jbpm</jdbc.mssql.username>
+ <jdbc.mssql.password>jbpm</jdbc.mssql.password>
+ <jdbc.mssql.driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</jdbc.mssql.driver>
<jdbc.mysql.server>localhost</jdbc.mysql.server>
<jdbc.mysql.port>3306</jdbc.mysql.port>
<jdbc.mysql.database>jbpmtest</jdbc.mysql.database>
<jdbc.mysql.url>jdbc:mysql://${jdbc.mysql.server}:${jdbc.mysql.port}/${jdbc.mysql.database}</jdbc.mysql.url>
<jdbc.mysql.username>jbpmtest</jdbc.mysql.username>
- <jdbc.mysql.password></jdbc.mysql.password>
+ <jdbc.mysql.password>jbpmtest</jdbc.mysql.password>
+ <jdbc.mysql.driver>com.mysql.jdbc.Driver</jdbc.mysql.driver>
<jdbc.oracle.server>localhost</jdbc.oracle.server>
<jdbc.oracle.port>1521</jdbc.oracle.port>
@@ -45,23 +48,23 @@
<jdbc.oracle.url>jdbc:oracle:thin:@${jdbc.oracle.server}:${jdbc.oracle.port}:${jdbc.oracle.database}</jdbc.oracle.url>
<jdbc.oracle.username>jbpmtest</jdbc.oracle.username>
<jdbc.oracle.password>jbpmtest</jdbc.oracle.password>
+ <jdbc.oracle.driver>oracle.jdbc.driver.OracleDriver</jdbc.oracle.driver>
<jdbc.postgresql.server>localhost</jdbc.postgresql.server>
<jdbc.postgresql.port>5432</jdbc.postgresql.port>
<jdbc.postgresql.database>jbpmtest</jdbc.postgresql.database>
<jdbc.postgresql.url>jdbc:postgresql://${jdbc.postgresql.server}:${jdbc.postgresql.port}/${jdbc.postgresql.database}</jdbc.postgresql.url>
<jdbc.postgresql.username>jbpmtest</jdbc.postgresql.username>
- <jdbc.postgresql.password></jdbc.postgresql.password>
+ <jdbc.postgresql.password>jbpmtest</jdbc.postgresql.password>
+ <jdbc.postgresql.driver>org.postgresql.Driver</jdbc.postgresql.driver>
<jdbc.sybase.server>localhost</jdbc.sybase.server>
<jdbc.sybase.port>5000</jdbc.sybase.port>
<jdbc.sybase.database>jbpmtest</jdbc.sybase.database>
<jdbc.sybase.url>jdbc:jtds:sybase://${jdbc.sybase.server}:${jdbc.sybase.port}/${jdbc.sybase.database}</jdbc.sybase.url>
- <!-- jconnect.url jdbc:sybase:Tds:${jdbc.sybase.server}:${jdbc.sybase.port}/${jdbc.sybase.database} -->
<jdbc.sybase.username>jbpmtest</jdbc.sybase.username>
<jdbc.sybase.password>jbpmtest</jdbc.sybase.password>
<jdbc.sybase.driver>net.sourceforge.jtds.jdbc.Driver</jdbc.sybase.driver>
- <!-- jconnect.driver com.sybase.jdbc3.jdbc.SybDriver -->
<jdbc.sybase.datasource>com.sybase.jdbc3.jdbc.SybXADataSource</jdbc.sybase.datasource>
<altDeploymentRepository>repository.jboss.org::default::file:${user.home}/jbpm/repository</altDeploymentRepository>
16 years, 6 months
JBoss JBPM SVN: r5739 - in jbpm3/branches/jbpm-3.2-soa/modules: db and 2 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-10-14 02:58:14 -0400 (Wed, 14 Oct 2009)
New Revision: 5739
Added:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/ant/HibernatePropertiesTask.java
Removed:
jbpm3/branches/jbpm-3.2-soa/modules/db/src/main/resources/db2.properties
jbpm3/branches/jbpm-3.2-soa/modules/db/src/main/resources/mssql.properties
jbpm3/branches/jbpm-3.2-soa/modules/db/src/main/resources/mysql.properties
jbpm3/branches/jbpm-3.2-soa/modules/db/src/main/resources/oracle.properties
jbpm3/branches/jbpm-3.2-soa/modules/db/src/main/resources/postgresql.properties
jbpm3/branches/jbpm-3.2-soa/modules/db/src/main/resources/sybase.properties
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/db/pom.xml
jbpm3/branches/jbpm-3.2-soa/modules/db/scripts/antrun-jbpmschema.xml
Log:
[JBPM-2582] Generate database update script correctly
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/ant/HibernatePropertiesTask.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/ant/HibernatePropertiesTask.java (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/ant/HibernatePropertiesTask.java 2009-10-14 06:58:14 UTC (rev 5739)
@@ -0,0 +1,97 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.ant;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Map.Entry;
+import java.util.regex.Pattern;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.hibernate.cfg.Configuration;
+
+/**
+ * @author Alejandro Guizar
+ */
+public class HibernatePropertiesTask extends Task {
+
+ private String config;
+ private String prefix;
+ private Pattern includes;
+ private Pattern excludes;
+
+ public void execute() throws BuildException {
+ log("loading hibernate properties from " + config);
+
+ Configuration configuration = AntHelper.getConfiguration(config, null);
+ Properties properties = configuration.getProperties();
+ if (properties.isEmpty()) return;
+
+ StringBuffer nameBuf = new StringBuffer(prefix);
+ int prefixLength = prefix.length();
+
+ Project project = getProject();
+ for (Iterator i = properties.entrySet().iterator(); i.hasNext();) {
+ Map.Entry property = (Entry) i.next();
+
+ String name = (String) property.getKey();
+ if (include(name) && !exclude(name)) {
+ name = nameBuf.append(name).toString();
+
+ String value = (String) property.getValue();
+ log("setting '" + name + "' to: " + value);
+ project.setNewProperty(name, value);
+
+ // drop key from prefix
+ nameBuf.setLength(prefixLength);
+ }
+ }
+ }
+
+ private boolean include(String name) {
+ return includes == null || includes.matcher(name).matches();
+ }
+
+ private boolean exclude(String name) {
+ return excludes != null && excludes.matcher(name).matches();
+ }
+
+ public void setConfig(String config) {
+ this.config = config;
+ }
+
+ public void setPrefix(String prefix) {
+ this.prefix = prefix;
+ }
+
+ public void setIncludes(String regex) {
+ includes = Pattern.compile(regex);
+ }
+
+ public void setExcludes(String regex) {
+ excludes = Pattern.compile(regex);
+ }
+
+}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/db/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/db/pom.xml 2009-10-13 16:25:52 UTC (rev 5738)
+++ jbpm3/branches/jbpm-3.2-soa/modules/db/pom.xml 2009-10-14 06:58:14 UTC (rev 5739)
@@ -1,20 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- ====================================================================== -->
-<!-- -->
-<!-- JBoss, the OpenSource J2EE webOS -->
-<!-- -->
-<!-- Distributable under LGPL license. -->
-<!-- See terms of license at http://www.gnu.org. -->
-<!-- -->
-<!-- ====================================================================== -->
+ <!-- ====================================================================== -->
+ <!-- -->
+ <!-- JBoss, the OpenSource J2EE webOS -->
+ <!-- -->
+ <!-- Distributable under LGPL license. -->
+ <!-- See terms of license at http://www.gnu.org. -->
+ <!-- -->
+ <!-- ====================================================================== -->
-<!-- $Id$ -->
+ <!-- $Id$ -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
-
<name>JBoss jBPM3 - Database</name>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm-db</artifactId>
@@ -28,6 +27,112 @@
<relativePath>../../pom.xml</relativePath>
</parent>
+ <properties>
+ <previous.version>3.2.5.SP5</previous.version>
+ </properties>
+
+ <profiles>
+ <profile>
+ <id>update</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>previous-version</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>jbpm-db</artifactId>
+ <version>${previous.version}</version>
+ </artifactItem>
+ </artifactItems>
+ <outputDirectory>${previous.version.directory}</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>update-schema</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <property name="project.output.dir" value="${project.build.outputDirectory}"/>
+ <property name="previous.version.dir" value="${previous.version.directory}"/>
+ <ant antfile="scripts/antrun-jbpmschema.xml" target="update-schema"
+ inheritRefs="true"/>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <properties>
+ <previous.version.directory>${project.build.directory}/${previous.version}</previous.version.directory>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.ibm</groupId>
+ <artifactId>db2jcc</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.ibm</groupId>
+ <artifactId>db2jcc_license_cu</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>net.sourceforge.jtds</groupId>
+ <artifactId>jtds</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.microsoft.sqlserver</groupId>
+ <artifactId>msjdbc</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.oracle</groupId>
+ <artifactId>ojdbc14</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+ <repositories>
+ <repository>
+ <id>qa.jboss.com</id>
+ <url>http://www.qa.jboss.com/jdbc-drivers/maven2</url>
+ </repository>
+ </repositories>
+ </profile>
+ </profiles>
+
<!-- Dependencies -->
<dependencies>
<!-- jBPM Dependencies -->
@@ -53,22 +158,12 @@
<classifier>config</classifier>
<version>${project.version}</version>
</dependency>
-
+
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<scope>runtime</scope>
</dependency>
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>postgresql</groupId>
- <artifactId>postgresql</artifactId>
- <scope>runtime</scope>
- </dependency>
</dependencies>
<!-- Plugins -->
@@ -79,27 +174,30 @@
<filtering>true</filtering>
</resource>
</resources>
+
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
- <id>jbpmschema</id>
- <phase>compile</phase>
+ <id>create-drop-schema</id>
+ <phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
- <property name="maven.runtime.classpath" refid="maven.runtime.classpath" />
- <ant antfile="scripts/antrun-jbpmschema.xml" target="create-schema" />
- <ant antfile="scripts/antrun-jbpmschema.xml" target="drop-schema" />
- <ant antfile="scripts/antrun-jbpmschema.xml" target="update-schema" />
+ <property name="project.output.dir" value="${project.build.outputDirectory}"/>
+ <ant antfile="scripts/antrun-jbpmschema.xml" target="create-schema"
+ inheritRefs="true"/>
+ <ant antfile="scripts/antrun-jbpmschema.xml" target="drop-schema"
+ inheritRefs="true"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
+
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
@@ -110,4 +208,5 @@
</plugin>
</plugins>
</build>
+
</project>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/db/scripts/antrun-jbpmschema.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/db/scripts/antrun-jbpmschema.xml 2009-10-13 16:25:52 UTC (rev 5738)
+++ jbpm3/branches/jbpm-3.2-soa/modules/db/scripts/antrun-jbpmschema.xml 2009-10-14 06:58:14 UTC (rev 5739)
@@ -9,124 +9,151 @@
<!-- ================================================================== -->
<target name="init">
- <taskdef name="jbpmschema" classname="org.jbpm.ant.JbpmSchemaTask">
- <classpath path="${maven.runtime.classpath}" />
- </taskdef>
-
- <property name="scriptsdir" value="${basedir}/target/classes" />
- <mkdir dir="${scriptsdir}" />
+ <taskdef name="jbpmschema"
+ classname="org.jbpm.ant.JbpmSchemaTask"
+ classpathref="maven.runtime.classpath" />
+ <taskdef name="hbproperties"
+ classname="org.jbpm.ant.HibernatePropertiesTask"
+ classpathref="maven.runtime.classpath" />
+ <mkdir dir="${project.output.dir}" />
</target>
- <target name="create-schema"
- depends="init"
- description="Generate schema creation scripts">
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.db2.sql"
+ <target name="create-schema" depends="init" description="Generate schema creation scripts">
+ <jbpmschema output="${project.output.dir}/jbpm.jpdl.db2.sql"
config="hibernate.cfg.db2.xml"
action="create" />
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.derby.sql"
+ <jbpmschema output="${project.output.dir}/jbpm.jpdl.derby.sql"
config="hibernate.cfg.derby.xml"
action="create" />
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.firebird.sql"
+ <jbpmschema output="${project.output.dir}/jbpm.jpdl.firebird.sql"
config="hibernate.cfg.firebird.xml"
action="create" />
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.hsqldb.sql"
+ <jbpmschema output="${project.output.dir}/jbpm.jpdl.hsqldb.sql"
config="hibernate.cfg.hsqldb.xml"
action="create" />
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.ingres.sql"
+ <jbpmschema output="${project.output.dir}/jbpm.jpdl.ingres.sql"
config="hibernate.cfg.ingres.xml"
action="create" />
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.interbase.sql"
+ <jbpmschema output="${project.output.dir}/jbpm.jpdl.interbase.sql"
config="hibernate.cfg.interbase.xml"
action="create" />
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.mckoi.sql"
+ <jbpmschema output="${project.output.dir}/jbpm.jpdl.mckoi.sql"
config="hibernate.cfg.mckoi.xml"
action="create" />
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.mssql.sql"
+ <jbpmschema output="${project.output.dir}/jbpm.jpdl.mssql.sql"
config="hibernate.cfg.mssql.xml"
action="create" />
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.mysql.sql"
+ <jbpmschema output="${project.output.dir}/jbpm.jpdl.mysql.sql"
config="hibernate.cfg.mysql.xml"
action="create"
delimiter=";" />
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.oracle.sql"
+ <jbpmschema output="${project.output.dir}/jbpm.jpdl.oracle.sql"
config="hibernate.cfg.oracle.xml"
action="create"
delimiter=";" />
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.postgresql.sql"
+ <jbpmschema output="${project.output.dir}/jbpm.jpdl.postgresql.sql"
config="hibernate.cfg.postgresql.xml"
action="create"
delimiter=";" />
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.sapdb.sql"
+ <jbpmschema output="${project.output.dir}/jbpm.jpdl.sapdb.sql"
config="hibernate.cfg.sapdb.xml"
action="create" />
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.sybase.sql"
+ <jbpmschema output="${project.output.dir}/jbpm.jpdl.sybase.sql"
config="hibernate.cfg.sybase.xml"
action="create" />
- <concat destfile="${scriptsdir}/jbpm.jpdl.sybase.sql" append="yes">go</concat>
+ <concat destfile="${project.output.dir}/jbpm.jpdl.sybase.sql" append="yes">go</concat>
</target>
- <target name="drop-schema"
- depends="init"
- description="Generate schema drop scripts">
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.db2.drop.sql"
+ <target name="drop-schema" depends="init" description="Generate schema drop scripts">
+ <jbpmschema output="${project.output.dir}/jbpm.jpdl.db2.drop.sql"
config="hibernate.cfg.db2.xml"
action="drop" />
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.hsqldb.drop.sql"
+ <jbpmschema output="${project.output.dir}/jbpm.jpdl.hsqldb.drop.sql"
config="hibernate.cfg.hsqldb.xml"
action="drop" />
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.mssql.drop.sql"
+ <jbpmschema output="${project.output.dir}/jbpm.jpdl.mssql.drop.sql"
config="hibernate.cfg.mssql.xml"
action="drop" />
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.mysql.drop.sql"
+ <jbpmschema output="${project.output.dir}/jbpm.jpdl.mysql.drop.sql"
config="hibernate.cfg.mysql.xml"
action="drop"
delimiter=";" />
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.oracle.drop.sql"
+ <jbpmschema output="${project.output.dir}/jbpm.jpdl.oracle.drop.sql"
config="hibernate.cfg.oracle.xml"
action="drop"
delimiter=";" />
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.postgresql.drop.sql"
+ <jbpmschema output="${project.output.dir}/jbpm.jpdl.postgresql.drop.sql"
config="hibernate.cfg.postgresql.xml"
action="drop"
delimiter=";" />
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.sybase.drop.sql"
+ <jbpmschema output="${project.output.dir}/jbpm.jpdl.sybase.drop.sql"
config="hibernate.cfg.sybase.xml"
action="drop" />
- <concat destfile="${scriptsdir}/jbpm.jpdl.sybase.drop.sql" append="yes">go</concat>
+ <concat destfile="${project.output.dir}/jbpm.jpdl.sybase.drop.sql" append="yes">go</concat>
</target>
- <target name="update-schema"
- depends="init"
- description="Generate schema update scripts">
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.db2.update322.sql"
- config="hibernate.cfg.db2.xml"
- properties="db2.properties"
- action="update"
- delimiter=";" />
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.mssql.update322.sql"
- config="hibernate.cfg.mssql.xml"
- properties="mssql.properties"
- action="update" />
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.mysql.update322.sql"
- config="hibernate.cfg.mysql.xml"
- properties="mysql.properties"
- action="update"
- delimiter=";" />
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.oracle.update322.sql"
- config="hibernate.cfg.oracle.xml"
- properties="oracle.properties"
- action="update"
- delimiter=";" />
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.postgresql.update322.sql"
- config="hibernate.cfg.postgresql.xml"
- properties="postgresql.properties"
- action="update"
- delimiter=";" />
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.sybase.update322.sql"
- config="hibernate.cfg.sybase.xml"
- properties="sybase.properties"
- action="update" />
- <concat destfile="${scriptsdir}/jbpm.jpdl.sybase.update322.sql" append="yes">go</concat>
+ <target name="update-schema" depends="init" description="Generate schema update scripts">
+ <generate-update-script db="db2" delimiter=";" />
+ <generate-update-script db="mssql" delimiter=";" />
+ <generate-update-script db="mysql" delimiter=";" />
+ <generate-update-script db="oracle" delimiter=";" />
+ <generate-update-script db="postgresql" delimiter=";" />
+ <generate-update-script db="sybase" />
</target>
+ <macrodef name="generate-update-script">
+ <attribute name="db" />
+ <attribute name="delimiter" />
+ <sequential>
+ <hbproperties config="hibernate.cfg.(a){db}.xml"
+ prefix="@{db}."
+ includes="hibernate\.connection\..*" />
+
+ <echo>Dropping current schema @{db}</echo>
+ <sql src="${project.output.dir}/jbpm.jpdl.(a){db}.drop.sql"
+ url="${(a){db}.hibernate.connection.url}"
+ driver="${(a){db}.hibernate.connection.driver_class}"
+ userid="${(a){db}.hibernate.connection.username}"
+ password="${(a){db}.hibernate.connection.password}"
+ classpathref="maven.runtime.classpath"
+ autocommit="yes"
+ onerror="continue" />
+
+ <echo>Creating previous schema @{db}</echo>
+ <sql src="${previous.version.dir}/jbpm.jpdl.(a){db}.sql"
+ url="${(a){db}.hibernate.connection.url}"
+ driver="${(a){db}.hibernate.connection.driver_class}"
+ userid="${(a){db}.hibernate.connection.username}"
+ password="${(a){db}.hibernate.connection.password}"
+ classpathref="maven.runtime.classpath"
+ autocommit="yes"
+ onerror="continue" />
+
+ <echo>Generating update script @{db}</echo>
+ <jbpmschema output="${project.output.dir}/jbpm.jpdl.(a){db}.update.sql"
+ config="hibernate.cfg.(a){db}.xml"
+ action="update"
+ delimiter="@{delimiter}" />
+
+ <echo>Dropping previous schema @{db}</echo>
+ <sql src="${project.output.dir}/jbpm.jpdl.(a){db}.drop.sql"
+ url="${(a){db}.hibernate.connection.url}"
+ driver="${(a){db}.hibernate.connection.driver_class}"
+ userid="${(a){db}.hibernate.connection.username}"
+ password="${(a){db}.hibernate.connection.password}"
+ classpathref="maven.compile.classpath"
+ autocommit="yes"
+ onerror="continue" />
+
+ <echo>Creating current schema @{db}</echo>
+ <sql src="${project.output.dir}/jbpm.jpdl.(a){db}.sql"
+ url="${(a){db}.hibernate.connection.url}"
+ driver="${(a){db}.hibernate.connection.driver_class}"
+ userid="${(a){db}.hibernate.connection.username}"
+ password="${(a){db}.hibernate.connection.password}"
+ classpathref="maven.runtime.classpath"
+ autocommit="yes"
+ onerror="continue" />
+ </sequential>
+ </macrodef>
</project>
Deleted: jbpm3/branches/jbpm-3.2-soa/modules/db/src/main/resources/db2.properties
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/db/src/main/resources/db2.properties 2009-10-13 16:25:52 UTC (rev 5738)
+++ jbpm3/branches/jbpm-3.2-soa/modules/db/src/main/resources/db2.properties 2009-10-14 06:58:14 UTC (rev 5739)
@@ -1,8 +0,0 @@
-hibernate.dialect=org.hibernate.dialect.DB2Dialect
-#
-# This uses the jbpm322 database schema as reference for the SchemaUpdate task
-#
-hibernate.connection.driver_class=com.ibm.db2.jcc.DB2Driver
-hibernate.connection.url=${jdbc.db2.url}
-hibernate.connection.username=jbpm322
-hibernate.connection.password=jbpm322
Deleted: jbpm3/branches/jbpm-3.2-soa/modules/db/src/main/resources/mssql.properties
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/db/src/main/resources/mssql.properties 2009-10-13 16:25:52 UTC (rev 5738)
+++ jbpm3/branches/jbpm-3.2-soa/modules/db/src/main/resources/mssql.properties 2009-10-14 06:58:14 UTC (rev 5739)
@@ -1,8 +0,0 @@
-hibernate.dialect=org.hibernate.dialect.SQLServerDialect
-#
-# This uses the jbpm322 database schema as reference for the SchemaUpdate task
-#
-hibernate.connection.driver_class=com.microsoft.sqlserver.jdbc.SQLServerDriver
-hibernate.connection.url=jdbc:sqlserver://${jdbc.mssql.server}:${jdbc.mssql.port}/jbpm322
-hibernate.connection.username=${jdbc.mssql.username}
-hibernate.connection.password=${jdbc.mssql.password}
\ No newline at end of file
Deleted: jbpm3/branches/jbpm-3.2-soa/modules/db/src/main/resources/mysql.properties
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/db/src/main/resources/mysql.properties 2009-10-13 16:25:52 UTC (rev 5738)
+++ jbpm3/branches/jbpm-3.2-soa/modules/db/src/main/resources/mysql.properties 2009-10-14 06:58:14 UTC (rev 5739)
@@ -1,8 +0,0 @@
-hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
-#
-# This uses the jbpm322 database schema as reference for the SchemaUpdate task
-#
-hibernate.connection.driver_class=com.mysql.jdbc.Driver
-hibernate.connection.url=jdbc:mysql://${jdbc.mysql.server}:${jdbc.mysql.port}/jbpm322
-hibernate.connection.username=${jdbc.mysql.username}
-hibernate.connection.password=${jdbc.mysql.password}
Deleted: jbpm3/branches/jbpm-3.2-soa/modules/db/src/main/resources/oracle.properties
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/db/src/main/resources/oracle.properties 2009-10-13 16:25:52 UTC (rev 5738)
+++ jbpm3/branches/jbpm-3.2-soa/modules/db/src/main/resources/oracle.properties 2009-10-14 06:58:14 UTC (rev 5739)
@@ -1,8 +0,0 @@
-hibernate.dialect=org.hibernate.dialect.Oracle9Dialect
-#
-# This uses the jbpm322 database schema as reference for the SchemaUpdate task
-#
-hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver
-hibernate.connection.url=${jdbc.oracle.url}
-hibernate.connection.username=jbpm322
-hibernate.connection.password=jbpm322
Deleted: jbpm3/branches/jbpm-3.2-soa/modules/db/src/main/resources/postgresql.properties
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/db/src/main/resources/postgresql.properties 2009-10-13 16:25:52 UTC (rev 5738)
+++ jbpm3/branches/jbpm-3.2-soa/modules/db/src/main/resources/postgresql.properties 2009-10-14 06:58:14 UTC (rev 5739)
@@ -1,8 +0,0 @@
-hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
-#
-# This uses the jbpm322 database schema as reference for the SchemaUpdate task
-#
-hibernate.connection.driver_class=org.postgresql.Driver
-hibernate.connection.url=jdbc:postgresql://${jdbc.postgresql.server}:${jdbc.postgresql.port}/jbpm322
-hibernate.connection.username=${jdbc.postgresql.username}
-hibernate.connection.password=${jdbc.postgresql.password}
Deleted: jbpm3/branches/jbpm-3.2-soa/modules/db/src/main/resources/sybase.properties
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/db/src/main/resources/sybase.properties 2009-10-13 16:25:52 UTC (rev 5738)
+++ jbpm3/branches/jbpm-3.2-soa/modules/db/src/main/resources/sybase.properties 2009-10-14 06:58:14 UTC (rev 5739)
@@ -1,8 +0,0 @@
-hibernate.dialect=org.hibernate.dialect.SybaseDialect
-#
-# This uses the jbpm322 database schema as reference for the SchemaUpdate task
-#
-hibernate.connection.driver_class=${jdbc.sybase.driver}
-hibernate.connection.url=jdbc:sybase:Tds:${jdbc.sybase.server}:${jdbc.sybase.port}/jbpm322
-hibernate.connection.username=${jdbc.sybase.username}
-hibernate.connection.password=${jdbc.sybase.password}
16 years, 6 months
JBoss JBPM SVN: r5738 - in jbpm4/trunk/modules: jpdl/src/main/java/org/jbpm/jpdl/internal/xml and 4 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-10-13 12:25:52 -0400 (Tue, 13 Oct 2009)
New Revision: 5738
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/xml/JpdlParser.java
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/test/update/ProcessUpdateTest.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/AbstractCollectionBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ListWireTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ObjectWireTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/SetWireTest.java
Log:
JBPM-2578 added pieces of merging of update dom into process dom
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-10-13 09:40:39 UTC (rev 5737)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/repository/JpdlDeployer.java 2009-10-13 16:25:52 UTC (rev 5738)
@@ -23,6 +23,12 @@
import java.io.ByteArrayInputStream;
import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
@@ -39,6 +45,8 @@
import org.jbpm.pvm.internal.xml.Parser;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
/**
* @author Tom Baeyens
@@ -84,16 +92,20 @@
.getDocument();
Element processElement = processDocument.getDocumentElement();
- Element updateProcessElement = updateDocument.getDocumentElement();
- Element updateDescriptionElement = XmlUtil.element(updateProcessElement, "description");
- if (updateDescriptionElement!=null) {
+ Element processUpdateElement = updateDocument.getDocumentElement();
+ Element processUpdateDescriptionElement = XmlUtil.element(processUpdateElement, "description");
+ if (processUpdateDescriptionElement!=null) {
Element processDescriptionElement = XmlUtil.element(processElement, "description");
if (processDescriptionElement!=null) {
processElement.removeChild(processDescriptionElement);
}
- processElement.appendChild(updateDescriptionElement);
+ Node clonedDescriptionElement = processUpdateDescriptionElement.cloneNode(true);
+ processDocument.adoptNode(clonedDescriptionElement);
+ processElement.appendChild(clonedDescriptionElement);
}
+ updateActivities(processDocument, processElement, processUpdateDescriptionElement);
+
try {
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
@@ -102,10 +114,89 @@
DOMSource source = new DOMSource(processDocument);
transformer.transform(source, result);
- byte[] bytes = result.getWriter().toString().getBytes();
+ String updatedProcessXml = result.getWriter().toString();
+ log.debug("updated process xml: \n"+updatedProcessXml);
+ byte[] bytes = updatedProcessXml.getBytes();
deployment.addResourceFromInputStream(resourceName, new ByteArrayInputStream(bytes));
} catch (Exception e) {
throw new JbpmException("couldn't serialize updated process dom model", e);
}
}
+
+ private void updateActivities(Document processDocument, Element activityContainerElement, Element updateContainerElement) {
+ Set<String> activityNames = jpdlParser.getActivityTagNames();
+
+ Map<String, Element> processActivityMap = getActivityMap(activityContainerElement, activityNames);
+ Map<String, Element> updateActivityMap = getActivityMap(updateContainerElement, activityNames);
+
+ for (String activityName: updateActivityMap.keySet()) {
+ Element processActivity = processActivityMap.get(activityName);
+ Element updateActivity = updateActivityMap.get(activityName);
+ String updateTagName = XmlUtil.getTagLocalName(updateActivity);
+
+ activityContainerElement.removeChild(processActivity);
+ Element mergedActivityElement = processDocument.createElement(updateTagName);
+
+ mergeAttributes(mergedActivityElement, processActivity.getAttributes());
+ mergeAttributes(mergedActivityElement, updateActivity.getAttributes());
+
+ Map<String, List<Element>> processActivityContents = getElementsByTagName(processActivity);
+ Map<String, List<Element>> updateActivityContents = getElementsByTagName(updateActivity);
+
+ Set<String> allTagNames = new HashSet<String>(processActivityContents.keySet());
+ allTagNames.addAll(updateActivityContents.keySet());
+
+ for (String tagName: allTagNames) {
+ List<Element> contentElements = processActivityContents.get(tagName);
+ if (contentElements==null) {
+ contentElements = new ArrayList<Element>();
+ }
+ List<Element> updateElements = updateActivityContents.get(tagName);
+ for (int i=0; i<contentElements.size(); i++) {
+ Element contentElement = contentElements.get(i);
+ Element updateElement = (updateElements!=null && updateElements.size()>i ? updateElements.get(i) : null);
+ if (updateElement!=null) {
+ mergeAttributes(contentElement, updateElement.getAttributes());
+ }
+ }
+ }
+ }
+ }
+
+ public Map<String, List<Element>> getElementsByTagName(Element element) {
+ Map<String, List<Element>> elementsByTagName = new HashMap<String, List<Element>>();
+ for (Element contentElement: XmlUtil.elements(element)) {
+ String tagName = XmlUtil.getTagLocalName(contentElement);
+ List<Element> tagElements = elementsByTagName.get(tagName);
+ if (tagElements==null) {
+ tagElements = new ArrayList<Element>();
+ elementsByTagName.put(tagName, tagElements);
+ }
+ tagElements.add(contentElement);
+ }
+ return elementsByTagName;
+ }
+
+ private void mergeAttributes(Element element, NamedNodeMap attributes) {
+ for (int i=0; i<attributes.getLength(); i++) {
+ Node attribute = attributes.item(i);
+ String attributeName = attribute.getNodeName();
+ String attributeValue = attribute.getNodeValue();
+ element.setAttribute(attributeName, attributeValue);
+ }
+ }
+
+ protected Map<String, Element> getActivityMap(Element containerElement, Set<String> activityNames) {
+ Map<String, Element> activityMap = new HashMap<String, Element>();
+
+ for (Element element: XmlUtil.elements(containerElement)) {
+ String tagName = XmlUtil.getTagLocalName(element);
+ if (activityNames.contains(tagName)) {
+ String activityName = element.getAttribute("name");
+ activityMap.put(activityName, element);
+ }
+ }
+
+ return activityMap;
+ }
}
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2009-10-13 09:40:39 UTC (rev 5737)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2009-10-13 16:25:52 UTC (rev 5738)
@@ -769,4 +769,8 @@
return userCodeReference;
}
+
+ public Set<String> getActivityTagNames() {
+ return getBindings().getTagNames(CATEGORY_ACTIVITY);
+ }
}
Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/test/update/ProcessUpdateTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/test/update/ProcessUpdateTest.java 2009-10-13 09:40:39 UTC (rev 5737)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/test/update/ProcessUpdateTest.java 2009-10-13 16:25:52 UTC (rev 5738)
@@ -24,6 +24,7 @@
import java.io.ByteArrayInputStream;
import java.io.InputStream;
+import org.jbpm.api.ProcessInstance;
import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.pvm.internal.xml.Parser;
import org.jbpm.test.JbpmTestCase;
@@ -36,9 +37,9 @@
*/
public class ProcessUpdateTest extends JbpmTestCase {
- public void testReplaceActivity() {
+ public void testUpdateProcessDescription() {
String deploymentId = deployJpdlXmlString(
- "<process name='DescriptionProcess'>" +
+ "<process name='UpdateProcessDescription'>" +
" <start>" +
" <transition to='s' />" +
" </start>" +
@@ -48,11 +49,11 @@
updateJpdlXmlString(
deploymentId,
- "<update-process>" +
+ "<process-update>" +
" <description>" +
" This is a description" +
" </description>" +
- "</update-process>"
+ "</process-update>"
);
InputStream inputStream = repositoryService.getResourceAsStream(deploymentId, "xmlstring.jpdl.xml");
@@ -73,7 +74,34 @@
assertNotNull(stateSElement);
assertEquals("s", stateSElement.getAttribute("name"));
}
-
+
+ public void testReplaceActivity() {
+ String deploymentId = deployJpdlXmlString(
+ "<process name='ReplaceActivity'>" +
+ " <start>" +
+ " <transition to='getDataFromDb' />" +
+ " </start>" +
+ " <sql name='getDataFromDb' var='nbrOfOrders'>" +
+ " <query>COUNT * FROM ORDERS</query>" +
+ " <transition to='wait' />" +
+ " </sql>" +
+ " <state name='wait' />" +
+ "</process>"
+ );
+
+ updateJpdlXmlString(
+ deploymentId,
+ "<process-update>" +
+ " <java name='getDataFromDb' expr='#{541}' />" +
+ "</process-update>"
+ );
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("ReplaceActivity");
+ processInstance.isActive("wait");
+
+ assertEquals(541, executionService.getVariable(processInstance.getId(), "nbrOfOrders"));
+ }
+
public void updateJpdlXmlString(String deploymentId, String xmlString) {
InputStream inputStream = new ByteArrayInputStream(xmlString.getBytes());
repositoryService.updateDeploymentResource(deploymentId, "xmlstring.jpdl.xml", inputStream);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/AbstractCollectionBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/AbstractCollectionBinding.java 2009-10-13 09:40:39 UTC (rev 5737)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/AbstractCollectionBinding.java 2009-10-13 16:25:52 UTC (rev 5738)
@@ -40,6 +40,8 @@
Descriptor valueDescriptor = (Descriptor) parser.parseElement(valueElement, parse, WireParser.CATEGORY_DESCRIPTOR);
if (valueDescriptor!=null) {
valueDescriptors.add(valueDescriptor);
+ } else {
+ parse.addProblem("unrecognized element: "+XmlUtil.toString(valueElement));
}
}
descriptor.setValueDescriptors(valueDescriptors);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java 2009-10-13 09:40:39 UTC (rev 5737)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java 2009-10-13 16:25:52 UTC (rev 5738)
@@ -511,8 +511,8 @@
if (binding!=null) {
object = binding.parse(element, parse, this);
- } else {
- parse.addProblem("no element parser for tag "+tagName+(category!=null ? " in category "+category : " in the default category"), element);
+ } else if (log.isDebugEnabled()) {
+ log.debug("no element parser for tag "+tagName+(category!=null ? " in category "+category : " in the default category"));
}
return object;
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ListWireTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ListWireTest.java 2009-10-13 09:40:39 UTC (rev 5737)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ListWireTest.java 2009-10-13 16:25:52 UTC (rev 5738)
@@ -97,7 +97,7 @@
);
assertEquals(problems.toString(), 1, problems.size());
- assertTextPresent("no element parser for tag unknown-descriptor", problems.get(0).getMsg());
+ assertTextPresent("unrecognized element: <unknown-descriptor", problems.get(0).getMsg());
}
public static class TextElement {
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ObjectWireTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ObjectWireTest.java 2009-10-13 09:40:39 UTC (rev 5737)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ObjectWireTest.java 2009-10-13 16:25:52 UTC (rev 5738)
@@ -504,9 +504,8 @@
"</objects>"
);
assertNotNull(problems);
- assertEquals(2L, problems.size());
- assertTextPresent("no element parser for tag bad-descriptor in category descriptor", problems.get(0).getMsg());
- assertTextPresent("unknown descriptor element bad-descriptor inside field operation: ", problems.get(1).getMsg());
+ assertEquals(1, problems.size());
+ assertTextPresent("unknown descriptor element bad-descriptor inside field operation: ", problems.get(0).getMsg());
}
public static class InheritedFieldInjectionClass extends FieldInjectionClass {
@@ -693,9 +692,8 @@
"</objects>"
);
assertNotNull(problems);
- assertEquals(2L, problems.size());
- assertTextPresent("no element parser for tag bad-descriptor in category descriptor", problems.get(0).getMsg());
- assertTextPresent("couldn't parse property content element as a value descriptor: ", problems.get(1).getMsg());
+ assertEquals(1, problems.size());
+ assertTextPresent("couldn't parse property content element as a value descriptor: ", problems.get(0).getMsg());
}
public void testMissingPropertySetter() {
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/SetWireTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/SetWireTest.java 2009-10-13 09:40:39 UTC (rev 5737)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/SetWireTest.java 2009-10-13 16:25:52 UTC (rev 5738)
@@ -58,7 +58,7 @@
"</objects>"
);
assertNotNull(problems);
- assertTextPresent("no element parser for tag unknown-descriptor", problems.get(0).getMsg());
+ assertTextPresent("unrecognized element: <unknown-descriptor", problems.get(0).getMsg());
}
}
16 years, 6 months
JBoss JBPM SVN: r5737 - in jbpm4/trunk/modules: test-cfg/src/test/java/org/jbpm/test and 3 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-10-13 05:40:39 -0400 (Tue, 13 Oct 2009)
New Revision: 5737
Added:
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/CustomVariableTypeTest.java
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/Husky.java
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/HuskyMatcher.java
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/HuskyVariable.java
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/husky.hbm.xml
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/jbpm.cfg.xml
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/jbpm.hibernate.cfg.xml
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/jbpm.variable.types.xml
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TypesBinding.java
Log:
added cusom variable type example
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TypesBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TypesBinding.java 2009-10-13 01:51:40 UTC (rev 5736)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TypesBinding.java 2009-10-13 09:40:39 UTC (rev 5737)
@@ -37,8 +37,9 @@
import org.jbpm.pvm.internal.type.matcher.HibernateLongIdMatcher;
import org.jbpm.pvm.internal.type.matcher.HibernateStringIdMatcher;
import org.jbpm.pvm.internal.type.matcher.SerializableMatcher;
-import org.jbpm.pvm.internal.util.ReflectUtil;
import org.jbpm.pvm.internal.util.XmlUtil;
+import org.jbpm.pvm.internal.wire.Descriptor;
+import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.descriptor.TypesDescriptor;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
@@ -144,7 +145,8 @@
Element matcherObjectElement = XmlUtil.element(matcherElement);
if (matcherObjectElement!=null) {
try {
- matcher = (Matcher) parser.parseElement(matcherObjectElement, parse);
+ Descriptor descriptor = (Descriptor) parser.parseElement(matcherObjectElement, parse);
+ matcher = (Matcher) WireContext.create(descriptor);
} catch (ClassCastException e) {
parse.addProblem("matcher is not a "+Matcher.class.getName()+": "+(matcher!=null ? matcher.getClass().getName() : "null"), element);
}
Added: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/CustomVariableTypeTest.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/CustomVariableTypeTest.java (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/CustomVariableTypeTest.java 2009-10-13 09:40:39 UTC (rev 5737)
@@ -0,0 +1,54 @@
+/*
+ * 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.customtype;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.test.JbpmCustomCfgTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class CustomVariableTypeTest extends JbpmCustomCfgTestCase {
+
+ public void testCustomVariable() {
+ deployJpdlXmlString(
+ "<process name='CustomVariable'>" +
+ " <start>" +
+ " <transition to='s' />" +
+ " </start>" +
+ " <state name='s' />" +
+ "</process>"
+ );
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("dog", new Husky("max"));
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("CustomVariable", variables);
+
+ String pid = processInstance.getId();
+ Husky husky = (Husky) executionService.getVariable(pid, "dog");
+ assertEquals("max", husky.getName());
+ }
+}
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/CustomVariableTypeTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/Husky.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/Husky.java (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/Husky.java 2009-10-13 09:40:39 UTC (rev 5737)
@@ -0,0 +1,39 @@
+/*
+ * 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.customtype;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class Husky {
+
+ String name;
+
+ public Husky(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+}
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/Husky.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/HuskyMatcher.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/HuskyMatcher.java (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/HuskyMatcher.java 2009-10-13 09:40:39 UTC (rev 5737)
@@ -0,0 +1,38 @@
+/*
+ * 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.customtype;
+
+import org.jbpm.pvm.internal.type.Matcher;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HuskyMatcher implements Matcher {
+
+ private static final long serialVersionUID = 1L;
+
+ public boolean matches(String name, Object value) {
+ return value instanceof Husky;
+ }
+
+}
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/HuskyMatcher.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/HuskyVariable.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/HuskyVariable.java (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/HuskyVariable.java 2009-10-13 09:40:39 UTC (rev 5737)
@@ -0,0 +1,47 @@
+/*
+ * 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.customtype;
+
+import org.jbpm.pvm.internal.type.Variable;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HuskyVariable extends Variable {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String name;
+
+ protected Object getObject() {
+ return new Husky(name);
+ }
+
+ public boolean isStorable(Object value) {
+ return value instanceof Husky;
+ }
+
+ protected void setObject(Object value) {
+ name = ((Husky)value).getName();
+ }
+}
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/customtype/HuskyVariable.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/husky.hbm.xml
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/husky.hbm.xml (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/husky.hbm.xml 2009-10-13 09:40:39 UTC (rev 5737)
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping default-access="field">
+
+ <subclass name="org.jbpm.test.customtype.HuskyVariable" extends="org.jbpm.pvm.internal.type.Variable" discriminator-value="husky">
+ <property name="name" column="STRING_VALUE_" type="string"/>
+ </subclass>
+
+</hibernate-mapping>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/husky.hbm.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/jbpm.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/jbpm.cfg.xml 2009-10-13 09:40:39 UTC (rev 5737)
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <import resource="jbpm.businesscalendar.cfg.xml" />
+ <import resource="jbpm.tx.hibernate.cfg.xml" />
+ <import resource="jbpm.jpdl.cfg.xml" />
+ <import resource="jbpm.identity.cfg.xml" />
+
+ <process-engine-context>
+
+ <types resource="org/jbpm/test/customtype/jbpm.variable.types.xml" />
+
+ <hibernate-configuration>
+ <cfg resource="org/jbpm/test/customtype/jbpm.hibernate.cfg.xml" />
+ </hibernate-configuration>
+
+
+
+ <repository-service />
+ <repository-cache />
+ <execution-service />
+ <history-service />
+ <management-service />
+ <identity-service />
+ <task-service />
+
+ <hibernate-session-factory />
+
+ <object class="org.jbpm.pvm.internal.id.DatabaseDbidGenerator" init="eager">
+ <field name="commandService"><ref object="newTxRequiredCommandService" /></field>
+ <invoke method="initialize" />
+ </object>
+
+ <object class="org.jbpm.pvm.internal.id.DatabaseIdComposer" init="eager" />
+
+ <script-manager default-expression-language="juel"
+ default-script-language="juel">
+ <script-language name="juel" factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
+ </script-manager>
+
+ <address-resolver />
+
+ <mail-template name='task-notification'>
+ <to users="${task.assignee}"/>
+ <subject>${task.name}</subject>
+ <text><![CDATA[Hi ${task.assignee},
+Task "${task.name}" has been assigned to you.
+${task.description}
+
+Sent by JBoss jBPM
+]]></text>
+ </mail-template>
+
+ <mail-template name='task-reminder'>
+ <to users="${task.assignee}"/>
+ <subject>${task.name}</subject>
+ <text><![CDATA[Hey ${task.assignee},
+Do not forget about task "${task.name}".
+${task.description}
+
+Sent by JBoss jBPM
+]]></text>
+ </mail-template>
+
+ </process-engine-context>
+
+ <transaction-context>
+ <repository-session />
+ <db-session />
+
+ <message-session />
+ <timer-session />
+ <history-session />
+ <mail-session>
+ <mail-server>
+ <session-properties resource="jbpm.mail.properties" />
+ </mail-server>
+ </mail-session>
+ </transaction-context>
+
+</jbpm-configuration>
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/jbpm.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/jbpm.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/jbpm.hibernate.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/jbpm.hibernate.cfg.xml 2009-10-13 09:40:39 UTC (rev 5737)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+ <session-factory>
+
+ <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
+ <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
+ <property name="hibernate.connection.url">jdbc:hsqldb:mem:.</property>
+ <property name="hibernate.connection.username">sa</property>
+ <property name="hibernate.connection.password"></property>
+ <property name="hibernate.hbm2ddl.auto">create-drop</property>
+ <property name="hibernate.format_sql">true</property>
+
+ <mapping resource="org/jbpm/test/customtype/husky.hbm.xml" />
+
+ <mapping resource="jbpm.repository.hbm.xml" />
+ <mapping resource="jbpm.execution.hbm.xml" />
+ <mapping resource="jbpm.history.hbm.xml" />
+ <mapping resource="jbpm.task.hbm.xml" />
+ <mapping resource="jbpm.identity.hbm.xml" />
+
+ </session-factory>
+</hibernate-configuration>
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/jbpm.hibernate.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/jbpm.variable.types.xml
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/jbpm.variable.types.xml (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/jbpm.variable.types.xml 2009-10-13 09:40:39 UTC (rev 5737)
@@ -0,0 +1,38 @@
+<types>
+
+ <type name="husky" variable-class="org.jbpm.test.customtype.HuskyVariable">
+ <matcher><object class="org.jbpm.test.customtype.HuskyMatcher" /></matcher>
+ </type>
+
+ <!-- types stored in a native column -->
+ <type name="string" class="java.lang.String" variable-class="org.jbpm.pvm.internal.type.variable.StringVariable" />
+ <type name="long" class="java.lang.Long" variable-class="org.jbpm.pvm.internal.type.variable.LongVariable" />
+ <type name="double" class="java.lang.Double" variable-class="org.jbpm.pvm.internal.type.variable.DoubleVariable" />
+
+ <!-- types converted to a string -->
+ <type name="date" class="java.util.Date" converter="org.jbpm.pvm.internal.type.converter.DateToStringConverter" variable-class="org.jbpm.pvm.internal.type.variable.StringVariable" />
+ <type name="boolean" class="java.lang.Boolean" converter="org.jbpm.pvm.internal.type.converter.BooleanToStringConverter" variable-class="org.jbpm.pvm.internal.type.variable.StringVariable" />
+ <type name="char" class="java.lang.Character" converter="org.jbpm.pvm.internal.type.converter.CharacterToStringConverter" variable-class="org.jbpm.pvm.internal.type.variable.StringVariable" />
+
+ <!-- types converted to a long -->
+ <type name="byte" class="java.lang.Byte" converter="org.jbpm.pvm.internal.type.converter.ByteToLongConverter" variable-class="org.jbpm.pvm.internal.type.variable.LongVariable" />
+ <type name="short" class="java.lang.Short" converter="org.jbpm.pvm.internal.type.converter.ShortToLongConverter" variable-class="org.jbpm.pvm.internal.type.variable.LongVariable" />
+ <type name="integer" class="java.lang.Integer" converter="org.jbpm.pvm.internal.type.converter.IntegerToLongConverter" variable-class="org.jbpm.pvm.internal.type.variable.LongVariable" />
+
+ <!-- types converted to a double -->
+ <type name="float" class="java.lang.Float" converter="org.jbpm.pvm.internal.type.converter.FloatToDoubleConverter" variable-class="org.jbpm.pvm.internal.type.variable.DoubleVariable" />
+
+ <!-- byte[] and char[] -->
+ <type name="byte[]" class="[B" variable-class="org.jbpm.pvm.internal.type.variable.BlobVariable" />
+ <type name="char[]" class="[C" variable-class="org.jbpm.pvm.internal.type.variable.TextVariable" />
+
+ <type name="hibernate-long-id" class="hibernatable" id-type="long" variable-class="org.jbpm.pvm.internal.type.variable.HibernateLongVariable" />
+ <type name="hibernate-string-id" class="hibernatable" id-type="string" variable-class="org.jbpm.pvm.internal.type.variable.HibernateStringVariable" />
+
+ <type name="serializable" class="serializable" converter="org.jbpm.pvm.internal.type.converter.SerializableToBytesConverter" variable-class="org.jbpm.pvm.internal.type.variable.BlobVariable" />
+
+ <!-- TODO: add ejb3 entity bean support -->
+ <!-- TODO: add JCR activity support -->
+ <!-- TODO: add collection support -->
+
+</types>
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/customtype/jbpm.variable.types.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 6 months
JBoss JBPM SVN: r5736 - jbpm4/trunk/modules/jboss.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-10-12 21:51:40 -0400 (Mon, 12 Oct 2009)
New Revision: 5736
Modified:
jbpm4/trunk/modules/jboss/
Log:
ignore jboss module settings dir
Property changes on: jbpm4/trunk/modules/jboss
___________________________________________________________________
Name: svn:ignore
- target
+ target
.settings
16 years, 6 months
JBoss JBPM SVN: r5735 - jbpm3/tags.
by do-not-reply@jboss.org
Author: jcoleman(a)redhat.com
Date: 2009-10-12 17:18:19 -0400 (Mon, 12 Oct 2009)
New Revision: 5735
Added:
jbpm3/tags/jbpm-3.2.8.CR3/
Log:
Create 3.2.8 CR3 tag from 3.2-soa branch
Copied: jbpm3/tags/jbpm-3.2.8.CR3 (from rev 5734, jbpm3/branches/jbpm-3.2-soa)
16 years, 6 months
JBoss JBPM SVN: r5734 - jbpm3/branches/jbpm-3.2-soa/modules/db/scripts.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-10-12 16:11:10 -0400 (Mon, 12 Oct 2009)
New Revision: 5734
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/db/scripts/antrun-jbpmschema.xml
Log:
[JBPM-2563] restore original sql script names
Modified: jbpm3/branches/jbpm-3.2-soa/modules/db/scripts/antrun-jbpmschema.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/db/scripts/antrun-jbpmschema.xml 2009-10-12 17:44:34 UTC (rev 5733)
+++ jbpm3/branches/jbpm-3.2-soa/modules/db/scripts/antrun-jbpmschema.xml 2009-10-12 20:11:10 UTC (rev 5734)
@@ -20,95 +20,113 @@
<target name="create-schema"
depends="init"
description="Generate schema creation scripts">
- <jbpmschema output="${scriptsdir}/jbpm.db2.create.sql"
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.db2.sql"
config="hibernate.cfg.db2.xml"
action="create" />
- <jbpmschema output="${scriptsdir}/jbpm.hsqldb.create.sql"
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.derby.sql"
+ config="hibernate.cfg.derby.xml"
+ action="create" />
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.firebird.sql"
+ config="hibernate.cfg.firebird.xml"
+ action="create" />
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.hsqldb.sql"
config="hibernate.cfg.hsqldb.xml"
action="create" />
- <jbpmschema output="${scriptsdir}/jbpm.mssql.create.sql"
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.ingres.sql"
+ config="hibernate.cfg.ingres.xml"
+ action="create" />
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.interbase.sql"
+ config="hibernate.cfg.interbase.xml"
+ action="create" />
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.mckoi.sql"
+ config="hibernate.cfg.mckoi.xml"
+ action="create" />
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.mssql.sql"
config="hibernate.cfg.mssql.xml"
action="create" />
- <jbpmschema output="${scriptsdir}/jbpm.mysql.create.sql"
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.mysql.sql"
config="hibernate.cfg.mysql.xml"
action="create"
delimiter=";" />
- <jbpmschema output="${scriptsdir}/jbpm.oracle.create.sql"
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.oracle.sql"
config="hibernate.cfg.oracle.xml"
action="create"
delimiter=";" />
- <jbpmschema output="${scriptsdir}/jbpm.postgresql.create.sql"
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.postgresql.sql"
config="hibernate.cfg.postgresql.xml"
action="create"
delimiter=";" />
- <jbpmschema output="${scriptsdir}/jbpm.sybase.create.sql"
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.sapdb.sql"
+ config="hibernate.cfg.sapdb.xml"
+ action="create" />
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.sybase.sql"
config="hibernate.cfg.sybase.xml"
action="create" />
- <concat destfile="${scriptsdir}/jbpm.sybase.create.sql" append="yes">go</concat>
+ <concat destfile="${scriptsdir}/jbpm.jpdl.sybase.sql" append="yes">go</concat>
</target>
<target name="drop-schema"
depends="init"
description="Generate schema drop scripts">
- <jbpmschema output="${scriptsdir}/jbpm.db2.drop.sql"
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.db2.drop.sql"
config="hibernate.cfg.db2.xml"
action="drop" />
- <jbpmschema output="${scriptsdir}/jbpm.hsqldb.drop.sql"
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.hsqldb.drop.sql"
config="hibernate.cfg.hsqldb.xml"
action="drop" />
- <jbpmschema output="${scriptsdir}/jbpm.mssql.drop.sql"
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.mssql.drop.sql"
config="hibernate.cfg.mssql.xml"
action="drop" />
- <jbpmschema output="${scriptsdir}/jbpm.mysql.drop.sql"
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.mysql.drop.sql"
config="hibernate.cfg.mysql.xml"
action="drop"
delimiter=";" />
- <jbpmschema output="${scriptsdir}/jbpm.oracle.drop.sql"
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.oracle.drop.sql"
config="hibernate.cfg.oracle.xml"
action="drop"
delimiter=";" />
- <jbpmschema output="${scriptsdir}/jbpm.postgresql.drop.sql"
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.postgresql.drop.sql"
config="hibernate.cfg.postgresql.xml"
action="drop"
delimiter=";" />
- <jbpmschema output="${scriptsdir}/jbpm.sybase.drop.sql"
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.sybase.drop.sql"
config="hibernate.cfg.sybase.xml"
action="drop" />
- <concat destfile="${scriptsdir}/jbpm.sybase.drop.sql" append="yes">go</concat>
+ <concat destfile="${scriptsdir}/jbpm.jpdl.sybase.drop.sql" append="yes">go</concat>
</target>
<target name="update-schema"
depends="init"
description="Generate schema update scripts">
- <jbpmschema output="${scriptsdir}/jbpm.db2.update.sql"
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.db2.update322.sql"
config="hibernate.cfg.db2.xml"
properties="db2.properties"
action="update"
delimiter=";" />
- <jbpmschema output="${scriptsdir}/jbpm.mssql.update.sql"
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.mssql.update322.sql"
config="hibernate.cfg.mssql.xml"
properties="mssql.properties"
action="update" />
- <jbpmschema output="${scriptsdir}/jbpm.mysql.update.sql"
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.mysql.update322.sql"
config="hibernate.cfg.mysql.xml"
properties="mysql.properties"
action="update"
delimiter=";" />
- <jbpmschema output="${scriptsdir}/jbpm.oracle.update.sql"
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.oracle.update322.sql"
config="hibernate.cfg.oracle.xml"
properties="oracle.properties"
action="update"
delimiter=";" />
- <jbpmschema output="${scriptsdir}/jbpm.postgresql.update.sql"
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.postgresql.update322.sql"
config="hibernate.cfg.postgresql.xml"
properties="postgresql.properties"
action="update"
delimiter=";" />
- <jbpmschema output="${scriptsdir}/jbpm.sybase.update.sql"
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.sybase.update322.sql"
config="hibernate.cfg.sybase.xml"
properties="sybase.properties"
action="update" />
- <concat destfile="${scriptsdir}/jbpm.sybase.update.sql" append="yes">go</concat>
+ <concat destfile="${scriptsdir}/jbpm.jpdl.sybase.update322.sql" append="yes">go</concat>
</target>
</project>
16 years, 6 months
JBoss JBPM SVN: r5733 - in jbpm4/trunk/modules: jpdl/src/main/java/org/jbpm/jpdl/internal/xml and 1 other directories.
by do-not-reply@jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-10-12 13:44:34 -0400 (Mon, 12 Oct 2009)
New Revision: 5733
Modified:
jbpm4/trunk/modules/api/src/main/resources/jpdl-4.2.xsd
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/migration/InstanceMigratorTest.java
Log:
Modified: jbpm4/trunk/modules/api/src/main/resources/jpdl-4.2.xsd
===================================================================
--- jbpm4/trunk/modules/api/src/main/resources/jpdl-4.2.xsd 2009-10-12 13:22:58 UTC (rev 5732)
+++ jbpm4/trunk/modules/api/src/main/resources/jpdl-4.2.xsd 2009-10-12 17:44:34 UTC (rev 5733)
@@ -1183,4 +1183,26 @@
<annotation><documentation>Reference to the email template</documentation></annotation>
<restriction base="string"></restriction>
</simpleType>
+
+ <element name="migrate-instances">
+ <annotation><documentation>Information to migrate instances of previously deployed process definitions
+ to the new one</documentation></annotation>
+ <complexType>
+ <sequence>
+ <element name="activity-mapping" minOccurs="0" maxOccurs="unbounded">
+ <annotation><documentation>One activity mapping will be present for each activity of which the name changed.</documentation></annotation>
+ <complexType>
+ <attribute name="old-name" type="string" use="required">
+ <annotation><documentation>The name of the activity in the previously deployed process definition.</documentation></annotation>
+ </attribute>
+ <attribute name="new-name" type="string" use="required">
+ <annotation><documentation>The name of the activity in the newly deployed process definition</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+ </element>
+
+
</schema>
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2009-10-12 13:22:58 UTC (rev 5732)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2009-10-12 17:44:34 UTC (rev 5733)
@@ -80,6 +80,8 @@
import org.jbpm.pvm.internal.xml.Parser;
import org.jbpm.pvm.internal.xml.ProblemImpl;
import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
/**
* @author Tom Baeyens
@@ -287,7 +289,17 @@
migrations = new HashMap<ProcessDefinition, MigrationDescriptor>();
parse.contextMapPut(Parse.CONTEXT_KEY_MIGRATIONS, migrations);
}
- migrations.put(processDefinition, new MigrationDescriptor());
+ MigrationDescriptor migrationDescriptor = new MigrationDescriptor();
+ NodeList activityMappings = migrationElement.getElementsByTagName("activity-mapping");
+ for (int i = 0; i < activityMappings.getLength(); i++) {
+ Node activityMapping = activityMappings.item(i);
+ if (activityMapping instanceof Element) {
+ String oldName = ((Element)activityMapping).getAttribute("old-name");
+ String newName = ((Element)activityMapping).getAttribute("new-name");
+ migrationDescriptor.addMigrationElement(MigrationDescriptor.ACTIVITY_TYPE, oldName, newName);
+ }
+ }
+ migrations.put(processDefinition, migrationDescriptor);
}
public void parseActivities(Element documentElement, Parse parse, CompositeElementImpl compositeElement) {
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/migration/InstanceMigratorTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/migration/InstanceMigratorTest.java 2009-10-12 13:22:58 UTC (rev 5732)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/migration/InstanceMigratorTest.java 2009-10-12 17:44:34 UTC (rev 5733)
@@ -28,13 +28,19 @@
" <transition to='foo'/>" +
" </start>" +
" <state name='foo'>" +
- " <transition to='bar'/>" +
+ " <transition to='fu'/>" +
" </state>" +
- " <state name='bar'>" +
+ " <state name='fu'>" +
+ " <transition name='to end' to='end'/>" +
+ " <transition name='to baz' to='baz'/>" +
+ " </state>" +
+ " <state name='baz'>" +
" <transition to='end'/>" +
" </state>" +
" <end name='end'/>" +
- " <migrate-instances/>" +
+ " <migrate-instances>" +
+ " <activity-mapping old-name='bar' new-name='fu'/>" +
+ " </migrate-instances>" +
"</process>";
@@ -54,7 +60,8 @@
.createProcessInstanceQuery()
.processDefinitionId(processDefinition1.getId())
.uniqueResult();
- assertNotNull(processInstance1.findActiveExecutionIn("bar"));
+ execution = processInstance1.findActiveExecutionIn("bar");
+ assertNotNull(execution);
String deploymentId2 = repositoryService.createDeployment()
.addResourceFromString("foobar.jpdl.xml", secondVersion)
@@ -67,9 +74,18 @@
.createProcessInstanceQuery()
.processDefinitionId(processDefinition2.getId())
.uniqueResult();
+ execution = processInstance2.findActiveExecutionIn("fu");
+ assertNotNull(execution);
- assertNotNull(processInstance2);
+ executionService.signalExecutionById(execution.getId(), "to baz");
+ processInstance2 = executionService
+ .createProcessInstanceQuery()
+ .processDefinitionId(processDefinition2.getId())
+ .uniqueResult();
+ execution = processInstance2.findActiveExecutionIn("baz");
+ assertNotNull(execution);
+
repositoryService.deleteDeploymentCascade(deploymentId2);
repositoryService.deleteDeploymentCascade(deploymentId1);
16 years, 6 months