JBoss JBPM SVN: r4544 - in jbpm4/branches/email/modules: pvm and 7 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-04-14 03:13:56 -0400 (Tue, 14 Apr 2009)
New Revision: 4544
Added:
jbpm4/branches/email/modules/pvm/.settings/org.eclipse.jdt.core.prefs
jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/AttachmentTemplate.java
jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/MailTemplate.java
jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/RecipientTemplate.java
jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/MailTemplateBinding.java
jbpm4/branches/email/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/MailTemplateWireTest.java
Removed:
jbpm4/branches/email/modules/pvm/.settings/org.eclipse.jdt.ui.prefs
Modified:
jbpm4/branches/email/modules/api/.project
jbpm4/branches/email/modules/pvm/.project
jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/XmlUtil.java
jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/DomBuilder.java
jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java
jbpm4/branches/email/modules/pvm/src/test/resources/jbpm.wire.bindings.xml
Log:
bind mail template
Modified: jbpm4/branches/email/modules/api/.project
===================================================================
--- jbpm4/branches/email/modules/api/.project 2009-04-13 11:01:01 UTC (rev 4543)
+++ jbpm4/branches/email/modules/api/.project 2009-04-14 07:13:56 UTC (rev 4544)
@@ -1,18 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>api</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jbpm-api</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Modified: jbpm4/branches/email/modules/pvm/.project
===================================================================
--- jbpm4/branches/email/modules/pvm/.project 2009-04-13 11:01:01 UTC (rev 4543)
+++ jbpm4/branches/email/modules/pvm/.project 2009-04-14 07:13:56 UTC (rev 4544)
@@ -1,18 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>pvm</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jbpm-pvm</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Added: jbpm4/branches/email/modules/pvm/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- jbpm4/branches/email/modules/pvm/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ jbpm4/branches/email/modules/pvm/.settings/org.eclipse.jdt.core.prefs 2009-04-14 07:13:56 UTC (rev 4544)
@@ -0,0 +1,5 @@
+#Tue Apr 14 00:52:21 CDT 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.source=1.5
Deleted: jbpm4/branches/email/modules/pvm/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- jbpm4/branches/email/modules/pvm/.settings/org.eclipse.jdt.ui.prefs 2009-04-13 11:01:01 UTC (rev 4543)
+++ jbpm4/branches/email/modules/pvm/.settings/org.eclipse.jdt.ui.prefs 2009-04-14 07:13:56 UTC (rev 4544)
@@ -1,3 +0,0 @@
-#Mon Apr 06 21:23:03 CDT 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates/>
Added: jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/AttachmentTemplate.java
===================================================================
--- jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/AttachmentTemplate.java (rev 0)
+++ jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/AttachmentTemplate.java 2009-04-14 07:13:56 UTC (rev 4544)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.email.impl;
+
+/**
+ * @author Alejandro Guizar
+ */
+public class AttachmentTemplate {
+
+ private String url;
+ private String resource;
+ private String file;
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public String getResource() {
+ return resource;
+ }
+
+ public void setResource(String resource) {
+ this.resource = resource;
+ }
+
+ public String getFile() {
+ return file;
+ }
+
+ public void setFile(String file) {
+ this.file = file;
+ }
+
+}
Added: jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/MailTemplate.java
===================================================================
--- jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/MailTemplate.java (rev 0)
+++ jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/MailTemplate.java 2009-04-14 07:13:56 UTC (rev 4544)
@@ -0,0 +1,134 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.email.impl;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.mail.Message.RecipientType;
+
+/**
+ * Template for electronic mail, complete with recipients, subject, content and attachments.
+ *
+ * @author Alejandro Guizar
+ */
+public class MailTemplate {
+
+ private String name;
+ private String language;
+ private Map<RecipientType, RecipientTemplate> recipientTemplates;
+ private String subject;
+ private String text;
+ private String html;
+ private List<AttachmentTemplate> attachmentTemplates;
+
+ /**
+ * Name of this template, useful for referencing it from mail activities.
+ */
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Templating engine meant to produce dynamic content.
+ */
+ public String getLanguage() {
+ return language;
+ }
+
+ public void setLanguage(String language) {
+ this.language = language;
+ }
+
+ public RecipientTemplate getRecipientTemplate(RecipientType recipientType) {
+ return recipientTemplates != null ? recipientTemplates.get(recipientType) : null;
+ }
+
+ public void setRecipientTemplate(RecipientType recipientType, RecipientTemplate recipientTemplate) {
+ if (recipientTemplates == null)
+ recipientTemplates = new HashMap<RecipientType, RecipientTemplate>();
+ recipientTemplates.put(recipientType, recipientTemplate);
+ }
+
+ public RecipientTemplate getTo() {
+ return getRecipientTemplate(RecipientType.TO);
+ }
+
+ public void setTo(RecipientTemplate to) {
+ setRecipientTemplate(RecipientType.TO, to);
+ }
+
+ public RecipientTemplate getCc() {
+ return getRecipientTemplate(RecipientType.CC);
+ }
+
+ public void setCc(RecipientTemplate cc) {
+ setRecipientTemplate(RecipientType.CC, cc);
+ }
+
+ public RecipientTemplate getBcc() {
+ return getRecipientTemplate(RecipientType.BCC);
+ }
+
+ public void setBcc(RecipientTemplate bcc) {
+ setRecipientTemplate(RecipientType.BCC, bcc);
+ }
+
+ public String getSubject() {
+ return subject;
+ }
+
+ public void setSubject(String subject) {
+ this.subject = subject;
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ public String getHtml() {
+ return html;
+ }
+
+ public void setHtml(String html) {
+ this.html = html;
+ }
+
+ public List<AttachmentTemplate> getAttachmentTemplates() {
+ return attachmentTemplates;
+ }
+
+ public void addAttachmentTemplate(AttachmentTemplate attachmentTemplate) {
+ if (attachmentTemplates == null) attachmentTemplates = new ArrayList<AttachmentTemplate>();
+ attachmentTemplates.add(attachmentTemplate);
+ }
+}
Added: jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/RecipientTemplate.java
===================================================================
--- jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/RecipientTemplate.java (rev 0)
+++ jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/RecipientTemplate.java 2009-04-14 07:13:56 UTC (rev 4544)
@@ -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.pvm.internal.email.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Template for email recipients, either addresses or actors.
+ *
+ * @author Alejandro Guizar
+ */
+public class RecipientTemplate {
+
+ private List<String> addresses;
+ private List<String> actors;
+
+ public List<String> getAddresses() {
+ return addresses;
+ }
+
+ public void addAddress(String address) {
+ if (addresses == null) addresses = new ArrayList<String>();
+ addresses.add(address);
+ }
+
+ public List<String> getActors() {
+ return actors;
+ }
+
+ public void addActor(String actor) {
+ if (actors == null) actors = new ArrayList<String>();
+ actors.add(actor);
+ }
+}
Modified: jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/XmlUtil.java
===================================================================
--- jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/XmlUtil.java 2009-04-13 11:01:01 UTC (rev 4543)
+++ jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/XmlUtil.java 2009-04-14 07:13:56 UTC (rev 4544)
@@ -21,7 +21,6 @@
*/
package org.jbpm.pvm.internal.util;
-import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Collections;
@@ -34,8 +33,6 @@
import org.jbpm.pvm.internal.xml.Parse;
import javax.xml.namespace.QName;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
@@ -225,23 +222,15 @@
return "null";
}
- Source source = new DOMSource(element);
-
StringWriter stringWriter = new StringWriter();
- PrintWriter printWriter = new PrintWriter(stringWriter);
- Result result = new StreamResult(printWriter);
-
try {
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
- transformer.transform(source, result);
+ transformer.transform(new DOMSource(element), new StreamResult(stringWriter));
} catch (Exception e) {
log.error("couldn't transform dom element into string representation");
return "<" + element.getTagName() + " ... >...</" + element.getTagName() + ">";
}
-
- printWriter.close();
-
return stringWriter.toString();
}
Added: jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/MailTemplateBinding.java
===================================================================
--- jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/MailTemplateBinding.java (rev 0)
+++ jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/MailTemplateBinding.java 2009-04-14 07:13:56 UTC (rev 4544)
@@ -0,0 +1,163 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.wire.binding;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jbpm.pvm.internal.email.impl.AttachmentTemplate;
+import org.jbpm.pvm.internal.email.impl.MailTemplate;
+import org.jbpm.pvm.internal.email.impl.RecipientTemplate;
+import org.jbpm.pvm.internal.util.XmlUtil;
+import org.jbpm.pvm.internal.wire.Descriptor;
+import org.jbpm.pvm.internal.wire.descriptor.ListDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.StringDescriptor;
+import org.jbpm.pvm.internal.wire.operation.PropertyOperation;
+import org.jbpm.pvm.internal.xml.Parse;
+import org.jbpm.pvm.internal.xml.Parser;
+import org.w3c.dom.Element;
+
+/**
+ * @author Alejandro Guizar
+ */
+public class MailTemplateBinding extends WireDescriptorBinding {
+
+ public MailTemplateBinding() {
+ super("mail-template");
+ }
+
+ public Object parse(Element element, Parse parse, Parser parser) {
+ ObjectDescriptor templateDescriptor = new ObjectDescriptor(MailTemplate.class);
+ // name
+ String name = element.getAttribute("name");
+ if (name != null) {
+ templateDescriptor.addInjection("name", new StringDescriptor(name));
+ }
+ else {
+ parse.addProblem("template has no name");
+ }
+ // language
+ String language = XmlUtil.attribute(element, "language");
+ if (language != null) {
+ templateDescriptor.addInjection("language", new StringDescriptor(language));
+ }
+ // to
+ Element toElement = XmlUtil.element(element, "to");
+ if (toElement != null) {
+ Descriptor toDescriptor = parseRecipientTemplate(toElement, parse, parser);
+ addPropertyInjection(templateDescriptor, "to", toDescriptor);
+ }
+ else {
+ parse.addProblem("template '" + name + "' has no 'to' recipients");
+ }
+ // cc
+ Element ccElement = XmlUtil.element(element, "cc");
+ if (ccElement != null) {
+ Descriptor ccDescriptor = parseRecipientTemplate(ccElement, parse, parser);
+ addPropertyInjection(templateDescriptor, "cc", ccDescriptor);
+ }
+ // bcc
+ Element bccElement = XmlUtil.element(element, "bcc");
+ if (bccElement != null) {
+ Descriptor bccDescriptor = parseRecipientTemplate(bccElement, parse, parser);
+ addPropertyInjection(templateDescriptor, "bcc", bccDescriptor);
+ }
+ // subject
+ Element subjectElement = XmlUtil.element(element, "subject");
+ if (subjectElement != null) {
+ StringDescriptor subjectDescriptor =
+ new StringDescriptor(XmlUtil.getContentText(subjectElement));
+ templateDescriptor.addInjection("subject", subjectDescriptor);
+ }
+ else {
+ parse.addProblem("template '" + name + "' has no subject");
+ }
+ // text
+ Element textElement = XmlUtil.element(element, "text");
+ if (textElement != null) {
+ StringDescriptor textDescriptor = new StringDescriptor(XmlUtil.getContentText(textElement));
+ templateDescriptor.addInjection("text", textDescriptor);
+ }
+ // html
+ Element htmlElement = XmlUtil.element(element, "html");
+ if (htmlElement != null) {
+ StringDescriptor htmlDescriptor = new StringDescriptor(XmlUtil.toString(htmlElement));
+ templateDescriptor.addInjection("html", htmlDescriptor);
+ }
+ // attachments
+ Element attachmentsElement = XmlUtil.element(element, "attachments");
+ if (attachmentsElement != null) {
+ List<Descriptor> attachmentDescriptors = new ArrayList<Descriptor>();
+ for (Element attachmentElement : XmlUtil.elements(attachmentsElement, "attachment")) {
+ ObjectDescriptor attachmentDescriptor = new ObjectDescriptor(AttachmentTemplate.class);
+ attachmentDescriptors.add(attachmentDescriptor);
+ // url
+ String url = XmlUtil.attribute(attachmentElement, "url");
+ if (url != null) attachmentDescriptor.addInjection("url", new StringDescriptor(url));
+ // resource
+ String resource = XmlUtil.attribute(attachmentElement, "resource");
+ if (resource != null)
+ attachmentDescriptor.addInjection("resource", new StringDescriptor(resource));
+ // file
+ String file = XmlUtil.attribute(attachmentElement, "file");
+ if (file != null) attachmentDescriptor.addInjection("file", new StringDescriptor(file));
+ }
+
+ ListDescriptor attachmentsDescriptor = new ListDescriptor();
+ attachmentsDescriptor.setValueDescriptors(attachmentDescriptors);
+ templateDescriptor.addInjection("attachmentTemplates", attachmentsDescriptor);
+ }
+ return templateDescriptor;
+ }
+
+ private static void addPropertyInjection(ObjectDescriptor objectDescriptor, String propertyName,
+ Descriptor valueDescriptor) {
+ PropertyOperation operation = new PropertyOperation();
+ operation.setPropertyName(propertyName);
+ operation.setDescriptor(valueDescriptor);
+ objectDescriptor.addOperation(operation);
+ }
+
+ protected Descriptor parseRecipientTemplate(Element element, Parse parse, Parser parser) {
+ ObjectDescriptor recipientDescriptor = new ObjectDescriptor(RecipientTemplate.class);
+
+ String addresses = XmlUtil.attribute(element, "addresses");
+ if (addresses != null) recipientDescriptor.addInjection("addresses", parseTokens(addresses));
+
+ String actors = XmlUtil.attribute(element, "actors");
+ if (actors != null) recipientDescriptor.addInjection("actors", parseTokens(actors));
+
+ return recipientDescriptor;
+ }
+
+ private static ListDescriptor parseTokens(String tokens) {
+ List<Descriptor> tokenDescriptors = new ArrayList<Descriptor>();
+ for (String token : tokens.split("[,|\\s]+")) {
+ tokenDescriptors.add(new StringDescriptor(token));
+ }
+ ListDescriptor listDescriptor = new ListDescriptor();
+ listDescriptor.setValueDescriptors(tokenDescriptors);
+ return listDescriptor;
+ }
+
+}
Modified: jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/DomBuilder.java
===================================================================
--- jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/DomBuilder.java 2009-04-13 11:01:01 UTC (rev 4543)
+++ jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/DomBuilder.java 2009-04-14 07:13:56 UTC (rev 4544)
@@ -29,6 +29,7 @@
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.Text;
+import org.w3c.dom.UserDataHandler;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.Locator;
@@ -41,7 +42,6 @@
public Document document;
- protected String debugNamespace = null;
protected String lineAttributeName = "line";
protected String columnAttributeName = null;
@@ -315,23 +315,12 @@
int lineNumber = locator.getLineNumber();
int columnNumber = locator.getColumnNumber();
- if (debugNamespace==null) {
- if (lineAttributeName!=null) {
- elem.setAttribute(lineAttributeName, Integer.toString(lineNumber));
- }
- if (columnAttributeName!=null) {
- elem.setAttribute(columnAttributeName, Integer.toString(columnNumber));
- }
-
- } else {
- if (lineAttributeName!=null) {
- elem.setAttributeNS(debugNamespace, lineAttributeName, Integer.toString(lineNumber));
- }
- if (columnAttributeName!=null) {
- elem.setAttributeNS(debugNamespace, columnAttributeName, Integer.toString(columnNumber));
- }
-
+ if (lineAttributeName!=null) {
+ elem.setUserData(lineAttributeName, lineNumber, null);
}
+ if (columnAttributeName!=null) {
+ elem.setUserData(columnAttributeName, columnNumber, null);
+ }
}
@@ -824,18 +813,12 @@
return true;
}
- public void setDebugNamespace(String debugNamespace) {
- this.debugNamespace = debugNamespace;
- }
public void setLineAttributeName(String lineAttributeName) {
this.lineAttributeName = lineAttributeName;
}
public void setColumnAttributeName(String columnAttributeName) {
this.columnAttributeName = columnAttributeName;
}
- public String getDebugNamespace() {
- return debugNamespace;
- }
public String getLineAttributeName() {
return lineAttributeName;
}
Modified: jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java
===================================================================
--- jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java 2009-04-13 11:01:01 UTC (rev 4543)
+++ jbpm4/branches/email/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java 2009-04-14 07:13:56 UTC (rev 4544)
@@ -394,6 +394,7 @@
parseDocument(parse.document, parse);
} catch (Exception e) {
+ e.printStackTrace();
parse.addProblem("couldn't interpret the dom model: "+e.getMessage(), e);
}
}
@@ -437,7 +438,7 @@
}
DocumentBuilder documentBuilder = createDocumentBuilder(parse);
- document = documentBuilder.newDocument();
+ document = documentBuilder.getDOMImplementation().createDocument(null, null, null);
parse.setDocument(document);
DomBuilder domBuilder = new DomBuilder();
Added: jbpm4/branches/email/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/MailTemplateWireTest.java
===================================================================
--- jbpm4/branches/email/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/MailTemplateWireTest.java (rev 0)
+++ jbpm4/branches/email/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/MailTemplateWireTest.java 2009-04-14 07:13:56 UTC (rev 4544)
@@ -0,0 +1,174 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.wire;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.jbpm.pvm.internal.email.impl.AttachmentTemplate;
+import org.jbpm.pvm.internal.email.impl.MailTemplate;
+
+/**
+ * @author Alejandro Guizar
+ */
+public class MailTemplateWireTest extends WireTestCase {
+
+ public void testName() {
+ WireContext wireContext =
+ createWireContext("<objects>"
+ + "<mail-template name='plate'>"
+ + " <to addresses='dilbert@office, alice@work, dogbert@house'/>"
+ + " <subject>bureaucracy</subject>"
+ + "</mail-template>"
+ + "</objects>");
+
+ MailTemplate template = wireContext.get(MailTemplate.class);
+ assertEquals("plate", template.getName());
+ }
+
+ public void testLanguage() {
+ WireContext wireContext =
+ createWireContext("<objects>"
+ + "<mail-template name='plate' language='juel'>"
+ + " <to addresses='dilbert@office, alice@work, dogbert@house'/>"
+ + " <subject>bureaucracy</subject>"
+ + "</mail-template>"
+ + "</objects>");
+
+ MailTemplate template = wireContext.get(MailTemplate.class);
+ assertEquals("juel", template.getLanguage());
+ }
+
+ public void testTo() {
+ WireContext wireContext =
+ createWireContext("<objects>"
+ + "<mail-template name='plate'>"
+ + " <to addresses='dilbert@office, alice@work, dogbert@house'/>"
+ + " <subject>bureaucracy</subject>"
+ + "</mail-template>"
+ + "</objects>");
+
+ MailTemplate template = wireContext.get(MailTemplate.class);
+ assertEquals(Arrays.asList("dilbert@office", "alice@work", "dogbert@house"), template
+ .getTo()
+ .getAddresses());
+ }
+
+ public void testCc() {
+ WireContext wireContext =
+ createWireContext("<objects>"
+ + "<mail-template name='plate'>"
+ + " <to addresses='dilbert@office, alice@work, dogbert@house'/>"
+ + " <cc actors='theboss, hrpolicymaker'/>"
+ + " <subject>bureaucracy</subject>"
+ + "</mail-template>"
+ + "</objects>");
+
+ MailTemplate template = wireContext.get(MailTemplate.class);
+ assertEquals(Arrays.asList("theboss", "hrpolicymaker"), template.getCc().getActors());
+ }
+
+ public void testBcc() {
+ WireContext wireContext =
+ createWireContext("<objects>"
+ + "<mail-template name='plate'>"
+ + " <to addresses='dilbert@office, alice@work, dogbert@house'/>"
+ + " <bcc actors='thoughtpolice'/>"
+ + " <subject>bureaucracy</subject>"
+ + "</mail-template>"
+ + "</objects>");
+
+ MailTemplate template = wireContext.get(MailTemplate.class);
+ assertEquals(Collections.singletonList("thoughtpolice"), template.getBcc().getActors());
+ }
+
+ public void testSubject() {
+ WireContext wireContext =
+ createWireContext("<objects>"
+ + "<mail-template name='plate'>"
+ + " <to addresses='dilbert@office, alice@work, dogbert@house'/>"
+ + " <subject>bureaucracy</subject>"
+ + "</mail-template>"
+ + "</objects>");
+
+ MailTemplate template = wireContext.get(MailTemplate.class);
+ assertEquals("bureaucracy", template.getSubject());
+ }
+
+ public void testText() {
+ WireContext wireContext =
+ createWireContext("<objects>"
+ + "<mail-template name='plate'>"
+ + " <to addresses='dilbert@office, alice@work, dogbert@house'/>"
+ + " <subject>bureaucracy</subject>"
+ + " <text>plain text content</text>"
+ + "</mail-template>"
+ + "</objects>");
+
+ MailTemplate template = wireContext.get(MailTemplate.class);
+ assertEquals("plain text content", template.getText());
+ }
+
+ public void testHtml() {
+ WireContext wireContext =
+ createWireContext("<objects>"
+ + "<mail-template name='plate'>"
+ + " <to addresses='dilbert@office, alice@work, dogbert@house'/>"
+ + " <subject>bureaucracy</subject>"
+ + " <html><strong>rich</strong> content</html>"
+ + "</mail-template>"
+ + "</objects>");
+
+ MailTemplate template = wireContext.get(MailTemplate.class);
+ System.out.println(template.getHtml());
+ assertEquals("<html>\n<strong>rich</strong> content</html>\n", template.getHtml());
+ }
+
+ public void testAttachments() {
+ WireContext wireContext =
+ createWireContext("<objects>"
+ + "<mail-template name='plate'>"
+ + " <to addresses='dilbert@office, alice@work, dogbert@house'/>"
+ + " <subject>bureaucracy</subject>"
+ + " <attachments>"
+ + " <attachment url='http://en.wikipedia.org/wiki/File:Dilbert-20050910.png'/>"
+ + " <attachment resource='org/example/pic.jpg'/>"
+ + " <attachment file='${user.home}/.face'/>"
+ + " </attachments>"
+ + "</mail-template>"
+ + "</objects>");
+
+ MailTemplate template = wireContext.get(MailTemplate.class);
+ List<AttachmentTemplate> attachmentTemplates = template.getAttachmentTemplates();
+ assertEquals(3, attachmentTemplates.size());
+ // url
+ AttachmentTemplate attachmentTemplate = attachmentTemplates.get(0);
+ assertEquals("http://en.wikipedia.org/wiki/File:Dilbert-20050910.png", attachmentTemplate.getUrl());
+ // resource
+ attachmentTemplate = attachmentTemplates.get(1);
+ assertEquals("org/example/pic.jpg", attachmentTemplate.getResource());
+ // file
+ attachmentTemplate = attachmentTemplates.get(2);
+ assertEquals("${user.home}/.face", attachmentTemplate.getFile());
+ }
+}
Modified: jbpm4/branches/email/modules/pvm/src/test/resources/jbpm.wire.bindings.xml
===================================================================
--- jbpm4/branches/email/modules/pvm/src/test/resources/jbpm.wire.bindings.xml 2009-04-13 11:01:01 UTC (rev 4543)
+++ jbpm4/branches/email/modules/pvm/src/test/resources/jbpm.wire.bindings.xml 2009-04-14 07:13:56 UTC (rev 4544)
@@ -39,6 +39,7 @@
<binding class="org.jbpm.pvm.internal.wire.binding.BusinessCalendarBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.IdGeneratorBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.AuthenticationBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.MailTemplateBinding" />
<!-- hibernate bindings -->
<binding class="org.jbpm.pvm.internal.wire.binding.HibernateConfigurationBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.SeamHibernateSessionBinding" />
17 years
JBoss JBPM SVN: r4543 - in jbpm4/trunk: modules/api/src/main/resources and 2 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-04-13 07:01:01 -0400 (Mon, 13 Apr 2009)
New Revision: 4543
Modified:
jbpm4/trunk/build.xml
jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/TimerDefinitionImpl.java
Log:
JBPM-2029 added parsing and updated schema for timers
Modified: jbpm4/trunk/build.xml
===================================================================
--- jbpm4/trunk/build.xml 2009-04-13 08:59:29 UTC (rev 4542)
+++ jbpm4/trunk/build.xml 2009-04-13 11:01:01 UTC (rev 4543)
@@ -98,7 +98,7 @@
<arg line="-Pschemadocs package" />
</exec>
<antcall target="show.html">
- <param name="page" value="modules/api/target/doc/schemadoc/index.html"/>
+ <param name="page" value="modules/api/target/schemadocs/index.html"/>
</antcall>
</target>
Modified: jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
===================================================================
--- jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd 2009-04-13 08:59:29 UTC (rev 4542)
+++ jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd 2009-04-13 11:01:01 UTC (rev 4543)
@@ -6,7 +6,6 @@
elementFormDefault="qualified"
attributeFormDefault="unqualified">
-
<annotation>
<documentation>Schema for jPDL 4 process descriptions;
element process is the top level element.
@@ -18,17 +17,6 @@
delegation group can be pulled up as an expression
attribute in each use case of the delegationGroup
- TODO: Should automatic activities have timers? That makes sense
- in a transient scenario, but not in a transactional scenario.
- Same comment holds for asynchronous continuations
-
- TODO: Is it a good idea to move blocking and signalling to the API ?
-
- TODO: Figure out task reuse (requires templating and parameters)
- and dynamic task creation (requires tasks to be declared by name
- in the process definition and that from the API tasks can be
- easily instantiated.
-
TODO: Investigate if object-refs to centrally defined objects would
add value over inline defined objects.
</documentation>
@@ -43,6 +31,7 @@
<sequence minOccurs="0" maxOccurs="unbounded">
<element ref="tns:swimlane" minOccurs="0" maxOccurs="unbounded"/>
<element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="tns:timer" minOccurs="0" maxOccurs="unbounded"/>
<group ref="tns:activityGroup" minOccurs="0" maxOccurs="unbounded" />
</sequence>
<attribute name="name" use="required" type="string">
@@ -163,13 +152,14 @@
<complexType>
<sequence>
<element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="tns:timer" minOccurs="0" maxOccurs="unbounded"/>
<element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
</sequence>
<attributeGroup ref="tns:activityAttributes" />
</complexType>
</element>
- <!-- ~~~ EXCLUSIVE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <!-- ~~~ DECISION ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<element name="decision">
<annotation><documentation>Decision gateway: selects one path out of many alternatives.
When an execution comes in, exactly one outgoing transition is taken.
@@ -331,6 +321,7 @@
<sequence>
<element name="assignment-handler" minOccurs="0" type="tns:wireObjectType" />
<element ref="tns:on" minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="tns:timer" minOccurs="0" maxOccurs="unbounded"/>
<element ref="tns:transition" minOccurs="0" maxOccurs="unbounded" />
</sequence>
<attributeGroup ref="tns:activityAttributes" />
@@ -632,6 +623,42 @@
</attribute>
</complexType>
</element>
+
+ <element name="timer">
+ <complexType>
+ <sequence>
+ <group ref="tns:eventListenerGroup" minOccurs="0" maxOccurs="unbounded">
+ <annotation><documentation>A list of event listeners that will
+ be notified when the timer fires</documentation></annotation>
+ </group>
+ </sequence>
+ <attribute name="event" type="string">
+ <annotation><documentation>The event identification for this timer event.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="transition" type="string">
+ <annotation><documentation>The name of the outgoing transition that must be
+ taken when this timer fires.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="duedate" type="string">
+ <annotation><documentation>Timer duedate expression that defines the duedate of this
+ timer relative to the creation time of the timer. E.g. '2 hours' or '4 business days'
+ </documentation></annotation>
+ </attribute>
+ <attribute name="repeat" type="string">
+ <annotation><documentation>Timer duedate expression that defines repeated scheduling
+ relative to the last timer fire event. E.g. '2 hours' or '4 business days'
+ </documentation></annotation>
+ </attribute>
+ <attribute name="duedatetime" type="string">
+ <annotation><documentation>Absolute time in format <code>HH:mm dd/MM/yyyy</code>
+ (see SimpleDateFormat). The format for the absolute time can be customized in the
+ jbpm configuration.
+ </documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
<group name="eventListenerGroup">
<choice>
@@ -743,42 +770,6 @@
</restriction>
</simpleType>
- <element name="subtask" type="tns:taskType">
- <annotation><documentation>Subtask in a task activity.</documentation></annotation>
- </element>
-
- <complexType name="assignmentType">
- <annotation><documentation>An element of type assignmentType will be used in
- tasks and swimlanes to specify to whom these respectively are assigned.
- </documentation></annotation>
- <attribute name="assignee" type="string">
- <annotation><documentation>An expression '#{expr}' that resolves to an identifier of
- the actual actor that needs to execute the task. It can be a literal as well.
- </documentation></annotation>
- </attribute>
- <attribute name="candidate-groups" type="string">
- <annotation><documentation>An expression '#{expr}' that resolves to a comma separated
- list of groups of actors with candidates to execute the task.
- </documentation></annotation>
- </attribute>
- <attribute name="candidate-users" type="string">
- <annotation><documentation>An expression '#{expr}' that resolves to a comma separated
- list of actors that are candidate to execute the task.
- </documentation></annotation>
- </attribute>
- <attribute name="swimlane" type="string">
- <annotation><documentation>The name of the swimlane that will contain the actor that
- needs to execute the task.
- </documentation></annotation>
- </attribute>
- </complexType>
-
- <element name="assignment" type="tns:assignmentType">
- <annotation><documentation>The assignment which specifies who needs to execute
- task or who is among the candidates to execute it.
- </documentation></annotation>
- </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-04-13 08:59:29 UTC (rev 4542)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2009-04-13 11:01:01 UTC (rev 4543)
@@ -22,12 +22,16 @@
package org.jbpm.jpdl.internal.xml;
import java.net.URL;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
+import java.util.Date;
import java.util.Enumeration;
import java.util.List;
import java.util.Set;
import org.jbpm.activity.ActivityBehaviour;
+import org.jbpm.env.Environment;
import org.jbpm.internal.log.Log;
import org.jbpm.jpdl.internal.activity.JpdlBinding;
import org.jbpm.jpdl.internal.model.JpdlProcessDefinition;
@@ -36,6 +40,8 @@
import org.jbpm.pvm.internal.model.EventImpl;
import org.jbpm.pvm.internal.model.ObservableElementImpl;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+import org.jbpm.pvm.internal.model.ScopeElementImpl;
+import org.jbpm.pvm.internal.model.TimerDefinitionImpl;
import org.jbpm.pvm.internal.task.AssignableDefinitionImpl;
import org.jbpm.pvm.internal.task.SwimlaneDefinitionImpl;
import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
@@ -177,38 +183,18 @@
}
}
+ // on events
parseOnEvents(documentElement, parse, processDefinition);
+
+ // timers
+ parseTimers(documentElement, parse, processDefinition);
// activities
- List<Element> elements = XmlUtil.elements(documentElement);
- for (Element element: elements) {
- if (!"on".equals(XmlUtil.getTagLocalName(element))) {
- JpdlBinding activityBinding = (JpdlBinding) getBinding(element, "activity");
- if (activityBinding!=null) {
- ActivityImpl activity = processDefinition.createActivity();
- parse.pushObject(activity);
- try {
- activity.setType(activityBinding.getTagName());
- activityBinding.parseName(element, activity, parse);
- activityBinding.parseTransitions(element, activity, parse, this);
- ActivityBehaviour activityBehaviour = (ActivityBehaviour) activityBinding.parse(element, parse, this);
- activity.setBehaviour(activityBehaviour);
-
- parseOnEvents(element, parse, activity);
-
- } finally {
- parse.popObject();
- }
- } else {
- log.debug("unrecognized activity: "+XmlUtil.getTagLocalName(element));
- }
- }
- }
-
- for (UnresolvedTransition unresolvedTransition: unresolvedTransitions.list) {
- unresolvedTransition.resolve(processDefinition, parse);
- }
+ parseActivities(documentElement, parse, processDefinition);
+ // bind activities to their destinations
+ resolveTransitionDestinations(parse, processDefinition, unresolvedTransitions);
+
} finally {
parse.popObject();
}
@@ -221,6 +207,81 @@
return processDefinition;
}
+ private void resolveTransitionDestinations(Parse parse, JpdlProcessDefinition processDefinition, UnresolvedTransitions unresolvedTransitions) {
+ for (UnresolvedTransition unresolvedTransition: unresolvedTransitions.list) {
+ unresolvedTransition.resolve(processDefinition, parse);
+ }
+ }
+
+ private void parseActivities(Element documentElement, Parse parse, JpdlProcessDefinition processDefinition) {
+ List<Element> elements = XmlUtil.elements(documentElement);
+ for (Element element: elements) {
+ if ( !"on".equals(XmlUtil.getTagLocalName(element))
+ && !"timer".equals(XmlUtil.getTagLocalName(element))
+ ) {
+ JpdlBinding activityBinding = (JpdlBinding) getBinding(element, "activity");
+ if (activityBinding!=null) {
+ ActivityImpl activity = processDefinition.createActivity();
+ parse.pushObject(activity);
+ try {
+ activity.setType(activityBinding.getTagName());
+ activityBinding.parseName(element, activity, parse);
+ activityBinding.parseTransitions(element, activity, parse, this);
+ ActivityBehaviour activityBehaviour = (ActivityBehaviour) activityBinding.parse(element, parse, this);
+ activity.setBehaviour(activityBehaviour);
+
+ parseOnEvents(element, parse, activity);
+ parseTimers(element, parse, activity);
+
+ } finally {
+ parse.popObject();
+ }
+ } else {
+ log.debug("unrecognized activity: "+XmlUtil.getTagLocalName(element));
+ }
+ }
+ }
+ }
+
+ public void parseTimers(Element element, Parse parse, ScopeElementImpl scopeElement) {
+ List<Element> timerElements = XmlUtil.elements(element, "timer");
+ for (Element timerElement: timerElements) {
+ parseTimerDefinition(timerElement, parse, scopeElement);
+ }
+ }
+
+ private void parseTimerDefinition(Element timerElement, Parse parse, ScopeElementImpl scopeElement) {
+ TimerDefinitionImpl timerDefinition = scopeElement.createTimerDefinition();
+
+ String eventName = XmlUtil.attribute(timerElement, "event");
+ timerDefinition.setEventName(eventName);
+ parseEventListeners(timerElement, scopeElement, eventName, parse);
+
+ String transition = XmlUtil.attribute(timerElement, "transition");
+ timerDefinition.setSignalName(transition);
+
+ String duedate = XmlUtil.attribute(timerElement, "duedate", true, parse);
+ timerDefinition.setDueDateDescription(duedate);
+
+ String duedatetime = XmlUtil.attribute(timerElement, "duedatetime", true, parse);
+ if (duedatetime!=null) {
+ String dueDateTimeFormatText = (String) Environment.getFromCurrent("jbpm.duedatetime.format");
+ if (dueDateTimeFormatText==null) {
+ dueDateTimeFormatText = "HH:mm dd/MM/yyyy";
+ }
+ SimpleDateFormat dateFormat = new SimpleDateFormat(dueDateTimeFormatText);
+ try {
+ Date duedatetimeDate = dateFormat.parse(duedatetime);
+ timerDefinition.setDueDate(duedatetimeDate);
+ } catch (ParseException e) {
+ parse.addProblem("couldn't parse duedatetime "+duedatetime, e);
+ }
+ }
+
+ String repeat = XmlUtil.attribute(timerElement, "repeat");
+ timerDefinition.setRepeat(repeat);
+ }
+
public void parseOnEvents(Element element, Parse parse, ObservableElementImpl observableElement) {
// event listeners
List<Element> onElements = XmlUtil.elements(element, "on");
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/TimerDefinitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/TimerDefinitionImpl.java 2009-04-13 08:59:29 UTC (rev 4542)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/TimerDefinitionImpl.java 2009-04-13 11:01:01 UTC (rev 4543)
@@ -36,12 +36,12 @@
protected long dbid;
protected int dbversion;
protected String dueDateDescription;
+ protected Date dueDate;
protected String repeat;
protected Boolean isExclusive;
protected Integer retries;
protected String eventName;
protected String signalName;
- protected Date dueDate;
public TimerDefinitionImpl() {
}
17 years
JBoss JBPM SVN: r4542 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/jpdl and 30 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-04-13 04:59:29 -0400 (Mon, 13 Apr 2009)
New Revision: 4542
Added:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/jpdl/DecisionHandler.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/conditions/
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/conditions/DecisionConditionsTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/expression/
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/expression/DecisionExpressionTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/handler/
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/handler/DecisionHandlerTest.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/decision/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/decision/conditions/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/decision/expression/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/decision/handler/
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionBinding.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionBuilder.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionConditionActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionExpressionActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionHandlerActivity.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/DecisionEnd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDecisionInstanceImpl.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/DecisionTest.java
Removed:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/jpdl/ExclusiveHandler.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/conditions/ExclusiveConditionsTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/expression/ExclusiveExpressionTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/handler/ExclusiveHandlerTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/conditions/
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/expression/
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/handler/
jbpm4/trunk/modules/examples/src/test/resources/jbpm.cache.xml
jbpm4/trunk/modules/examples/src/test/resources/jbpm.definition.hbm.xml
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/exclusive/conditions/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/exclusive/expression/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/exclusive/handler/
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveBinding.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveBuilder.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveConditionActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveExpressionActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveHandlerActivity.java
jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.cache.xml
jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.definition.hbm.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ExclusiveEnd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryExclusiveInstanceImpl.java
jbpm4/trunk/modules/pvm/src/test/resources/jbpm.cache.xml
jbpm4/trunk/modules/pvm/src/test/resources/jbpm.definition.hbm.xml
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ExclusiveTest.java
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.definition.hbm.xml
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java
jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.history.hbm.xml
jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.jpdl.hbm.xml
jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/jbpm.jpdl.activities.xml
jbpm4/trunk/modules/examples/scripts/antrun-test-jars.xml
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/handler/ContentEvaluation.java
jbpm4/trunk/modules/examples/src/test/resources/jbpm.history.hbm.xml
jbpm4/trunk/modules/examples/src/test/resources/jbpm.jpdl.activities.xml
jbpm4/trunk/modules/examples/src/test/resources/jbpm.jpdl.hbm.xml
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/decision/conditions/process.jpdl.xml
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/decision/expression/process.jpdl.xml
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/decision/handler/process.jpdl.xml
jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.history.hbm.xml
jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.jpdl.activities.xml
jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.jpdl.hbm.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/TimerBuilder.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
jbpm4/trunk/modules/pvm/src/test/resources/jbpm.history.hbm.xml
jbpm4/trunk/modules/pvm/src/test/resources/jbpm.jpdl.activities.xml
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/ChoiceDistributionTest.java
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.history.hbm.xml
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.jpdl.activities.xml
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.jpdl.hbm.xml
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveMessagesTest.java
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Jpdl.xml
Log:
JBPM-2123 rename exclusive to decision
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -210,9 +210,9 @@
* is set to true. */
Transition getPreviousTransition();
- /** record history event that specifies for an exclusive activity which transition
+ /** record history event that specifies for a decision activity which transition
* has been taken. */
- void historyExclusive(String transitionName);
+ void historyDecision(String transitionName);
/** records the end of an automatic event. This should be called at the end of
* the activity. Before the activity's execute method is invoked, the start time
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/jpdl/DecisionHandler.java (from rev 4541, jbpm4/trunk/modules/api/src/main/java/org/jbpm/jpdl/ExclusiveHandler.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/jpdl/DecisionHandler.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/jpdl/DecisionHandler.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -0,0 +1,34 @@
+/*
+ * 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;
+
+import org.jbpm.model.OpenExecution;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public interface DecisionHandler {
+
+ /** the name of the selected outgoing transition */
+ String decide(OpenExecution execution);
+}
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/jpdl/DecisionHandler.java
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/jpdl/ExclusiveHandler.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/jpdl/ExclusiveHandler.java 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/jpdl/ExclusiveHandler.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,34 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.jpdl;
-
-import org.jbpm.model.OpenExecution;
-
-
-/**
- * @author Tom Baeyens
- */
-public interface ExclusiveHandler {
-
- /** the name of the selected outgoing transition */
- String select(OpenExecution execution);
-}
Modified: jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
===================================================================
--- jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd 2009-04-13 08:59:29 UTC (rev 4542)
@@ -170,8 +170,8 @@
</element>
<!-- ~~~ EXCLUSIVE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <element name="exclusive">
- <annotation><documentation>Exclusive gateway: selects one path out of many alternatives.
+ <element name="decision">
+ <annotation><documentation>Decision gateway: selects one path out of many alternatives.
When an execution comes in, exactly one outgoing transition is taken.
</documentation></annotation>
<complexType>
Modified: jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.history.hbm.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.history.hbm.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.history.hbm.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -63,7 +63,7 @@
<property name="transitionName" column="TRANSITION_" />
<subclass name="HistoryAutomaticInstanceImpl" discriminator-value="AUT">
- <subclass name="HistoryExclusiveInstanceImpl" discriminator-value="EXCL" />
+ <subclass name="HistoryDecisionInstanceImpl" discriminator-value="EXCL" />
</subclass>
<subclass name="HistoryTaskInstanceImpl" discriminator-value="TASK">
Modified: jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.jpdl.hbm.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.jpdl.hbm.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/hibernate/mapping.files/jbpm.jpdl.hbm.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -44,14 +44,14 @@
</id>
<discriminator column="CLASS_" />
<subclass name="org.jbpm.jpdl.internal.activity.StartActivity" discriminator-value="start" />
- <subclass name="org.jbpm.jpdl.internal.activity.ExclusiveConditionActivity" discriminator-value="excl-cond" />
- <subclass name="org.jbpm.jpdl.internal.activity.ExclusiveExpressionActivity" discriminator-value="excl-expr">
+ <subclass name="org.jbpm.jpdl.internal.activity.DecisionConditionActivity" discriminator-value="excl-cond" />
+ <subclass name="org.jbpm.jpdl.internal.activity.DecisionExpressionActivity" discriminator-value="excl-expr">
<property name="expr" column="TEXT_" />
<property name="lang" column="TEXT2_" />
</subclass>
- <subclass name="org.jbpm.jpdl.internal.activity.ExclusiveHandlerActivity" discriminator-value="excl-handler">
- <property name="exclusiveHandlerName" column="TEXT_" />
- <many-to-one name="exclusiveHandlerDescriptor"
+ <subclass name="org.jbpm.jpdl.internal.activity.DecisionHandlerActivity" discriminator-value="excl-handler">
+ <property name="decisionHandlerName" column="TEXT_" />
+ <many-to-one name="decisionHandlerDescriptor"
column="EXCLDESCR_"
cascade="all"
class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
Modified: jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/jbpm.jpdl.activities.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/jbpm.jpdl.activities.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/jbpm.jpdl.activities.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,7 +1,7 @@
<activities>
<activity binding="org.jbpm.jpdl.internal.activity.StartBinding" />
<activity binding="org.jbpm.jpdl.internal.activity.StateBinding" />
- <activity binding="org.jbpm.jpdl.internal.activity.ExclusiveBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.DecisionBinding" />
<activity binding="org.jbpm.jpdl.internal.activity.EndBinding" />
<activity binding="org.jbpm.jpdl.internal.activity.EndCancelBinding" />
<activity binding="org.jbpm.jpdl.internal.activity.EndErrorBinding" />
Modified: jbpm4/trunk/modules/examples/scripts/antrun-test-jars.xml
===================================================================
--- jbpm4/trunk/modules/examples/scripts/antrun-test-jars.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/examples/scripts/antrun-test-jars.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -31,16 +31,16 @@
<!-- EsbTest -->
<test-jar name="EsbTest" pkg="esb"/>
- <!-- ExclusiveConditionsTest -->
- <test-jar name="ExclusiveConditionsTest" pkg="exclusive/conditions"/>
+ <!-- DecisionConditionsTest -->
+ <test-jar name="DecisionConditionsTest" pkg="decision/conditions"/>
- <!-- ExclusiveExpressionTest -->
- <test-jar name="ExclusiveExpressionTest" pkg="exclusive/expression"/>
+ <!-- DecisionExpressionTest -->
+ <test-jar name="DecisionExpressionTest" pkg="decision/expression"/>
- <!-- ExclusiveHandlerTest -->
- <test-jar name="ExclusiveHandlerTest" pkg="exclusive/handler"/>
+ <!-- DecisionHandlerTest -->
+ <test-jar name="DecisionHandlerTest" pkg="decision/handler"/>
- <!-- ExclusiveHandlerTest -->
+ <!-- DecisionHandlerTest -->
<test-jar name="HqlTest" pkg="hql"/>
<!-- JavaInstantiateTest -->
Copied: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/conditions (from rev 4541, jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/conditions)
Copied: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/conditions/DecisionConditionsTest.java (from rev 4541, jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/conditions/ExclusiveConditionsTest.java)
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/conditions/DecisionConditionsTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/conditions/DecisionConditionsTest.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.examples.decision.conditions;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jbpm.Execution;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DecisionConditionsTest extends JbpmTestCase {
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ deploy("jbpm-DecisionConditionsTest.jpdl");
+
+ }
+
+ protected void tearDown() throws Exception
+ {
+ undeploy("jbpm-DecisionConditionsTest.jpdl");
+ super.tearDown();
+ }
+
+ public void testDecisionConditionsGood() {
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("content", "good");
+ Execution execution = executionService.startProcessInstanceByKey("DecisionConditions", variables);
+ assertEquals("submit document", execution.getActivityName());
+ }
+
+ public void testDecisionConditionsBad() {
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("content", "bad");
+ Execution execution = executionService.startProcessInstanceByKey("DecisionConditions", variables);
+ assertEquals("try again", execution.getActivityName());
+ }
+
+ public void testDecisionConditionsUgly() {
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("content", "ugly");
+ Execution execution = executionService.startProcessInstanceByKey("DecisionConditions", variables);
+ assertEquals("give up", execution.getActivityName());
+ }
+
+}
Deleted: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/conditions/ExclusiveConditionsTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/conditions/ExclusiveConditionsTest.java 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/conditions/ExclusiveConditionsTest.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,70 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.examples.exclusive.conditions;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jbpm.Execution;
-import org.jbpm.test.JbpmTestCase;
-
-
-/**
- * @author Tom Baeyens
- */
-public class ExclusiveConditionsTest extends JbpmTestCase {
-
- protected void setUp() throws Exception
- {
- super.setUp();
- deploy("jbpm-ExclusiveConditionsTest.jpdl");
-
- }
-
- protected void tearDown() throws Exception
- {
- undeploy("jbpm-ExclusiveConditionsTest.jpdl");
- super.tearDown();
- }
-
- public void testExclusiveConditionsGood() {
- Map<String, Object> variables = new HashMap<String, Object>();
- variables.put("content", "good");
- Execution execution = executionService.startProcessInstanceByKey("ExclusiveConditions", variables);
- assertEquals("submit document", execution.getActivityName());
- }
-
- public void testExclusiveConditionsBad() {
- Map<String, Object> variables = new HashMap<String, Object>();
- variables.put("content", "bad");
- Execution execution = executionService.startProcessInstanceByKey("ExclusiveConditions", variables);
- assertEquals("try again", execution.getActivityName());
- }
-
- public void testExclusiveConditionsUgly() {
- Map<String, Object> variables = new HashMap<String, Object>();
- variables.put("content", "ugly");
- Execution execution = executionService.startProcessInstanceByKey("ExclusiveConditions", variables);
- assertEquals("give up", execution.getActivityName());
- }
-
-}
Copied: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/expression (from rev 4541, jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/expression)
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/expression/DecisionExpressionTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/expression/DecisionExpressionTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/expression/DecisionExpressionTest.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.examples.decision.expression;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jbpm.Execution;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DecisionExpressionTest extends JbpmTestCase {
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ deploy("jbpm-DecisionExpressionTest.jpdl");
+
+ }
+
+ protected void tearDown() throws Exception
+ {
+ undeploy("jbpm-DecisionExpressionTest.jpdl");
+ super.tearDown();
+ }
+
+ public void testDecisionExpressionGood() {
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("content", "good");
+ Execution execution = executionService.startProcessInstanceByKey("DecisionExpression", variables);
+ assertEquals("submit document", execution.getActivityName());
+ }
+
+ public void testDecisionExpressionBad() {
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("content", "bad");
+ Execution execution = executionService.startProcessInstanceByKey("DecisionExpression", variables);
+ assertEquals("try again", execution.getActivityName());
+ }
+
+ public void testDecisionExpressionUgly() {
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("content", "ugly");
+ Execution execution = executionService.startProcessInstanceByKey("DecisionExpression", variables);
+ assertEquals("give up", execution.getActivityName());
+ }
+
+}
Deleted: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/expression/ExclusiveExpressionTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/expression/ExclusiveExpressionTest.java 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/expression/ExclusiveExpressionTest.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,70 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.examples.exclusive.expression;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jbpm.Execution;
-import org.jbpm.test.JbpmTestCase;
-
-
-/**
- * @author Tom Baeyens
- */
-public class ExclusiveExpressionTest extends JbpmTestCase {
-
- protected void setUp() throws Exception
- {
- super.setUp();
- deploy("jbpm-ExclusiveExpressionTest.jpdl");
-
- }
-
- protected void tearDown() throws Exception
- {
- undeploy("jbpm-ExclusiveExpressionTest.jpdl");
- super.tearDown();
- }
-
- public void testExclusiveExpressionGood() {
- Map<String, Object> variables = new HashMap<String, Object>();
- variables.put("content", "good");
- Execution execution = executionService.startProcessInstanceByKey("ExclusiveExpression", variables);
- assertEquals("submit document", execution.getActivityName());
- }
-
- public void testExclusiveExpressionBad() {
- Map<String, Object> variables = new HashMap<String, Object>();
- variables.put("content", "bad");
- Execution execution = executionService.startProcessInstanceByKey("ExclusiveExpression", variables);
- assertEquals("try again", execution.getActivityName());
- }
-
- public void testExclusiveExpressionUgly() {
- Map<String, Object> variables = new HashMap<String, Object>();
- variables.put("content", "ugly");
- Execution execution = executionService.startProcessInstanceByKey("ExclusiveExpression", variables);
- assertEquals("give up", execution.getActivityName());
- }
-
-}
Copied: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/handler (from rev 4541, jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/handler)
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/handler/ContentEvaluation.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/handler/ContentEvaluation.java 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/handler/ContentEvaluation.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -19,14 +19,14 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.examples.exclusive.handler;
+package org.jbpm.examples.decision.handler;
-import org.jbpm.jpdl.ExclusiveHandler;
+import org.jbpm.jpdl.DecisionHandler;
import org.jbpm.model.OpenExecution;
-public class ContentEvaluation implements ExclusiveHandler {
+public class ContentEvaluation implements DecisionHandler {
- public String select(OpenExecution execution) {
+ public String decide(OpenExecution execution) {
String content = (String) execution.getVariable("content");
if (content.equals("you're great")) {
return "good";
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/handler/DecisionHandlerTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/handler/DecisionHandlerTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/handler/DecisionHandlerTest.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.examples.decision.handler;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jbpm.Execution;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DecisionHandlerTest extends JbpmTestCase {
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ deploy("jbpm-DecisionHandlerTest.jpdl");
+ }
+
+ protected void tearDown() throws Exception
+ {
+ undeploy("jbpm-DecisionHandlerTest.jpdl");
+ super.tearDown();
+ }
+
+ public void testDecisionHandlerGreat() {
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("content", "you're great");
+ Execution execution = executionService.startProcessInstanceByKey("DecisionHandler", variables);
+ assertEquals("submit document", execution.getActivityName());
+ }
+
+ public void testDecisionHandlerImprove() {
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("content", "you gotta improve");
+ Execution execution = executionService.startProcessInstanceByKey("DecisionHandler", variables);
+ assertEquals("try again", execution.getActivityName());
+ }
+
+ public void testDecisionHandlerSuck() {
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("content", "you suck");
+ Execution execution = executionService.startProcessInstanceByKey("DecisionHandler", variables);
+ assertEquals("give up", execution.getActivityName());
+ }
+}
Deleted: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/handler/ExclusiveHandlerTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/handler/ExclusiveHandlerTest.java 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/decision/handler/ExclusiveHandlerTest.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.examples.exclusive.handler;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jbpm.Execution;
-import org.jbpm.test.JbpmTestCase;
-
-
-/**
- * @author Tom Baeyens
- */
-public class ExclusiveHandlerTest extends JbpmTestCase {
-
- protected void setUp() throws Exception
- {
- super.setUp();
- deploy("jbpm-ExclusiveHandlerTest.jpdl");
- }
-
- protected void tearDown() throws Exception
- {
- undeploy("jbpm-ExclusiveHandlerTest.jpdl");
- super.tearDown();
- }
-
- public void testExclusiveHandlerGreat() {
- Map<String, Object> variables = new HashMap<String, Object>();
- variables.put("content", "you're great");
- Execution execution = executionService.startProcessInstanceByKey("ExclusiveHandler", variables);
- assertEquals("submit document", execution.getActivityName());
- }
-
- public void testExclusiveHandlerImprove() {
- Map<String, Object> variables = new HashMap<String, Object>();
- variables.put("content", "you gotta improve");
- Execution execution = executionService.startProcessInstanceByKey("ExclusiveHandler", variables);
- assertEquals("try again", execution.getActivityName());
- }
-
- public void testExclusiveHandlerSuck() {
- Map<String, Object> variables = new HashMap<String, Object>();
- variables.put("content", "you suck");
- Execution execution = executionService.startProcessInstanceByKey("ExclusiveHandler", variables);
- assertEquals("give up", execution.getActivityName());
- }
-}
Deleted: jbpm4/trunk/modules/examples/src/test/resources/jbpm.cache.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.cache.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.cache.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,39 +0,0 @@
-<hibernate-cache>
-
- <class-cache class="org.jbpm.pvm.internal.model.ProcessDefinitionImpl" />
- <class-cache class="org.jbpm.pvm.internal.model.ActivityImpl" />
- <class-cache class="org.jbpm.pvm.internal.model.TransitionImpl" />
- <class-cache class="org.jbpm.pvm.internal.model.EventImpl" />
- <class-cache class="org.jbpm.pvm.internal.model.ExceptionHandlerImpl" />
- <class-cache class="org.jbpm.pvm.internal.model.ObjectReference" />
- <class-cache class="org.jbpm.pvm.internal.model.VariableDefinitionImpl" />
- <class-cache class="org.jbpm.pvm.internal.model.TimerDefinitionImpl" />
- <class-cache class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" />
-
- <collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.exceptionHandlers" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.events" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.activities" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.variableDefinitions" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.timerDefinitions" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.attachments" />
-
- <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.exceptionHandlers" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.events" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.activities" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.variableDefinitions" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.timerDefinitions" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.incomingTransitions" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.outgoingTransitions" />
-
- <collection-cache collection="org.jbpm.pvm.internal.model.TransitionImpl.exceptionHandlers" />
- <collection-cache collection="org.jbpm.pvm.internal.model.TransitionImpl.events" />
-
- <collection-cache collection="org.jbpm.pvm.internal.model.EventImpl.exceptionHandlers" />
- <collection-cache collection="org.jbpm.pvm.internal.model.EventImpl.listenerReferences" />
-
- <collection-cache collection="org.jbpm.pvm.internal.model.ExceptionHandlerImpl.eventListenerReferences" />
-
- <collection-cache collection="org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor.argDescriptors" />
- <collection-cache collection="org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor.operations" />
-
-</hibernate-cache>
Deleted: jbpm4/trunk/modules/examples/src/test/resources/jbpm.definition.hbm.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.definition.hbm.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.definition.hbm.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,646 +0,0 @@
-<?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 package="org.jbpm.pvm.internal.model" default-access="field">
-
- <!-- ### PROCESS DEFINITION ############################################# -->
- <class name="ProcessDefinitionImpl"
- table="JBPM_PROCESS"
- discriminator-value="pvm">
- <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <discriminator><column name="CLASS_" /></discriminator>
-
- <version name="dbversion" column="DBVERSION_" />
- <many-to-one name="properties"
- class="WireProperties"
- column="PROPS_"
- foreign-key="FK_PROCDEF_PROPS"
- index="IDX_PROCDEF_PROPS"
- cascade="all" />
- <list name="exceptionHandlers" cascade="all">
- <key foreign-key="FK_EXHDLR_PROCESS">
- <column name="PROCESS_" index="IDX_EXHDLR_PROCESS"/>
- </key>
- <index column="PROCESS_IDX_" />
- <one-to-many class="ExceptionHandlerImpl"/>
- </list>
-
- <!-- ObservableElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <property name="name" column="NAME_" />
- <property name="description" column="DESCR_" />
- <map name="events" cascade="all-delete-orphan">
- <key foreign-key="FK_EVENT_PROCESS">
- <column name="PROCESS_" index="IDX_EVENT_PROCESS" />
- </key>
- <map-key type="string" column="NAME_" />
- <one-to-many class="org.jbpm.pvm.internal.model.EventImpl"/>
- </map>
-
- <!-- CompositeElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <list name="activities" cascade="all" inverse="false">
- <key foreign-key="FK_ACTS_PROCESS">
- <column name="ACTSPROCESS_" index="IDX_ACTS_PROCESS"/>
- </key>
- <list-index column="ACTSPROCESS_IDX_" />
- <one-to-many class="ActivityImpl" />
- </list>
- <property name="hasVariableDefinitions" column="HAS_VAR_DEF_" />
- <list name="variableDefinitions" cascade="all">
- <key foreign-key="FK_VARDEF_PROCESS">
- <column name="PROCESS_" index="IDX_VARDEF_PROCESS"/>
- </key>
- <index column="PROCESS_IDX_" />
- <one-to-many class="VariableDefinitionImpl" />
- </list>
- <property name="hasTimerDefinitions" column="HAS_TIMER_DEF_" />
- <set name="timerDefinitions" cascade="all">
- <key foreign-key="FK_TMRDEF_PROCESS">
- <column name="PROCESS_" index="IDX_TMRDEF_PROCESS"/>
- </key>
- <one-to-many class="TimerDefinitionImpl" />
- </set>
-
- <!-- ProcessDefinitionImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <property name="key" column="KEY_" />
- <property name="id" column="ID_" unique="true" />
-
- <property name="packageName" column="PACKAGE_" />
- <property name="version" column="VERSION_" />
- <property name="deploymentTime" column="DEPLOYED_" />
- <many-to-one name="initial"
- column="INITIAL_"
- class="ActivityImpl"
- cascade="all"
- foreign-key="FK_PROCDEF_INITIAL"
- index="IDX_PROCDEF_INIT"
- fetch="select" />
-
- <map name="attachments" cascade="all-delete-orphan">
- <key foreign-key="FK_LOB_PROCESS">
- <column name="PROCESS_" index="IDX_LOB_PROCESS" />
- </key>
- <map-key type="string" column="NAME_" />
- <one-to-many class="org.jbpm.pvm.internal.lob.Lob"/>
- </map>
- </class>
-
- <!-- ### Activity ############################################################## -->
- <class name="ActivityImpl" table="JBPM_ACTIVITY">
- <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <many-to-one name="processDefinition"
- class="ProcessDefinitionImpl"
- column="PROCESS_"
- foreign-key="FK_ACT_PROCESS"
- index="IDX_ACT_PROCESS" />
- <many-to-one name="properties"
- class="WireProperties"
- column="PROPS_"
- foreign-key="FK_ACT_PROPS"
- index="IDX_ACT_PROPS"
- cascade="all" />
- <list name="exceptionHandlers" cascade="all">
- <key foreign-key="FK_EXHDLR_ACT">
- <column name="ACT_" index="IDX_EXHDLR_ACT"/>
- </key>
- <index column="ACT_IDX_" />
- <one-to-many class="ExceptionHandlerImpl" />
- </list>
-
- <!-- ObservableElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <property name="name" column="NAME_"/>
- <property name="description" column="DESCR_"/>
- <map name="events" cascade="all-delete-orphan">
- <key foreign-key="FK_EVENT_ACT">
- <column name="ACT_" index="IDX_EVENT_ACT" />
- </key>
- <map-key type="string" column="NAME_" />
- <one-to-many class="org.jbpm.pvm.internal.model.EventImpl" />
- </map>
-
- <!-- CompositeElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <list name="activities" cascade="all" inverse="false">
- <key column="PARENT_" foreign-key="none" />
- <list-index column="PARENT_IDX_" />
- <one-to-many class="ActivityImpl" />
- </list>
- <property name="hasVariableDefinitions" column="HAS_VAR_DEF_" />
- <list name="variableDefinitions" cascade="all">
- <key foreign-key="FK_VARDEF_ACT">
- <column name="ACT_" index="IDX_VARDEF_ACT"/>
- </key>
- <index column="ACT_IDX_" />
- <one-to-many class="VariableDefinitionImpl" />
- </list>
- <property name="hasTimerDefinitions" column="HAS_TIMER_DEF_" />
- <set name="timerDefinitions" cascade="all">
- <key foreign-key="FK_TMRDEF_ACT">
- <column name="ACT_" index="IDX_TMRDEF_ACT"/>
- </key>
- <one-to-many class="TimerDefinitionImpl" />
- </set>
-
- <!-- ActivityImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <property name="type" column="TYPE_" />
- <property name="isLocalScope" column="LOCAL_SCOPE_" />
- <property name="isExecutionAsync" column="EXEC_ASYNC_" />
- <property name="isSignalAsync" column="SIGNAL_ASYNC_" />
- <property name="isPreviousNeeded" column="PREV_NEEDED_" />
-
- <many-to-one name="parentActivity"
- column="PARENT_"
- class="ActivityImpl"
- cascade="all"
- foreign-key="FK_ACT_PARENT"
- index="IDX_ACT_PARENT" />
-
- <many-to-one name="defaultTransition"
- column="DEFTRANS_"
- class="TransitionImpl"
- fetch="select"
- foreign-key="FK_ACT_DEFTRANS"
- index="IDX_ACT_DEFTRANS" />
-
- <list name="incomingTransitions" inverse="false">
- <key column="DESTINATION_" />
- <index column="IN_IDX_" />
- <one-to-many class="TransitionImpl" />
- </list>
-
- <list name="outgoingTransitions" inverse="false" cascade="all">
- <key column="SOURCE_" />
- <index column="OUT_IDX_" />
- <one-to-many class="TransitionImpl" />
- </list>
-
- <component name="behaviourReference" class="ObjectReference">
- <many-to-one name="descriptor"
- column="BEHAV_DESCR_"
- cascade="all"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_NODE_BEHAV_DESCR"
- index="IDX_NODE_BEHAV_DESCR" />
- <any name="object" id-type="long" cascade="all">
- <!-- TODO: Specify names for classes -->
- <!-- <meta-value value="bpel::activity" class="org.jbpm.pvm.bpel.BpelActivity"/> -->
- <column name="BEHAV_CLASS_" />
- <column name="BEHAV_ID_" />
- </any>
- </component>
- </class>
-
- <!-- ### TRANSITION ##################################################### -->
- <class name="TransitionImpl" table="JBPM_TRANSITION">
- <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <many-to-one name="processDefinition"
- class="ProcessDefinitionImpl"
- column="PROCESS_"
- foreign-key="FK_TRANS_PROCDEF"
- index="IDX_TRANS_PROCDEF" />
- <many-to-one name="properties"
- class="WireProperties"
- column="PROPS_"
- foreign-key="FK_TRANS_PROPS"
- index="IDX_TRANS_PROPS"
- cascade="all" />
- <list name="exceptionHandlers" cascade="all">
- <key foreign-key="FK_EXHDLR_TRANS">
- <column name="TRANSITION_" index="IDX_EXHDLR_TRANS" />
- </key>
- <index column="TRANSITION_IDX_" />
- <one-to-many class="ExceptionHandlerImpl" />
- </list>
-
- <!-- ObservableElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <property name="name" column="NAME_" />
- <property name="description" column="DESCR_" />
- <map name="events" cascade="all-delete-orphan">
- <key foreign-key="FK_EVENT_TRANS">
- <column name="TRANSITION_" index="IDX_EVENT_TRANS" />
- </key>
- <map-key type="string" column="NAME_" />
- <one-to-many class="org.jbpm.pvm.internal.model.EventImpl" />
- </map>
-
- <!-- TransitionImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <many-to-one name="source"
- column="SRC_"
- class="ActivityImpl"
- fetch="select"
- foreign-key="FK_TRANS_SRC"
- index="IDX_TRANS_SRC" />
-
- <many-to-one name="destination"
- column="DEST_"
- class="ActivityImpl"
- fetch="select"
- cascade="all"
- foreign-key="FK_TRANS_DST"
- index="IDX_TRANS_DST" />
-
- <many-to-one name="conditionDescriptor"
- column="COND_DESCR_"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- cascade="all"
- foreign-key="FK_TRANS_COND"
- index="IDX_TRANS_COND" />
-
- <!--
- <many-to-one name="waitConditionDescriptor"
- column="WAIT_DESCR_"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- cascade="all"
- foreign-key="FK_TRANS_WAIT_DESCR"
- index="IDX_TRANS_WAIT_DESCR" />
- -->
-
- <property name="isTakeAsync" column="TAKEASYNC_" />
- </class>
-
- <!-- ### EVENT ########################################################## -->
- <class name="EventImpl" table="JBPM_EVENT">
- <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <many-to-one name="processDefinition"
- class="ProcessDefinitionImpl"
- column="PROCESSDEF_"
- foreign-key="FK_EVENT_PROCDEF"
- index="IDX_EVENT_PROCDEF" />
- <many-to-one name="properties"
- class="WireProperties"
- column="PROPS_"
- foreign-key="FK_EVENT_PROPS"
- index="IDX_EVENT_PROPS"
- cascade="all" />
- <list name="exceptionHandlers" cascade="all">
- <key foreign-key="FK_EXHDLR_EVENT">
- <column name="EVENT_" index="IDX_EXHDLR_EVENT"/>
- </key>
- <index column="EVENT_IDX_" />
- <one-to-many class="ExceptionHandlerImpl" />
- </list>
-
- <!-- EventImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <property name="name" column="NAME_" />
- <list name="listenerReferences" table="JBPM_OBJECTREFERENCES" cascade="all-delete-orphan">
- <key foreign-key="FK_OBJECTREF_EVENT">
- <column name="EVENT_" index="IDX_OBJREF_EVENT"/>
- </key>
- <list-index column="EVENT_IDX_" />
- <one-to-many class="EventListenerReference" />
- </list>
- </class>
-
- <!-- ### EXCEPTION HANDLER ############################################## -->
- <class name="ExceptionHandlerImpl" table="JBPM_EXCEPTHNDLR">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <property name="exceptionClassName" column="EXCEPT_CLASS_" />
- <property name="isTransactional" column="TRANSACT_" />
- <property name="isRethrowMasked" column="RETHROW_MASKED_"/>
- <property name="transitionName" column="TRANSITIONNAME_" />
- <property name="activityName" column="NODENAME_" />
- <list name="eventListenerReferences"
- inverse="false"
- cascade="all-delete-orphan"
- table="JBPM_OBJECTREFERENCES">
- <key foreign-key="FK_OBJREF_EXHNDLR" not-null="false">
- <column name="EXHNDLR_" index="IDX_OBJREF_EXHNDLR" />
- </key>
- <list-index column="EXHNDLR_IDX_" />
- <one-to-many class="ObjectReference" />
- </list>
- </class>
-
- <!-- ### OBJECT REFERENCE ############################################### -->
- <class name="ObjectReference" discriminator-value="objref" table="JBPM_OBJECTREF">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <discriminator column="CLASS_" />
- <version name="dbversion" column="DBVERSION_" />
- <many-to-one name="descriptor"
- column="OBJ_DESCR_"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- cascade="all"
- foreign-key="FK_OBJREF_EVENT"
- index="IDX_OBJREF_EVENT"/>
- <any name="object" id-type="long" cascade="all">
- <!-- TODO: Specify names for classes -->
- <column name="OBJ_CLASS_" />
- <column name="OBJ_ID_" />
- </any>
- <property name="expression" column="OBJ_EXPRESSION_"/>
- <property name="expressionLanguage" column="OBJ_EXPRLANG_"/>
-
- <subclass name="EventListenerReference" discriminator-value="evtlis">
- <property name="isPropagationEnabled" column="PROPAGATE_" />
- </subclass>
-
- </class>
-
- <!-- ### VARIABLE DEFINITION ############################################ -->
- <class name="VariableDefinitionImpl" table="JBPM_VARIABLEDEF">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <property name="name" column="NAME_"/>
- <property name="typeName" column="TYPE_"/>
-
- <property name="inVariableName" column="INVAR_" />
- <property name="inExpression" column="INEXPR_" />
- <many-to-one name="inDescriptor"
- column="INDESCR_"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- cascade="all"
- foreign-key="FK_VARDEF_INDES"
- index="IDX_VARDEF_INDES"/>
- <property name="outVariableName" column="OUTVAR_" />
- <property name="outExpression" column="OUTEXPR_" />
- </class>
-
- <!-- ### TIMER DEFINITION ############################################### -->
- <class name="TimerDefinitionImpl" table="JBPM_TIMERDEF">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <property name="dueDateDescription" column="DUEDATEDESCR_"/>
- <property name="repeat" column="REPEAT_"/>
- <property name="isExclusive" column="ISEXCL_"/>
- <property name="retries" column="RETRIES_"/>
- <property name="eventName" column="EVENT_"/>
- <property name="signalName" column="SIGNAL_"/>
- <property name="dueDate" column="DUEDATE_" type="timestamp"/>
- </class>
-
- <!-- ### DESCRIPTORS #################################################### -->
- <class name="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" table="JBPM_DESCRIPTOR" abstract="true"
- discriminator-value="abstract">
- <!--
- byte : ByteDescriptor
- string : StringDescriptor
- char : CharacterDescriptor
- class : ClassDescriptor
- double : DoubleDescriptor
- expr : ExpressionDescriptor
- float : FloatDescriptor
- long : LongDescriptor
- int : IntegerDescriptor
- short : ShortDescriptor
- coll : CollectionDescriptor
- map : MapDescriptor
- list : ListDescriptor
- set : SetDescriptor
- object : ObjectDescriptor
- ref : ReferenceDescriptor
- null : NullDescriptor
- true : TrueDescriptor
- false : FalseDescriptor
- provided : ProvidedObjectDescriptor
- -->
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <discriminator column="CLASS_" />
- <version name="dbversion" column="DBVERSION_" />
-
- <property name="name" column="NAME_" />
- <property name="init" column="INIT_" />
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.NullDescriptor" discriminator-value="null_" />
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.TrueDescriptor" discriminator-value="true" />
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.FalseDescriptor" discriminator-value="false" />
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.StringDescriptor" discriminator-value="string">
- <property name="text" column="TEXT_" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.CharacterDescriptor" discriminator-value="char">
- <property name="text" column="TEXT_" />
- </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ClassDescriptor" discriminator-value="class">
- <property name="text" column="TEXT_" />
- </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ReferenceDescriptor" discriminator-value="ref">
- <property name="text" column="TEXT_" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.DoubleDescriptor" discriminator-value="double">
- <property name="doubleVal" column="DOUBLEVAL_" />
- </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.FloatDescriptor" discriminator-value="float">
- <property name="doubleVal" column="DOUBLEVAL_" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.LongDescriptor" discriminator-value="long">
- <property name="longVal" column="LONGVAL_" />
- </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.IntegerDescriptor" discriminator-value="int">
- <property name="longVal" column="LONGVAL_" />
- </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ShortDescriptor" discriminator-value="short">
- <property name="longVal" column="LONGVAL_" />
- </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ByteDescriptor" discriminator-value="byte">
- <property name="longVal" column="LONGVAL_" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.CollectionDescriptor" discriminator-value="coll">
- <property name="className" column="CLASSNAME_" />
- <list name="valueDescriptors" cascade="all-delete-orphan">
- <key foreign-key="FK_DESCR_VALDESCR">
- <column name="VALUEDESCR_" index="IDX_DESCR_VALDESCR" />
- </key>
- <list-index column="VALUEDESCR_IDX_" />
- <one-to-many class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" />
- </list>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.MapDescriptor" discriminator-value="map">
- <list name="keyDescriptors" cascade="all-delete-orphan">
- <key column="KEYDESCR_" foreign-key="FK_DESCR_KEYDESCR" />
- <list-index column="KEYDESCR_IDX_" />
- <one-to-many class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" />
- </list>
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ListDescriptor" discriminator-value="list" />
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.SetDescriptor" discriminator-value="set" />
- </subclass>
-
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor" discriminator-value="object">
- <property name="className" column="TEXT_" />
- <property name="methodName" column="METHOD_" />
- <property name="isAutoWireEnabled" column="BOOLVAL_" />
- <property name="factoryObjectName" column="FACTORYNAME_" />
-
- <many-to-one name="factoryDescriptor" class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" column="FACTORYDESCR_"
- foreign-key="FK_DESCR_ARG_REF" index="IDX_DESCR_ARG_REF" cascade="all" />
-
- <list name="argDescriptors" cascade="all-delete-orphan">
- <key foreign-key="FK_OBJARG_DESCR">
- <column name="OBJARG_DESCR_" index="IDX_OBJARG_DESCR" />
- </key>
- <list-index column="OBJARG_DESCR_IDX_" />
- <one-to-many class="org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor" />
- </list>
-
- <list name="operations" cascade="all-delete-orphan">
- <key foreign-key="FK_OBJOPER_DESCR">
- <column name="OBJOPER_DESCR_" index="IDX_OBJOPER_DESCR" />
- </key>
- <list-index column="OBJOPER_DESCR_IDX_" />
- <one-to-many class="org.jbpm.pvm.internal.wire.operation.AbstractOperation" />
- </list>
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ExpressionDescriptor" discriminator-value="expr">
- <property name="expr" column="TEXT_" />
- <property name="lang" column="METHOD_" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ProvidedObjectDescriptor" discriminator-value="provided">
- <any name="providedObject" id-type="long" cascade="all">
- <column name="TEXT_" />
- <column name="LONGVAL_" />
- </any>
- <property name="exposeType" column="BOOLVAL_" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.EnvDescriptor" discriminator-value="env">
- <property name="objectName" column="TEXT_" />
- <property name="typeName" column="CLASSNAME_" />
- </subclass>
-
- </class>
-
- <!-- ### OPERATIONS ##################################################### -->
- <class name="org.jbpm.pvm.internal.wire.operation.AbstractOperation" abstract="true"
- table="JBPM_OPERATION" discriminator-value="oper">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <discriminator column="CLASS_" />
- <version name="dbversion" column="DBVERSION_" />
-
- <subclass name="org.jbpm.pvm.internal.wire.operation.FieldOperation"
- discriminator-value="field">
- <property name="fieldName" column="TEXT_" />
- <many-to-one name="descriptor" column="DESCR_" cascade="all"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_OPER_DESC" index="IDX_OPER_DESC" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.operation.PropertyOperation"
- discriminator-value="prop">
- <property name="setterName" column="TEXT_" />
- <many-to-one name="descriptor" column="DESCR_" cascade="all"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.operation.InvokeOperation"
- discriminator-value="invoke">
- <property name="methodName" column="TEXT_" />
- <list name="argDescriptors" cascade="all-delete-orphan">
- <key foreign-key="FK_ARGDSCR_OPER">
- <column name="OPER_" index="IDX_ARGDSCR_OPER" />
- </key>
- <list-index column="OPER_IDX_" />
- <one-to-many class="org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor" />
- </list>
- </subclass>
- </class>
-
- <!-- ### ARG DESCRIPTOR ################################################# -->
- <class name="org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor" table="JBPM_ARGDESCRIPTOR">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <property name="typeName" column="TYPENAME_" />
- <many-to-one name="descriptor" column="DESCRIPTOR_"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_ARGDESCR_DESCR" index="IDX_ARGDESCR_DESCR" cascade="all" />
- </class>
-
- <!-- ### PROPERTIES ##################################################### -->
- <class name="org.jbpm.pvm.internal.model.WireProperties" table="JBPM_WIREPROPS">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <component name="wireContext" class="org.jbpm.pvm.internal.wire.WireContext">
- <component name="wireDefinition" class="org.jbpm.pvm.internal.wire.WireDefinition">
- <map name="descriptors" cascade="all-delete-orphan" lazy="false">
- <key foreign-key="FK_DESCR_PROPS">
- <column name="PROPS_" index="IDX_DESCR_PROPS" />
- </key>
- <map-key type="string" column="NAME_" />
- <one-to-many class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" />
- </map>
- </component>
- </component>
- </class>
-
-
- <!-- ### QUERIES ######################################################## -->
-
- <query name="findProcessDefinitionKeys">
- <![CDATA[
- select distinct process.key
- from org.jbpm.pvm.internal.model.ProcessDefinitionImpl as process
- order by process.key asc
- ]]>
- </query>
-
- <query name="findProcessDefinitionsByKey">
- <![CDATA[
- select process
- from org.jbpm.pvm.internal.model.ProcessDefinitionImpl as process
- where process.key = :key
- order by process.version desc
- ]]>
- </query>
-
- <query name="findProcessDefinitionById">
- <![CDATA[
- select process
- from org.jbpm.pvm.internal.model.ProcessDefinitionImpl as process
- where process.id = :id
- ]]>
- </query>
-
- <query name="findProcessDefinitionKeysByName">
- <![CDATA[
- select process.key
- from org.jbpm.pvm.internal.model.ProcessDefinitionImpl as process
- where process.name = :name
- ]]>
- </query>
-
- <query name="findProcessDefinitionNamesByKey">
- <![CDATA[
- select process.name
- from org.jbpm.pvm.internal.model.ProcessDefinitionImpl as process
- where process.key = :key
- ]]>
- </query>
-
-</hibernate-mapping>
\ No newline at end of file
Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.history.hbm.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.history.hbm.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.history.hbm.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -63,7 +63,7 @@
<property name="transitionName" column="TRANSITION_" />
<subclass name="HistoryAutomaticInstanceImpl" discriminator-value="AUT">
- <subclass name="HistoryExclusiveInstanceImpl" discriminator-value="EXCL" />
+ <subclass name="HistoryDecisionInstanceImpl" discriminator-value="EXCL" />
</subclass>
<subclass name="HistoryTaskInstanceImpl" discriminator-value="TASK">
Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.jpdl.activities.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.jpdl.activities.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.jpdl.activities.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,7 +1,7 @@
<activities>
<activity binding="org.jbpm.jpdl.internal.activity.StartBinding" />
<activity binding="org.jbpm.jpdl.internal.activity.StateBinding" />
- <activity binding="org.jbpm.jpdl.internal.activity.ExclusiveBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.DecisionBinding" />
<activity binding="org.jbpm.jpdl.internal.activity.EndBinding" />
<activity binding="org.jbpm.jpdl.internal.activity.EndCancelBinding" />
<activity binding="org.jbpm.jpdl.internal.activity.EndErrorBinding" />
Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.jpdl.hbm.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.jpdl.hbm.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.jpdl.hbm.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -44,14 +44,14 @@
</id>
<discriminator column="CLASS_" />
<subclass name="org.jbpm.jpdl.internal.activity.StartActivity" discriminator-value="start" />
- <subclass name="org.jbpm.jpdl.internal.activity.ExclusiveConditionActivity" discriminator-value="excl-cond" />
- <subclass name="org.jbpm.jpdl.internal.activity.ExclusiveExpressionActivity" discriminator-value="excl-expr">
+ <subclass name="org.jbpm.jpdl.internal.activity.DecisionConditionActivity" discriminator-value="excl-cond" />
+ <subclass name="org.jbpm.jpdl.internal.activity.DecisionExpressionActivity" discriminator-value="excl-expr">
<property name="expr" column="TEXT_" />
<property name="lang" column="TEXT2_" />
</subclass>
- <subclass name="org.jbpm.jpdl.internal.activity.ExclusiveHandlerActivity" discriminator-value="excl-handler">
- <property name="exclusiveHandlerName" column="TEXT_" />
- <many-to-one name="exclusiveHandlerDescriptor"
+ <subclass name="org.jbpm.jpdl.internal.activity.DecisionHandlerActivity" discriminator-value="excl-handler">
+ <property name="decisionHandlerName" column="TEXT_" />
+ <many-to-one name="decisionHandlerDescriptor"
column="EXCLDESCR_"
cascade="all"
class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
Copied: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/decision/conditions (from rev 4541, jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/exclusive/conditions)
Modified: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/decision/conditions/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/exclusive/conditions/process.jpdl.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/decision/conditions/process.jpdl.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
-<process name="ExclusiveConditions" xmlns="http://jbpm.org/4/jpdl">
+<process name="DecisionConditions" xmlns="http://jbpm.org/4/jpdl">
<start g="16,102,48,48">
<transition to="evaluate document" />
</start>
- <exclusive name="evaluate document" g="96,102,48,48">
+ <decision name="evaluate document" g="96,102,48,48">
<transition to="submit document" g="120,60:">
<condition expr="#{content=="good"}" />
</transition>
@@ -14,7 +14,7 @@
<condition expr="#{content=="bad"}" />
</transition>
<transition to="give up" g="120,189:" />
- </exclusive>
+ </decision>
<state name="submit document" g="175,35,122,52"/>
<state name="try again" g="176,100,122,52"/>
Copied: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/decision/expression (from rev 4541, jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/exclusive/expression)
Modified: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/decision/expression/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/exclusive/expression/process.jpdl.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/decision/expression/process.jpdl.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
-<process name="ExclusiveExpression" xmlns="http://jbpm.org/4/jpdl">
+<process name="DecisionExpression" xmlns="http://jbpm.org/4/jpdl">
<start g="16,102,48,48">
<transition to="evaluate document" name=""/>
</start>
- <exclusive expr="#{content}" g="96,102,48,48" name="evaluate document">
+ <decision expr="#{content}" g="96,102,48,48" name="evaluate document">
<transition g="120,60:-36,23" name="good" to="submit document"/>
<transition g=":-15,-21" name="bad" to="try again"/>
<transition g="120,189:-35,-41" name="ugly" to="give up"/>
- </exclusive>
+ </decision>
<state g="175,35,122,52" name="submit document"/>
<state g="176,100,122,52" name="try again"/>
Copied: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/decision/handler (from rev 4541, jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/exclusive/handler)
Modified: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/decision/handler/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/exclusive/handler/process.jpdl.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/decision/handler/process.jpdl.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
-<process name="ExclusiveHandler" xmlns="http://jbpm.org/4/jpdl">
+<process name="DecisionHandler" xmlns="http://jbpm.org/4/jpdl">
<start g="16,102,48,48">
<transition to="evaluate document" name=""/>
</start>
- <exclusive g="96,102,48,48" name="evaluate document">
- <handler class="org.jbpm.examples.exclusive.handler.ContentEvaluation"/>
+ <decision g="96,102,48,48" name="evaluate document">
+ <handler class="org.jbpm.examples.decision.handler.ContentEvaluation"/>
<transition g="120,60:-37,22" name="good" to="submit document"/>
<transition g=":-19,-22" name="bad" to="try again"/>
<transition g="120,189:-33,-39" name="ugly" to="give up"/>
- </exclusive>
+ </decision>
<state g="175,35,122,52" name="submit document"/>
<state g="176,100,122,52" name="try again"/>
Copied: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionBinding.java (from rev 4541, jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveBinding.java)
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionBinding.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionBinding.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -0,0 +1,114 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.activity;
+
+import java.util.List;
+
+import org.jbpm.pvm.internal.model.ActivityImpl;
+import org.jbpm.pvm.internal.model.TransitionImpl;
+import org.jbpm.pvm.internal.util.XmlUtil;
+import org.jbpm.pvm.internal.wire.binding.ObjectBinding;
+import org.jbpm.pvm.internal.wire.descriptor.ExpressionDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.ReferenceDescriptor;
+import org.jbpm.pvm.internal.wire.xml.WireParser;
+import org.jbpm.pvm.internal.xml.Parse;
+import org.jbpm.pvm.internal.xml.Parser;
+import org.w3c.dom.Element;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DecisionBinding extends JpdlBinding {
+
+ static ObjectBinding objectBinding = new ObjectBinding();
+ static WireParser wireParser = WireParser.getInstance();
+
+ public DecisionBinding() {
+ super("decision");
+ }
+
+ public Object parse(Element element, Parse parse, Parser parser) {
+ if (element.hasAttribute("expr")) {
+ DecisionExpressionActivity decisionExpressionActivity = new DecisionExpressionActivity();
+ String expr = element.getAttribute("expr");
+ decisionExpressionActivity.setExpr(expr);
+ return decisionExpressionActivity;
+ }
+
+ if (element.hasAttribute("handler-ref")) {
+ String decisionHandlerName = element.getAttribute("handler-ref");
+ DecisionHandlerActivity decisionHandlerActivity = new DecisionHandlerActivity();
+ decisionHandlerActivity.setDecisionHandlerName(decisionHandlerName);
+ return decisionHandlerActivity;
+ }
+
+ Element handlerElement = XmlUtil.element(element, "handler");
+ if (handlerElement!=null) {
+ DecisionHandlerActivity decisionHandlerActivity = new DecisionHandlerActivity();
+ ObjectDescriptor decisionHandlerDescriptor = (ObjectDescriptor)
+ objectBinding.parse(handlerElement, parse, wireParser);
+ decisionHandlerActivity.setDecisionHandlerDescriptor(decisionHandlerDescriptor);
+ return decisionHandlerActivity;
+ }
+
+ boolean hasConditions = false;
+ List<Element> transitionElements = XmlUtil.elements(element, "transition");
+ ActivityImpl activity = parse.findObject(ActivityImpl.class);
+ List<TransitionImpl> transitions = (List) activity.getOutgoingTransitions();
+
+ for (int i=0; i<transitionElements.size(); i++) {
+ TransitionImpl transition = transitions.get(i);
+ Element transitionElement = transitionElements.get(i);
+
+ Element conditionElement = XmlUtil.element(transitionElement, "condition");
+ if (conditionElement!=null) {
+ hasConditions = true;
+
+ if (conditionElement.hasAttribute("expr")) {
+ String expr = conditionElement.getAttribute("expr");
+ String lang = XmlUtil.attribute(conditionElement, "expr-lang");
+ ExpressionDescriptor expressionDescriptor = new ExpressionDescriptor(expr, lang);
+ transition.setConditionDescriptor(expressionDescriptor);
+
+ } else if (conditionElement.hasAttribute("ref")) {
+ String expr = conditionElement.getAttribute("ref");
+ ReferenceDescriptor refDescriptor = new ReferenceDescriptor(expr);
+ transition.setConditionDescriptor(refDescriptor);
+
+ } else if (ObjectBinding.isObjectDescriptor(conditionElement)) {
+ ObjectDescriptor conditionDescriptor = (ObjectDescriptor) objectBinding.parse(conditionElement, parse, parser);
+ transition.setConditionDescriptor(conditionDescriptor);
+ }
+ }
+ }
+
+ if (hasConditions) {
+ return new DecisionConditionActivity();
+ } else {
+ parse.addProblem("decision '"+element.getAttribute("name")+"' must have one of: expr attribute, handler attribute, handler element or condition expressions");
+ }
+
+ return null;
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionBinding.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionBuilder.java (from rev 4541, jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveBuilder.java)
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionBuilder.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionBuilder.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.activity;
+
+import org.jbpm.pvm.internal.builder.ActivityBehaviourBuilder;
+import org.jbpm.pvm.internal.builder.ActivityBuilder;
+import org.jbpm.pvm.internal.builder.CompositeBuilder;
+import org.jbpm.pvm.internal.wire.Descriptor;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DecisionBuilder extends ActivityBehaviourBuilder {
+
+ public DecisionBuilder(ActivityBuilder activityBuilder) {
+ super(activityBuilder);
+ }
+
+ public DecisionBuilder handler(Descriptor descriptor) {
+ // TODO finish this
+ return null;
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionBuilder.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionConditionActivity.java (from rev 4541, jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveConditionActivity.java)
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionConditionActivity.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionConditionActivity.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.activity;
+
+import java.util.List;
+
+import org.jbpm.JbpmException;
+import org.jbpm.activity.ActivityExecution;
+import org.jbpm.model.Activity;
+import org.jbpm.model.Condition;
+import org.jbpm.model.Transition;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DecisionConditionActivity extends JpdlActivity {
+
+ private static final long serialVersionUID = 1L;
+
+ public void execute(ActivityExecution execution) {
+ Transition transition = findTransition(execution);
+ if (transition==null) {
+ throw new JbpmException("no outgoing transition condition evaluated to true for decision "+execution.getActivity());
+ }
+ if (transition.getName()!=null) {
+ execution.historyDecision(transition.getName());
+ }
+ execution.take(transition);
+ }
+
+ private Transition findTransition(ActivityExecution execution) {
+ Activity activity = execution.getActivity();
+ List<Transition> outgoingTransitions = activity.getOutgoingTransitions();
+ for (Transition transition : outgoingTransitions) {
+ Condition condition = transition.getCondition();
+ if ( (condition==null)
+ || (condition.evaluate(execution))
+ ) {
+ return transition;
+ }
+ }
+ return null;
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionConditionActivity.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionExpressionActivity.java (from rev 4541, jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveExpressionActivity.java)
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionExpressionActivity.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionExpressionActivity.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.activity;
+
+import org.jbpm.JbpmException;
+import org.jbpm.activity.ActivityExecution;
+import org.jbpm.model.Activity;
+import org.jbpm.model.Transition;
+import org.jbpm.pvm.internal.env.EnvironmentDefaults;
+import org.jbpm.pvm.internal.script.ScriptManager;
+
+/**
+ * @author Tom Baeyens
+ */
+public class DecisionExpressionActivity extends JpdlActivity {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String expr;
+ protected String lang;
+
+ public void execute(ActivityExecution execution) throws Exception {
+ Activity activity = execution.getActivity();
+ String transitionName = null;
+
+ ScriptManager scriptManager = EnvironmentDefaults.getScriptManager();
+ Object result = scriptManager.evaluateExpression(expr, execution, lang);
+ if ( (result!=null)
+ && (! (result instanceof String))
+ ) {
+ throw new JbpmException("expression '"+expr+"' in decision '"+activity.getName()+"' returned "+result.getClass().getName()+" instead of a transitionName (String): "+result);
+ }
+ transitionName = (String) result;
+
+ Transition transition = activity.getOutgoingTransition(transitionName);
+ if (transition==null) {
+ throw new JbpmException("expression '"+expr+"' in decision '"+activity.getName()+"' returned unexisting outgoing transition name: "+transitionName);
+ }
+
+ execution.historyDecision(transitionName);
+
+ execution.take(transition);
+ }
+
+ public void setExpr(String expr) {
+ this.expr = expr;
+ }
+ public void setLang(String lang) {
+ this.lang = lang;
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionExpressionActivity.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionHandlerActivity.java (from rev 4541, jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveHandlerActivity.java)
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionHandlerActivity.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionHandlerActivity.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -0,0 +1,80 @@
+/*
+ * 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.JbpmException;
+import org.jbpm.activity.ActivityExecution;
+import org.jbpm.env.Environment;
+import org.jbpm.jpdl.DecisionHandler;
+import org.jbpm.model.Activity;
+import org.jbpm.model.Transition;
+import org.jbpm.pvm.internal.wire.Descriptor;
+import org.jbpm.pvm.internal.wire.WireContext;
+
+/**
+ * @author Tom Baeyens
+ */
+public class DecisionHandlerActivity extends JpdlActivity {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String decisionHandlerName;
+ protected Descriptor decisionHandlerDescriptor;
+
+ public void execute(ActivityExecution execution) throws Exception {
+ Activity activity = execution.getActivity();
+ String transitionName = null;
+
+ Object object = null;
+ if (decisionHandlerDescriptor!=null) {
+ object = WireContext.create(decisionHandlerDescriptor);
+ } else if (decisionHandlerName!=null) {
+ Environment environment = Environment.getCurrent();
+ object = environment.get(decisionHandlerName);
+ }
+
+ if (object==null) {
+ throw new JbpmException("decision handler for "+activity+" is null");
+ }
+ if (! (object instanceof DecisionHandler)) {
+ throw new JbpmException("handler for decision is not a "+DecisionHandler.class.getName()+": "+object.getClass().getName());
+ }
+ DecisionHandler decisionHandler = (DecisionHandler) object;
+ transitionName = decisionHandler.decide(execution);
+
+ Transition transition = activity.getOutgoingTransition(transitionName);
+ if (transition==null) {
+ throw new JbpmException("handler in decision '"+activity.getName()+"' returned unexisting outgoing transition name: "+transitionName);
+ }
+
+ execution.historyDecision(transitionName);
+
+ execution.take(transition);
+ }
+
+ public void setDecisionHandlerName(String decisionHandlerName) {
+ this.decisionHandlerName = decisionHandlerName;
+ }
+ public void setDecisionHandlerDescriptor(Descriptor decisionHandlerDescriptor) {
+ this.decisionHandlerDescriptor = decisionHandlerDescriptor;
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionHandlerActivity.java
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveBinding.java 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveBinding.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,115 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.jpdl.internal.activity;
-
-import java.util.List;
-
-import org.jbpm.pvm.internal.model.ExpressionEvaluator;
-import org.jbpm.pvm.internal.model.ActivityImpl;
-import org.jbpm.pvm.internal.model.TransitionImpl;
-import org.jbpm.pvm.internal.util.XmlUtil;
-import org.jbpm.pvm.internal.wire.binding.ObjectBinding;
-import org.jbpm.pvm.internal.wire.descriptor.ExpressionDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ReferenceDescriptor;
-import org.jbpm.pvm.internal.wire.xml.WireParser;
-import org.jbpm.pvm.internal.xml.Parse;
-import org.jbpm.pvm.internal.xml.Parser;
-import org.w3c.dom.Element;
-
-
-/**
- * @author Tom Baeyens
- */
-public class ExclusiveBinding extends JpdlBinding {
-
- static ObjectBinding objectBinding = new ObjectBinding();
- static WireParser wireParser = WireParser.getInstance();
-
- public ExclusiveBinding() {
- super("exclusive");
- }
-
- public Object parse(Element element, Parse parse, Parser parser) {
- if (element.hasAttribute("expr")) {
- ExclusiveExpressionActivity exclusiveExpressionActivity = new ExclusiveExpressionActivity();
- String expr = element.getAttribute("expr");
- exclusiveExpressionActivity.setExpr(expr);
- return exclusiveExpressionActivity;
- }
-
- if (element.hasAttribute("handler-ref")) {
- String exclusiveHandlerName = element.getAttribute("handler-ref");
- ExclusiveHandlerActivity exclusiveHandlerActivity = new ExclusiveHandlerActivity();
- exclusiveHandlerActivity.setExclusiveHandlerName(exclusiveHandlerName);
- return exclusiveHandlerActivity;
- }
-
- Element handlerElement = XmlUtil.element(element, "handler");
- if (handlerElement!=null) {
- ExclusiveHandlerActivity exclusiveHandlerActivity = new ExclusiveHandlerActivity();
- ObjectDescriptor exclusiveHandlerDescriptor = (ObjectDescriptor)
- objectBinding.parse(handlerElement, parse, wireParser);
- exclusiveHandlerActivity.setExclusiveHandlerDescriptor(exclusiveHandlerDescriptor);
- return exclusiveHandlerActivity;
- }
-
- boolean hasConditions = false;
- List<Element> transitionElements = XmlUtil.elements(element, "transition");
- ActivityImpl activity = parse.findObject(ActivityImpl.class);
- List<TransitionImpl> transitions = (List) activity.getOutgoingTransitions();
-
- for (int i=0; i<transitionElements.size(); i++) {
- TransitionImpl transition = transitions.get(i);
- Element transitionElement = transitionElements.get(i);
-
- Element conditionElement = XmlUtil.element(transitionElement, "condition");
- if (conditionElement!=null) {
- hasConditions = true;
-
- if (conditionElement.hasAttribute("expr")) {
- String expr = conditionElement.getAttribute("expr");
- String lang = XmlUtil.attribute(conditionElement, "expr-lang");
- ExpressionDescriptor expressionDescriptor = new ExpressionDescriptor(expr, lang);
- transition.setConditionDescriptor(expressionDescriptor);
-
- } else if (conditionElement.hasAttribute("ref")) {
- String expr = conditionElement.getAttribute("ref");
- ReferenceDescriptor refDescriptor = new ReferenceDescriptor(expr);
- transition.setConditionDescriptor(refDescriptor);
-
- } else if (ObjectBinding.isObjectDescriptor(conditionElement)) {
- ObjectDescriptor conditionDescriptor = (ObjectDescriptor) objectBinding.parse(conditionElement, parse, parser);
- transition.setConditionDescriptor(conditionDescriptor);
- }
- }
- }
-
- if (hasConditions) {
- return new ExclusiveConditionActivity();
- } else {
- parse.addProblem("exclusive '"+element.getAttribute("name")+"' must have one of: expr attribute, handler attribute, handler element or condition expressions");
- }
-
- return null;
- }
-}
Deleted: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveBuilder.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveBuilder.java 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveBuilder.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.jpdl.internal.activity;
-
-import org.jbpm.pvm.internal.builder.ActivityBehaviourBuilder;
-import org.jbpm.pvm.internal.builder.ActivityBuilder;
-import org.jbpm.pvm.internal.builder.CompositeBuilder;
-import org.jbpm.pvm.internal.wire.Descriptor;
-
-
-/**
- * @author Tom Baeyens
- */
-public class ExclusiveBuilder extends ActivityBehaviourBuilder {
-
- public ExclusiveBuilder(ActivityBuilder activityBuilder) {
- super(activityBuilder);
- }
-
- public ExclusiveBuilder handler(Descriptor descriptor) {
- // TODO finish this
- return null;
- }
-}
Deleted: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveConditionActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveConditionActivity.java 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveConditionActivity.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,64 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.jpdl.internal.activity;
-
-import java.util.List;
-
-import org.jbpm.JbpmException;
-import org.jbpm.activity.ActivityExecution;
-import org.jbpm.model.Activity;
-import org.jbpm.model.Condition;
-import org.jbpm.model.Transition;
-
-
-/**
- * @author Tom Baeyens
- */
-public class ExclusiveConditionActivity extends JpdlActivity {
-
- private static final long serialVersionUID = 1L;
-
- public void execute(ActivityExecution execution) {
- Transition transition = findTransition(execution);
- if (transition==null) {
- throw new JbpmException("no outgoing transition condition evaluated to true for exclusive "+execution.getActivity());
- }
- if (transition.getName()!=null) {
- execution.historyExclusive(transition.getName());
- }
- execution.take(transition);
- }
-
- private Transition findTransition(ActivityExecution execution) {
- Activity activity = execution.getActivity();
- List<Transition> outgoingTransitions = activity.getOutgoingTransitions();
- for (Transition transition : outgoingTransitions) {
- Condition condition = transition.getCondition();
- if ( (condition==null)
- || (condition.evaluate(execution))
- ) {
- return transition;
- }
- }
- return null;
- }
-}
Deleted: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveExpressionActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveExpressionActivity.java 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveExpressionActivity.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,70 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.jpdl.internal.activity;
-
-import org.jbpm.JbpmException;
-import org.jbpm.activity.ActivityExecution;
-import org.jbpm.model.Activity;
-import org.jbpm.model.Transition;
-import org.jbpm.pvm.internal.env.EnvironmentDefaults;
-import org.jbpm.pvm.internal.script.ScriptManager;
-
-/**
- * @author Tom Baeyens
- */
-public class ExclusiveExpressionActivity extends JpdlActivity {
-
- private static final long serialVersionUID = 1L;
-
- protected String expr;
- protected String lang;
-
- public void execute(ActivityExecution execution) throws Exception {
- Activity activity = execution.getActivity();
- String transitionName = null;
-
- ScriptManager scriptManager = EnvironmentDefaults.getScriptManager();
- Object result = scriptManager.evaluateExpression(expr, execution, lang);
- if ( (result!=null)
- && (! (result instanceof String))
- ) {
- throw new JbpmException("expression '"+expr+"' in exclusive '"+activity.getName()+"' returned "+result.getClass().getName()+" instead of a transitionName (String): "+result);
- }
- transitionName = (String) result;
-
- Transition transition = activity.getOutgoingTransition(transitionName);
- if (transition==null) {
- throw new JbpmException("expression '"+expr+"' in exclusive '"+activity.getName()+"' returned unexisting outgoing transition name: "+transitionName);
- }
-
- execution.historyExclusive(transitionName);
-
- execution.take(transition);
- }
-
- public void setExpr(String expr) {
- this.expr = expr;
- }
- public void setLang(String lang) {
- this.lang = lang;
- }
-}
Deleted: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveHandlerActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveHandlerActivity.java 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExclusiveHandlerActivity.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,80 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.jpdl.internal.activity;
-
-import org.jbpm.JbpmException;
-import org.jbpm.activity.ActivityExecution;
-import org.jbpm.env.Environment;
-import org.jbpm.jpdl.ExclusiveHandler;
-import org.jbpm.model.Activity;
-import org.jbpm.model.Transition;
-import org.jbpm.pvm.internal.wire.Descriptor;
-import org.jbpm.pvm.internal.wire.WireContext;
-
-/**
- * @author Tom Baeyens
- */
-public class ExclusiveHandlerActivity extends JpdlActivity {
-
- private static final long serialVersionUID = 1L;
-
- protected String exclusiveHandlerName;
- protected Descriptor exclusiveHandlerDescriptor;
-
- public void execute(ActivityExecution execution) throws Exception {
- Activity activity = execution.getActivity();
- String transitionName = null;
-
- Object object = null;
- if (exclusiveHandlerDescriptor!=null) {
- object = WireContext.create(exclusiveHandlerDescriptor);
- } else if (exclusiveHandlerName!=null) {
- Environment environment = Environment.getCurrent();
- object = environment.get(exclusiveHandlerName);
- }
-
- if (object==null) {
- throw new JbpmException("exclusive handler for "+activity+" is null");
- }
- if (! (object instanceof ExclusiveHandler)) {
- throw new JbpmException("handler for exclusive is not a "+ExclusiveHandler.class.getName()+": "+object.getClass().getName());
- }
- ExclusiveHandler exclusiveHandler = (ExclusiveHandler) object;
- transitionName = exclusiveHandler.select(execution);
-
- Transition transition = activity.getOutgoingTransition(transitionName);
- if (transition==null) {
- throw new JbpmException("handler in exclusive '"+activity.getName()+"' returned unexisting outgoing transition name: "+transitionName);
- }
-
- execution.historyExclusive(transitionName);
-
- execution.take(transition);
- }
-
- public void setExclusiveHandlerName(String exclusiveHandlerName) {
- this.exclusiveHandlerName = exclusiveHandlerName;
- }
- public void setExclusiveHandlerDescriptor(Descriptor exclusiveHandlerDescriptor) {
- this.exclusiveHandlerDescriptor = exclusiveHandlerDescriptor;
- }
-}
Deleted: jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.cache.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.cache.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.cache.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,39 +0,0 @@
-<hibernate-cache>
-
- <class-cache class="org.jbpm.pvm.internal.model.ProcessDefinitionImpl" />
- <class-cache class="org.jbpm.pvm.internal.model.ActivityImpl" />
- <class-cache class="org.jbpm.pvm.internal.model.TransitionImpl" />
- <class-cache class="org.jbpm.pvm.internal.model.EventImpl" />
- <class-cache class="org.jbpm.pvm.internal.model.ExceptionHandlerImpl" />
- <class-cache class="org.jbpm.pvm.internal.model.ObjectReference" />
- <class-cache class="org.jbpm.pvm.internal.model.VariableDefinitionImpl" />
- <class-cache class="org.jbpm.pvm.internal.model.TimerDefinitionImpl" />
- <class-cache class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" />
-
- <collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.exceptionHandlers" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.events" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.activities" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.variableDefinitions" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.timerDefinitions" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.attachments" />
-
- <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.exceptionHandlers" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.events" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.activities" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.variableDefinitions" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.timerDefinitions" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.incomingTransitions" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.outgoingTransitions" />
-
- <collection-cache collection="org.jbpm.pvm.internal.model.TransitionImpl.exceptionHandlers" />
- <collection-cache collection="org.jbpm.pvm.internal.model.TransitionImpl.events" />
-
- <collection-cache collection="org.jbpm.pvm.internal.model.EventImpl.exceptionHandlers" />
- <collection-cache collection="org.jbpm.pvm.internal.model.EventImpl.listenerReferences" />
-
- <collection-cache collection="org.jbpm.pvm.internal.model.ExceptionHandlerImpl.eventListenerReferences" />
-
- <collection-cache collection="org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor.argDescriptors" />
- <collection-cache collection="org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor.operations" />
-
-</hibernate-cache>
Deleted: jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.definition.hbm.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.definition.hbm.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.definition.hbm.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,646 +0,0 @@
-<?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 package="org.jbpm.pvm.internal.model" default-access="field">
-
- <!-- ### PROCESS DEFINITION ############################################# -->
- <class name="ProcessDefinitionImpl"
- table="JBPM_PROCESS"
- discriminator-value="pvm">
- <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <discriminator><column name="CLASS_" /></discriminator>
-
- <version name="dbversion" column="DBVERSION_" />
- <many-to-one name="properties"
- class="WireProperties"
- column="PROPS_"
- foreign-key="FK_PROCDEF_PROPS"
- index="IDX_PROCDEF_PROPS"
- cascade="all" />
- <list name="exceptionHandlers" cascade="all">
- <key foreign-key="FK_EXHDLR_PROCESS">
- <column name="PROCESS_" index="IDX_EXHDLR_PROCESS"/>
- </key>
- <index column="PROCESS_IDX_" />
- <one-to-many class="ExceptionHandlerImpl"/>
- </list>
-
- <!-- ObservableElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <property name="name" column="NAME_" />
- <property name="description" column="DESCR_" />
- <map name="events" cascade="all-delete-orphan">
- <key foreign-key="FK_EVENT_PROCESS">
- <column name="PROCESS_" index="IDX_EVENT_PROCESS" />
- </key>
- <map-key type="string" column="NAME_" />
- <one-to-many class="org.jbpm.pvm.internal.model.EventImpl"/>
- </map>
-
- <!-- CompositeElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <list name="activities" cascade="all" inverse="false">
- <key foreign-key="FK_ACTS_PROCESS">
- <column name="ACTSPROCESS_" index="IDX_ACTS_PROCESS"/>
- </key>
- <list-index column="ACTSPROCESS_IDX_" />
- <one-to-many class="ActivityImpl" />
- </list>
- <property name="hasVariableDefinitions" column="HAS_VAR_DEF_" />
- <list name="variableDefinitions" cascade="all">
- <key foreign-key="FK_VARDEF_PROCESS">
- <column name="PROCESS_" index="IDX_VARDEF_PROCESS"/>
- </key>
- <index column="PROCESS_IDX_" />
- <one-to-many class="VariableDefinitionImpl" />
- </list>
- <property name="hasTimerDefinitions" column="HAS_TIMER_DEF_" />
- <set name="timerDefinitions" cascade="all">
- <key foreign-key="FK_TMRDEF_PROCESS">
- <column name="PROCESS_" index="IDX_TMRDEF_PROCESS"/>
- </key>
- <one-to-many class="TimerDefinitionImpl" />
- </set>
-
- <!-- ProcessDefinitionImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <property name="key" column="KEY_" />
- <property name="id" column="ID_" unique="true" />
-
- <property name="packageName" column="PACKAGE_" />
- <property name="version" column="VERSION_" />
- <property name="deploymentTime" column="DEPLOYED_" />
- <many-to-one name="initial"
- column="INITIAL_"
- class="ActivityImpl"
- cascade="all"
- foreign-key="FK_PROCDEF_INITIAL"
- index="IDX_PROCDEF_INIT"
- fetch="select" />
-
- <map name="attachments" cascade="all-delete-orphan">
- <key foreign-key="FK_LOB_PROCESS">
- <column name="PROCESS_" index="IDX_LOB_PROCESS" />
- </key>
- <map-key type="string" column="NAME_" />
- <one-to-many class="org.jbpm.pvm.internal.lob.Lob"/>
- </map>
- </class>
-
- <!-- ### Activity ############################################################## -->
- <class name="ActivityImpl" table="JBPM_ACTIVITY">
- <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <many-to-one name="processDefinition"
- class="ProcessDefinitionImpl"
- column="PROCESS_"
- foreign-key="FK_ACT_PROCESS"
- index="IDX_ACT_PROCESS" />
- <many-to-one name="properties"
- class="WireProperties"
- column="PROPS_"
- foreign-key="FK_ACT_PROPS"
- index="IDX_ACT_PROPS"
- cascade="all" />
- <list name="exceptionHandlers" cascade="all">
- <key foreign-key="FK_EXHDLR_ACT">
- <column name="ACT_" index="IDX_EXHDLR_ACT"/>
- </key>
- <index column="ACT_IDX_" />
- <one-to-many class="ExceptionHandlerImpl" />
- </list>
-
- <!-- ObservableElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <property name="name" column="NAME_"/>
- <property name="description" column="DESCR_"/>
- <map name="events" cascade="all-delete-orphan">
- <key foreign-key="FK_EVENT_ACT">
- <column name="ACT_" index="IDX_EVENT_ACT" />
- </key>
- <map-key type="string" column="NAME_" />
- <one-to-many class="org.jbpm.pvm.internal.model.EventImpl" />
- </map>
-
- <!-- CompositeElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <list name="activities" cascade="all" inverse="false">
- <key column="PARENT_" foreign-key="none" />
- <list-index column="PARENT_IDX_" />
- <one-to-many class="ActivityImpl" />
- </list>
- <property name="hasVariableDefinitions" column="HAS_VAR_DEF_" />
- <list name="variableDefinitions" cascade="all">
- <key foreign-key="FK_VARDEF_ACT">
- <column name="ACT_" index="IDX_VARDEF_ACT"/>
- </key>
- <index column="ACT_IDX_" />
- <one-to-many class="VariableDefinitionImpl" />
- </list>
- <property name="hasTimerDefinitions" column="HAS_TIMER_DEF_" />
- <set name="timerDefinitions" cascade="all">
- <key foreign-key="FK_TMRDEF_ACT">
- <column name="ACT_" index="IDX_TMRDEF_ACT"/>
- </key>
- <one-to-many class="TimerDefinitionImpl" />
- </set>
-
- <!-- ActivityImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <property name="type" column="TYPE_" />
- <property name="isLocalScope" column="LOCAL_SCOPE_" />
- <property name="isExecutionAsync" column="EXEC_ASYNC_" />
- <property name="isSignalAsync" column="SIGNAL_ASYNC_" />
- <property name="isPreviousNeeded" column="PREV_NEEDED_" />
-
- <many-to-one name="parentActivity"
- column="PARENT_"
- class="ActivityImpl"
- cascade="all"
- foreign-key="FK_ACT_PARENT"
- index="IDX_ACT_PARENT" />
-
- <many-to-one name="defaultTransition"
- column="DEFTRANS_"
- class="TransitionImpl"
- fetch="select"
- foreign-key="FK_ACT_DEFTRANS"
- index="IDX_ACT_DEFTRANS" />
-
- <list name="incomingTransitions" inverse="false">
- <key column="DESTINATION_" />
- <index column="IN_IDX_" />
- <one-to-many class="TransitionImpl" />
- </list>
-
- <list name="outgoingTransitions" inverse="false" cascade="all">
- <key column="SOURCE_" />
- <index column="OUT_IDX_" />
- <one-to-many class="TransitionImpl" />
- </list>
-
- <component name="behaviourReference" class="ObjectReference">
- <many-to-one name="descriptor"
- column="BEHAV_DESCR_"
- cascade="all"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_NODE_BEHAV_DESCR"
- index="IDX_NODE_BEHAV_DESCR" />
- <any name="object" id-type="long" cascade="all">
- <!-- TODO: Specify names for classes -->
- <!-- <meta-value value="bpel::activity" class="org.jbpm.pvm.bpel.BpelActivity"/> -->
- <column name="BEHAV_CLASS_" />
- <column name="BEHAV_ID_" />
- </any>
- </component>
- </class>
-
- <!-- ### TRANSITION ##################################################### -->
- <class name="TransitionImpl" table="JBPM_TRANSITION">
- <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <many-to-one name="processDefinition"
- class="ProcessDefinitionImpl"
- column="PROCESS_"
- foreign-key="FK_TRANS_PROCDEF"
- index="IDX_TRANS_PROCDEF" />
- <many-to-one name="properties"
- class="WireProperties"
- column="PROPS_"
- foreign-key="FK_TRANS_PROPS"
- index="IDX_TRANS_PROPS"
- cascade="all" />
- <list name="exceptionHandlers" cascade="all">
- <key foreign-key="FK_EXHDLR_TRANS">
- <column name="TRANSITION_" index="IDX_EXHDLR_TRANS" />
- </key>
- <index column="TRANSITION_IDX_" />
- <one-to-many class="ExceptionHandlerImpl" />
- </list>
-
- <!-- ObservableElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <property name="name" column="NAME_" />
- <property name="description" column="DESCR_" />
- <map name="events" cascade="all-delete-orphan">
- <key foreign-key="FK_EVENT_TRANS">
- <column name="TRANSITION_" index="IDX_EVENT_TRANS" />
- </key>
- <map-key type="string" column="NAME_" />
- <one-to-many class="org.jbpm.pvm.internal.model.EventImpl" />
- </map>
-
- <!-- TransitionImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <many-to-one name="source"
- column="SRC_"
- class="ActivityImpl"
- fetch="select"
- foreign-key="FK_TRANS_SRC"
- index="IDX_TRANS_SRC" />
-
- <many-to-one name="destination"
- column="DEST_"
- class="ActivityImpl"
- fetch="select"
- cascade="all"
- foreign-key="FK_TRANS_DST"
- index="IDX_TRANS_DST" />
-
- <many-to-one name="conditionDescriptor"
- column="COND_DESCR_"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- cascade="all"
- foreign-key="FK_TRANS_COND"
- index="IDX_TRANS_COND" />
-
- <!--
- <many-to-one name="waitConditionDescriptor"
- column="WAIT_DESCR_"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- cascade="all"
- foreign-key="FK_TRANS_WAIT_DESCR"
- index="IDX_TRANS_WAIT_DESCR" />
- -->
-
- <property name="isTakeAsync" column="TAKEASYNC_" />
- </class>
-
- <!-- ### EVENT ########################################################## -->
- <class name="EventImpl" table="JBPM_EVENT">
- <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <many-to-one name="processDefinition"
- class="ProcessDefinitionImpl"
- column="PROCESSDEF_"
- foreign-key="FK_EVENT_PROCDEF"
- index="IDX_EVENT_PROCDEF" />
- <many-to-one name="properties"
- class="WireProperties"
- column="PROPS_"
- foreign-key="FK_EVENT_PROPS"
- index="IDX_EVENT_PROPS"
- cascade="all" />
- <list name="exceptionHandlers" cascade="all">
- <key foreign-key="FK_EXHDLR_EVENT">
- <column name="EVENT_" index="IDX_EXHDLR_EVENT"/>
- </key>
- <index column="EVENT_IDX_" />
- <one-to-many class="ExceptionHandlerImpl" />
- </list>
-
- <!-- EventImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <property name="name" column="NAME_" />
- <list name="listenerReferences" table="JBPM_OBJECTREFERENCES" cascade="all-delete-orphan">
- <key foreign-key="FK_OBJECTREF_EVENT">
- <column name="EVENT_" index="IDX_OBJREF_EVENT"/>
- </key>
- <list-index column="EVENT_IDX_" />
- <one-to-many class="EventListenerReference" />
- </list>
- </class>
-
- <!-- ### EXCEPTION HANDLER ############################################## -->
- <class name="ExceptionHandlerImpl" table="JBPM_EXCEPTHNDLR">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <property name="exceptionClassName" column="EXCEPT_CLASS_" />
- <property name="isTransactional" column="TRANSACT_" />
- <property name="isRethrowMasked" column="RETHROW_MASKED_"/>
- <property name="transitionName" column="TRANSITIONNAME_" />
- <property name="activityName" column="NODENAME_" />
- <list name="eventListenerReferences"
- inverse="false"
- cascade="all-delete-orphan"
- table="JBPM_OBJECTREFERENCES">
- <key foreign-key="FK_OBJREF_EXHNDLR" not-null="false">
- <column name="EXHNDLR_" index="IDX_OBJREF_EXHNDLR" />
- </key>
- <list-index column="EXHNDLR_IDX_" />
- <one-to-many class="ObjectReference" />
- </list>
- </class>
-
- <!-- ### OBJECT REFERENCE ############################################### -->
- <class name="ObjectReference" discriminator-value="objref" table="JBPM_OBJECTREF">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <discriminator column="CLASS_" />
- <version name="dbversion" column="DBVERSION_" />
- <many-to-one name="descriptor"
- column="OBJ_DESCR_"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- cascade="all"
- foreign-key="FK_OBJREF_EVENT"
- index="IDX_OBJREF_EVENT"/>
- <any name="object" id-type="long" cascade="all">
- <!-- TODO: Specify names for classes -->
- <column name="OBJ_CLASS_" />
- <column name="OBJ_ID_" />
- </any>
- <property name="expression" column="OBJ_EXPRESSION_"/>
- <property name="expressionLanguage" column="OBJ_EXPRLANG_"/>
-
- <subclass name="EventListenerReference" discriminator-value="evtlis">
- <property name="isPropagationEnabled" column="PROPAGATE_" />
- </subclass>
-
- </class>
-
- <!-- ### VARIABLE DEFINITION ############################################ -->
- <class name="VariableDefinitionImpl" table="JBPM_VARIABLEDEF">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <property name="name" column="NAME_"/>
- <property name="typeName" column="TYPE_"/>
-
- <property name="inVariableName" column="INVAR_" />
- <property name="inExpression" column="INEXPR_" />
- <many-to-one name="inDescriptor"
- column="INDESCR_"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- cascade="all"
- foreign-key="FK_VARDEF_INDES"
- index="IDX_VARDEF_INDES"/>
- <property name="outVariableName" column="OUTVAR_" />
- <property name="outExpression" column="OUTEXPR_" />
- </class>
-
- <!-- ### TIMER DEFINITION ############################################### -->
- <class name="TimerDefinitionImpl" table="JBPM_TIMERDEF">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <property name="dueDateDescription" column="DUEDATEDESCR_"/>
- <property name="repeat" column="REPEAT_"/>
- <property name="isExclusive" column="ISEXCL_"/>
- <property name="retries" column="RETRIES_"/>
- <property name="eventName" column="EVENT_"/>
- <property name="signalName" column="SIGNAL_"/>
- <property name="dueDate" column="DUEDATE_" type="timestamp"/>
- </class>
-
- <!-- ### DESCRIPTORS #################################################### -->
- <class name="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" table="JBPM_DESCRIPTOR" abstract="true"
- discriminator-value="abstract">
- <!--
- byte : ByteDescriptor
- string : StringDescriptor
- char : CharacterDescriptor
- class : ClassDescriptor
- double : DoubleDescriptor
- expr : ExpressionDescriptor
- float : FloatDescriptor
- long : LongDescriptor
- int : IntegerDescriptor
- short : ShortDescriptor
- coll : CollectionDescriptor
- map : MapDescriptor
- list : ListDescriptor
- set : SetDescriptor
- object : ObjectDescriptor
- ref : ReferenceDescriptor
- null : NullDescriptor
- true : TrueDescriptor
- false : FalseDescriptor
- provided : ProvidedObjectDescriptor
- -->
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <discriminator column="CLASS_" />
- <version name="dbversion" column="DBVERSION_" />
-
- <property name="name" column="NAME_" />
- <property name="init" column="INIT_" />
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.NullDescriptor" discriminator-value="null_" />
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.TrueDescriptor" discriminator-value="true" />
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.FalseDescriptor" discriminator-value="false" />
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.StringDescriptor" discriminator-value="string">
- <property name="text" column="TEXT_" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.CharacterDescriptor" discriminator-value="char">
- <property name="text" column="TEXT_" />
- </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ClassDescriptor" discriminator-value="class">
- <property name="text" column="TEXT_" />
- </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ReferenceDescriptor" discriminator-value="ref">
- <property name="text" column="TEXT_" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.DoubleDescriptor" discriminator-value="double">
- <property name="doubleVal" column="DOUBLEVAL_" />
- </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.FloatDescriptor" discriminator-value="float">
- <property name="doubleVal" column="DOUBLEVAL_" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.LongDescriptor" discriminator-value="long">
- <property name="longVal" column="LONGVAL_" />
- </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.IntegerDescriptor" discriminator-value="int">
- <property name="longVal" column="LONGVAL_" />
- </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ShortDescriptor" discriminator-value="short">
- <property name="longVal" column="LONGVAL_" />
- </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ByteDescriptor" discriminator-value="byte">
- <property name="longVal" column="LONGVAL_" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.CollectionDescriptor" discriminator-value="coll">
- <property name="className" column="CLASSNAME_" />
- <list name="valueDescriptors" cascade="all-delete-orphan">
- <key foreign-key="FK_DESCR_VALDESCR">
- <column name="VALUEDESCR_" index="IDX_DESCR_VALDESCR" />
- </key>
- <list-index column="VALUEDESCR_IDX_" />
- <one-to-many class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" />
- </list>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.MapDescriptor" discriminator-value="map">
- <list name="keyDescriptors" cascade="all-delete-orphan">
- <key column="KEYDESCR_" foreign-key="FK_DESCR_KEYDESCR" />
- <list-index column="KEYDESCR_IDX_" />
- <one-to-many class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" />
- </list>
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ListDescriptor" discriminator-value="list" />
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.SetDescriptor" discriminator-value="set" />
- </subclass>
-
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor" discriminator-value="object">
- <property name="className" column="TEXT_" />
- <property name="methodName" column="METHOD_" />
- <property name="isAutoWireEnabled" column="BOOLVAL_" />
- <property name="factoryObjectName" column="FACTORYNAME_" />
-
- <many-to-one name="factoryDescriptor" class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" column="FACTORYDESCR_"
- foreign-key="FK_DESCR_ARG_REF" index="IDX_DESCR_ARG_REF" cascade="all" />
-
- <list name="argDescriptors" cascade="all-delete-orphan">
- <key foreign-key="FK_OBJARG_DESCR">
- <column name="OBJARG_DESCR_" index="IDX_OBJARG_DESCR" />
- </key>
- <list-index column="OBJARG_DESCR_IDX_" />
- <one-to-many class="org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor" />
- </list>
-
- <list name="operations" cascade="all-delete-orphan">
- <key foreign-key="FK_OBJOPER_DESCR">
- <column name="OBJOPER_DESCR_" index="IDX_OBJOPER_DESCR" />
- </key>
- <list-index column="OBJOPER_DESCR_IDX_" />
- <one-to-many class="org.jbpm.pvm.internal.wire.operation.AbstractOperation" />
- </list>
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ExpressionDescriptor" discriminator-value="expr">
- <property name="expr" column="TEXT_" />
- <property name="lang" column="METHOD_" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ProvidedObjectDescriptor" discriminator-value="provided">
- <any name="providedObject" id-type="long" cascade="all">
- <column name="TEXT_" />
- <column name="LONGVAL_" />
- </any>
- <property name="exposeType" column="BOOLVAL_" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.EnvDescriptor" discriminator-value="env">
- <property name="objectName" column="TEXT_" />
- <property name="typeName" column="CLASSNAME_" />
- </subclass>
-
- </class>
-
- <!-- ### OPERATIONS ##################################################### -->
- <class name="org.jbpm.pvm.internal.wire.operation.AbstractOperation" abstract="true"
- table="JBPM_OPERATION" discriminator-value="oper">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <discriminator column="CLASS_" />
- <version name="dbversion" column="DBVERSION_" />
-
- <subclass name="org.jbpm.pvm.internal.wire.operation.FieldOperation"
- discriminator-value="field">
- <property name="fieldName" column="TEXT_" />
- <many-to-one name="descriptor" column="DESCR_" cascade="all"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_OPER_DESC" index="IDX_OPER_DESC" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.operation.PropertyOperation"
- discriminator-value="prop">
- <property name="setterName" column="TEXT_" />
- <many-to-one name="descriptor" column="DESCR_" cascade="all"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.operation.InvokeOperation"
- discriminator-value="invoke">
- <property name="methodName" column="TEXT_" />
- <list name="argDescriptors" cascade="all-delete-orphan">
- <key foreign-key="FK_ARGDSCR_OPER">
- <column name="OPER_" index="IDX_ARGDSCR_OPER" />
- </key>
- <list-index column="OPER_IDX_" />
- <one-to-many class="org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor" />
- </list>
- </subclass>
- </class>
-
- <!-- ### ARG DESCRIPTOR ################################################# -->
- <class name="org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor" table="JBPM_ARGDESCRIPTOR">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <property name="typeName" column="TYPENAME_" />
- <many-to-one name="descriptor" column="DESCRIPTOR_"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_ARGDESCR_DESCR" index="IDX_ARGDESCR_DESCR" cascade="all" />
- </class>
-
- <!-- ### PROPERTIES ##################################################### -->
- <class name="org.jbpm.pvm.internal.model.WireProperties" table="JBPM_WIREPROPS">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <component name="wireContext" class="org.jbpm.pvm.internal.wire.WireContext">
- <component name="wireDefinition" class="org.jbpm.pvm.internal.wire.WireDefinition">
- <map name="descriptors" cascade="all-delete-orphan" lazy="false">
- <key foreign-key="FK_DESCR_PROPS">
- <column name="PROPS_" index="IDX_DESCR_PROPS" />
- </key>
- <map-key type="string" column="NAME_" />
- <one-to-many class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" />
- </map>
- </component>
- </component>
- </class>
-
-
- <!-- ### QUERIES ######################################################## -->
-
- <query name="findProcessDefinitionKeys">
- <![CDATA[
- select distinct process.key
- from org.jbpm.pvm.internal.model.ProcessDefinitionImpl as process
- order by process.key asc
- ]]>
- </query>
-
- <query name="findProcessDefinitionsByKey">
- <![CDATA[
- select process
- from org.jbpm.pvm.internal.model.ProcessDefinitionImpl as process
- where process.key = :key
- order by process.version desc
- ]]>
- </query>
-
- <query name="findProcessDefinitionById">
- <![CDATA[
- select process
- from org.jbpm.pvm.internal.model.ProcessDefinitionImpl as process
- where process.id = :id
- ]]>
- </query>
-
- <query name="findProcessDefinitionKeysByName">
- <![CDATA[
- select process.key
- from org.jbpm.pvm.internal.model.ProcessDefinitionImpl as process
- where process.name = :name
- ]]>
- </query>
-
- <query name="findProcessDefinitionNamesByKey">
- <![CDATA[
- select process.name
- from org.jbpm.pvm.internal.model.ProcessDefinitionImpl as process
- where process.key = :key
- ]]>
- </query>
-
-</hibernate-mapping>
\ No newline at end of file
Modified: jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.history.hbm.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.history.hbm.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.history.hbm.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -63,7 +63,7 @@
<property name="transitionName" column="TRANSITION_" />
<subclass name="HistoryAutomaticInstanceImpl" discriminator-value="AUT">
- <subclass name="HistoryExclusiveInstanceImpl" discriminator-value="EXCL" />
+ <subclass name="HistoryDecisionInstanceImpl" discriminator-value="EXCL" />
</subclass>
<subclass name="HistoryTaskInstanceImpl" discriminator-value="TASK">
Modified: jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.jpdl.activities.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.jpdl.activities.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.jpdl.activities.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,7 +1,7 @@
<activities>
<activity binding="org.jbpm.jpdl.internal.activity.StartBinding" />
<activity binding="org.jbpm.jpdl.internal.activity.StateBinding" />
- <activity binding="org.jbpm.jpdl.internal.activity.ExclusiveBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.DecisionBinding" />
<activity binding="org.jbpm.jpdl.internal.activity.EndBinding" />
<activity binding="org.jbpm.jpdl.internal.activity.EndCancelBinding" />
<activity binding="org.jbpm.jpdl.internal.activity.EndErrorBinding" />
Modified: jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.jpdl.hbm.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.jpdl.hbm.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.jpdl.hbm.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -44,14 +44,14 @@
</id>
<discriminator column="CLASS_" />
<subclass name="org.jbpm.jpdl.internal.activity.StartActivity" discriminator-value="start" />
- <subclass name="org.jbpm.jpdl.internal.activity.ExclusiveConditionActivity" discriminator-value="excl-cond" />
- <subclass name="org.jbpm.jpdl.internal.activity.ExclusiveExpressionActivity" discriminator-value="excl-expr">
+ <subclass name="org.jbpm.jpdl.internal.activity.DecisionConditionActivity" discriminator-value="excl-cond" />
+ <subclass name="org.jbpm.jpdl.internal.activity.DecisionExpressionActivity" discriminator-value="excl-expr">
<property name="expr" column="TEXT_" />
<property name="lang" column="TEXT2_" />
</subclass>
- <subclass name="org.jbpm.jpdl.internal.activity.ExclusiveHandlerActivity" discriminator-value="excl-handler">
- <property name="exclusiveHandlerName" column="TEXT_" />
- <many-to-one name="exclusiveHandlerDescriptor"
+ <subclass name="org.jbpm.jpdl.internal.activity.DecisionHandlerActivity" discriminator-value="excl-handler">
+ <property name="decisionHandlerName" column="TEXT_" />
+ <many-to-one name="decisionHandlerDescriptor"
column="EXCLDESCR_"
cascade="all"
class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/TimerBuilder.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/TimerBuilder.java 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/TimerBuilder.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -67,7 +67,7 @@
return this;
}
- public TimerBuilder exclusive() {
+ public TimerBuilder decision() {
timerDefinition.setExclusive(true);
return this;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -58,7 +58,7 @@
}
JobImpl<?> job = (JobImpl<?>) session.get(JobImpl.class, jobDbid);
- // in case of exclusive jobs, the job might have been deleted
+ // in case of decision jobs, the job might have been deleted
// before we execute it (they are in a list)
if (job != null) {
try {
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/DecisionEnd.java (from rev 4541, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ExclusiveEnd.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/DecisionEnd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/DecisionEnd.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.events;
+
+import org.jbpm.history.HistoryProcessInstance;
+import org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl;
+import org.jbpm.pvm.internal.history.model.HistoryDecisionInstanceImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DecisionEnd extends AutomaticEnd {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String transitionName;
+
+ public DecisionEnd(String transitionName) {
+ this.transitionName = transitionName;
+ }
+
+ protected HistoryActivityInstanceImpl createHistoryActivityInstance(HistoryProcessInstance historyProcessInstanceImpl) {
+ return new HistoryDecisionInstanceImpl(historyProcessInstanceImpl, execution, transitionName);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/DecisionEnd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ExclusiveEnd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ExclusiveEnd.java 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ExclusiveEnd.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.history.events;
-
-import org.jbpm.history.HistoryProcessInstance;
-import org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl;
-import org.jbpm.pvm.internal.history.model.HistoryExclusiveInstanceImpl;
-
-
-/**
- * @author Tom Baeyens
- */
-public class ExclusiveEnd extends AutomaticEnd {
-
- private static final long serialVersionUID = 1L;
-
- protected String transitionName;
-
- public ExclusiveEnd(String transitionName) {
- this.transitionName = transitionName;
- }
-
- protected HistoryActivityInstanceImpl createHistoryActivityInstance(HistoryProcessInstance historyProcessInstanceImpl) {
- return new HistoryExclusiveInstanceImpl(historyProcessInstanceImpl, execution, transitionName);
- }
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDecisionInstanceImpl.java (from rev 4541, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryExclusiveInstanceImpl.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDecisionInstanceImpl.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDecisionInstanceImpl.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.model;
+
+import org.jbpm.history.HistoryProcessInstance;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HistoryDecisionInstanceImpl extends HistoryAutomaticInstanceImpl {
+
+ public HistoryDecisionInstanceImpl() {
+ }
+
+ public HistoryDecisionInstanceImpl(HistoryProcessInstance historyProcessInstanceImpl, ExecutionImpl execution, String transitionName) {
+ super(historyProcessInstanceImpl, execution);
+ this.transitionName = transitionName;
+ }
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDecisionInstanceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryExclusiveInstanceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryExclusiveInstanceImpl.java 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryExclusiveInstanceImpl.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.history.model;
-
-import org.jbpm.history.HistoryProcessInstance;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
-
-
-/**
- * @author Tom Baeyens
- */
-public class HistoryExclusiveInstanceImpl extends HistoryAutomaticInstanceImpl {
-
- public HistoryExclusiveInstanceImpl() {
- }
-
- public HistoryExclusiveInstanceImpl(HistoryProcessInstance historyProcessInstanceImpl, ExecutionImpl execution, String transitionName) {
- super(historyProcessInstanceImpl, execution);
- this.transitionName = transitionName;
- }
-
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -57,7 +57,7 @@
import org.jbpm.pvm.internal.history.events.ActivityEnd;
import org.jbpm.pvm.internal.history.events.ActivityStart;
import org.jbpm.pvm.internal.history.events.AutomaticEnd;
-import org.jbpm.pvm.internal.history.events.ExclusiveEnd;
+import org.jbpm.pvm.internal.history.events.DecisionEnd;
import org.jbpm.pvm.internal.history.events.ProcessInstanceEnd;
import org.jbpm.pvm.internal.history.events.ProcessInstanceStart;
import org.jbpm.pvm.internal.job.MessageImpl;
@@ -956,8 +956,8 @@
fireHistoryEvent(new AutomaticEnd());
}
- public void historyExclusive(String transitionName) {
- fireHistoryEvent(new ExclusiveEnd(transitionName));
+ public void historyDecision(String transitionName) {
+ fireHistoryEvent(new DecisionEnd(transitionName));
}
public void historyActivityStart() {
Deleted: jbpm4/trunk/modules/pvm/src/test/resources/jbpm.cache.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/jbpm.cache.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/pvm/src/test/resources/jbpm.cache.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,39 +0,0 @@
-<hibernate-cache>
-
- <class-cache class="org.jbpm.pvm.internal.model.ProcessDefinitionImpl" />
- <class-cache class="org.jbpm.pvm.internal.model.ActivityImpl" />
- <class-cache class="org.jbpm.pvm.internal.model.TransitionImpl" />
- <class-cache class="org.jbpm.pvm.internal.model.EventImpl" />
- <class-cache class="org.jbpm.pvm.internal.model.ExceptionHandlerImpl" />
- <class-cache class="org.jbpm.pvm.internal.model.ObjectReference" />
- <class-cache class="org.jbpm.pvm.internal.model.VariableDefinitionImpl" />
- <class-cache class="org.jbpm.pvm.internal.model.TimerDefinitionImpl" />
- <class-cache class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" />
-
- <collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.exceptionHandlers" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.events" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.activities" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.variableDefinitions" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.timerDefinitions" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.attachments" />
-
- <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.exceptionHandlers" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.events" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.activities" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.variableDefinitions" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.timerDefinitions" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.incomingTransitions" />
- <collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.outgoingTransitions" />
-
- <collection-cache collection="org.jbpm.pvm.internal.model.TransitionImpl.exceptionHandlers" />
- <collection-cache collection="org.jbpm.pvm.internal.model.TransitionImpl.events" />
-
- <collection-cache collection="org.jbpm.pvm.internal.model.EventImpl.exceptionHandlers" />
- <collection-cache collection="org.jbpm.pvm.internal.model.EventImpl.listenerReferences" />
-
- <collection-cache collection="org.jbpm.pvm.internal.model.ExceptionHandlerImpl.eventListenerReferences" />
-
- <collection-cache collection="org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor.argDescriptors" />
- <collection-cache collection="org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor.operations" />
-
-</hibernate-cache>
Deleted: jbpm4/trunk/modules/pvm/src/test/resources/jbpm.definition.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/jbpm.definition.hbm.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/pvm/src/test/resources/jbpm.definition.hbm.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,646 +0,0 @@
-<?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 package="org.jbpm.pvm.internal.model" default-access="field">
-
- <!-- ### PROCESS DEFINITION ############################################# -->
- <class name="ProcessDefinitionImpl"
- table="JBPM_PROCESS"
- discriminator-value="pvm">
- <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <discriminator><column name="CLASS_" /></discriminator>
-
- <version name="dbversion" column="DBVERSION_" />
- <many-to-one name="properties"
- class="WireProperties"
- column="PROPS_"
- foreign-key="FK_PROCDEF_PROPS"
- index="IDX_PROCDEF_PROPS"
- cascade="all" />
- <list name="exceptionHandlers" cascade="all">
- <key foreign-key="FK_EXHDLR_PROCESS">
- <column name="PROCESS_" index="IDX_EXHDLR_PROCESS"/>
- </key>
- <index column="PROCESS_IDX_" />
- <one-to-many class="ExceptionHandlerImpl"/>
- </list>
-
- <!-- ObservableElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <property name="name" column="NAME_" />
- <property name="description" column="DESCR_" />
- <map name="events" cascade="all-delete-orphan">
- <key foreign-key="FK_EVENT_PROCESS">
- <column name="PROCESS_" index="IDX_EVENT_PROCESS" />
- </key>
- <map-key type="string" column="NAME_" />
- <one-to-many class="org.jbpm.pvm.internal.model.EventImpl"/>
- </map>
-
- <!-- CompositeElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <list name="activities" cascade="all" inverse="false">
- <key foreign-key="FK_ACTS_PROCESS">
- <column name="ACTSPROCESS_" index="IDX_ACTS_PROCESS"/>
- </key>
- <list-index column="ACTSPROCESS_IDX_" />
- <one-to-many class="ActivityImpl" />
- </list>
- <property name="hasVariableDefinitions" column="HAS_VAR_DEF_" />
- <list name="variableDefinitions" cascade="all">
- <key foreign-key="FK_VARDEF_PROCESS">
- <column name="PROCESS_" index="IDX_VARDEF_PROCESS"/>
- </key>
- <index column="PROCESS_IDX_" />
- <one-to-many class="VariableDefinitionImpl" />
- </list>
- <property name="hasTimerDefinitions" column="HAS_TIMER_DEF_" />
- <set name="timerDefinitions" cascade="all">
- <key foreign-key="FK_TMRDEF_PROCESS">
- <column name="PROCESS_" index="IDX_TMRDEF_PROCESS"/>
- </key>
- <one-to-many class="TimerDefinitionImpl" />
- </set>
-
- <!-- ProcessDefinitionImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <property name="key" column="KEY_" />
- <property name="id" column="ID_" unique="true" />
-
- <property name="packageName" column="PACKAGE_" />
- <property name="version" column="VERSION_" />
- <property name="deploymentTime" column="DEPLOYED_" />
- <many-to-one name="initial"
- column="INITIAL_"
- class="ActivityImpl"
- cascade="all"
- foreign-key="FK_PROCDEF_INITIAL"
- index="IDX_PROCDEF_INIT"
- fetch="select" />
-
- <map name="attachments" cascade="all-delete-orphan">
- <key foreign-key="FK_LOB_PROCESS">
- <column name="PROCESS_" index="IDX_LOB_PROCESS" />
- </key>
- <map-key type="string" column="NAME_" />
- <one-to-many class="org.jbpm.pvm.internal.lob.Lob"/>
- </map>
- </class>
-
- <!-- ### Activity ############################################################## -->
- <class name="ActivityImpl" table="JBPM_ACTIVITY">
- <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <many-to-one name="processDefinition"
- class="ProcessDefinitionImpl"
- column="PROCESS_"
- foreign-key="FK_ACT_PROCESS"
- index="IDX_ACT_PROCESS" />
- <many-to-one name="properties"
- class="WireProperties"
- column="PROPS_"
- foreign-key="FK_ACT_PROPS"
- index="IDX_ACT_PROPS"
- cascade="all" />
- <list name="exceptionHandlers" cascade="all">
- <key foreign-key="FK_EXHDLR_ACT">
- <column name="ACT_" index="IDX_EXHDLR_ACT"/>
- </key>
- <index column="ACT_IDX_" />
- <one-to-many class="ExceptionHandlerImpl" />
- </list>
-
- <!-- ObservableElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <property name="name" column="NAME_"/>
- <property name="description" column="DESCR_"/>
- <map name="events" cascade="all-delete-orphan">
- <key foreign-key="FK_EVENT_ACT">
- <column name="ACT_" index="IDX_EVENT_ACT" />
- </key>
- <map-key type="string" column="NAME_" />
- <one-to-many class="org.jbpm.pvm.internal.model.EventImpl" />
- </map>
-
- <!-- CompositeElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <list name="activities" cascade="all" inverse="false">
- <key column="PARENT_" foreign-key="none" />
- <list-index column="PARENT_IDX_" />
- <one-to-many class="ActivityImpl" />
- </list>
- <property name="hasVariableDefinitions" column="HAS_VAR_DEF_" />
- <list name="variableDefinitions" cascade="all">
- <key foreign-key="FK_VARDEF_ACT">
- <column name="ACT_" index="IDX_VARDEF_ACT"/>
- </key>
- <index column="ACT_IDX_" />
- <one-to-many class="VariableDefinitionImpl" />
- </list>
- <property name="hasTimerDefinitions" column="HAS_TIMER_DEF_" />
- <set name="timerDefinitions" cascade="all">
- <key foreign-key="FK_TMRDEF_ACT">
- <column name="ACT_" index="IDX_TMRDEF_ACT"/>
- </key>
- <one-to-many class="TimerDefinitionImpl" />
- </set>
-
- <!-- ActivityImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <property name="type" column="TYPE_" />
- <property name="isLocalScope" column="LOCAL_SCOPE_" />
- <property name="isExecutionAsync" column="EXEC_ASYNC_" />
- <property name="isSignalAsync" column="SIGNAL_ASYNC_" />
- <property name="isPreviousNeeded" column="PREV_NEEDED_" />
-
- <many-to-one name="parentActivity"
- column="PARENT_"
- class="ActivityImpl"
- cascade="all"
- foreign-key="FK_ACT_PARENT"
- index="IDX_ACT_PARENT" />
-
- <many-to-one name="defaultTransition"
- column="DEFTRANS_"
- class="TransitionImpl"
- fetch="select"
- foreign-key="FK_ACT_DEFTRANS"
- index="IDX_ACT_DEFTRANS" />
-
- <list name="incomingTransitions" inverse="false">
- <key column="DESTINATION_" />
- <index column="IN_IDX_" />
- <one-to-many class="TransitionImpl" />
- </list>
-
- <list name="outgoingTransitions" inverse="false" cascade="all">
- <key column="SOURCE_" />
- <index column="OUT_IDX_" />
- <one-to-many class="TransitionImpl" />
- </list>
-
- <component name="behaviourReference" class="ObjectReference">
- <many-to-one name="descriptor"
- column="BEHAV_DESCR_"
- cascade="all"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_NODE_BEHAV_DESCR"
- index="IDX_NODE_BEHAV_DESCR" />
- <any name="object" id-type="long" cascade="all">
- <!-- TODO: Specify names for classes -->
- <!-- <meta-value value="bpel::activity" class="org.jbpm.pvm.bpel.BpelActivity"/> -->
- <column name="BEHAV_CLASS_" />
- <column name="BEHAV_ID_" />
- </any>
- </component>
- </class>
-
- <!-- ### TRANSITION ##################################################### -->
- <class name="TransitionImpl" table="JBPM_TRANSITION">
- <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <many-to-one name="processDefinition"
- class="ProcessDefinitionImpl"
- column="PROCESS_"
- foreign-key="FK_TRANS_PROCDEF"
- index="IDX_TRANS_PROCDEF" />
- <many-to-one name="properties"
- class="WireProperties"
- column="PROPS_"
- foreign-key="FK_TRANS_PROPS"
- index="IDX_TRANS_PROPS"
- cascade="all" />
- <list name="exceptionHandlers" cascade="all">
- <key foreign-key="FK_EXHDLR_TRANS">
- <column name="TRANSITION_" index="IDX_EXHDLR_TRANS" />
- </key>
- <index column="TRANSITION_IDX_" />
- <one-to-many class="ExceptionHandlerImpl" />
- </list>
-
- <!-- ObservableElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <property name="name" column="NAME_" />
- <property name="description" column="DESCR_" />
- <map name="events" cascade="all-delete-orphan">
- <key foreign-key="FK_EVENT_TRANS">
- <column name="TRANSITION_" index="IDX_EVENT_TRANS" />
- </key>
- <map-key type="string" column="NAME_" />
- <one-to-many class="org.jbpm.pvm.internal.model.EventImpl" />
- </map>
-
- <!-- TransitionImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <many-to-one name="source"
- column="SRC_"
- class="ActivityImpl"
- fetch="select"
- foreign-key="FK_TRANS_SRC"
- index="IDX_TRANS_SRC" />
-
- <many-to-one name="destination"
- column="DEST_"
- class="ActivityImpl"
- fetch="select"
- cascade="all"
- foreign-key="FK_TRANS_DST"
- index="IDX_TRANS_DST" />
-
- <many-to-one name="conditionDescriptor"
- column="COND_DESCR_"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- cascade="all"
- foreign-key="FK_TRANS_COND"
- index="IDX_TRANS_COND" />
-
- <!--
- <many-to-one name="waitConditionDescriptor"
- column="WAIT_DESCR_"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- cascade="all"
- foreign-key="FK_TRANS_WAIT_DESCR"
- index="IDX_TRANS_WAIT_DESCR" />
- -->
-
- <property name="isTakeAsync" column="TAKEASYNC_" />
- </class>
-
- <!-- ### EVENT ########################################################## -->
- <class name="EventImpl" table="JBPM_EVENT">
- <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <many-to-one name="processDefinition"
- class="ProcessDefinitionImpl"
- column="PROCESSDEF_"
- foreign-key="FK_EVENT_PROCDEF"
- index="IDX_EVENT_PROCDEF" />
- <many-to-one name="properties"
- class="WireProperties"
- column="PROPS_"
- foreign-key="FK_EVENT_PROPS"
- index="IDX_EVENT_PROPS"
- cascade="all" />
- <list name="exceptionHandlers" cascade="all">
- <key foreign-key="FK_EXHDLR_EVENT">
- <column name="EVENT_" index="IDX_EXHDLR_EVENT"/>
- </key>
- <index column="EVENT_IDX_" />
- <one-to-many class="ExceptionHandlerImpl" />
- </list>
-
- <!-- EventImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <property name="name" column="NAME_" />
- <list name="listenerReferences" table="JBPM_OBJECTREFERENCES" cascade="all-delete-orphan">
- <key foreign-key="FK_OBJECTREF_EVENT">
- <column name="EVENT_" index="IDX_OBJREF_EVENT"/>
- </key>
- <list-index column="EVENT_IDX_" />
- <one-to-many class="EventListenerReference" />
- </list>
- </class>
-
- <!-- ### EXCEPTION HANDLER ############################################## -->
- <class name="ExceptionHandlerImpl" table="JBPM_EXCEPTHNDLR">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <property name="exceptionClassName" column="EXCEPT_CLASS_" />
- <property name="isTransactional" column="TRANSACT_" />
- <property name="isRethrowMasked" column="RETHROW_MASKED_"/>
- <property name="transitionName" column="TRANSITIONNAME_" />
- <property name="activityName" column="NODENAME_" />
- <list name="eventListenerReferences"
- inverse="false"
- cascade="all-delete-orphan"
- table="JBPM_OBJECTREFERENCES">
- <key foreign-key="FK_OBJREF_EXHNDLR" not-null="false">
- <column name="EXHNDLR_" index="IDX_OBJREF_EXHNDLR" />
- </key>
- <list-index column="EXHNDLR_IDX_" />
- <one-to-many class="ObjectReference" />
- </list>
- </class>
-
- <!-- ### OBJECT REFERENCE ############################################### -->
- <class name="ObjectReference" discriminator-value="objref" table="JBPM_OBJECTREF">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <discriminator column="CLASS_" />
- <version name="dbversion" column="DBVERSION_" />
- <many-to-one name="descriptor"
- column="OBJ_DESCR_"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- cascade="all"
- foreign-key="FK_OBJREF_EVENT"
- index="IDX_OBJREF_EVENT"/>
- <any name="object" id-type="long" cascade="all">
- <!-- TODO: Specify names for classes -->
- <column name="OBJ_CLASS_" />
- <column name="OBJ_ID_" />
- </any>
- <property name="expression" column="OBJ_EXPRESSION_"/>
- <property name="expressionLanguage" column="OBJ_EXPRLANG_"/>
-
- <subclass name="EventListenerReference" discriminator-value="evtlis">
- <property name="isPropagationEnabled" column="PROPAGATE_" />
- </subclass>
-
- </class>
-
- <!-- ### VARIABLE DEFINITION ############################################ -->
- <class name="VariableDefinitionImpl" table="JBPM_VARIABLEDEF">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <property name="name" column="NAME_"/>
- <property name="typeName" column="TYPE_"/>
-
- <property name="inVariableName" column="INVAR_" />
- <property name="inExpression" column="INEXPR_" />
- <many-to-one name="inDescriptor"
- column="INDESCR_"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- cascade="all"
- foreign-key="FK_VARDEF_INDES"
- index="IDX_VARDEF_INDES"/>
- <property name="outVariableName" column="OUTVAR_" />
- <property name="outExpression" column="OUTEXPR_" />
- </class>
-
- <!-- ### TIMER DEFINITION ############################################### -->
- <class name="TimerDefinitionImpl" table="JBPM_TIMERDEF">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <property name="dueDateDescription" column="DUEDATEDESCR_"/>
- <property name="repeat" column="REPEAT_"/>
- <property name="isExclusive" column="ISEXCL_"/>
- <property name="retries" column="RETRIES_"/>
- <property name="eventName" column="EVENT_"/>
- <property name="signalName" column="SIGNAL_"/>
- <property name="dueDate" column="DUEDATE_" type="timestamp"/>
- </class>
-
- <!-- ### DESCRIPTORS #################################################### -->
- <class name="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" table="JBPM_DESCRIPTOR" abstract="true"
- discriminator-value="abstract">
- <!--
- byte : ByteDescriptor
- string : StringDescriptor
- char : CharacterDescriptor
- class : ClassDescriptor
- double : DoubleDescriptor
- expr : ExpressionDescriptor
- float : FloatDescriptor
- long : LongDescriptor
- int : IntegerDescriptor
- short : ShortDescriptor
- coll : CollectionDescriptor
- map : MapDescriptor
- list : ListDescriptor
- set : SetDescriptor
- object : ObjectDescriptor
- ref : ReferenceDescriptor
- null : NullDescriptor
- true : TrueDescriptor
- false : FalseDescriptor
- provided : ProvidedObjectDescriptor
- -->
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <discriminator column="CLASS_" />
- <version name="dbversion" column="DBVERSION_" />
-
- <property name="name" column="NAME_" />
- <property name="init" column="INIT_" />
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.NullDescriptor" discriminator-value="null_" />
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.TrueDescriptor" discriminator-value="true" />
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.FalseDescriptor" discriminator-value="false" />
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.StringDescriptor" discriminator-value="string">
- <property name="text" column="TEXT_" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.CharacterDescriptor" discriminator-value="char">
- <property name="text" column="TEXT_" />
- </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ClassDescriptor" discriminator-value="class">
- <property name="text" column="TEXT_" />
- </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ReferenceDescriptor" discriminator-value="ref">
- <property name="text" column="TEXT_" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.DoubleDescriptor" discriminator-value="double">
- <property name="doubleVal" column="DOUBLEVAL_" />
- </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.FloatDescriptor" discriminator-value="float">
- <property name="doubleVal" column="DOUBLEVAL_" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.LongDescriptor" discriminator-value="long">
- <property name="longVal" column="LONGVAL_" />
- </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.IntegerDescriptor" discriminator-value="int">
- <property name="longVal" column="LONGVAL_" />
- </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ShortDescriptor" discriminator-value="short">
- <property name="longVal" column="LONGVAL_" />
- </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ByteDescriptor" discriminator-value="byte">
- <property name="longVal" column="LONGVAL_" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.CollectionDescriptor" discriminator-value="coll">
- <property name="className" column="CLASSNAME_" />
- <list name="valueDescriptors" cascade="all-delete-orphan">
- <key foreign-key="FK_DESCR_VALDESCR">
- <column name="VALUEDESCR_" index="IDX_DESCR_VALDESCR" />
- </key>
- <list-index column="VALUEDESCR_IDX_" />
- <one-to-many class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" />
- </list>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.MapDescriptor" discriminator-value="map">
- <list name="keyDescriptors" cascade="all-delete-orphan">
- <key column="KEYDESCR_" foreign-key="FK_DESCR_KEYDESCR" />
- <list-index column="KEYDESCR_IDX_" />
- <one-to-many class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" />
- </list>
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ListDescriptor" discriminator-value="list" />
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.SetDescriptor" discriminator-value="set" />
- </subclass>
-
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor" discriminator-value="object">
- <property name="className" column="TEXT_" />
- <property name="methodName" column="METHOD_" />
- <property name="isAutoWireEnabled" column="BOOLVAL_" />
- <property name="factoryObjectName" column="FACTORYNAME_" />
-
- <many-to-one name="factoryDescriptor" class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" column="FACTORYDESCR_"
- foreign-key="FK_DESCR_ARG_REF" index="IDX_DESCR_ARG_REF" cascade="all" />
-
- <list name="argDescriptors" cascade="all-delete-orphan">
- <key foreign-key="FK_OBJARG_DESCR">
- <column name="OBJARG_DESCR_" index="IDX_OBJARG_DESCR" />
- </key>
- <list-index column="OBJARG_DESCR_IDX_" />
- <one-to-many class="org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor" />
- </list>
-
- <list name="operations" cascade="all-delete-orphan">
- <key foreign-key="FK_OBJOPER_DESCR">
- <column name="OBJOPER_DESCR_" index="IDX_OBJOPER_DESCR" />
- </key>
- <list-index column="OBJOPER_DESCR_IDX_" />
- <one-to-many class="org.jbpm.pvm.internal.wire.operation.AbstractOperation" />
- </list>
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ExpressionDescriptor" discriminator-value="expr">
- <property name="expr" column="TEXT_" />
- <property name="lang" column="METHOD_" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ProvidedObjectDescriptor" discriminator-value="provided">
- <any name="providedObject" id-type="long" cascade="all">
- <column name="TEXT_" />
- <column name="LONGVAL_" />
- </any>
- <property name="exposeType" column="BOOLVAL_" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.EnvDescriptor" discriminator-value="env">
- <property name="objectName" column="TEXT_" />
- <property name="typeName" column="CLASSNAME_" />
- </subclass>
-
- </class>
-
- <!-- ### OPERATIONS ##################################################### -->
- <class name="org.jbpm.pvm.internal.wire.operation.AbstractOperation" abstract="true"
- table="JBPM_OPERATION" discriminator-value="oper">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <discriminator column="CLASS_" />
- <version name="dbversion" column="DBVERSION_" />
-
- <subclass name="org.jbpm.pvm.internal.wire.operation.FieldOperation"
- discriminator-value="field">
- <property name="fieldName" column="TEXT_" />
- <many-to-one name="descriptor" column="DESCR_" cascade="all"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_OPER_DESC" index="IDX_OPER_DESC" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.operation.PropertyOperation"
- discriminator-value="prop">
- <property name="setterName" column="TEXT_" />
- <many-to-one name="descriptor" column="DESCR_" cascade="all"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.operation.InvokeOperation"
- discriminator-value="invoke">
- <property name="methodName" column="TEXT_" />
- <list name="argDescriptors" cascade="all-delete-orphan">
- <key foreign-key="FK_ARGDSCR_OPER">
- <column name="OPER_" index="IDX_ARGDSCR_OPER" />
- </key>
- <list-index column="OPER_IDX_" />
- <one-to-many class="org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor" />
- </list>
- </subclass>
- </class>
-
- <!-- ### ARG DESCRIPTOR ################################################# -->
- <class name="org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor" table="JBPM_ARGDESCRIPTOR">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <property name="typeName" column="TYPENAME_" />
- <many-to-one name="descriptor" column="DESCRIPTOR_"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_ARGDESCR_DESCR" index="IDX_ARGDESCR_DESCR" cascade="all" />
- </class>
-
- <!-- ### PROPERTIES ##################################################### -->
- <class name="org.jbpm.pvm.internal.model.WireProperties" table="JBPM_WIREPROPS">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <component name="wireContext" class="org.jbpm.pvm.internal.wire.WireContext">
- <component name="wireDefinition" class="org.jbpm.pvm.internal.wire.WireDefinition">
- <map name="descriptors" cascade="all-delete-orphan" lazy="false">
- <key foreign-key="FK_DESCR_PROPS">
- <column name="PROPS_" index="IDX_DESCR_PROPS" />
- </key>
- <map-key type="string" column="NAME_" />
- <one-to-many class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" />
- </map>
- </component>
- </component>
- </class>
-
-
- <!-- ### QUERIES ######################################################## -->
-
- <query name="findProcessDefinitionKeys">
- <![CDATA[
- select distinct process.key
- from org.jbpm.pvm.internal.model.ProcessDefinitionImpl as process
- order by process.key asc
- ]]>
- </query>
-
- <query name="findProcessDefinitionsByKey">
- <![CDATA[
- select process
- from org.jbpm.pvm.internal.model.ProcessDefinitionImpl as process
- where process.key = :key
- order by process.version desc
- ]]>
- </query>
-
- <query name="findProcessDefinitionById">
- <![CDATA[
- select process
- from org.jbpm.pvm.internal.model.ProcessDefinitionImpl as process
- where process.id = :id
- ]]>
- </query>
-
- <query name="findProcessDefinitionKeysByName">
- <![CDATA[
- select process.key
- from org.jbpm.pvm.internal.model.ProcessDefinitionImpl as process
- where process.name = :name
- ]]>
- </query>
-
- <query name="findProcessDefinitionNamesByKey">
- <![CDATA[
- select process.name
- from org.jbpm.pvm.internal.model.ProcessDefinitionImpl as process
- where process.key = :key
- ]]>
- </query>
-
-</hibernate-mapping>
\ No newline at end of file
Modified: jbpm4/trunk/modules/pvm/src/test/resources/jbpm.history.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/jbpm.history.hbm.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/pvm/src/test/resources/jbpm.history.hbm.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -63,7 +63,7 @@
<property name="transitionName" column="TRANSITION_" />
<subclass name="HistoryAutomaticInstanceImpl" discriminator-value="AUT">
- <subclass name="HistoryExclusiveInstanceImpl" discriminator-value="EXCL" />
+ <subclass name="HistoryDecisionInstanceImpl" discriminator-value="EXCL" />
</subclass>
<subclass name="HistoryTaskInstanceImpl" discriminator-value="TASK">
Modified: jbpm4/trunk/modules/pvm/src/test/resources/jbpm.jpdl.activities.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/jbpm.jpdl.activities.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/pvm/src/test/resources/jbpm.jpdl.activities.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,7 +1,7 @@
<activities>
<activity binding="org.jbpm.jpdl.internal.activity.StartBinding" />
<activity binding="org.jbpm.jpdl.internal.activity.StateBinding" />
- <activity binding="org.jbpm.jpdl.internal.activity.ExclusiveBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.DecisionBinding" />
<activity binding="org.jbpm.jpdl.internal.activity.EndBinding" />
<activity binding="org.jbpm.jpdl.internal.activity.EndCancelBinding" />
<activity binding="org.jbpm.jpdl.internal.activity.EndErrorBinding" />
Copied: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/DecisionTest.java (from rev 4541, jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ExclusiveTest.java)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/DecisionTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/DecisionTest.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -0,0 +1,96 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.activities;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jbpm.Execution;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DecisionTest extends JbpmTestCase {
+
+ public void testDecisionExpression() {
+ deployJpdlXmlString(
+ "<process name='Poolcar'>" +
+ " <start>" +
+ " <transition to='How far?' />" +
+ " </start>" +
+ " <decision name='How far?' expr='#{distance}'>" +
+ " <transition name='far' to='Big car' />" +
+ " <transition name='nearby' to='Small car' />" +
+ " </decision>" +
+ " <state name='Big car' />" +
+ " <state name='Small car' />" +
+ "</process>"
+ );
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("distance", "far");
+ Execution execution = executionService.startProcessInstanceByKey("Poolcar", variables);
+ assertEquals("Big car", execution.getActivityName());
+
+ variables.put("distance", "nearby");
+ execution = executionService.startProcessInstanceByKey("Poolcar", variables);
+ assertEquals("Small car", execution.getActivityName());
+ }
+
+ public void testDecisionWithConditions() {
+ deployJpdlXmlString(
+ "<process name='Poolcar'>" +
+ " <start>" +
+ " <transition to='How far?' />" +
+ " </start>" +
+ " <decision name='How far?'>" +
+ " <transition to='Big car'>" +
+ " <condition expr='#{distance > 10}' />" +
+ " </transition>" +
+ " <transition to='Small car'>" +
+ " <condition expr='#{distance >= 3}' />" +
+ " </transition>" +
+ " <transition to='No car' />" +
+ " </decision>" +
+ " <state name='Big car' />" +
+ " <state name='Small car' />" +
+ " <state name='No car' />" +
+ "</process>"
+ );
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("distance", new Integer(69));
+ Execution execution = executionService.startProcessInstanceByKey("Poolcar", variables);
+ assertEquals("Big car", execution.getActivityName());
+
+ variables.put("distance", new Integer(6));
+ execution = executionService.startProcessInstanceByKey("Poolcar", variables);
+ assertEquals("Small car", execution.getActivityName());
+
+ variables.put("distance", new Integer(2));
+ execution = executionService.startProcessInstanceByKey("Poolcar", variables);
+ assertEquals("No car", execution.getActivityName());
+ }
+
+}
Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/DecisionTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ExclusiveTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ExclusiveTest.java 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ExclusiveTest.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,96 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.test.activities;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jbpm.Execution;
-import org.jbpm.test.JbpmTestCase;
-
-
-/**
- * @author Tom Baeyens
- */
-public class ExclusiveTest extends JbpmTestCase {
-
- public void testExclusiveExpression() {
- deployJpdlXmlString(
- "<process name='Poolcar'>" +
- " <start>" +
- " <transition to='How far?' />" +
- " </start>" +
- " <exclusive name='How far?' expr='#{distance}'>" +
- " <transition name='far' to='Big car' />" +
- " <transition name='nearby' to='Small car' />" +
- " </exclusive>" +
- " <state name='Big car' />" +
- " <state name='Small car' />" +
- "</process>"
- );
-
- Map<String, Object> variables = new HashMap<String, Object>();
- variables.put("distance", "far");
- Execution execution = executionService.startProcessInstanceByKey("Poolcar", variables);
- assertEquals("Big car", execution.getActivityName());
-
- variables.put("distance", "nearby");
- execution = executionService.startProcessInstanceByKey("Poolcar", variables);
- assertEquals("Small car", execution.getActivityName());
- }
-
- public void testExclusiveWithConditions() {
- deployJpdlXmlString(
- "<process name='Poolcar'>" +
- " <start>" +
- " <transition to='How far?' />" +
- " </start>" +
- " <exclusive name='How far?'>" +
- " <transition to='Big car'>" +
- " <condition expr='#{distance > 10}' />" +
- " </transition>" +
- " <transition to='Small car'>" +
- " <condition expr='#{distance >= 3}' />" +
- " </transition>" +
- " <transition to='No car' />" +
- " </exclusive>" +
- " <state name='Big car' />" +
- " <state name='Small car' />" +
- " <state name='No car' />" +
- "</process>"
- );
-
- Map<String, Object> variables = new HashMap<String, Object>();
- variables.put("distance", new Integer(69));
- Execution execution = executionService.startProcessInstanceByKey("Poolcar", variables);
- assertEquals("Big car", execution.getActivityName());
-
- variables.put("distance", new Integer(6));
- execution = executionService.startProcessInstanceByKey("Poolcar", variables);
- assertEquals("Small car", execution.getActivityName());
-
- variables.put("distance", new Integer(2));
- execution = executionService.startProcessInstanceByKey("Poolcar", variables);
- assertEquals("No car", execution.getActivityName());
- }
-
-}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/ChoiceDistributionTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/ChoiceDistributionTest.java 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/history/ChoiceDistributionTest.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -32,17 +32,17 @@
*/
public class ChoiceDistributionTest extends JbpmTestCase {
- public void testExclusiveExpression() {
+ public void testDecisionExpression() {
deployJpdlXmlString(
"<process name='Transport Selection' key='TRS'>" +
" <start>" +
" <transition to='How far?' />" +
" </start>" +
- " <exclusive name='How far?' expr='#{distance}'>" +
+ " <decision name='How far?' expr='#{distance}'>" +
" <transition name='far' to='Big car' />" +
" <transition name='nearby' to='Small car' />" +
" <transition name='other country' to='Airoplane' />" +
- " </exclusive>" +
+ " </decision>" +
" <state name='Big car' />" +
" <state name='Small car' />" +
" <state name='Airoplane' />" +
Deleted: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.definition.hbm.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.definition.hbm.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.definition.hbm.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,646 +0,0 @@
-<?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 package="org.jbpm.pvm.internal.model" default-access="field">
-
- <!-- ### PROCESS DEFINITION ############################################# -->
- <class name="ProcessDefinitionImpl"
- table="JBPM_PROCESS"
- discriminator-value="pvm">
- <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <discriminator><column name="CLASS_" /></discriminator>
-
- <version name="dbversion" column="DBVERSION_" />
- <many-to-one name="properties"
- class="WireProperties"
- column="PROPS_"
- foreign-key="FK_PROCDEF_PROPS"
- index="IDX_PROCDEF_PROPS"
- cascade="all" />
- <list name="exceptionHandlers" cascade="all">
- <key foreign-key="FK_EXHDLR_PROCESS">
- <column name="PROCESS_" index="IDX_EXHDLR_PROCESS"/>
- </key>
- <index column="PROCESS_IDX_" />
- <one-to-many class="ExceptionHandlerImpl"/>
- </list>
-
- <!-- ObservableElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <property name="name" column="NAME_" />
- <property name="description" column="DESCR_" />
- <map name="events" cascade="all-delete-orphan">
- <key foreign-key="FK_EVENT_PROCESS">
- <column name="PROCESS_" index="IDX_EVENT_PROCESS" />
- </key>
- <map-key type="string" column="NAME_" />
- <one-to-many class="org.jbpm.pvm.internal.model.EventImpl"/>
- </map>
-
- <!-- CompositeElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <list name="activities" cascade="all" inverse="false">
- <key foreign-key="FK_ACTS_PROCESS">
- <column name="ACTSPROCESS_" index="IDX_ACTS_PROCESS"/>
- </key>
- <list-index column="ACTSPROCESS_IDX_" />
- <one-to-many class="ActivityImpl" />
- </list>
- <property name="hasVariableDefinitions" column="HAS_VAR_DEF_" />
- <list name="variableDefinitions" cascade="all">
- <key foreign-key="FK_VARDEF_PROCESS">
- <column name="PROCESS_" index="IDX_VARDEF_PROCESS"/>
- </key>
- <index column="PROCESS_IDX_" />
- <one-to-many class="VariableDefinitionImpl" />
- </list>
- <property name="hasTimerDefinitions" column="HAS_TIMER_DEF_" />
- <set name="timerDefinitions" cascade="all">
- <key foreign-key="FK_TMRDEF_PROCESS">
- <column name="PROCESS_" index="IDX_TMRDEF_PROCESS"/>
- </key>
- <one-to-many class="TimerDefinitionImpl" />
- </set>
-
- <!-- ProcessDefinitionImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <property name="key" column="KEY_" />
- <property name="id" column="ID_" unique="true" />
-
- <property name="packageName" column="PACKAGE_" />
- <property name="version" column="VERSION_" />
- <property name="deploymentTime" column="DEPLOYED_" />
- <many-to-one name="initial"
- column="INITIAL_"
- class="ActivityImpl"
- cascade="all"
- foreign-key="FK_PROCDEF_INITIAL"
- index="IDX_PROCDEF_INIT"
- fetch="select" />
-
- <map name="attachments" cascade="all-delete-orphan">
- <key foreign-key="FK_LOB_PROCESS">
- <column name="PROCESS_" index="IDX_LOB_PROCESS" />
- </key>
- <map-key type="string" column="NAME_" />
- <one-to-many class="org.jbpm.pvm.internal.lob.Lob"/>
- </map>
- </class>
-
- <!-- ### Activity ############################################################## -->
- <class name="ActivityImpl" table="JBPM_ACTIVITY">
- <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <many-to-one name="processDefinition"
- class="ProcessDefinitionImpl"
- column="PROCESS_"
- foreign-key="FK_ACT_PROCESS"
- index="IDX_ACT_PROCESS" />
- <many-to-one name="properties"
- class="WireProperties"
- column="PROPS_"
- foreign-key="FK_ACT_PROPS"
- index="IDX_ACT_PROPS"
- cascade="all" />
- <list name="exceptionHandlers" cascade="all">
- <key foreign-key="FK_EXHDLR_ACT">
- <column name="ACT_" index="IDX_EXHDLR_ACT"/>
- </key>
- <index column="ACT_IDX_" />
- <one-to-many class="ExceptionHandlerImpl" />
- </list>
-
- <!-- ObservableElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <property name="name" column="NAME_"/>
- <property name="description" column="DESCR_"/>
- <map name="events" cascade="all-delete-orphan">
- <key foreign-key="FK_EVENT_ACT">
- <column name="ACT_" index="IDX_EVENT_ACT" />
- </key>
- <map-key type="string" column="NAME_" />
- <one-to-many class="org.jbpm.pvm.internal.model.EventImpl" />
- </map>
-
- <!-- CompositeElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <list name="activities" cascade="all" inverse="false">
- <key column="PARENT_" foreign-key="none" />
- <list-index column="PARENT_IDX_" />
- <one-to-many class="ActivityImpl" />
- </list>
- <property name="hasVariableDefinitions" column="HAS_VAR_DEF_" />
- <list name="variableDefinitions" cascade="all">
- <key foreign-key="FK_VARDEF_ACT">
- <column name="ACT_" index="IDX_VARDEF_ACT"/>
- </key>
- <index column="ACT_IDX_" />
- <one-to-many class="VariableDefinitionImpl" />
- </list>
- <property name="hasTimerDefinitions" column="HAS_TIMER_DEF_" />
- <set name="timerDefinitions" cascade="all">
- <key foreign-key="FK_TMRDEF_ACT">
- <column name="ACT_" index="IDX_TMRDEF_ACT"/>
- </key>
- <one-to-many class="TimerDefinitionImpl" />
- </set>
-
- <!-- ActivityImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <property name="type" column="TYPE_" />
- <property name="isLocalScope" column="LOCAL_SCOPE_" />
- <property name="isExecutionAsync" column="EXEC_ASYNC_" />
- <property name="isSignalAsync" column="SIGNAL_ASYNC_" />
- <property name="isPreviousNeeded" column="PREV_NEEDED_" />
-
- <many-to-one name="parentActivity"
- column="PARENT_"
- class="ActivityImpl"
- cascade="all"
- foreign-key="FK_ACT_PARENT"
- index="IDX_ACT_PARENT" />
-
- <many-to-one name="defaultTransition"
- column="DEFTRANS_"
- class="TransitionImpl"
- fetch="select"
- foreign-key="FK_ACT_DEFTRANS"
- index="IDX_ACT_DEFTRANS" />
-
- <list name="incomingTransitions" inverse="false">
- <key column="DESTINATION_" />
- <index column="IN_IDX_" />
- <one-to-many class="TransitionImpl" />
- </list>
-
- <list name="outgoingTransitions" inverse="false" cascade="all">
- <key column="SOURCE_" />
- <index column="OUT_IDX_" />
- <one-to-many class="TransitionImpl" />
- </list>
-
- <component name="behaviourReference" class="ObjectReference">
- <many-to-one name="descriptor"
- column="BEHAV_DESCR_"
- cascade="all"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_NODE_BEHAV_DESCR"
- index="IDX_NODE_BEHAV_DESCR" />
- <any name="object" id-type="long" cascade="all">
- <!-- TODO: Specify names for classes -->
- <!-- <meta-value value="bpel::activity" class="org.jbpm.pvm.bpel.BpelActivity"/> -->
- <column name="BEHAV_CLASS_" />
- <column name="BEHAV_ID_" />
- </any>
- </component>
- </class>
-
- <!-- ### TRANSITION ##################################################### -->
- <class name="TransitionImpl" table="JBPM_TRANSITION">
- <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <many-to-one name="processDefinition"
- class="ProcessDefinitionImpl"
- column="PROCESS_"
- foreign-key="FK_TRANS_PROCDEF"
- index="IDX_TRANS_PROCDEF" />
- <many-to-one name="properties"
- class="WireProperties"
- column="PROPS_"
- foreign-key="FK_TRANS_PROPS"
- index="IDX_TRANS_PROPS"
- cascade="all" />
- <list name="exceptionHandlers" cascade="all">
- <key foreign-key="FK_EXHDLR_TRANS">
- <column name="TRANSITION_" index="IDX_EXHDLR_TRANS" />
- </key>
- <index column="TRANSITION_IDX_" />
- <one-to-many class="ExceptionHandlerImpl" />
- </list>
-
- <!-- ObservableElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <property name="name" column="NAME_" />
- <property name="description" column="DESCR_" />
- <map name="events" cascade="all-delete-orphan">
- <key foreign-key="FK_EVENT_TRANS">
- <column name="TRANSITION_" index="IDX_EVENT_TRANS" />
- </key>
- <map-key type="string" column="NAME_" />
- <one-to-many class="org.jbpm.pvm.internal.model.EventImpl" />
- </map>
-
- <!-- TransitionImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <many-to-one name="source"
- column="SRC_"
- class="ActivityImpl"
- fetch="select"
- foreign-key="FK_TRANS_SRC"
- index="IDX_TRANS_SRC" />
-
- <many-to-one name="destination"
- column="DEST_"
- class="ActivityImpl"
- fetch="select"
- cascade="all"
- foreign-key="FK_TRANS_DST"
- index="IDX_TRANS_DST" />
-
- <many-to-one name="conditionDescriptor"
- column="COND_DESCR_"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- cascade="all"
- foreign-key="FK_TRANS_COND"
- index="IDX_TRANS_COND" />
-
- <!--
- <many-to-one name="waitConditionDescriptor"
- column="WAIT_DESCR_"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- cascade="all"
- foreign-key="FK_TRANS_WAIT_DESCR"
- index="IDX_TRANS_WAIT_DESCR" />
- -->
-
- <property name="isTakeAsync" column="TAKEASYNC_" />
- </class>
-
- <!-- ### EVENT ########################################################## -->
- <class name="EventImpl" table="JBPM_EVENT">
- <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <many-to-one name="processDefinition"
- class="ProcessDefinitionImpl"
- column="PROCESSDEF_"
- foreign-key="FK_EVENT_PROCDEF"
- index="IDX_EVENT_PROCDEF" />
- <many-to-one name="properties"
- class="WireProperties"
- column="PROPS_"
- foreign-key="FK_EVENT_PROPS"
- index="IDX_EVENT_PROPS"
- cascade="all" />
- <list name="exceptionHandlers" cascade="all">
- <key foreign-key="FK_EXHDLR_EVENT">
- <column name="EVENT_" index="IDX_EXHDLR_EVENT"/>
- </key>
- <index column="EVENT_IDX_" />
- <one-to-many class="ExceptionHandlerImpl" />
- </list>
-
- <!-- EventImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <property name="name" column="NAME_" />
- <list name="listenerReferences" table="JBPM_OBJECTREFERENCES" cascade="all-delete-orphan">
- <key foreign-key="FK_OBJECTREF_EVENT">
- <column name="EVENT_" index="IDX_OBJREF_EVENT"/>
- </key>
- <list-index column="EVENT_IDX_" />
- <one-to-many class="EventListenerReference" />
- </list>
- </class>
-
- <!-- ### EXCEPTION HANDLER ############################################## -->
- <class name="ExceptionHandlerImpl" table="JBPM_EXCEPTHNDLR">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <property name="exceptionClassName" column="EXCEPT_CLASS_" />
- <property name="isTransactional" column="TRANSACT_" />
- <property name="isRethrowMasked" column="RETHROW_MASKED_"/>
- <property name="transitionName" column="TRANSITIONNAME_" />
- <property name="activityName" column="NODENAME_" />
- <list name="eventListenerReferences"
- inverse="false"
- cascade="all-delete-orphan"
- table="JBPM_OBJECTREFERENCES">
- <key foreign-key="FK_OBJREF_EXHNDLR" not-null="false">
- <column name="EXHNDLR_" index="IDX_OBJREF_EXHNDLR" />
- </key>
- <list-index column="EXHNDLR_IDX_" />
- <one-to-many class="ObjectReference" />
- </list>
- </class>
-
- <!-- ### OBJECT REFERENCE ############################################### -->
- <class name="ObjectReference" discriminator-value="objref" table="JBPM_OBJECTREF">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <discriminator column="CLASS_" />
- <version name="dbversion" column="DBVERSION_" />
- <many-to-one name="descriptor"
- column="OBJ_DESCR_"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- cascade="all"
- foreign-key="FK_OBJREF_EVENT"
- index="IDX_OBJREF_EVENT"/>
- <any name="object" id-type="long" cascade="all">
- <!-- TODO: Specify names for classes -->
- <column name="OBJ_CLASS_" />
- <column name="OBJ_ID_" />
- </any>
- <property name="expression" column="OBJ_EXPRESSION_"/>
- <property name="expressionLanguage" column="OBJ_EXPRLANG_"/>
-
- <subclass name="EventListenerReference" discriminator-value="evtlis">
- <property name="isPropagationEnabled" column="PROPAGATE_" />
- </subclass>
-
- </class>
-
- <!-- ### VARIABLE DEFINITION ############################################ -->
- <class name="VariableDefinitionImpl" table="JBPM_VARIABLEDEF">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <property name="name" column="NAME_"/>
- <property name="typeName" column="TYPE_"/>
-
- <property name="inVariableName" column="INVAR_" />
- <property name="inExpression" column="INEXPR_" />
- <many-to-one name="inDescriptor"
- column="INDESCR_"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- cascade="all"
- foreign-key="FK_VARDEF_INDES"
- index="IDX_VARDEF_INDES"/>
- <property name="outVariableName" column="OUTVAR_" />
- <property name="outExpression" column="OUTEXPR_" />
- </class>
-
- <!-- ### TIMER DEFINITION ############################################### -->
- <class name="TimerDefinitionImpl" table="JBPM_TIMERDEF">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <property name="dueDateDescription" column="DUEDATEDESCR_"/>
- <property name="repeat" column="REPEAT_"/>
- <property name="isExclusive" column="ISEXCL_"/>
- <property name="retries" column="RETRIES_"/>
- <property name="eventName" column="EVENT_"/>
- <property name="signalName" column="SIGNAL_"/>
- <property name="dueDate" column="DUEDATE_" type="timestamp"/>
- </class>
-
- <!-- ### DESCRIPTORS #################################################### -->
- <class name="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" table="JBPM_DESCRIPTOR" abstract="true"
- discriminator-value="abstract">
- <!--
- byte : ByteDescriptor
- string : StringDescriptor
- char : CharacterDescriptor
- class : ClassDescriptor
- double : DoubleDescriptor
- expr : ExpressionDescriptor
- float : FloatDescriptor
- long : LongDescriptor
- int : IntegerDescriptor
- short : ShortDescriptor
- coll : CollectionDescriptor
- map : MapDescriptor
- list : ListDescriptor
- set : SetDescriptor
- object : ObjectDescriptor
- ref : ReferenceDescriptor
- null : NullDescriptor
- true : TrueDescriptor
- false : FalseDescriptor
- provided : ProvidedObjectDescriptor
- -->
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <discriminator column="CLASS_" />
- <version name="dbversion" column="DBVERSION_" />
-
- <property name="name" column="NAME_" />
- <property name="init" column="INIT_" />
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.NullDescriptor" discriminator-value="null_" />
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.TrueDescriptor" discriminator-value="true" />
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.FalseDescriptor" discriminator-value="false" />
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.StringDescriptor" discriminator-value="string">
- <property name="text" column="TEXT_" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.CharacterDescriptor" discriminator-value="char">
- <property name="text" column="TEXT_" />
- </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ClassDescriptor" discriminator-value="class">
- <property name="text" column="TEXT_" />
- </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ReferenceDescriptor" discriminator-value="ref">
- <property name="text" column="TEXT_" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.DoubleDescriptor" discriminator-value="double">
- <property name="doubleVal" column="DOUBLEVAL_" />
- </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.FloatDescriptor" discriminator-value="float">
- <property name="doubleVal" column="DOUBLEVAL_" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.LongDescriptor" discriminator-value="long">
- <property name="longVal" column="LONGVAL_" />
- </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.IntegerDescriptor" discriminator-value="int">
- <property name="longVal" column="LONGVAL_" />
- </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ShortDescriptor" discriminator-value="short">
- <property name="longVal" column="LONGVAL_" />
- </subclass>
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ByteDescriptor" discriminator-value="byte">
- <property name="longVal" column="LONGVAL_" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.CollectionDescriptor" discriminator-value="coll">
- <property name="className" column="CLASSNAME_" />
- <list name="valueDescriptors" cascade="all-delete-orphan">
- <key foreign-key="FK_DESCR_VALDESCR">
- <column name="VALUEDESCR_" index="IDX_DESCR_VALDESCR" />
- </key>
- <list-index column="VALUEDESCR_IDX_" />
- <one-to-many class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" />
- </list>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.MapDescriptor" discriminator-value="map">
- <list name="keyDescriptors" cascade="all-delete-orphan">
- <key column="KEYDESCR_" foreign-key="FK_DESCR_KEYDESCR" />
- <list-index column="KEYDESCR_IDX_" />
- <one-to-many class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" />
- </list>
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ListDescriptor" discriminator-value="list" />
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.SetDescriptor" discriminator-value="set" />
- </subclass>
-
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor" discriminator-value="object">
- <property name="className" column="TEXT_" />
- <property name="methodName" column="METHOD_" />
- <property name="isAutoWireEnabled" column="BOOLVAL_" />
- <property name="factoryObjectName" column="FACTORYNAME_" />
-
- <many-to-one name="factoryDescriptor" class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" column="FACTORYDESCR_"
- foreign-key="FK_DESCR_ARG_REF" index="IDX_DESCR_ARG_REF" cascade="all" />
-
- <list name="argDescriptors" cascade="all-delete-orphan">
- <key foreign-key="FK_OBJARG_DESCR">
- <column name="OBJARG_DESCR_" index="IDX_OBJARG_DESCR" />
- </key>
- <list-index column="OBJARG_DESCR_IDX_" />
- <one-to-many class="org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor" />
- </list>
-
- <list name="operations" cascade="all-delete-orphan">
- <key foreign-key="FK_OBJOPER_DESCR">
- <column name="OBJOPER_DESCR_" index="IDX_OBJOPER_DESCR" />
- </key>
- <list-index column="OBJOPER_DESCR_IDX_" />
- <one-to-many class="org.jbpm.pvm.internal.wire.operation.AbstractOperation" />
- </list>
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ExpressionDescriptor" discriminator-value="expr">
- <property name="expr" column="TEXT_" />
- <property name="lang" column="METHOD_" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.ProvidedObjectDescriptor" discriminator-value="provided">
- <any name="providedObject" id-type="long" cascade="all">
- <column name="TEXT_" />
- <column name="LONGVAL_" />
- </any>
- <property name="exposeType" column="BOOLVAL_" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.descriptor.EnvDescriptor" discriminator-value="env">
- <property name="objectName" column="TEXT_" />
- <property name="typeName" column="CLASSNAME_" />
- </subclass>
-
- </class>
-
- <!-- ### OPERATIONS ##################################################### -->
- <class name="org.jbpm.pvm.internal.wire.operation.AbstractOperation" abstract="true"
- table="JBPM_OPERATION" discriminator-value="oper">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <discriminator column="CLASS_" />
- <version name="dbversion" column="DBVERSION_" />
-
- <subclass name="org.jbpm.pvm.internal.wire.operation.FieldOperation"
- discriminator-value="field">
- <property name="fieldName" column="TEXT_" />
- <many-to-one name="descriptor" column="DESCR_" cascade="all"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_OPER_DESC" index="IDX_OPER_DESC" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.operation.PropertyOperation"
- discriminator-value="prop">
- <property name="setterName" column="TEXT_" />
- <many-to-one name="descriptor" column="DESCR_" cascade="all"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" />
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.wire.operation.InvokeOperation"
- discriminator-value="invoke">
- <property name="methodName" column="TEXT_" />
- <list name="argDescriptors" cascade="all-delete-orphan">
- <key foreign-key="FK_ARGDSCR_OPER">
- <column name="OPER_" index="IDX_ARGDSCR_OPER" />
- </key>
- <list-index column="OPER_IDX_" />
- <one-to-many class="org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor" />
- </list>
- </subclass>
- </class>
-
- <!-- ### ARG DESCRIPTOR ################################################# -->
- <class name="org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor" table="JBPM_ARGDESCRIPTOR">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <property name="typeName" column="TYPENAME_" />
- <many-to-one name="descriptor" column="DESCRIPTOR_"
- class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
- foreign-key="FK_ARGDESCR_DESCR" index="IDX_ARGDESCR_DESCR" cascade="all" />
- </class>
-
- <!-- ### PROPERTIES ##################################################### -->
- <class name="org.jbpm.pvm.internal.model.WireProperties" table="JBPM_WIREPROPS">
- <id name="dbid" column="DBID_">
- <generator class="native" />
- </id>
- <version name="dbversion" column="DBVERSION_" />
- <component name="wireContext" class="org.jbpm.pvm.internal.wire.WireContext">
- <component name="wireDefinition" class="org.jbpm.pvm.internal.wire.WireDefinition">
- <map name="descriptors" cascade="all-delete-orphan" lazy="false">
- <key foreign-key="FK_DESCR_PROPS">
- <column name="PROPS_" index="IDX_DESCR_PROPS" />
- </key>
- <map-key type="string" column="NAME_" />
- <one-to-many class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor" />
- </map>
- </component>
- </component>
- </class>
-
-
- <!-- ### QUERIES ######################################################## -->
-
- <query name="findProcessDefinitionKeys">
- <![CDATA[
- select distinct process.key
- from org.jbpm.pvm.internal.model.ProcessDefinitionImpl as process
- order by process.key asc
- ]]>
- </query>
-
- <query name="findProcessDefinitionsByKey">
- <![CDATA[
- select process
- from org.jbpm.pvm.internal.model.ProcessDefinitionImpl as process
- where process.key = :key
- order by process.version desc
- ]]>
- </query>
-
- <query name="findProcessDefinitionById">
- <![CDATA[
- select process
- from org.jbpm.pvm.internal.model.ProcessDefinitionImpl as process
- where process.id = :id
- ]]>
- </query>
-
- <query name="findProcessDefinitionKeysByName">
- <![CDATA[
- select process.key
- from org.jbpm.pvm.internal.model.ProcessDefinitionImpl as process
- where process.name = :name
- ]]>
- </query>
-
- <query name="findProcessDefinitionNamesByKey">
- <![CDATA[
- select process.name
- from org.jbpm.pvm.internal.model.ProcessDefinitionImpl as process
- where process.key = :key
- ]]>
- </query>
-
-</hibernate-mapping>
\ No newline at end of file
Modified: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.history.hbm.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.history.hbm.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.history.hbm.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -63,7 +63,7 @@
<property name="transitionName" column="TRANSITION_" />
<subclass name="HistoryAutomaticInstanceImpl" discriminator-value="AUT">
- <subclass name="HistoryExclusiveInstanceImpl" discriminator-value="EXCL" />
+ <subclass name="HistoryDecisionInstanceImpl" discriminator-value="EXCL" />
</subclass>
<subclass name="HistoryTaskInstanceImpl" discriminator-value="TASK">
Modified: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.jpdl.activities.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.jpdl.activities.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.jpdl.activities.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -1,7 +1,7 @@
<activities>
<activity binding="org.jbpm.jpdl.internal.activity.StartBinding" />
<activity binding="org.jbpm.jpdl.internal.activity.StateBinding" />
- <activity binding="org.jbpm.jpdl.internal.activity.ExclusiveBinding" />
+ <activity binding="org.jbpm.jpdl.internal.activity.DecisionBinding" />
<activity binding="org.jbpm.jpdl.internal.activity.EndBinding" />
<activity binding="org.jbpm.jpdl.internal.activity.EndCancelBinding" />
<activity binding="org.jbpm.jpdl.internal.activity.EndErrorBinding" />
Modified: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.jpdl.hbm.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.jpdl.hbm.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.jpdl.hbm.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -44,14 +44,14 @@
</id>
<discriminator column="CLASS_" />
<subclass name="org.jbpm.jpdl.internal.activity.StartActivity" discriminator-value="start" />
- <subclass name="org.jbpm.jpdl.internal.activity.ExclusiveConditionActivity" discriminator-value="excl-cond" />
- <subclass name="org.jbpm.jpdl.internal.activity.ExclusiveExpressionActivity" discriminator-value="excl-expr">
+ <subclass name="org.jbpm.jpdl.internal.activity.DecisionConditionActivity" discriminator-value="excl-cond" />
+ <subclass name="org.jbpm.jpdl.internal.activity.DecisionExpressionActivity" discriminator-value="excl-expr">
<property name="expr" column="TEXT_" />
<property name="lang" column="TEXT2_" />
</subclass>
- <subclass name="org.jbpm.jpdl.internal.activity.ExclusiveHandlerActivity" discriminator-value="excl-handler">
- <property name="exclusiveHandlerName" column="TEXT_" />
- <many-to-one name="exclusiveHandlerDescriptor"
+ <subclass name="org.jbpm.jpdl.internal.activity.DecisionHandlerActivity" discriminator-value="excl-handler">
+ <property name="decisionHandlerName" column="TEXT_" />
+ <many-to-one name="decisionHandlerDescriptor"
column="EXCLDESCR_"
cascade="all"
class="org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor"
Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveMessagesTest.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveMessagesTest.java 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveMessagesTest.java 2009-04-13 08:59:29 UTC (rev 4542)
@@ -54,8 +54,8 @@
exclusiveThreadIds = new HashMap<String, Set<Long>>();
}
- public void testExclusiveMessageProcessing() {
- insertExclusiveTestMessages();
+ public void testDecisionMessageProcessing() {
+ insertDecisionTestMessages();
JobExecutor jobExecutor = processEngine.get(JobExecutor.class);
jobExecutor.start();
@@ -97,7 +97,7 @@
}
}
- public void insertExclusiveTestMessages() {
+ public void insertDecisionTestMessages() {
commandService.execute(new Command<Object>() {
public Object execute(Environment environment) throws Exception {
ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) ProcessDefinitionBuilder
Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Jpdl.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Jpdl.xml 2009-04-10 15:36:35 UTC (rev 4541)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Jpdl.xml 2009-04-13 08:59:29 UTC (rev 4542)
@@ -20,10 +20,10 @@
<transition name="Supplier not ok" to="Error" />
</state>
- <exclusive name="Check supplier data">
+ <decision name="Check supplier data">
<transition name="nok" to="Error" />
<transition name="ok" to="Completed" />
- </exclusive>
+ </decision>
<end name="Completed" />
@@ -252,22 +252,22 @@
</section>
</section>
- <section id="exclusive">
- <title><literal>exclusive</literal></title>
- <para>Takes one path of many alternatives. Also known as a decision. An exclusive
- activity has multiple outgoing transitions and when an execution arrives in an exclusive
+ <section id="decision">
+ <title><literal>decision</literal></title>
+ <para>Takes one path of many alternatives. Also known as a decision. A decision
+ activity has multiple outgoing transitions and when an execution arrives in a decision
activity, an automatic evaluation will decide which outgoing transition is taken.
</para>
- <para>An exclusive activity should be configured in one of the three following ways:
+ <para>A decision activity should be configured in one of the three following ways:
</para>
- <section id="exclusiveconditions">
- <title>Exclusive conditions</title>
- <para>An exclusive with conditions on the transitions evaluates the condition in each transition.
+ <section id="decisionconditions">
+ <title>Decision conditions</title>
+ <para>A decision with conditions on the transitions evaluates the condition in each transition.
The first transition for which the nested condition expression resolves to true or which does
not have a condition is taken.
</para>
- <table><title><literal>exclusive.transition.condition</literal> attributes:</title>
+ <table><title><literal>decision.transition.condition</literal> attributes:</title>
<tgroup cols="5" rowsep="1" colsep="1">
<thead>
<row>
@@ -302,17 +302,17 @@
</table>
<para>Example:
</para>
- <figure id="process.exclusive.condition">
- <title>The exclusive conditions example process</title>
- <mediaobject><imageobject><imagedata align="center" fileref="images/process.exclusive.png"/></imageobject></mediaobject>
+ <figure id="process.decision.condition">
+ <title>The decision conditions example process</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.decision.png"/></imageobject></mediaobject>
</figure>
- <programlisting><process name="ExclusiveConditions" >
+ <programlisting><process name="DecisionConditions" >
<start>
<transition to="evaluate document" />
</start>
- <exclusive name="evaluate document">
+ <decision name="evaluate document">
<transition to="submit document">
<emphasis role="bold"><condition expr="#{content=="good"}" /></emphasis>
</transition>
@@ -320,7 +320,7 @@
<emphasis role="bold"><condition expr="#{content=="not so good"}" /></emphasis>
</transition>
<transition to="give up" />
- </exclusive>
+ </decision>
<state name="submit document" />
@@ -331,12 +331,12 @@
</process></programlisting>
</section>
- <section id="exclusiveexpression">
- <title>Exclusive expression</title>
- <para>An exclusive expression evaluates to a String representing the name of
+ <section id="decisionexpression">
+ <title>Decision expression</title>
+ <para>A decision expression evaluates to a String representing the name of
an outgoing transition.
</para>
- <table><title><literal>exclusive</literal> attributes:</title>
+ <table><title><literal>decision</literal> attributes:</title>
<tgroup cols="5" rowsep="1" colsep="1">
<thead>
<row>
@@ -371,18 +371,18 @@
</table>
<para>Example:
</para>
- <figure id="process.exclusive.expression">
- <title>The exclusive expression example process</title>
- <mediaobject><imageobject><imagedata align="center" fileref="images/process.exclusive.png"/></imageobject></mediaobject>
+ <figure id="process.decision.expression">
+ <title>The decision expression example process</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.decision.png"/></imageobject></mediaobject>
</figure>
<programlisting><process name="Poolcar">
<start>
<transition to="How far?" />
</start>
- <exclusive name="How far?" <emphasis role="bold">expr="#{distance}"</emphasis>>
+ <decision name="How far?" <emphasis role="bold">expr="#{distance}"</emphasis>>
<transition name="far" to="Big car" />
<transition name="nearby" to="Small car" />
- </exclusive>
+ </decision>
<state name="Big car" />
<state name="Small car" />
</process></programlisting>
@@ -394,17 +394,17 @@
<para>then the new execution will go to activity <literal>Big car</literal>.</para>
</section>
- <section id="exclusivehandler">
- <title>Exclusive handler</title>
- <para>An exclusive handler is a java class that implements the
- <literal>ExclusiveHandler</literal> interface. The exclusive handler
+ <section id="decisionhandler">
+ <title>Decision handler</title>
+ <para>A decision handler is a java class that implements the
+ <literal>DecisionHandler</literal> interface. The decision handler
will be responsible for selecting the name of the outgoing transition.
</para>
- <programlisting>public interface ExclusiveHandler {
+ <programlisting>public interface DecisionHandler {
String select(OpenExecution execution);
}</programlisting>
- <para>The handler is specified as a sub element of the exclusive</para>
- <table><title><literal>exclusive.handler</literal> attributes:</title>
+ <para>The handler is specified as a sub element of the decision</para>
+ <table><title><literal>decision.handler</literal> attributes:</title>
<tgroup cols="5" rowsep="1" colsep="1">
<thead>
<row>
@@ -427,23 +427,23 @@
</tbody>
</tgroup>
</table>
- <para>Here's an example process of an exclusive using an ExclusiveHandler:</para>
- <figure id="process.exclusive.handler">
- <title>The exclusive handler example process</title>
- <mediaobject><imageobject><imagedata align="center" fileref="images/process.exclusive.png"/></imageobject></mediaobject>
+ <para>Here's an example process of a decision using a DecisionHandler:</para>
+ <figure id="process.decision.handler">
+ <title>The decision handler example process</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.decision.png"/></imageobject></mediaobject>
</figure>
- <programlisting><process name="ExclusiveHandler">
+ <programlisting><process name="DecisionHandler">
<start>
<transition to="evaluate document" />
</start>
- <exclusive name="evaluate document">
- <handler class="org.jbpm.examples.exclusive.handler.ContentEvaluation" />
+ <decision name="evaluate document">
+ <handler class="org.jbpm.examples.decision.handler.ContentEvaluation" />
<transition name="good" to="submit document" />
<transition name="bad" to="try again" />
<transition name="ugly" to="give up" />
- </exclusive>
+ </decision>
<state name="submit document" />
@@ -453,7 +453,7 @@
</process></programlisting>
<para>The ContentEvaluation class looks like this</para>
- <programlisting>public class ContentEvaluation implements ExclusiveHandler {
+ <programlisting>public class ContentEvaluation implements DecisionHandler {
public String select(OpenExecution execution) {
String content = (String) execution.getVariable("content");
17 years
JBoss JBPM SVN: r4541 - jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/repository.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-04-10 11:36:35 -0400 (Fri, 10 Apr 2009)
New Revision: 4541
Modified:
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/repository/JpdlDeployer.java
Log:
JBPM-2158 fixed deployment reload problem
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-04-10 15:21:24 UTC (rev 4540)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/repository/JpdlDeployer.java 2009-04-10 15:36:35 UTC (rev 4541)
@@ -69,10 +69,10 @@
if (deployment.hasObjectProperties(processDefinitionName)) {
String key = (String) deployment.getObjectProperty(processDefinitionName, KEY_KEY);
String id = (String) deployment.getObjectProperty(processDefinitionName, KEY_ID);
- String version = (String) deployment.getObjectProperty(processDefinitionName, KEY_VERSION);
+ Long version = (Long) deployment.getObjectProperty(processDefinitionName, KEY_VERSION);
processDefinition.setId(id);
processDefinition.setKey(key);
- processDefinition.setVersion(Integer.parseInt(version));
+ processDefinition.setVersion(version.intValue());
} else {
checkKey(processDefinition, deployment);
17 years
JBoss JBPM SVN: r4540 - in jbpm4/trunk/modules/distro: scripts and 1 other directory.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-04-10 11:21:24 -0400 (Fri, 10 Apr 2009)
New Revision: 4540
Added:
jbpm4/trunk/modules/distro/scripts/assembly-jbpm-single-jar.xml
Modified:
jbpm4/trunk/modules/distro/pom.xml
Log:
re-enabling the jbpm single jar
Modified: jbpm4/trunk/modules/distro/pom.xml
===================================================================
--- jbpm4/trunk/modules/distro/pom.xml 2009-04-10 15:04:49 UTC (rev 4539)
+++ jbpm4/trunk/modules/distro/pom.xml 2009-04-10 15:21:24 UTC (rev 4540)
@@ -172,10 +172,8 @@
<version>2.2-beta-2</version>
<executions>
- <!-- Installer -->
-
<execution>
- <id>create-installer</id>
+ <id>prepare-files-for-installer</id>
<phase>process-resources</phase>
<goals>
<goal>directory-single</goal>
@@ -190,6 +188,22 @@
</configuration>
</execution>
+ <execution>
+ <id>generate-jbpm-single-jar</id>
+ <phase>package</phase>
+ <goals>
+ <goal>assembly</goal>
+ </goals>
+ <configuration>
+ <finalName>jbpm</finalName>
+ <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
+ <appendAssemblyId>false</appendAssemblyId>
+ <descriptors>
+ <descriptor>scripts/assembly-jbpm-single-jar.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+
</executions>
</plugin>
Added: jbpm4/trunk/modules/distro/scripts/assembly-jbpm-single-jar.xml
===================================================================
--- jbpm4/trunk/modules/distro/scripts/assembly-jbpm-single-jar.xml (rev 0)
+++ jbpm4/trunk/modules/distro/scripts/assembly-jbpm-single-jar.xml 2009-04-10 15:21:24 UTC (rev 4540)
@@ -0,0 +1,46 @@
+<assembly>
+ <id>package</id>
+ <formats>
+ <format>jar</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <dependencySets>
+ <dependencySet>
+ <includes>
+ <include>org.jbpm.jbpm4:jbpm-api</include>
+ </includes>
+ <unpack>true</unpack>
+ <outputFileNameMapping></outputFileNameMapping>
+ <outputDirectory></outputDirectory>
+ </dependencySet>
+ <dependencySet>
+ <includes>
+ <include>org.jbpm.jbpm4:jbpm-log</include>
+ </includes>
+ <unpack>true</unpack>
+ <outputFileNameMapping></outputFileNameMapping>
+ <outputDirectory></outputDirectory>
+ </dependencySet>
+ <dependencySet>
+ <includes>
+ <include>org.jbpm.jbpm4:jbpm-pvm</include>
+ </includes>
+ <unpack>true</unpack>
+ <outputDirectory></outputDirectory>
+ </dependencySet>
+ <dependencySet>
+ <includes>
+ <include>org.jbpm.jbpm4:jbpm-jpdl</include>
+ </includes>
+ <unpack>true</unpack>
+ <outputDirectory></outputDirectory>
+ </dependencySet>
+ <dependencySet>
+ <includes>
+ <include>org.jbpm.jbpm4:jbpm-test-base</include>
+ </includes>
+ <unpack>true</unpack>
+ <outputDirectory></outputDirectory>
+ </dependencySet>
+ </dependencySets>
+</assembly>
Property changes on: jbpm4/trunk/modules/distro/scripts/assembly-jbpm-single-jar.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years
JBoss JBPM SVN: r4539 - jbpm4/branches/email/modules/userguide/src/main/docbook/en/modules.
by do-not-reply@jboss.org
Author: bradsdavis
Date: 2009-04-10 11:04:49 -0400 (Fri, 10 Apr 2009)
New Revision: 4539
Modified:
jbpm4/branches/email/modules/userguide/src/main/docbook/en/modules/ch09-Emails.xml
Log:
Added custom email example.
Modified: jbpm4/branches/email/modules/userguide/src/main/docbook/en/modules/ch09-Emails.xml
===================================================================
--- jbpm4/branches/email/modules/userguide/src/main/docbook/en/modules/ch09-Emails.xml 2009-04-10 14:54:55 UTC (rev 4538)
+++ jbpm4/branches/email/modules/userguide/src/main/docbook/en/modules/ch09-Emails.xml 2009-04-10 15:04:49 UTC (rev 4539)
@@ -10,9 +10,9 @@
</section>
<section id="scriptableemails">
<title>Producers</title>
- <para>Producers are responsible for creating emails within jBPM. All mail producers implement the <literal>MailProducer</literal> interface.
+ <para>Producers are responsible for creating emails within jBPM. All mail producers implement the <literal>org.jbpm.pvm.internal.email.producer.MailProducer</literal> interface.
Several out-of-the-box implementations have been created to address simple email needs.</para>
- <para>For complex emails or custom generation of attachments, see: <link linkend="customemails">Extension Points: Custom Emails</link>.</para>
+
<section id="standardemailformat">
<title>Standard</title>
<para>Used to send non-scripted text emails.</para>
@@ -51,7 +51,7 @@
<tbody>
<row>
<entry><literal>language</literal></entry>
- <entry>The scripting language used to resolve properties within the subject and textual body.</entry>
+ <entry>The scripting language used to resolve properties within the subject and textual body. If not provided, the default script language is applied.</entry>
</row>
<row>
<entry><literal>subject</literal></entry>
@@ -80,7 +80,7 @@
<tbody>
<row>
<entry><literal>language</literal></entry>
- <entry>The scripting language used to resolve properties within the subject, textual body, and HTML body.</entry>
+ <entry>The scripting language used to resolve properties within the subject, textual body, and HTML body. If not provided, the default script language is applied.</entry>
</row>
<row>
<entry><literal>subject</literal></entry>
@@ -97,12 +97,17 @@
</tbody>
</tgroup>
</table>
+ <para>For complex emails or custom generation of attachments, see: <link linkend="customemails">Extension Points: Custom Emails</link>.</para>
</section>
<section id="emailtemplates">
<title>Templates</title>
<para>Templates are available to externalize commonly used messages from jPDL definitions. In jBPM 4, templates can produce either standard or HTML message; also, templates
can support any scripting language supported by the jBPM Script Manager. As you will see, any <literal>MailProducer</literal> implementation available to jPDL is also available to be templated.
</para>
+ <para>The following is an example of a scriptable Email Template.</para>
+ <programlisting>TODO</programlisting>
+ <para>The following is an example of a scriptable HTML Email Template.</para>
+ <programlisting>TODO</programlisting>
</section>
<section id="emailserverconfiguration">
<title>Server Configuration</title>
@@ -201,11 +206,16 @@
<title>Extension Points</title>
<section id="addressresolvers">
<title>Address Resolvers</title>
+ <para>When implementing a different Identity Management in jBPM [such as LDAP], an Address Resolver is required to resolve Actor and Group email addresses from the Identity Management system.</para>
+ <para>Address Resolvers must implement the <literal>org.jbpm.pvm.internal.email.resolver.AddressResolver</literal> interface. Provided with a User or Group Identifier, the should return valid JavaMail <literal>javax.mail.internet.InternetAddress</literal>es for the given identifier.</para>
+ <para>Plugging in a custom Address Resolver to jBPM is handled within the jBPM Configuration. The following is an example of providing a custom Address Resolver within <literal>jbpm.cfg.xml</literal>.</para>
+ <programlisting>TODO</programlisting>
+
</section>
<section id="customemails">
<title>Custom Emails</title>
<para>jBPM 4 allows the creation of your own Email Producers to address an organization's specific email needs.
- To do so, users must implement the <literal>MailProducer</literal> interface. The method produce will return one or more Email objects, which jBPM will then send using the jBPM MailSession.
+ To do so, users must implement the <literal>org.jbpm.pvm.internal.email.producer.MailProducer</literal> interface. The method produce will return one or more Email objects, which jBPM will then send using the jBPM MailSession.
<para>Apache Commons Email was choosen to simplify the email interface for jBPM. All emails returned by the MailProducer implementation must extend the base <literal>org.apache.commons.mail.Email</literal>.</para>
<para>See the Apache Commons for more information on supported <literal>Email</literal> types:
<ulink url="http://commons.apache.org/email/">Apache Commons Email</ulink>.</para>
@@ -213,6 +223,34 @@
<section id="generatedemailattachments">
<title>Attachments</title>
+ <para>
+ Generation of custom attachments at runtime can be easily implemented in jBPM 4. By extending out-of-the-box mail producers, or implementing your own with the <literal>MailProducer</literal> interface, attachments can be generated, attachments can be generated and added to
+ emails at runtime.
+ </para>
+ <para>The following is an example of how to extend <literal>HtmlScriptMailProducer</literal> to produce HTML emails with custom attachments.</para>
+ <programlisting>public class CustomAttachmentHtmlScriptMailProducer extends HtmlScriptMailProducer{
+
+ @Override
+ public Collection<Email> produce(Execution exe, MailContext mailContext)
+ throws Exception {
+ //Use the HTML producer to create the body, subject, text.
+ Collection<Email> emails = super.produce(exe, mailContext);
+
+ //Add custom code to generate attachments here.
+ EmailAttachment attachment = null;
+
+ for(Email email : emails)
+ {
+ //We know it's a collection of HTML email.
+ HtmlEmail html = (HtmlEmail)email;
+ //Add your custom attachment.
+ html.attach(attachment);
+ }
+
+ return emails;
+
+ }
+}</programlisting>
</section>
</section>
17 years
JBoss JBPM SVN: r4538 - in jbpm4/trunk/modules: jpdl/src/main/java/org/jbpm/jpdl/internal/activity and 1 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-04-10 10:54:55 -0400 (Fri, 10 Apr 2009)
New Revision: 4538
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ForkActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JoinActivity.java
jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/SubProcessTest.java
jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionBasedConcurrencyTest.java
Log:
JBPM-2134 removed execution hierarchy methods and sub process instance methods from ActivityExecution interface
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java 2009-04-10 14:48:00 UTC (rev 4537)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java 2009-04-10 14:54:55 UTC (rev 4538)
@@ -134,62 +134,6 @@
/** position the given execution in the destination activity */
void setActivity(Activity destination, Execution execution);
- // managing the parent-child relation ///////////////////////////////////////
-
- /** creates a child execution. See
- * {@link #createExecution(Execution, String)} for more information. */
- Execution createExecution();
-
- /** creates a child execution with the given name. See
- * {@link #createExecution(Execution, String)} for more information. */
- Execution createExecution(String name);
-
- /** creates a new child execution under the given parent. See
- * {@link #createExecution(Execution, String)} for more information.
- * @throws JbpmException if the given parent is not in this execution's
- * process instance. */
- Execution createExecution(Execution parent);
-
- /** creates a new child execution under the given parent with the given name.
- * Only leaf executions can be active. So creating the first child execution
- * will {@link Execution#STATE_INACTIVE inactivate} the parent execution
- * automatically.
- * @throws JbpmException if the given parent is not in this execution's
- * process instance. */
- Execution createExecution(String name, Execution parent);
-
- /** removes the child execution from this execution. Removing the last
- * child execution of a parent will cause the parent's state to become
- * {@link Execution#STATE_ACTIVE active}. */
- void removeExecution(Execution child);
-
- /** removes the child execution from the given parent. Removing the last
- * child execution of a parent will cause the parent's state to become
- * {@link Execution#STATE_ACTIVE active}. */
- void removeExecution(Execution child, Execution parent);
-
- // create sub process execution /////////////////////////////////////////////
-
- /** creates a sub process related to this path of execution.
- * ProcessDefinitions can be obtained from the {@link PvmDbSession}
- * in the {@link Environment}. */
- ClientProcessInstance createSubProcessInstance(ClientProcessDefinition processDefinition);
-
- /** creates a sub process related to this path of execution.
- * ProcessDefinitions can be obtained from the {@link PvmDbSession}
- * in the {@link Environment}. */
- ClientProcessInstance createSubProcessInstance(ClientProcessDefinition processDefinition, String key);
-
- /** creates and begins a sub process related to this path of execution.
- * ProcessDefinitions can be obtained from the {@link PvmDbSession}
- * in the {@link Environment}. */
- ClientProcessInstance beginSubProcessInstance(ClientProcessDefinition processDefinition);
-
- /** creates and begins a sub process related to this path of execution.
- * ProcessDefinitions can be obtained from the {@link PvmDbSession}
- * in the {@link Environment}. */
- ClientProcessInstance beginSubProcessInstance(ClientProcessDefinition processDefinition, String key);
-
// ending an execution //////////////////////////////////////////////////////
/** ends this execution and all of its child executions.
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ForkActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ForkActivity.java 2009-04-10 14:48:00 UTC (rev 4537)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ForkActivity.java 2009-04-10 14:54:55 UTC (rev 4538)
@@ -28,6 +28,7 @@
import org.jbpm.model.Activity;
import org.jbpm.model.OpenExecution;
import org.jbpm.model.Transition;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
/**
@@ -48,7 +49,8 @@
// launch a concurrent path of execution
String childExecutionName = outgoingTransition.getName();
// creating the execution will cause the execution to become inactive
- Execution childExecution = execution.createExecution(childExecutionName, processInstance);
+ ExecutionImpl executionImpl = (ExecutionImpl) execution;
+ Execution childExecution = executionImpl.createExecution(childExecutionName, processInstance);
execution.take(outgoingTransition, childExecution);
}
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JoinActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JoinActivity.java 2009-04-10 14:48:00 UTC (rev 4537)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JoinActivity.java 2009-04-10 14:54:55 UTC (rev 4538)
@@ -30,6 +30,7 @@
import org.jbpm.model.Activity;
import org.jbpm.model.OpenExecution;
import org.jbpm.model.Transition;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
/**
@@ -59,7 +60,8 @@
) {
outgoingExecution = processInstance;
} else {
- outgoingExecution = execution.createExecution(processInstance);
+ ExecutionImpl executionImpl = (ExecutionImpl) execution;
+ outgoingExecution = executionImpl.createExecution(processInstance);
}
execution.setActivity(join, outgoingExecution);
Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/SubProcessTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/SubProcessTest.java 2009-04-10 14:48:00 UTC (rev 4537)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/SubProcessTest.java 2009-04-10 14:54:55 UTC (rev 4538)
@@ -29,6 +29,7 @@
import org.jbpm.client.ClientExecution;
import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.test.BaseJbpmTestCase;
/**
@@ -44,7 +45,8 @@
this.subProcess = subProcess;
}
public void execute(ActivityExecution execution) throws Exception {
- ClientExecution subProcessInstance = execution.beginSubProcessInstance(subProcess);
+ ExecutionImpl executionImpl = (ExecutionImpl) execution;
+ ClientExecution subProcessInstance = executionImpl.beginSubProcessInstance(subProcess);
if (!subProcessInstance.isEnded()) {
execution.waitForSignal();
}
Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionBasedConcurrencyTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionBasedConcurrencyTest.java 2009-04-10 14:48:00 UTC (rev 4537)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionBasedConcurrencyTest.java 2009-04-10 14:54:55 UTC (rev 4538)
@@ -15,6 +15,7 @@
import org.jbpm.model.OpenExecution;
import org.jbpm.model.Transition;
import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.test.BaseJbpmTestCase;
/**
@@ -38,7 +39,8 @@
// launch a concurrent path of execution
String childExecutionName = outgoingTransition.getName();
// creating the execution will cause the execution to become inactive
- Execution childExecution = execution.createExecution(childExecutionName, processInstance);
+ ExecutionImpl executionImpl = (ExecutionImpl) execution;
+ Execution childExecution = executionImpl.createExecution(childExecutionName, processInstance);
execution.take(outgoingTransition, childExecution);
}
@@ -71,7 +73,8 @@
) {
outgoingExecution = processInstance;
} else {
- outgoingExecution = execution.createExecution(processInstance);
+ ExecutionImpl executionImpl = (ExecutionImpl) execution;
+ outgoingExecution = executionImpl.createExecution(processInstance);
}
execution.setActivity(join, outgoingExecution);
17 years
JBoss JBPM SVN: r4537 - in jbpm4/trunk/modules: jpdl/src/main/java/org/jbpm/jpdl/internal/activity and 2 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-04-10 10:48:00 -0400 (Fri, 10 Apr 2009)
New Revision: 4537
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Activity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JoinActivity.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/TransitionImpl.java
jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionBasedConcurrencyTest.java
Log:
JBPM-1459 renamed Activity.getDefaultTransition to getDefaultOutgoingTransition
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Activity.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Activity.java 2009-04-10 14:22:24 UTC (rev 4536)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Activity.java 2009-04-10 14:48:00 UTC (rev 4537)
@@ -49,7 +49,7 @@
* </p>
*
* <p>One of the outgoing transitions can optionally be marked as
- * {@link #getDefaultTransition() the default transition}.
+ * {@link #getDefaultOutgoingTransition() the default transition}.
* </p>
*
* <p>Block structured process languages have composite activities that can be
@@ -66,7 +66,7 @@
List<Transition> getOutgoingTransitions();
/** the default outgoing transition. */
- Transition getDefaultTransition();
+ Transition getDefaultOutgoingTransition();
/** the first leaving transition with the given name or null of no
* such leaving transition exists. If the multiple transitions have
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JoinActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JoinActivity.java 2009-04-10 14:22:24 UTC (rev 4536)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JoinActivity.java 2009-04-10 14:48:00 UTC (rev 4537)
@@ -63,7 +63,7 @@
}
execution.setActivity(join, outgoingExecution);
- Transition transition = join.getDefaultTransition();
+ Transition transition = join.getDefaultOutgoingTransition();
execution.take(transition, outgoingExecution);
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java 2009-04-10 14:22:24 UTC (rev 4536)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java 2009-04-10 14:48:00 UTC (rev 4537)
@@ -42,7 +42,7 @@
protected ObjectReference<ActivityBehaviour> behaviourReference;
protected List<TransitionImpl> outgoingTransitions;
protected List<TransitionImpl> incomingTransitions;
- protected TransitionImpl defaultTransition;
+ protected TransitionImpl defaultOutgoingTransition;
protected ActivityImpl parentActivity;
protected String type;
@@ -91,9 +91,9 @@
addOutgoingTransition(transition);
// if there is no default transition yet
- if (defaultTransition==null) {
+ if (defaultOutgoingTransition==null) {
// make this the default outgoing transition
- defaultTransition = transition;
+ defaultOutgoingTransition = transition;
}
return transition;
@@ -124,9 +124,9 @@
addOutgoingTransition(transition);
// if there is no default transition yet
- if (defaultTransition==null) {
+ if (defaultOutgoingTransition==null) {
// make this the default outgoing transition
- defaultTransition = transition;
+ defaultOutgoingTransition = transition;
}
return transition;
@@ -206,8 +206,8 @@
/** searches for the default transition in this activity and then up the
* parent chain. Returns null if no such transition is found. */
public TransitionImpl findDefaultTransition() {
- if (defaultTransition!=null) {
- return defaultTransition;
+ if (defaultOutgoingTransition!=null) {
+ return defaultOutgoingTransition;
}
if (parentActivity!=null) {
return parentActivity.findDefaultTransition();
@@ -442,11 +442,11 @@
public void setName(String name) {
this.name = name;
}
- public TransitionImpl getDefaultTransition() {
- return defaultTransition;
+ public TransitionImpl getDefaultOutgoingTransition() {
+ return defaultOutgoingTransition;
}
- public void setDefaultTransition(TransitionImpl defaultTransition) {
- this.defaultTransition = defaultTransition;
+ public void setDefaultOutgoingTransition(TransitionImpl defaultOutgoingTransition) {
+ this.defaultOutgoingTransition = defaultOutgoingTransition;
}
public ActivityImpl getParentActivity() {
return parentActivity;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-04-10 14:22:24 UTC (rev 4536)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-04-10 14:48:00 UTC (rev 4537)
@@ -412,7 +412,7 @@
/** @see Execution#takeDefaultTransition() */
public void takeDefaultTransition() {
- TransitionImpl defaultTransition = getActivity().getDefaultTransition();
+ TransitionImpl defaultTransition = getActivity().getDefaultOutgoingTransition();
if (defaultTransition==null) {
throw new JbpmException("there is no default transition in "+getActivity());
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/TransitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/TransitionImpl.java 2009-04-10 14:22:24 UTC (rev 4536)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/TransitionImpl.java 2009-04-10 14:48:00 UTC (rev 4537)
@@ -49,7 +49,7 @@
}
public void makeDefault() {
- source.setDefaultTransition(this);
+ source.setDefaultOutgoingTransition(this);
}
public String toString() {
Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionBasedConcurrencyTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionBasedConcurrencyTest.java 2009-04-10 14:22:24 UTC (rev 4536)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionBasedConcurrencyTest.java 2009-04-10 14:48:00 UTC (rev 4537)
@@ -75,7 +75,7 @@
}
execution.setActivity(join, outgoingExecution);
- Transition transition = join.getDefaultTransition();
+ Transition transition = join.getDefaultOutgoingTransition();
execution.take(transition, outgoingExecution);
}
}
17 years
JBoss JBPM SVN: r4536 - in jbpm4/trunk/modules/pvm/src: main/java/org/jbpm/pvm/internal/cmd and 5 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-04-10 10:22:24 -0400 (Fri, 10 Apr 2009)
New Revision: 4536
Added:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/JbpmConfigurationParser.java
Removed:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/PvmEnvironmentFactoryParser.java
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeployCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireDefinition.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parse.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ContextBlockSubscriptionTest.java
Log:
added import to jbpm configuration file parser
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java 2009-04-10 12:03:38 UTC (rev 4535)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java 2009-04-10 14:22:24 UTC (rev 4536)
@@ -42,7 +42,7 @@
import org.jbpm.env.WireObject;
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.env.PvmEnvironment;
-import org.jbpm.pvm.internal.env.PvmEnvironmentFactoryParser;
+import org.jbpm.pvm.internal.env.JbpmConfigurationParser;
import org.jbpm.pvm.internal.stream.FileStreamInput;
import org.jbpm.pvm.internal.stream.InputStreamInput;
import org.jbpm.pvm.internal.stream.ResourceStreamInput;
@@ -87,11 +87,11 @@
private static final long serialVersionUID = 1L;
private static final Log log = Log.getLog(JbpmConfiguration.class.getName());
- protected static PvmEnvironmentFactoryParser pvmEnvironmentFactoryParser = new PvmEnvironmentFactoryParser();
+ protected static JbpmConfigurationParser pvmEnvironmentFactoryParser = new JbpmConfigurationParser();
protected boolean isConfigured = false;
- protected WireContext environmentFactoryCtxWireContext = null;
- protected WireDefinition transactionCtxWireDefinition = null;
+ protected WireContext processEngineWireContext = new WireContext(new WireDefinition(), Context.CONTEXTNAME_PROCESS_ENGINE);
+ protected WireDefinition transactionWireDefinition = new WireDefinition();
public JbpmConfiguration() {
super((Configuration)null);
@@ -105,7 +105,7 @@
}
public void setSessionFactory(Object sessionFactory) {
- environmentFactoryCtxWireContext
+ processEngineWireContext
.getWireDefinition()
.addDescriptor(new ProvidedObjectDescriptor(sessionFactory));
}
@@ -137,7 +137,7 @@
protected void parse(StreamInput streamSource) {
isConfigured = true;
- PvmEnvironmentFactoryParser.getInstance()
+ JbpmConfigurationParser.getInstance()
.createParse()
.setDocumentObject(this)
.setStreamSource(streamSource)
@@ -146,22 +146,22 @@
}
public ExecutionService getExecutionService() {
- return environmentFactoryCtxWireContext.get(ExecutionService.class);
+ return processEngineWireContext.get(ExecutionService.class);
}
public HistoryService getHistoryService() {
- return environmentFactoryCtxWireContext.get(HistoryService.class);
+ return processEngineWireContext.get(HistoryService.class);
}
public ManagementService getManagementService() {
- return environmentFactoryCtxWireContext.get(ManagementService.class);
+ return processEngineWireContext.get(ManagementService.class);
}
public TaskService getTaskService() {
- return environmentFactoryCtxWireContext.get(TaskService.class);
+ return processEngineWireContext.get(TaskService.class);
}
public IdentityService getIdentityService() {
- return environmentFactoryCtxWireContext.get(IdentityService.class);
+ return processEngineWireContext.get(IdentityService.class);
}
public RepositoryService getRepositoryService() {
- return environmentFactoryCtxWireContext.get(RepositoryService.class);
+ return processEngineWireContext.get(RepositoryService.class);
}
public static EnvironmentFactory parseXmlString(String xmlString) {
@@ -182,18 +182,18 @@
if (log.isTraceEnabled()) log.trace("opening " + environment);
// set the classloader
- ClassLoader classLoader = environmentFactoryCtxWireContext.getClassLoader();
+ ClassLoader classLoader = processEngineWireContext.getClassLoader();
if (classLoader != null) {
environment.setClassLoader(classLoader);
}
// add the process-engine context
- environment.addContext(environmentFactoryCtxWireContext);
+ environment.addContext(processEngineWireContext);
// add the transaction context
- WireDefinition usedWireDefinition = transactionCtxWireDefinition;
+ WireDefinition usedWireDefinition = transactionWireDefinition;
if (txWireObjects!=null) {
- usedWireDefinition = new WireDefinition(transactionCtxWireDefinition, txWireObjects);
+ usedWireDefinition = new WireDefinition(transactionWireDefinition, txWireObjects);
}
WireContext transactionContext = new WireContext(usedWireDefinition, Context.CONTEXTNAME_TRANSACTION, environment, true);
@@ -215,48 +215,56 @@
}
public void close() {
- environmentFactoryCtxWireContext.fire(WireContext.EVENT_CLOSE, null);
+ processEngineWireContext.fire(WireContext.EVENT_CLOSE, null);
}
// process-engine context delegation methods
// ///////////////////////////////////
public Object get(String key) {
- return environmentFactoryCtxWireContext.get(key);
+ return processEngineWireContext.get(key);
}
public <T> T get(Class<T> type) {
- return environmentFactoryCtxWireContext.get(type);
+ return processEngineWireContext.get(type);
}
public String getName() {
- return environmentFactoryCtxWireContext.getName();
+ return processEngineWireContext.getName();
}
public boolean has(String key) {
- return environmentFactoryCtxWireContext.has(key);
+ return processEngineWireContext.has(key);
}
public Set<String> keys() {
- return environmentFactoryCtxWireContext.keys();
+ return processEngineWireContext.keys();
}
public Object set(String key, Object value) {
- return environmentFactoryCtxWireContext.set(key, value);
+ return processEngineWireContext.set(key, value);
}
+
+ public void addProcessEngineWireDefinition(WireDefinition wireDefinition) {
+ processEngineWireContext.getWireDefinition().addWireDefinition(wireDefinition);
+ }
+ public void addTransactionWireDefinition(WireDefinition wireDefinition) {
+ transactionWireDefinition.addWireDefinition(wireDefinition);
+ }
+
// getters and setters //////////////////////////////////////////////////////
- public void setTransactionCtxWireDefinition(WireDefinition blockWireDefinition) {
- this.transactionCtxWireDefinition = blockWireDefinition;
+ public void setTransactionWireDefinition(WireDefinition transactionWireDefinition) {
+ this.transactionWireDefinition = transactionWireDefinition;
}
- public WireContext getEnvironmentFactoryCtxWireContext() {
- return environmentFactoryCtxWireContext;
+ public WireContext getProcessEngineWireContext() {
+ return processEngineWireContext;
}
- public void setEnvironmentFactoryCtxWireContext(WireContext applicationWireContext) {
- this.environmentFactoryCtxWireContext = applicationWireContext;
+ public void setProcessEngineWireContext(WireContext processEngineWireContext) {
+ this.processEngineWireContext = processEngineWireContext;
}
- public WireDefinition getTransactionCtxWireDefinition() {
- return transactionCtxWireDefinition;
+ public WireDefinition getTransactionWireDefinition() {
+ return transactionWireDefinition;
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeployCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeployCmd.java 2009-04-10 12:03:38 UTC (rev 4535)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeployCmd.java 2009-04-10 14:22:24 UTC (rev 4536)
@@ -49,12 +49,9 @@
long deploymentDbid = repositorySession.deploy(deployment);
if (deployment.hasProblems()) {
- String problemsText = deployment.getProblemsText();
- if (problemsText!=null) {
- String errorMsg = "problems during deployment of "+deployment+": "+problemsText;
- log.info(errorMsg);
- throw new JbpmException(errorMsg);
- }
+ JbpmException jbpmException = deployment.getJbpmException();
+ log.info("problems during deployment of "+deployment+": "+jbpmException.getMessage());
+ throw jbpmException;
}
return deploymentDbid;
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/JbpmConfigurationParser.java (from rev 4513, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/PvmEnvironmentFactoryParser.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/JbpmConfigurationParser.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/JbpmConfigurationParser.java 2009-04-10 14:22:24 UTC (rev 4536)
@@ -0,0 +1,135 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.env;
+
+import org.jbpm.env.EnvironmentFactory;
+import org.jbpm.pvm.internal.cfg.JbpmConfiguration;
+import org.jbpm.pvm.internal.stream.StreamInput;
+import org.jbpm.pvm.internal.util.XmlUtil;
+import org.jbpm.pvm.internal.wire.WireDefinition;
+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.Document;
+import org.w3c.dom.Element;
+
+/** parses the <code>jbpm-configuration</code>, which is assumed the document element
+ * and can contain the {@link EnvironmentFactoryXmlParser process-engine}
+ * context and the {@link EnvironmentXmlParser environment} context.
+ *
+ * See {@link Parser} for usage instructions.
+ *
+ * @author Tom Baeyens
+ */
+public class JbpmConfigurationParser extends Parser {
+
+ private static final long serialVersionUID = 1L;
+
+ Parser environmentFactoryXmlParser = new WireParser();
+ Parser environmentXmlParser = new WireParser();
+
+ protected static JbpmConfigurationParser INSTANCE = new JbpmConfigurationParser();
+
+ public static JbpmConfigurationParser getInstance() {
+ return INSTANCE;
+ }
+
+ /** parses the given stream source with {@link #getInstance() the current parser}. */
+ static EnvironmentFactory parse(StreamInput streamSource) {
+ EnvironmentFactory environmentFactory = (EnvironmentFactory) getInstance()
+ .createParse()
+ .setStreamSource(streamSource)
+ .execute()
+ .checkProblems("environment configuration "+streamSource)
+ .getDocumentObject();
+ return environmentFactory;
+ }
+
+ public Object parseDocument(Document document, Parse parse) {
+ Element documentElement = document.getDocumentElement();
+
+ // if the default environment factory was already set in the parse
+ JbpmConfiguration jbpmConfiguration = (JbpmConfiguration) parse.getDocumentObject();
+ if (jbpmConfiguration==null) {
+ jbpmConfiguration = new JbpmConfiguration();
+ parse.setDocumentObject(jbpmConfiguration);
+ }
+
+ for (Element importElement : XmlUtil.elements(documentElement, "import")) {
+ if (importElement.hasAttribute("resource")) {
+ String resource = importElement.getAttribute("resource");
+ Parse importParse = createParse()
+ .setResource(resource)
+ .execute();
+
+ importParse.addProblems(importParse.getProblems());
+
+ JbpmConfiguration importedConfiguration = (JbpmConfiguration) importParse.getDocumentObject();
+
+ WireDefinition importedProcessEngineWireDefinition = importedConfiguration.getProcessEngineWireContext().getWireDefinition();
+ jbpmConfiguration.addProcessEngineWireDefinition(importedProcessEngineWireDefinition);
+
+ WireDefinition importedTransactionWireDefinition = importedConfiguration.getTransactionWireDefinition();
+ jbpmConfiguration.addTransactionWireDefinition(importedTransactionWireDefinition);
+ }
+ }
+
+ WireDefinition processEngineWireDefinition = getProcessEngineWireDefinition(documentElement, parse);
+ jbpmConfiguration.addProcessEngineWireDefinition(processEngineWireDefinition);
+
+ WireDefinition transactionWireDefinition = getTransactionWireDefinition(documentElement, parse);
+ jbpmConfiguration.addTransactionWireDefinition(transactionWireDefinition);
+
+ parse.setDocumentObject(jbpmConfiguration);
+
+ return jbpmConfiguration;
+ }
+
+ WireDefinition getProcessEngineWireDefinition(Element documentElement, Parse parse) {
+ Element processEngineElement = XmlUtil.element(documentElement, "process-engine-context");
+ if (processEngineElement != null) {
+ return (WireDefinition) environmentFactoryXmlParser.parseDocumentElement(processEngineElement, parse);
+ }
+ return null;
+ }
+
+ WireDefinition getTransactionWireDefinition(Element documentElement, Parse parse) {
+ Element txCtxElement = XmlUtil.element(documentElement, "transaction-context");
+ if (txCtxElement != null) {
+ return (WireDefinition) environmentXmlParser.parseDocumentElement(txCtxElement, parse);
+ }
+ return null;
+ }
+
+ public Parser getEnvironmentFactoryXmlParser() {
+ return environmentFactoryXmlParser;
+ }
+ public void setEnvironmentFactoryXmlParser(Parser applicationWireXmlParser) {
+ this.environmentFactoryXmlParser = applicationWireXmlParser;
+ }
+ public Parser getEnvironmentXmlParser() {
+ return environmentXmlParser;
+ }
+ public void setEnvironmentXmlParser(Parser blockWireXmlParser) {
+ this.environmentXmlParser = blockWireXmlParser;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/JbpmConfigurationParser.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/PvmEnvironmentFactoryParser.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/PvmEnvironmentFactoryParser.java 2009-04-10 12:03:38 UTC (rev 4535)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/PvmEnvironmentFactoryParser.java 2009-04-10 14:22:24 UTC (rev 4536)
@@ -1,124 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.env;
-
-import org.jbpm.env.Context;
-import org.jbpm.env.EnvironmentFactory;
-import org.jbpm.pvm.internal.cfg.JbpmConfiguration;
-import org.jbpm.pvm.internal.stream.StreamInput;
-import org.jbpm.pvm.internal.util.XmlUtil;
-import org.jbpm.pvm.internal.wire.WireContext;
-import org.jbpm.pvm.internal.wire.WireDefinition;
-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.Document;
-import org.w3c.dom.Element;
-
-/** main parser. It parses the <code>jbpm-configuration</code>, which is assumed the document element
- * and can contain the {@link EnvironmentFactoryXmlParser process-engine}
- * context and the {@link EnvironmentXmlParser environment} context.
- *
- * See {@link Parser} for usage instructions.
- *
- * @author Tom Baeyens
- */
-public class PvmEnvironmentFactoryParser extends Parser {
-
- private static final long serialVersionUID = 1L;
-
- Parser environmentFactoryXmlParser = new WireParser();
- Parser environmentXmlParser = new WireParser();
-
- protected static PvmEnvironmentFactoryParser INSTANCE = new PvmEnvironmentFactoryParser();
-
- public static PvmEnvironmentFactoryParser getInstance() {
- return INSTANCE;
- }
-
- /** parses the given stream source with {@link #getInstance() the current parser}. */
- static EnvironmentFactory parse(StreamInput streamSource) {
- EnvironmentFactory environmentFactory = (EnvironmentFactory) getInstance()
- .createParse()
- .setStreamSource(streamSource)
- .execute()
- .checkProblems("environment configuration "+streamSource)
- .getDocumentObject();
- return environmentFactory;
- }
-
- public Object parseDocument(Document document, Parse parse) {
- Element documentElement = document.getDocumentElement();
-
- // if the default environment factory was already set in the parse
- JbpmConfiguration jbpmConfiguration = (JbpmConfiguration) parse.getDocumentObject();
- if (jbpmConfiguration==null) {
- jbpmConfiguration = new JbpmConfiguration();
- parse.setDocumentObject(jbpmConfiguration);
- }
-
- WireDefinition environmentFactoryWireDefinition = getApplicationWireDefinition(documentElement, parse);
- WireDefinition environmentWireDefinition = getBlockWireDefinition(documentElement, parse);
-
- // create the application wire context from the definition
- WireContext environmentFactoryWireContext = new WireContext(environmentFactoryWireDefinition, Context.CONTEXTNAME_PROCESS_ENGINE);
- // propagate the parser classloader to the application context
- environmentFactoryWireContext.setClassLoader(classLoader);
-
- // configure the default environment factory
- jbpmConfiguration.setEnvironmentFactoryCtxWireContext(environmentFactoryWireContext);
- jbpmConfiguration.setTransactionCtxWireDefinition(environmentWireDefinition);
-
- parse.setDocumentObject(jbpmConfiguration);
-
- return jbpmConfiguration;
- }
-
- WireDefinition getApplicationWireDefinition(Element documentElement, Parse parse) {
- Element applicationElement = XmlUtil.element(documentElement, "process-engine-context");
- if (applicationElement != null) {
- return (WireDefinition) environmentFactoryXmlParser.parseDocumentElement(applicationElement, parse);
- }
- return null;
- }
-
- WireDefinition getBlockWireDefinition(Element documentElement, Parse parse) {
- Element blockElement = XmlUtil.element(documentElement, "transaction-context");
- if (blockElement != null) {
- return (WireDefinition) environmentXmlParser.parseDocumentElement(blockElement, parse);
- }
- return null;
- }
-
- public Parser getEnvironmentFactoryXmlParser() {
- return environmentFactoryXmlParser;
- }
- public void setEnvironmentFactoryXmlParser(Parser applicationWireXmlParser) {
- this.environmentFactoryXmlParser = applicationWireXmlParser;
- }
- public Parser getEnvironmentXmlParser() {
- return environmentXmlParser;
- }
- public void setEnvironmentXmlParser(Parser blockWireXmlParser) {
- this.environmentXmlParser = blockWireXmlParser;
- }
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java 2009-04-10 12:03:38 UTC (rev 4535)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java 2009-04-10 14:22:24 UTC (rev 4536)
@@ -54,13 +54,9 @@
deployerManager.deploy(deploymentImpl);
if (deploymentImpl.hasProblems()) {
- for (Problem problem: deploymentImpl.getProblems()) {
- Throwable cause = problem.getCause();
- if (cause!=null) {
- log.debug("deployment exception", cause);
- }
- }
- throw new JbpmException("problems during deployment: "+deploymentImpl.getProblemsText());
+ JbpmException jbpmException = deploymentImpl.getJbpmException();
+ log.info("problems during deployment of "+deployment+": "+jbpmException.getMessage());
+ throw jbpmException;
} else {
repositoryCache.set(deploymentImpl.getDbid(), deploymentImpl.getObjects());
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireDefinition.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireDefinition.java 2009-04-10 12:03:38 UTC (rev 4535)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireDefinition.java 2009-04-10 14:22:24 UTC (rev 4536)
@@ -197,8 +197,17 @@
// otherwise, use the current environment classloader
return Thread.currentThread().getContextClassLoader();
}
-
+ public void addWireDefinition(WireDefinition wireDefinition) {
+ if ( (wireDefinition!=null)
+ && (wireDefinition.getDescriptors()!=null)
+ ) {
+ for (Descriptor descriptor: wireDefinition.getDescriptors().values()) {
+ addDescriptor(descriptor);
+ }
+ }
+ }
+
public Map<String, Descriptor> getDescriptors() {
return descriptors;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parse.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parse.java 2009-04-10 12:03:38 UTC (rev 4535)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parse.java 2009-04-10 14:22:24 UTC (rev 4536)
@@ -190,11 +190,9 @@
* 'warning'. */
public Parse checkProblems(String description) {
if (hasProblems()) {
- String errorMsg = "problems during parse of "+description+":"+getProblemsText();
- log.info(errorMsg);
- if (errorMsg!=null) {
- throw new JbpmException(errorMsg);
- }
+ JbpmException jbpmException = getJbpmException();
+ log.info("problems during parse of "+description+": "+jbpmException.getMessage());
+ throw jbpmException;
}
return this;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java 2009-04-10 12:03:38 UTC (rev 4535)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java 2009-04-10 14:22:24 UTC (rev 4536)
@@ -26,6 +26,7 @@
import java.util.Collections;
import java.util.List;
+import org.jbpm.JbpmException;
import org.jbpm.Problem;
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.repository.DeploymentImpl;
@@ -73,6 +74,14 @@
addProblem(msg, e, ProblemImpl.TYPE_ERROR);
}
+ /** add all problems */
+ public void addProblems(List<Problem> problems) {
+ if (this.problems==null) {
+ this.problems = new ArrayList<ProblemImpl>();
+ }
+ this.problems.addAll((List)problems);
+ }
+
/** adds a problem with {@link ProblemImpl#TYPE_WARNING severity warning}.*/
public void addWarning(String msg) {
addWarning(msg, null);
@@ -99,45 +108,27 @@
public void setProblems(List<Problem> problems) {
this.problems = (List)problems;
}
-
-
- public String getProblemsText() {
+
+ public JbpmException getJbpmException() {
+ if (! hasProblems()) {
+ return null;
+ }
+
+ Throwable cause = null;
+
+ StringBuffer errorMsg = new StringBuffer();
if (problems!=null) {
- StringBuffer errorBuffer = null;
- StringBuffer warningBuffer = null;
+
for (Problem p : getProblems()) {
- if (p.getSeverity().equals(ProblemImpl.TYPE_ERROR)) {
- if (errorBuffer==null) {
- errorBuffer = new StringBuffer();
- errorBuffer.append("errors:");
- errorBuffer.append(NEWLINE);
- }
- errorBuffer.append(NEWLINE);
- errorBuffer.append(" ");
- errorBuffer.append(p.toString());
- } else {
- if (warningBuffer==null) {
- warningBuffer = new StringBuffer();
- warningBuffer.append("warnings:");
- warningBuffer.append(NEWLINE);
- }
- warningBuffer.append(NEWLINE);
- warningBuffer.append(" ");
- warningBuffer.append(p.toString());
+ errorMsg.append(NEWLINE);
+ errorMsg.append(" ");
+ errorMsg.append(p.toString());
+
+ if (p.getCause()!=null) {
+ cause = new JbpmException(p.getCause());
}
}
- if (errorBuffer!=null) {
- if (warningBuffer!=null) {
- errorBuffer.append(NEWLINE);
- errorBuffer.append(warningBuffer.toString());
- }
- return errorBuffer.toString();
- }
- if (warningBuffer!=null) {
- warningBuffer.append(NEWLINE);
- return warningBuffer.toString();
- }
}
- return null;
+ return new JbpmException(errorMsg.toString(), cause);
}
}
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ContextBlockSubscriptionTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ContextBlockSubscriptionTest.java 2009-04-10 12:03:38 UTC (rev 4535)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ContextBlockSubscriptionTest.java 2009-04-10 14:22:24 UTC (rev 4536)
@@ -364,7 +364,7 @@
index++;
assertEquals("close", events.get(index).eventName);
JbpmConfiguration jbpmConfiguration = (JbpmConfiguration) environmentFactory;
- WireContext applicationWireContext = jbpmConfiguration.getEnvironmentFactoryCtxWireContext();
+ WireContext applicationWireContext = jbpmConfiguration.getProcessEngineWireContext();
assertEquals(applicationWireContext, events.get(index).source);
assertNull(events.get(index).info);
}
17 years
JBoss JBPM SVN: r4535 - in jbpm4/trunk/modules: distro/src/main/resources/config-tool/jbpm and 6 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-04-10 08:03:38 -0400 (Fri, 10 Apr 2009)
New Revision: 4535
Added:
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlAutomaticActivity.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/HqlEventListenerTest.java
Modified:
jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/jbpm.jpdl.eventlisteners.xml
jbpm4/trunk/modules/examples/src/test/resources/jbpm.jpdl.eventlisteners.xml
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/EsbActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/HqlActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JavaActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ScriptActivity.java
jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.jpdl.eventlisteners.xml
jbpm4/trunk/modules/pvm/src/test/resources/jbpm.jpdl.eventlisteners.xml
jbpm4/trunk/modules/test-db/src/test/resources/jbpm.jpdl.eventlisteners.xml
Log:
JBPM-2027 adding all automatic activities as event listeners
Modified: jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
===================================================================
--- jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd 2009-04-10 09:57:59 UTC (rev 4534)
+++ jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd 2009-04-10 12:03:38 UTC (rev 4535)
@@ -635,10 +635,12 @@
<group name="eventListenerGroup">
<choice>
- <element name="event-listener" type="tns:wireObjectType" >
- <annotation><documentation>An EventListener
- </documentation></annotation>
- </element>
+ <element name="event-listener" type="tns:wireObjectType" />
+ <element name="hql" type="tns:qlType" />
+ <element name="sql" type="tns:qlType" />
+ <element name="java" type="tns:javaType" />
+ <element name="script" type="tns:scriptType" />
+ <element name="esb" type="tns:esbType" />
</choice>
</group>
Modified: jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/jbpm.jpdl.eventlisteners.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/jbpm.jpdl.eventlisteners.xml 2009-04-10 09:57:59 UTC (rev 4534)
+++ jbpm4/trunk/modules/distro/src/main/resources/config-tool/jbpm/jbpm.jpdl.eventlisteners.xml 2009-04-10 12:03:38 UTC (rev 4535)
@@ -1,4 +1,8 @@
<eventlisteners>
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.EventListenerBinding" />
<eventlistener binding="org.jbpm.jpdl.internal.activity.JavaBinding" />
- <eventlistener binding="org.jbpm.jpdl.internal.activity.EventListenerBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.EsbBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.HqlBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.SqlBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.ScriptBinding" />
</eventlisteners>
Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.jpdl.eventlisteners.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.jpdl.eventlisteners.xml 2009-04-10 09:57:59 UTC (rev 4534)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.jpdl.eventlisteners.xml 2009-04-10 12:03:38 UTC (rev 4535)
@@ -1,4 +1,8 @@
<eventlisteners>
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.EventListenerBinding" />
<eventlistener binding="org.jbpm.jpdl.internal.activity.JavaBinding" />
- <eventlistener binding="org.jbpm.jpdl.internal.activity.EventListenerBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.EsbBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.HqlBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.SqlBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.ScriptBinding" />
</eventlisteners>
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/EsbActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/EsbActivity.java 2009-04-10 09:57:59 UTC (rev 4534)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/EsbActivity.java 2009-04-10 12:03:38 UTC (rev 4535)
@@ -25,8 +25,8 @@
import org.jboss.soa.esb.message.Body;
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jbpm.activity.ActivityExecution;
import org.jbpm.internal.log.Log;
+import org.jbpm.model.OpenExecution;
import org.jbpm.pvm.internal.model.ExpressionEvaluator;
import org.jbpm.pvm.internal.wire.Descriptor;
import org.jbpm.pvm.internal.wire.WireContext;
@@ -36,7 +36,7 @@
/**
* @author Tom Baeyens
*/
-public class EsbActivity extends JpdlActivity {
+public class EsbActivity extends JpdlAutomaticActivity {
private static final long serialVersionUID = 1L;
@@ -46,7 +46,7 @@
protected String service = null;
protected ListDescriptor partsListDescriptor = null;
- public void execute(ActivityExecution execution) throws Exception {
+ public void perform(OpenExecution execution) throws Exception {
Message message = MessageFactory.getInstance().getMessage();
Body body = message.getBody();
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/HqlActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/HqlActivity.java 2009-04-10 09:57:59 UTC (rev 4534)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/HqlActivity.java 2009-04-10 12:03:38 UTC (rev 4535)
@@ -24,9 +24,9 @@
import org.hibernate.Query;
import org.hibernate.Session;
import org.jbpm.JbpmException;
-import org.jbpm.activity.ActivityExecution;
import org.jbpm.env.Environment;
import org.jbpm.internal.log.Log;
+import org.jbpm.model.OpenExecution;
import org.jbpm.pvm.internal.wire.Descriptor;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.descriptor.ListDescriptor;
@@ -35,7 +35,7 @@
/**
* @author Tom Baeyens
*/
-public class HqlActivity extends JpdlActivity {
+public class HqlActivity extends JpdlAutomaticActivity {
private static final Log log = Log.getLog(HqlActivity.class.getName());
@@ -46,7 +46,7 @@
protected String resultVariableName;
protected boolean isResultUnique;
- public void execute(ActivityExecution execution) {
+ public void perform(OpenExecution execution) {
Environment environment = Environment.getCurrent();
if (environment==null) {
throw new JbpmException("no environment for jpdl activity "+HqlBinding.TAG);
@@ -71,8 +71,6 @@
}
execution.setVariable(resultVariableName, result);
-
- execution.historyAutomatic();
}
protected Query createQuery(Session session) {
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JavaActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JavaActivity.java 2009-04-10 09:57:59 UTC (rev 4534)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JavaActivity.java 2009-04-10 12:03:38 UTC (rev 4535)
@@ -24,9 +24,6 @@
import java.lang.reflect.Method;
import java.util.List;
-import org.jbpm.activity.ActivityExecution;
-import org.jbpm.listener.EventListener;
-import org.jbpm.listener.EventListenerExecution;
import org.jbpm.model.OpenExecution;
import org.jbpm.pvm.internal.util.ReflectUtil;
import org.jbpm.pvm.internal.wire.Descriptor;
@@ -40,7 +37,7 @@
/**
* @author Tom Baeyens
*/
-public class JavaActivity extends JpdlActivity implements EventListener {
+public class JavaActivity extends JpdlAutomaticActivity {
private static final long serialVersionUID = 1L;
@@ -49,15 +46,6 @@
protected String variableName;
protected InvokeOperation invokeOperation;
- public void execute(ActivityExecution execution) throws Exception {
- perform(execution);
- execution.historyAutomatic();
- }
-
- public void notify(EventListenerExecution execution) throws Exception {
- perform(execution);
- }
-
public void perform(OpenExecution execution) throws Exception {
WireContext wireContext = new WireContext();
Object target = wireContext.create(descriptor, false);
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlAutomaticActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlAutomaticActivity.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlAutomaticActivity.java 2009-04-10 12:03:38 UTC (rev 4535)
@@ -0,0 +1,23 @@
+package org.jbpm.jpdl.internal.activity;
+
+import org.jbpm.activity.ActivityExecution;
+import org.jbpm.listener.EventListener;
+import org.jbpm.listener.EventListenerExecution;
+import org.jbpm.model.OpenExecution;
+
+
+public abstract class JpdlAutomaticActivity extends JpdlActivity implements EventListener {
+
+ private static final long serialVersionUID = 1L;
+
+ public void execute(ActivityExecution execution) throws Exception {
+ perform(execution);
+ execution.historyAutomatic();
+ }
+
+ public void notify(EventListenerExecution execution) throws Exception {
+ perform(execution);
+ }
+
+ abstract void perform(OpenExecution execution) throws Exception;
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlAutomaticActivity.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ScriptActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ScriptActivity.java 2009-04-10 09:57:59 UTC (rev 4534)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ScriptActivity.java 2009-04-10 12:03:38 UTC (rev 4535)
@@ -21,15 +21,15 @@
*/
package org.jbpm.jpdl.internal.activity;
-import org.jbpm.activity.ActivityExecution;
import org.jbpm.env.Environment;
+import org.jbpm.model.OpenExecution;
import org.jbpm.pvm.internal.script.ScriptManager;
/**
* @author Tom Baeyens
*/
-public class ScriptActivity extends JpdlActivity {
+public class ScriptActivity extends JpdlAutomaticActivity {
private static final long serialVersionUID = 1L;
@@ -37,15 +37,13 @@
protected String language;
protected String variableName;
- public void execute(ActivityExecution execution) {
+ public void perform(OpenExecution execution) {
ScriptManager scriptManager = Environment.getFromCurrent(ScriptManager.class);
Object returnValue = scriptManager.evaluateScript(script, execution, language);
if (variableName!=null) {
execution.setVariable(variableName, returnValue);
}
-
- execution.historyAutomatic();
}
public void setScript(String script) {
Modified: jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.jpdl.eventlisteners.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.jpdl.eventlisteners.xml 2009-04-10 09:57:59 UTC (rev 4534)
+++ jbpm4/trunk/modules/jpdl/src/test/resources/jbpm.jpdl.eventlisteners.xml 2009-04-10 12:03:38 UTC (rev 4535)
@@ -1,4 +1,8 @@
<eventlisteners>
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.EventListenerBinding" />
<eventlistener binding="org.jbpm.jpdl.internal.activity.JavaBinding" />
- <eventlistener binding="org.jbpm.jpdl.internal.activity.EventListenerBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.EsbBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.HqlBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.SqlBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.ScriptBinding" />
</eventlisteners>
Modified: jbpm4/trunk/modules/pvm/src/test/resources/jbpm.jpdl.eventlisteners.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/jbpm.jpdl.eventlisteners.xml 2009-04-10 09:57:59 UTC (rev 4534)
+++ jbpm4/trunk/modules/pvm/src/test/resources/jbpm.jpdl.eventlisteners.xml 2009-04-10 12:03:38 UTC (rev 4535)
@@ -1,4 +1,8 @@
<eventlisteners>
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.EventListenerBinding" />
<eventlistener binding="org.jbpm.jpdl.internal.activity.JavaBinding" />
- <eventlistener binding="org.jbpm.jpdl.internal.activity.EventListenerBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.EsbBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.HqlBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.SqlBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.ScriptBinding" />
</eventlisteners>
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/HqlEventListenerTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/HqlEventListenerTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/HqlEventListenerTest.java 2009-04-10 12:03:38 UTC (rev 4535)
@@ -0,0 +1,62 @@
+package org.jbpm.test.eventlistener;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jbpm.Execution;
+import org.jbpm.task.Task;
+import org.jbpm.test.JbpmTestCase;
+
+
+public class HqlEventListenerTest extends JbpmTestCase {
+
+ public void testHql() {
+ deployJpdlXmlString(
+ "<process name='HqlEventListener' xmlns='http://jbpm.org/4/jpdl'>" +
+ " <start >" +
+ " <transition to='wait' />" +
+ " </start>" +
+ " <state name='wait'>" +
+ " <on event='start'>" +
+ " <hql var='tasknames with i'>" +
+ " <query>" +
+ " select task.name" +
+ " from org.jbpm.pvm.internal.task.TaskImpl as task" +
+ " where task.name like :taskName" +
+ " </query>" +
+ " <parameters>" +
+ " <string name='taskName' value='%i%' />" +
+ " </parameters>" +
+ " </hql>" +
+ " </on>" +
+ " </state>" +
+ "</process>"
+ );
+
+ // add task laundry
+ Task task = taskService.newTask();
+ task.setName("laundry");
+ saveAndRegisterTask(task);
+
+ // add task dishes
+ task = taskService.newTask();
+ task.setName("dishes");
+ saveAndRegisterTask(task);
+
+ // add task iron
+ task = taskService.newTask();
+ task.setName("iron");
+ saveAndRegisterTask(task);
+
+ Execution execution = executionService.startProcessInstanceByKey("HqlEventListener");
+ String executionId = execution.getId();
+
+ Set<String> expectedTaskNames = new HashSet<String>();
+ expectedTaskNames.add("dishes");
+ expectedTaskNames.add("iron");
+ Collection<String> taskNames = (Collection<String>) executionService.getVariable(executionId, "tasknames with i");
+ taskNames = new HashSet<String>(taskNames);
+ assertEquals(expectedTaskNames, taskNames);
+ }
+}
Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/HqlEventListenerTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/test-db/src/test/resources/jbpm.jpdl.eventlisteners.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/jbpm.jpdl.eventlisteners.xml 2009-04-10 09:57:59 UTC (rev 4534)
+++ jbpm4/trunk/modules/test-db/src/test/resources/jbpm.jpdl.eventlisteners.xml 2009-04-10 12:03:38 UTC (rev 4535)
@@ -1,4 +1,8 @@
<eventlisteners>
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.EventListenerBinding" />
<eventlistener binding="org.jbpm.jpdl.internal.activity.JavaBinding" />
- <eventlistener binding="org.jbpm.jpdl.internal.activity.EventListenerBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.EsbBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.HqlBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.SqlBinding" />
+ <eventlistener binding="org.jbpm.jpdl.internal.activity.ScriptBinding" />
</eventlisteners>
17 years