JBoss JBPM SVN: r5233 - jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-07-05 10:27:27 -0400 (Sun, 05 Jul 2009)
New Revision: 5233
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Node.java
Log:
make NodeType serializable
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Node.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Node.java 2009-07-05 13:42:53 UTC (rev 5232)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Node.java 2009-07-05 14:27:27 UTC (rev 5233)
@@ -55,6 +55,7 @@
public static class NodeType implements Serializable {
private final String name;
+ private static final Map values = new HashMap();
private static final long serialVersionUID = 1L;
@@ -69,6 +70,7 @@
protected NodeType(String name) {
this.name = name;
+ values.put(name, this);
}
public String toString() {
@@ -76,10 +78,7 @@
}
public static NodeType valueOf(String name) {
- return Node.name.equals(name) ? Node : StartState.name.equals(name) ? StartState
- : EndState.name.equals(name) ? EndState : State.name.equals(name) ? State
- : Task.name.equals(name) ? Task : Fork.name.equals(name) ? Fork
- : Join.name.equals(name) ? Join : Decision.name.equals(name) ? Decision : null;
+ return (NodeType) values.get(name);
}
private Object readResolve() throws ObjectStreamException {
@@ -87,7 +86,6 @@
if (nodeType == null) throw new InvalidObjectException("invalid node type: " + name);
return nodeType;
}
-
};
protected List leavingTransitions = null;
@@ -159,7 +157,7 @@
* are the leaving {@link Transition}s, mapped by their name (java.lang.String).
*/
public Map getLeavingTransitionsMap() {
- if ((leavingTransitionMap == null) && (leavingTransitions != null)) {
+ if (leavingTransitionMap == null && leavingTransitions != null) {
// initialize the cached leaving transition map
leavingTransitionMap = new HashMap();
ListIterator iter = leavingTransitions.listIterator(leavingTransitions.size());
@@ -179,6 +177,7 @@
public Transition addLeavingTransition(Transition leavingTransition) {
if (leavingTransition == null)
throw new IllegalArgumentException("can't add a null leaving transition to an node");
+
if (leavingTransitions == null) leavingTransitions = new ArrayList();
leavingTransitions.add(leavingTransition);
leavingTransition.from = this;
@@ -194,11 +193,10 @@
public void removeLeavingTransition(Transition leavingTransition) {
if (leavingTransition == null)
throw new IllegalArgumentException("can't remove a null leavingTransition from an node");
- if (leavingTransitions != null) {
- if (leavingTransitions.remove(leavingTransition)) {
- leavingTransition.from = null;
- leavingTransitionMap = null;
- }
+
+ if (leavingTransitions != null && leavingTransitions.remove(leavingTransition)) {
+ leavingTransition.from = null;
+ leavingTransitionMap = null;
}
}
@@ -221,7 +219,7 @@
if (leavingTransitions != null) {
transition = (Transition) getLeavingTransitionsMap().get(transitionName);
}
- if ((transition == null) && (superState != null)) {
+ if (transition == null && superState != null) {
transition = superState.getLeavingTransition(transitionName);
}
return transition;
@@ -231,7 +229,8 @@
* true if this transition has leaving transitions.
*/
public boolean hasNoLeavingTransitions() {
- return (((leavingTransitions == null) || (leavingTransitions.size() == 0)) && ((superState == null) || (superState.hasNoLeavingTransitions())));
+ return (leavingTransitions == null || leavingTransitions.size() == 0) &&
+ (superState == null || superState.hasNoLeavingTransitions());
}
/**
@@ -249,15 +248,10 @@
}
boolean containsName(List leavingTransitions, String name) {
- Iterator iter = leavingTransitions.iterator();
- while (iter.hasNext()) {
+ for (Iterator iter = leavingTransitions.iterator(); iter.hasNext();) {
Transition transition = (Transition) iter.next();
- if ((name == null) && (transition.getName() == null)) {
+ if (name != null ? name.equals(transition.getName()) : transition.getName() == null)
return true;
- }
- else if ((name != null) && (name.equals(transition.getName()))) {
- return true;
- }
}
return false;
}
@@ -314,6 +308,7 @@
public Transition addArrivingTransition(Transition arrivingTransition) {
if (arrivingTransition == null)
throw new IllegalArgumentException("can't add a null arrivingTransition to a node");
+
if (arrivingTransitions == null) arrivingTransitions = new HashSet();
arrivingTransitions.add(arrivingTransition);
arrivingTransition.to = this;
@@ -328,10 +323,9 @@
public void removeArrivingTransition(Transition arrivingTransition) {
if (arrivingTransition == null)
throw new IllegalArgumentException("can't remove a null arrivingTransition from a node");
- if (arrivingTransitions != null) {
- if (arrivingTransitions.remove(arrivingTransition)) {
- arrivingTransition.to = null;
- }
+
+ if (arrivingTransitions != null && arrivingTransitions.remove(arrivingTransition)) {
+ arrivingTransition.to = null;
}
}
@@ -341,8 +335,11 @@
* is the {@link SuperState} or the {@link ProcessDefinition} in which this node is contained.
*/
public GraphElement getParent() {
- GraphElement parent = processDefinition;
- if (superState != null) parent = superState;
+ GraphElement parent;
+ if (superState != null)
+ parent = superState;
+ else
+ parent = processDefinition;
return parent;
}
@@ -360,8 +357,7 @@
// fire the leave-node event for this node
fireEvent(Event.EVENTTYPE_NODE_ENTER, executionContext);
- // keep track of node entrance in the token, so that a node-log can be generated at node leave
- // time.
+ // register entrance time so that a node-log can be generated upon leaving
token.setNodeEnter(Clock.getCurrentTime());
// remove the transition references from the runtime context
@@ -397,15 +393,13 @@
try {
// execute the action
executeAction(action, executionContext);
-
}
catch (Exception exception) {
- // NOTE that Error's are not caught because that might halt the JVM and mask the original
- // Error.
+ // NOTE that Errors are not caught because that might halt the JVM
+ // and mask the original Error.
// search for an exception handler or throw to the client
raiseException(exception, executionContext);
}
-
}
else {
// let this node handle the token
@@ -426,13 +420,9 @@
*/
public void leave(ExecutionContext executionContext, String transitionName) {
Transition transition = getLeavingTransition(transitionName);
- if (transition == null) {
- throw new JbpmException("transition '" +
- transitionName +
- "' is not a leaving transition of node '" +
- this +
- "'");
- }
+ if (transition == null)
+ throw new JbpmException("'" + transitionName + "' is not a leaving transition of " + this);
+
leave(executionContext, transition);
}
@@ -441,7 +431,8 @@
*/
public void leave(ExecutionContext executionContext, Transition transition) {
if (transition == null)
- throw new JbpmException("can't leave node '" + this + "' without leaving transition");
+ throw new JbpmException("cannot leave " + this + " without leaving transition");
+
Token token = executionContext.getToken();
token.setNode(this);
executionContext.setTransition(transition);
@@ -469,11 +460,7 @@
// ///////////////////////////////////////////////////////////////////////////
public ProcessDefinition getProcessDefinition() {
- ProcessDefinition pd = this.processDefinition;
- if (superState != null) {
- pd = superState.getProcessDefinition();
- }
- return pd;
+ return superState != null ? superState.getProcessDefinition() : processDefinition;
}
// change the name of a node ////////////////////////////////////////////////
@@ -485,11 +472,11 @@
String oldName = this.name;
if (superState != null) {
if (superState.hasNode(name)) {
- throw new IllegalArgumentException("couldn't set name '" +
- name +
- "' on node '" +
+ throw new IllegalArgumentException("cannot rename " +
this +
- "'cause the superState of this node has already another child node with the same name");
+ " to '" +
+ name +
+ "' - parent superstate has another child node with the same name");
}
Map nodes = superState.getNodesMap();
nodes.remove(oldName);
@@ -497,11 +484,11 @@
}
else if (processDefinition != null) {
if (processDefinition.hasNode(name)) {
- throw new IllegalArgumentException("couldn't set name '" +
- name +
- "' on node '" +
+ throw new IllegalArgumentException("cannot rename " +
this +
- "'cause the process definition of this node has already another node with the same name");
+ " to '" +
+ name +
+ "' - process definition has another child node with the same name");
}
Map nodeMap = processDefinition.getNodesMap();
nodeMap.remove(oldName);
@@ -511,25 +498,15 @@
}
}
- boolean isDifferent(String name1, String name2) {
- if ((name1 != null) && (name1.equals(name2))) {
- return false;
- }
- else if ((name1 == null) && (name2 == null)) {
- return false;
- }
- return true;
+ private static boolean isDifferent(String name1, String name2) {
+ return !(name1 != null ? name1.equals(name2) : name2 == null);
}
/**
* the slash separated name that includes all the superstate names.
*/
public String getFullyQualifiedName() {
- String fullyQualifiedName = name;
- if (superState != null) {
- fullyQualifiedName = superState.getFullyQualifiedName() + "/" + name;
- }
- return fullyQualifiedName;
+ return superState != null ? superState.getFullyQualifiedName() + '/' + name : name;
}
/** indicates wether this node is a superstate. */
15 years, 4 months
JBoss JBPM SVN: r5232 - in jbpm3/branches/jbpm-3.2-soa/modules/core/src: main/java/org/jbpm/graph/def and 2 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-07-05 09:42:53 -0400 (Sun, 05 Jul 2009)
New Revision: 5232
Added:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/hibernate/SybaseRowLockDialect.java
Removed:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/hibernate/StringMax.java
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/hibernate/Converters.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/hibernate/JbpmNamingStrategy.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Node.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/hibernate.properties.mysql.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/hibernate.properties.sybase.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/SerializabilityTest.java
Log:
extend sybase dialect in order to specify datarows locking in create table statements
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/hibernate/Converters.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/hibernate/Converters.java 2009-07-05 11:06:02 UTC (rev 5231)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/hibernate/Converters.java 2009-07-05 13:42:53 UTC (rev 5232)
@@ -38,7 +38,7 @@
/**
* provides access to the list of converters and ensures that the converter objects are unique.
*/
-public abstract class Converters {
+public class Converters {
static final int CONVERTERS_BY_CLASS_NAMES = 0;
static final int CONVERTERS_BY_DATABASE_ID = 1;
@@ -46,14 +46,18 @@
static Map converterMapsMap = new HashMap();
+ private Converters() {
+ // prevent instantiation
+ }
+
// public methods
public static Converter getConverterByClassName(String className) {
Converter converter = (Converter) getConvertersByClassNames().get(className);
if (converter == null) {
- throw new JbpmException("converter '"
- + className
- + "' is not declared in jbpm.converter.properties");
+ throw new JbpmException("converter '" +
+ className +
+ "' is not declared in jbpm.converter.properties");
}
return converter;
}
@@ -71,7 +75,7 @@
return getConverterMaps()[CONVERTERS_BY_CLASS_NAMES];
}
- // maps converter database-id-strings to unique converter objects
+ // maps converter database-id-strings to unique converter objects
static Map getConvertersByDatabaseId() {
return getConverterMaps()[CONVERTERS_BY_DATABASE_ID];
}
@@ -130,7 +134,8 @@
convertersIds.put(converter, converterDatabaseId);
}
catch (Exception e) {
- // NOTE that Error's are not caught because that might halt the JVM and mask the original Error.
+ // NOTE that Error's are not caught because that might halt the JVM and mask the original
+ // Error.
log.debug("couldn't instantiate converter '" + converterClassName + "': " + e);
}
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/hibernate/JbpmNamingStrategy.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/hibernate/JbpmNamingStrategy.java 2009-07-05 11:06:02 UTC (rev 5231)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/hibernate/JbpmNamingStrategy.java 2009-07-05 13:42:53 UTC (rev 5232)
@@ -21,7 +21,7 @@
*/
package org.jbpm.db.hibernate;
-import org.hibernate.cfg.*;
+import org.hibernate.cfg.NamingStrategy;
public class JbpmNamingStrategy implements NamingStrategy {
Deleted: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/hibernate/StringMax.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/hibernate/StringMax.java 2009-07-05 11:06:02 UTC (rev 5231)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/hibernate/StringMax.java 2009-07-05 13:42:53 UTC (rev 5232)
@@ -1,47 +0,0 @@
-package org.jbpm.db.hibernate;
-
-// $Id$
-
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-import java.util.Properties;
-
-import org.hibernate.type.StringType;
-import org.hibernate.usertype.ParameterizedType;
-import org.jbpm.JbpmException;
-
-/**
- * A custom type that truncates string values
- */
-public class StringMax extends StringType implements ParameterizedType
-{
- private static final long serialVersionUID = 1L;
-
- int length = 4000;
-
- public void set(PreparedStatement st, Object value, int index) throws SQLException
- {
- String string = (String)value;
- if (string != null && string.length() > length)
- {
- string = string.substring(0, length);
- }
- super.set(st, string, index);
- }
-
- public void setParameterValues(Properties parameters)
- {
- if (parameters != null && parameters.containsKey("length"))
- {
- String propval = parameters.getProperty("length");
- try
- {
- length = Integer.parseInt(propval);
- }
- catch (NumberFormatException e)
- {
- throw new JbpmException("hibernate column type 'string_max' can't parse value '" + propval + "' as a max length. default is 4000.", e);
- }
- }
- }
-}
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/hibernate/SybaseRowLockDialect.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/hibernate/SybaseRowLockDialect.java (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/hibernate/SybaseRowLockDialect.java 2009-07-05 13:42:53 UTC (rev 5232)
@@ -0,0 +1,35 @@
+/*
+ * 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.db.hibernate;
+
+import org.hibernate.dialect.SybaseDialect;
+
+/**
+ * @author Alejandro Guizar
+ */
+public class SybaseRowLockDialect extends SybaseDialect {
+
+ public String getTableTypeString() {
+ return " lock datarows";
+ }
+
+}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Node.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Node.java 2009-07-05 11:06:02 UTC (rev 5231)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Node.java 2009-07-05 13:42:53 UTC (rev 5232)
@@ -21,6 +21,9 @@
*/
package org.jbpm.graph.def;
+import java.io.InvalidObjectException;
+import java.io.ObjectStreamException;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
@@ -49,10 +52,12 @@
private static final long serialVersionUID = 1L;
- public static class NodeType {
+ public static class NodeType implements Serializable {
private final String name;
+ private static final long serialVersionUID = 1L;
+
public static final NodeType Node = new NodeType("Node");
public static final NodeType StartState = new NodeType("StartState");
public static final NodeType EndState = new NodeType("EndState");
@@ -69,6 +74,20 @@
public String toString() {
return name;
}
+
+ public static NodeType valueOf(String name) {
+ return Node.name.equals(name) ? Node : StartState.name.equals(name) ? StartState
+ : EndState.name.equals(name) ? EndState : State.name.equals(name) ? State
+ : Task.name.equals(name) ? Task : Fork.name.equals(name) ? Fork
+ : Join.name.equals(name) ? Join : Decision.name.equals(name) ? Decision : null;
+ }
+
+ private Object readResolve() throws ObjectStreamException {
+ NodeType nodeType = valueOf(name);
+ if (nodeType == null) throw new InvalidObjectException("invalid node type: " + name);
+ return nodeType;
+ }
+
};
protected List leavingTransitions = null;
@@ -270,9 +289,9 @@
* moves one leaving transition from the oldIndex and inserts it at the newIndex.
*/
public void reorderLeavingTransition(int oldIndex, int newIndex) {
- if (leavingTransitions != null
- && Math.min(oldIndex, newIndex) >= 0
- && Math.max(oldIndex, newIndex) < leavingTransitions.size()) {
+ if (leavingTransitions != null &&
+ Math.min(oldIndex, newIndex) >= 0 &&
+ Math.max(oldIndex, newIndex) < leavingTransitions.size()) {
Object transition = leavingTransitions.remove(oldIndex);
leavingTransitions.add(newIndex, transition);
}
@@ -341,7 +360,8 @@
// fire the leave-node event for this node
fireEvent(Event.EVENTTYPE_NODE_ENTER, executionContext);
- // keep track of node entrance in the token, so that a node-log can be generated at node leave time.
+ // keep track of node entrance in the token, so that a node-log can be generated at node leave
+ // time.
token.setNodeEnter(Clock.getCurrentTime());
// remove the transition references from the runtime context
@@ -380,7 +400,8 @@
}
catch (Exception exception) {
- // NOTE that Error's are not caught because that might halt the JVM and mask the original Error.
+ // NOTE that Error's are not caught because that might halt the JVM and mask the original
+ // Error.
// search for an exception handler or throw to the client
raiseException(exception, executionContext);
}
@@ -406,11 +427,11 @@
public void leave(ExecutionContext executionContext, String transitionName) {
Transition transition = getLeavingTransition(transitionName);
if (transition == null) {
- throw new JbpmException("transition '"
- + transitionName
- + "' is not a leaving transition of node '"
- + this
- + "'");
+ throw new JbpmException("transition '" +
+ transitionName +
+ "' is not a leaving transition of node '" +
+ this +
+ "'");
}
leave(executionContext, transition);
}
@@ -464,12 +485,11 @@
String oldName = this.name;
if (superState != null) {
if (superState.hasNode(name)) {
- throw new IllegalArgumentException(
- "couldn't set name '"
- + name
- + "' on node '"
- + this
- + "'cause the superState of this node has already another child node with the same name");
+ throw new IllegalArgumentException("couldn't set name '" +
+ name +
+ "' on node '" +
+ this +
+ "'cause the superState of this node has already another child node with the same name");
}
Map nodes = superState.getNodesMap();
nodes.remove(oldName);
@@ -477,12 +497,11 @@
}
else if (processDefinition != null) {
if (processDefinition.hasNode(name)) {
- throw new IllegalArgumentException(
- "couldn't set name '"
- + name
- + "' on node '"
- + this
- + "'cause the process definition of this node has already another node with the same name");
+ throw new IllegalArgumentException("couldn't set name '" +
+ name +
+ "' on node '" +
+ this +
+ "'cause the process definition of this node has already another node with the same name");
}
Map nodeMap = processDefinition.getNodesMap();
nodeMap.remove(oldName);
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/hibernate.properties.mysql.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/hibernate.properties.mysql.xml 2009-07-05 11:06:02 UTC (rev 5231)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/hibernate.properties.mysql.xml 2009-07-05 13:42:53 UTC (rev 5232)
@@ -1,6 +1,6 @@
<!-- hibernate dialect -->
- <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
+ <property name="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
<!-- JDBC connection properties (begin) -->
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/hibernate.properties.sybase.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/hibernate.properties.sybase.xml 2009-07-05 11:06:02 UTC (rev 5231)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/hibernate.properties.sybase.xml 2009-07-05 13:42:53 UTC (rev 5232)
@@ -10,7 +10,7 @@
-->
<!-- hibernate dialect -->
- <property name="hibernate.dialect">org.hibernate.dialect.SybaseDialect</property>
+ <property name="hibernate.dialect">org.jbpm.db.hibernate.SybaseRowLockDialect</property>
<!-- JDBC connection properties (begin) -->
<property name="hibernate.connection.driver_class">${jdbc.sybase.driver}</property>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/SerializabilityTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/SerializabilityTest.java 2009-07-05 11:06:02 UTC (rev 5231)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/SerializabilityTest.java 2009-07-05 13:42:53 UTC (rev 5232)
@@ -23,6 +23,7 @@
import java.io.File;
import java.io.Serializable;
+import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import org.jbpm.file.def.FileDefinitionFileSystemConfigTest;
@@ -37,7 +38,7 @@
.toString();
static final String[] excusedClasses = { "org.jbpm.ant", "org.jbpm.context.exe.JbpmType",
- "org.jbpm.db.hibernate.ConverterEnumType", "org.jbpm.db.hibernate.Converters",
+ "org.jbpm.db.hibernate.ConverterEnumType", "org.jbpm.db.hibernate.SybaseRowLockDialect",
"org.jbpm.db.hibernate.JbpmNamingStrategy", "org.jbpm.db.AbstractDbTestCase",
"org.jbpm.db.ContextSession", "org.jbpm.db.FileSession", "org.jbpm.db.GraphSession",
"org.jbpm.db.JbpmSession", "org.jbpm.db.JbpmSchema", "org.jbpm.db.JobSession",
@@ -65,22 +66,21 @@
"org.jbpm.security.filter.JbpmAuthenticationFilter",
"org.jbpm.command.service.CommandServiceImpl", "org.jbpm.sim.", "org.jbpm.util.Clock",
"org.jbpm.util.CustomLoaderObjectInputStream", "org.jbpm.web.JobExecutorLauncher",
- "org.jbpm.web.JbpmConfigurationCloser", "org.jbpm.JbpmContextTestHelper",
- "org.jbpm.EventCallback$1" };
+ "org.jbpm.web.JbpmConfigurationCloser", "org.jbpm.JbpmContextTestHelper", };
public void testForNonSerializableClasses() {
File jbpmRoot = new File(testRootDir + "../classes/");
scanForClasses(jbpmRoot, "");
}
- private void scanForClasses(File rootClassDir, String packageDir) {
+ private static void scanForClasses(File rootClassDir, String packageDir) {
File packageDirFile = new File(rootClassDir.getPath() + "/" + packageDir);
File[] files = packageDirFile.listFiles();
for (int i = 0; i < files.length; i++) {
if (files[i].isDirectory()) {
- String newPackageDir = ("".equals(packageDir) ? files[i].getName() : packageDir
- + "/"
- + files[i].getName());
+ String newPackageDir = ("".equals(packageDir) ? files[i].getName() : packageDir +
+ "/" +
+ files[i].getName());
// log.debug("descending into directory "+newPackageDir);
scanForClasses(rootClassDir, newPackageDir);
@@ -95,17 +95,36 @@
}
}
- private void assertSerializabilityOfClass(String className) {
+ private static void assertSerializabilityOfClass(String className) {
Class clazz = ClassLoaderUtil.classForName(className);
- if (!(Serializable.class.isAssignableFrom(clazz)
- || Modifier.isAbstract(clazz.getModifiers())
- || isExcused(className) || clazz.getConstructors().length == 0)) {
+ if (!(Serializable.class.isAssignableFrom(clazz) ||
+ Modifier.isAbstract(clazz.getModifiers()) ||
+ isAnonymous(clazz) ||
+ isUtility(clazz) || isExcused(className))) {
fail(className + " is NOT Serializable");
}
}
- boolean isExcused(String className) {
+ private static boolean isAnonymous(Class clazz) {
+ return clazz.getName().matches(".*\\$\\d+");
+ }
+
+ /**
+ * Tells whether the given class consists exclusively of static methods and has no public
+ * constructors.
+ */
+ private static boolean isUtility(Class clazz) {
+ Method[] methods = clazz.getMethods();
+ for (int i = 0; i < methods.length; i++) {
+ Method method = methods[i];
+ if (!Modifier.isStatic(method.getModifiers()) && method.getDeclaringClass() != Object.class)
+ return false;
+ }
+ return clazz.getConstructors().length == 0;
+ }
+
+ private static boolean isExcused(String className) {
for (int i = 0; i < excusedClasses.length; i++) {
if (className.startsWith(excusedClasses[i])) return true;
}
15 years, 4 months
JBoss JBPM SVN: r5231 - jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/job.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-07-05 07:06:02 -0400 (Sun, 05 Jul 2009)
New Revision: 5231
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/job/Job.sybase.hbm.xml
Log:
reattach job instead of loading it again
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/job/Job.sybase.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/job/Job.sybase.hbm.xml 2009-07-05 10:44:43 UTC (rev 5230)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/job/Job.sybase.hbm.xml 2009-07-05 11:06:02 UTC (rev 5231)
@@ -17,14 +17,17 @@
<many-to-one name="processInstance"
column="PROCESSINSTANCE_"
+ cascade="lock"
foreign-key="FK_JOB_PRINST"
index="IDX_JOB_PRINST" />
<many-to-one name="token"
column="TOKEN_"
+ cascade="lock"
foreign-key="FK_JOB_TOKEN"
index="IDX_JOB_TOKEN" />
<many-to-one name="taskInstance"
column="TASKINSTANCE_"
+ cascade="lock"
foreign-key="FK_JOB_TSKINST"
index="IDX_JOB_TSKINST" />
15 years, 4 months
JBoss JBPM SVN: r5230 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/api/activity and 6 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-07-05 06:44:43 -0400 (Sun, 05 Jul 2009)
New Revision: 5230
Added:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Condition.java
Removed:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Condition.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Deployment.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Execution.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinition.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinitionQuery.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/ActivityExecution.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/identity/Group.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/identity/User.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/ActivityCoordinates.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Comment.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Discussable.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenExecution.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenProcessInstance.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Assignable.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/AssignmentHandler.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Participation.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Swimlane.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Task.java
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-Incubation.xml
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/ForkActivity.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionEvaluator.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Transition.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/TransitionImpl.java
Log:
JBPM-2372 finish javadocs review
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Deployment.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Deployment.java 2009-07-05 09:02:33 UTC (rev 5229)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Deployment.java 2009-07-05 10:44:43 UTC (rev 5230)
@@ -35,7 +35,7 @@
* to have a kind of undoable delete operation. */
String STATE_SUSPENDED = "suspended";
- /** unique identification of this deployment */
+ /** unique identification of this deployment that is used as a reference in the service methods */
String getId();
/** typically correspond to the file name or url or some other
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Execution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Execution.java 2009-07-05 09:02:33 UTC (rev 5229)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Execution.java 2009-07-05 10:44:43 UTC (rev 5230)
@@ -26,13 +26,15 @@
import java.util.Map;
import java.util.Set;
+import org.jbpm.api.model.OpenExecution;
+
/** a runtime path of execution.
*
* <h3 id="state">State of an execution</h3>
*
* <p>The state of an execution is either active or locked. An active execution is either
- * executing or waiting for an external trigger. If an execution is not in {@link #STATE_ACTIVE_ROOT},
- * then it is locked. A locked execution is read only.
+ * executing or waiting for an external trigger. If an execution is not in {@link #STATE_ACTIVE_ROOT}
+ * or {@link #STATE_ACTIVE_CONCURRENT} then it is locked. A locked execution is read only.
* </p>
*
* <p>When a new execution is created, it is in {@link #STATE_ACTIVE_ROOT}.
@@ -43,14 +45,9 @@
*
* <p>If an execution is locked, methods that change the execution will throw
* a {@link JbpmException} and the message will reference the actual locking state.
- * {@link #fire(String, ObservableElement) Firing events},
- * {@link #setVariable(String, Object) updating variables},
- * {@link #setPriority(int) updating priority} and
- * {@link #createComment(String) adding comments} are not considered to change an
- * execution. Also {@link #createProcessInstance(String) creation} and
- * {@link #removeExecution(Execution) removal} of child executions are unchecked,
- * which means that those methods can be invoked by external API clients and
- * activity behaviour methods, even while the execution is in a locked state.
+ * {@link OpenExecution#setVariable(String, Object) updating variables},
+ * {@link OpenExecution#setPriority(int) updating priority} are not considered to change an
+ * execution.
* </p>
*
* <p>Make sure that comparisons between {@link #getState()} and the
@@ -66,11 +63,9 @@
*/
public interface Execution extends Serializable {
- /** between {@link ClientProcessDefinition#createProcessInstance() creation of
- * a new process instance} and the {@link ClientExecution#start() start} of that
- * process instance. The motivation of this state is that variables can be
- * set programmatically on the process instance so that they can be used during
- * initializations of variables and timers */
+ /** between creation of a new process instance and the start of that
+ * process instance. Typically this is only a very short period that is
+ * not observable thourgh the service interfaces. */
String STATE_CREATED = "created";
/** single (non-concurrent) path of execution that is an active indicator
@@ -126,8 +121,8 @@
* of the constants. */
String STATE_INACTIVE_JOIN = "inactive-join";
- /** indicates that this execution is temporary suspended with the
- * {@link #suspend()} method. Human tasks of a suspended execution
+ /** indicates that this execution is temporary suspended. Human tasks of
+ * a suspended execution
* shouldn't show up in people's task list and timers of suspended
* executions shouldn't fire and the execution is locked. Make sure that comparisons are
* done with .equals and not with '==' because if executions are
@@ -155,7 +150,7 @@
* a single process definition. */
String getKey();
- /** a globally unique identifier for this execution. */
+ /** a globally unique identifier for this execution that is used as a reference in the service methods. */
String getId();
/** the <a href="#state">state</a> of this execution. */
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinition.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinition.java 2009-07-05 09:02:33 UTC (rev 5229)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinition.java 2009-07-05 10:44:43 UTC (rev 5230)
@@ -24,7 +24,7 @@
import java.io.Serializable;
-/** a graphical process which is deployed in the {@ ProcessService}.
+/** a graphical process which is deployed in the {@link RepositoryService}.
*
* @author Tom Baeyens
*/
@@ -32,7 +32,7 @@
/** the short display name given to this process definition.
* Multiple process definitions can have the same as long
- * as they are given a different {@link #version}. */
+ * as they are given a different {@link #getVersion() version}. */
String getName();
/** the user defined short representation of the name. Just
@@ -40,12 +40,12 @@
* can have the same key. */
String getKey();
- /** the unique id for this process definition. */
+ /** the unique id for this process definition that is used as a reference in the service methods. */
String getId();
/** automatically assigned during deployment of a process that
* represents the sequence number for process definitions with
- * the same {@link ObservableElement#getId() name}. */
+ * the same {@link #getName() name}. */
int getVersion();
/** references the deployment in which this process definition is
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinitionQuery.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinitionQuery.java 2009-07-05 09:02:33 UTC (rev 5229)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinitionQuery.java 2009-07-05 10:44:43 UTC (rev 5230)
@@ -62,10 +62,10 @@
/** select only process definitions that are not suspended */
ProcessDefinitionQuery notSuspended();
- /** order selected process definitions ascending for certain {@link #PROPERTY_STATE properties} */
+ /** order selected process definitions ascending for certain {@link #PROPERTY_ID properties} */
ProcessDefinitionQuery orderAsc(String property);
- /** order selected process definitions descending for certain {@link #PROPERTY_STATE properties} */
+ /** order selected process definitions descending for certain {@link #PROPERTY_ID properties} */
ProcessDefinitionQuery orderDesc(String property);
/** select a specific page in the result set */
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java 2009-07-05 09:02:33 UTC (rev 5229)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java 2009-07-05 10:44:43 UTC (rev 5230)
@@ -101,12 +101,12 @@
void deleteTask(String taskId, String reason);
/** add a role to a given task.
- * @param participation specifies the kind of involvement of the participatingUser
+ * @param participationType specifies the kind of involvement of the participatingUser
* in this task. see {@link Participation} for default constants. */
void addTaskParticipatingUser(String taskId, String userId, String participationType);
/** add a role to a given task.
- * @param participation specifies the kind of involvement of the participatingUser
+ * @param participationType specifies the kind of involvement of the participatingUser
* in this task. see {@link Participation} for default constants. */
void addTaskParticipatingGroup(String taskId, String groupId, String participationType);
@@ -115,13 +115,13 @@
/** removes a role to a given task. Nothing happens (no exception) if
* the role does not exist.
- * @param participation specifies the kind of involvement of the participatingUser
+ * @param participationType specifies the kind of involvement of the participatingUser
* in this task. see {@link Participation} for default constants. */
void removeTaskParticipatingUser(String taskId, String userId, String participationType);
/** removes a role to a given task. Nothing happens (no exception) if
* the role does not exist.
- * @param participation specifies the kind of involvement of the participatingUser
+ * @param participationType specifies the kind of involvement of the participatingUser
* in this task. see {@link Participation} for default constants. */
void removeTaskParticipatingGroup(String taskId, String groupId, String participationType);
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/ActivityExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/ActivityExecution.java 2009-07-05 09:02:33 UTC (rev 5229)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/ActivityExecution.java 2009-07-05 10:44:43 UTC (rev 5230)
@@ -22,6 +22,7 @@
package org.jbpm.api.activity;
import org.jbpm.api.Execution;
+import org.jbpm.api.ExecutionService;
import org.jbpm.api.JbpmException;
import org.jbpm.api.model.OpenExecution;
@@ -41,7 +42,7 @@
// wait state behaviour /////////////////////////////////////////////////////
/** makes this execution wait in the current activity until an external trigger is given
- * with one of the {@link #signal()} methods. */
+ * with one of the {@link ExecutionService#signalExecutionById(String) signal} methods. */
void waitForSignal();
// taking a transition //////////////////////////////////////////////////////
@@ -49,11 +50,7 @@
/** takes the default transition.
*
* <p>This method can only be called from inside
- * {@link ExternalActivityBehaviour} implementations and in rare occasions also from outside
- * of the execution (from an external client while the process is in a wait state).
- * For external clients, it is more normal to use the {@link #signal()}
- * method as in that case, it's the current activity (hence the process language)that
- * will decide how to interpret the signal.
+ * {@link ExternalActivityBehaviour} implementations.
* </p>
*
* @throws JbpmException in case there is no default transition in the current activity
@@ -62,12 +59,8 @@
/** takes the outgoing transition with the given name.
*
- * <p>This method can only be called
- * from inside {@link ExternalActivityBehaviour} implementations and in rare occasions also from
- * outside of the execution (from an external client while the process is in a wait state).
- * For external clients, it is more normal to use the {@link #signal(String)}
- * method as in that case, it's the current activity (hence the process language)that
- * will decide how to interpret the signal.</p>
+ * <p>This method can only be called from inside
+ * {@link ExternalActivityBehaviour} implementations.</p>
*
* <p>Transitions will be looked up recursively starting from the
* {@link #getActivityName() current activity} and then up the activity-parent-hierarchy</p>
@@ -75,7 +68,7 @@
* @param transitionName is the name of the transition to take. A null value will
* match the first unnamed transition.
*
- * @throws JbpmException in case no such transition is found in {@link #getActivity() the current activity}
+ * @throws JbpmException in case no such transition is found in {@link #getActivityName() the current activity}
* or in case this method is called from inside an {@link ActivityBehaviour}.*/
void take(String transitionName);
@@ -85,12 +78,8 @@
*
* <p>The activityName is looked up in the current activity's nested activities.</p>
*
- * <p>This method can only be called
- * from inside {@link ExternalActivityBehaviour} implementations and in rare occasions also from
- * outside of the execution (from an external client while the process is in a wait state).
- * For external clients, it is more normal to use the {@link #signal(String)}
- * method as in that case, it's the current activity (hence the process language)that
- * will decide how to interpret the signal.</p> */
+ * <p>This method can only be called from inside {@link ExternalActivityBehaviour}
+ * implementations.</p> */
void execute(String activityName);
// ending an execution //////////////////////////////////////////////////////
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/identity/Group.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/identity/Group.java 2009-07-05 09:02:33 UTC (rev 5229)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/identity/Group.java 2009-07-05 10:44:43 UTC (rev 5230)
@@ -28,7 +28,7 @@
*/
public interface Group {
- /** unique id for the group */
+ /** unique id for the group that is used as a reference in the service methods */
String getId();
/** name for the group (should be unique within one group type) */
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/identity/User.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/identity/User.java 2009-07-05 09:02:33 UTC (rev 5229)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/identity/User.java 2009-07-05 10:44:43 UTC (rev 5230)
@@ -28,7 +28,7 @@
*/
public interface User {
- /** unique id for the user */
+ /** unique id for the user that is used as a reference in the service methods */
String getId();
/** given name (aka first name) */
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/ActivityCoordinates.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/ActivityCoordinates.java 2009-07-05 09:02:33 UTC (rev 5229)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/ActivityCoordinates.java 2009-07-05 10:44:43 UTC (rev 5230)
@@ -21,8 +21,11 @@
*/
package org.jbpm.api.model;
+import org.jbpm.api.RepositoryService;
+
/** activity coordinates indicating the graphical position in the diagram.
*
+ * @see RepositoryService#getActivityCoordinates(String, String)
* @author Tom Baeyens
*/
public interface ActivityCoordinates {
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Comment.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Comment.java 2009-07-05 09:02:33 UTC (rev 5229)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Comment.java 2009-07-05 10:44:43 UTC (rev 5230)
@@ -30,14 +30,13 @@
* or a task.
*
* This class also supports threaded discussions with the
- * {@link #getParent() parent}-{@link #getComments() child}
- * relation.
+ * {@link #getComments() parent-child relation}.
*
* @author Tom Baeyens
*/
public interface Comment extends Discussable {
- /** the meaningless database primary key */
+ /** the unique id for this comment that is used as a reference in the service methods */
String getId();
/** the id of the user that made this comment. The term actorId is an abstract
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Condition.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Condition.java 2009-07-05 09:02:33 UTC (rev 5229)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Condition.java 2009-07-05 10:44:43 UTC (rev 5230)
@@ -1,38 +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.api.model;
-
-import java.io.Serializable;
-
-/** user code that reflects a runtime calculation of a boolean value.
- * Used for {@link Transition#getCondition() transition guard conditions} and
- * {@link Transition#getWaitCondition() transition wait states}.
- *
- * @see Transition
- *
- * @author Tom Baeyens
- */
-public interface Condition extends Serializable {
-
- /** evaluates this condition in the context of the given execution. */
- boolean evaluate(OpenExecution execution);
-}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Discussable.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Discussable.java 2009-07-05 09:02:33 UTC (rev 5229)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Discussable.java 2009-07-05 10:44:43 UTC (rev 5230)
@@ -23,8 +23,15 @@
import java.util.List;
+import org.jbpm.api.TaskService;
-/**
+
+/** something that people can discuss like a task
+ * or a process instance.
+ *
+ * for now, only task discussions are supported in
+ * the {@link TaskService}
+ *
* @author Tom Baeyens
*/
public interface Discussable {
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenExecution.java 2009-07-05 09:02:33 UTC (rev 5229)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenExecution.java 2009-07-05 10:44:43 UTC (rev 5230)
@@ -34,15 +34,17 @@
* This execution exposes the execution hierarchy,
* variable access and associated timers.
*
- * This is an execution that can be used backed by
- * an open persistence session. Typically inside of
- * an environment block. Navigation over the
- * related model objects will load the related objects
- * transparently with lazy loading.
+ * Open refers to the relations being accessible. This is related
+ * to hibernate's lazy loading capabilities. That requires an active
+ * session. Inside process execution, there is such an active session
+ * and hence the relations can be exposed. But for the client of the
+ * service methods, it's not sure if the session is still active.
+ * That is why the relations are not exposed in the return values
+ * of service methods.
*
* @author Tom Baeyens
*/
-public interface OpenExecution extends Execution, Discussable {
+public interface OpenExecution extends Execution {
/** update the state */
void setState(String state);
@@ -79,7 +81,7 @@
/** remove the key-value pair for the given key from this scope.
* No exception will be thrown when the variable is not present.
- * @returns whether a variable was actually found and removed. */
+ * @return whether a variable was actually found and removed. */
boolean removeVariable(String key);
/** removes all variables in this scope */
@@ -117,18 +119,18 @@
// execution hierarchy access ///////////////////////////////////////////////
- /** the main path of execution in the <a href="package-summary.html#basicexecutionstructure">execution
- * structure</a>. Null will be returned in case this execution itself is the
- * main execution path. */
+ /** the main path of execution in the execution tree structure. The
+ * process instance is the root of the execution tree. */
OpenProcessInstance getProcessInstance();
- /** the parent execution in the <a href="package-summary.html#basicexecutionstructure">execution
- * structure</a>. Null will be returned in case this execution itself is the
- * main execution path. */
+ /** the parent execution in the execution structure.
+ * Null will be returned in case this execution itself is the
+ * process instance. */
OpenExecution getParent();
/** the child execution for the given name or null in case such execution doesn't exist. */
OpenExecution getExecution(String name);
+ /** find the execution in the given activity or null if no such activity exists */
OpenExecution findActiveExecutionIn(String activityName);
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenProcessInstance.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenProcessInstance.java 2009-07-05 09:02:33 UTC (rev 5229)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenProcessInstance.java 2009-07-05 10:44:43 UTC (rev 5230)
@@ -23,5 +23,17 @@
import org.jbpm.api.ProcessInstance;
+/** process instance for which the relations are exposed.
+ *
+ * Open refers to the relations being accessible. This is related
+ * to hibernate's lazy loading capabilities. That requires an active
+ * session. Inside process execution, there is such an active session
+ * and hence the relations can be exposed. But for the client of the
+ * service methods, it's not sure if the session is still active.
+ * That is why the relations are not exposed in the return values
+ * of service methods.
+ *
+ * @author Tom Baeyens
+ */
public interface OpenProcessInstance extends OpenExecution, ProcessInstance {
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Assignable.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Assignable.java 2009-07-05 09:02:33 UTC (rev 5229)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Assignable.java 2009-07-05 10:44:43 UTC (rev 5230)
@@ -22,12 +22,19 @@
package org.jbpm.api.task;
-/**
+/** tasks or swimlanes can be assigned.
+ *
+ * @see AssignmentHandler
* @author Tom Baeyens
*/
public interface Assignable {
- void setAssignee(String assignee);
+ /** assign the task or swimlane to the given user */
+ void setAssignee(String userId);
+
+ /** add the given user as a candidate to the task or swimlane */
void addCandidateUser(String userId);
+
+ /** add the members of the given group as candidates to the task or swimlane */
void addCandidateGroup(String groupId);
}
\ No newline at end of file
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/AssignmentHandler.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/AssignmentHandler.java 2009-07-05 09:02:33 UTC (rev 5229)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/AssignmentHandler.java 2009-07-05 10:44:43 UTC (rev 5230)
@@ -27,6 +27,7 @@
/** interface to delegate {@link Task} or {@link Swimlane} assignment.
+ *
* @author Tom Baeyens
*/
public interface AssignmentHandler extends Serializable {
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Participation.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Participation.java 2009-07-05 09:02:33 UTC (rev 5229)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Participation.java 2009-07-05 10:44:43 UTC (rev 5230)
@@ -50,6 +50,7 @@
* reassigned. */
String REPLACED_ASSIGNEE = "replaced-assignee";
+ /** the unique id for this participation that is used as a reference in the service methods */
String getId();
/** userId for this participation.
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Swimlane.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Swimlane.java 2009-07-05 09:02:33 UTC (rev 5229)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Swimlane.java 2009-07-05 10:44:43 UTC (rev 5230)
@@ -23,6 +23,8 @@
import java.io.Serializable;
+import org.jbpm.api.IdentityService;
+
/** a runtime process role that can store an assignment so that
* multiple related tasks are assigned to the same actor.
*
@@ -30,10 +32,13 @@
*/
public interface Swimlane extends Serializable {
+ /** the unique id for this swimlane that is used as a reference in the service methods */
String getId();
+ /** the name of the swimlane as defined in the process file */
String getName();
+ /** the {@link IdentityService#findUserById(String) userId}
+ * of the person that is assigned to this swimlane. */
String getAssignee();
- void setAssignee(String assignee);
}
\ No newline at end of file
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Task.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Task.java 2009-07-05 09:02:33 UTC (rev 5229)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/Task.java 2009-07-05 10:44:43 UTC (rev 5230)
@@ -24,38 +24,76 @@
import java.io.Serializable;
import java.util.Date;
-/** runtime task.
+import org.jbpm.api.TaskService;
+
+/** a task.
*
* @author Tom Baeyens
*/
public interface Task extends Serializable {
+ /** task is waiting for someone to work on it and completed it */
public static final String STATE_OPEN = "open";
+
+ /** task is done */
public static final String STATE_COMPLETED = "completed";
+
+ /** task doesn't show up in task lists as something is wrong
+ * with the related process instance that requires manual
+ * intervention first. */
public static final String STATE_SUSPENDED = "suspended";
+ /** the unique id for this task that is used as a reference in the service methods */
String getId();
+ /** the short display name of this task. Originally, this might come
+ * from the process file, but it can be changed at runtime for individual
+ * tasks. */
String getName();
+
+ /** change the short display name of this tasks.
+ * Updates require you to invoke {@link TaskService#saveTask(Task)} afterwards. */
void setName(String name);
+ /** longer description of this task */
String getDescription();
+
+ /** update the longer description of this task.
+ * Updates like this require you to invoke {@link TaskService#saveTask(Task)} afterwards. */
void setDescription(String description);
+ /** the person responsible for completion of this task. */
String getAssignee();
+
+ /** update the assignee of this task.
+ * Updates like this require you to invoke {@link TaskService#saveTask(Task)} afterwards. */
void setAssignee(String assignee);
+ /** date and time when this task was created */
Date getCreate();
+ /** date and time when this task must be completed. This might be null. */
Date getDueDate();
+
+ /** update the date and time when this task must be completed.
+ * Updates like this require you to invoke {@link TaskService#saveTask(Task)} afterwards. */
void setDueDate(Date dueDate);
+ /** the priority of this task. This is only a data item for user purposes.
+ * The engine doesn't do anything different for different priorities. */
int getPriority();
+
+ /** update the priority.
+ * Updates like this require you to invoke {@link TaskService#saveTask(Task)} afterwards. */
void setPriority(int priority);
+ /** reference to the execution or null if this task is unrelated to an execution */
String getExecutionId();
+ /** reference to the activity or null if this task is unrelated to an activity */
String getActivityName();
+ /** name of the resource in the deployment for the form that is associated
+ * to this task. */
String getFormResourceName();
}
\ No newline at end of file
Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-Incubation.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-Incubation.xml 2009-07-05 09:02:33 UTC (rev 5229)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-Incubation.xml 2009-07-05 10:44:43 UTC (rev 5230)
@@ -605,7 +605,14 @@
}</programlisting>
<para>In the next release we might switch to user provided ID's for these 3 methods.
</para>
-
+
</section>
+ <section>
+ <title>Task outcomes</title>
+ <para>Task outcomes might be changed as it is still being discussed
+ <ulink url="http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4241828">here</ulink>
+ </para>
+ </section>
+
</chapter>
Modified: 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/DecisionConditionActivity.java 2009-07-05 09:02:33 UTC (rev 5229)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionConditionActivity.java 2009-07-05 10:44:43 UTC (rev 5230)
@@ -25,8 +25,8 @@
import org.jbpm.api.JbpmException;
import org.jbpm.api.activity.ActivityExecution;
-import org.jbpm.api.model.Condition;
import org.jbpm.pvm.internal.model.Activity;
+import org.jbpm.pvm.internal.model.Condition;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.model.Transition;
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-07-05 09:02:33 UTC (rev 5229)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ForkActivity.java 2009-07-05 10:44:43 UTC (rev 5230)
@@ -26,8 +26,8 @@
import org.jbpm.api.Execution;
import org.jbpm.api.activity.ActivityExecution;
-import org.jbpm.api.model.Condition;
import org.jbpm.pvm.internal.model.Activity;
+import org.jbpm.pvm.internal.model.Condition;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.model.Transition;
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Condition.java (from rev 5226, jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Condition.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Condition.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Condition.java 2009-07-05 10:44:43 UTC (rev 5230)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.model;
+
+import java.io.Serializable;
+
+import org.jbpm.api.model.OpenExecution;
+
+/** user code that reflects a runtime calculation of a boolean value.
+ * Used for {@link Transition#getCondition() transition guard conditions} and
+ * {@link Transition#getWaitCondition() transition wait states}.
+ *
+ * @see Transition
+ *
+ * @author Tom Baeyens
+ */
+public interface Condition extends Serializable {
+
+ /** evaluates this condition in the context of the given execution. */
+ boolean evaluate(OpenExecution execution);
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Condition.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionEvaluator.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionEvaluator.java 2009-07-05 09:02:33 UTC (rev 5229)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionEvaluator.java 2009-07-05 10:44:43 UTC (rev 5230)
@@ -21,7 +21,6 @@
*/
package org.jbpm.pvm.internal.model;
-import org.jbpm.api.model.Condition;
import org.jbpm.api.model.OpenExecution;
import org.jbpm.pvm.internal.env.EnvironmentDefaults;
import org.jbpm.pvm.internal.script.ScriptManager;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Transition.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Transition.java 2009-07-05 09:02:33 UTC (rev 5229)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Transition.java 2009-07-05 10:44:43 UTC (rev 5230)
@@ -21,7 +21,6 @@
*/
package org.jbpm.pvm.internal.model;
-import org.jbpm.api.model.Condition;
/**
* a transition in a {@link OpenProcessDefinition} graph.
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-07-05 09:02:33 UTC (rev 5229)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/TransitionImpl.java 2009-07-05 10:44:43 UTC (rev 5230)
@@ -23,7 +23,6 @@
import java.util.List;
-import org.jbpm.api.model.Condition;
import org.jbpm.api.model.Event;
import org.jbpm.pvm.internal.wire.Descriptor;
import org.jbpm.pvm.internal.wire.WireContext;
15 years, 4 months
JBoss JBPM SVN: r5229 - jbpm3/branches/jbpm-3.2-soa/hudson/hudson-home.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-07-05 05:02:33 -0400 (Sun, 05 Jul 2009)
New Revision: 5229
Modified:
jbpm3/branches/jbpm-3.2-soa/hudson/hudson-home/command.sh
Log:
install db2 license file along with driver,
remove hardcoded driver versions
Modified: jbpm3/branches/jbpm-3.2-soa/hudson/hudson-home/command.sh
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/hudson/hudson-home/command.sh 2009-07-05 03:55:25 UTC (rev 5228)
+++ jbpm3/branches/jbpm-3.2-soa/hudson/hudson-home/command.sh 2009-07-05 09:02:33 UTC (rev 5229)
@@ -23,9 +23,9 @@
;;
esac
-java -version 2> tmp.ver
-JAVA_VERSION=`grep "java version" tmp.ver | awk '{ print substr($3, 2, length($3)-2); }'`
-rm tmp.ver
+java -version 2> version.tmp
+JAVA_VERSION=`grep "java version" version.tmp | awk '{ print substr($3, 2, length($3)-2); }'`
+rm version.tmp
echo java version $JAVA_VERSION
case $JAVA_VERSION in
@@ -86,27 +86,44 @@
cp $JBOSS_HOME/docs/examples/jbpm/jbpm-$DATABASE-ds.xml $JBOSS_HOME/server/$JBOSS_SERVER/deploy/jbpm/jbpm-$DATABASE-ds.xml
cp $JBOSS_HOME/docs/examples/jbpm/hibernate.cfg.$DATABASE.xml $JBOSS_HOME/server/$JBOSS_SERVER/deploy/jbpm/jbpm-service.sar/hibernate.cfg.xml
-# Install Sybase JDBC driver manually as it is not redistributable
-SYBASE_JDBC_DRIVER=~/.m2/repository/com/sybase/jconnect/6.0.5/jconnect-6.0.5.jar
-if [ -f $SYBASE_JDBC_DRIVER ]; then
- echo "cp $SYBASE_JDBC_DRIVER $JBOSS_HOME/server/$JBOSS_SERVER/deploy/jbpm/jbpm-service.sar"
- cp $SYBASE_JDBC_DRIVER $JBOSS_HOME/server/$JBOSS_SERVER/deploy/jbpm/jbpm-service.sar
+#
+# Install non-redistributable JDBC drivers
+#
+MVN_CMD="mvn --offline --non-recursive $ENVIRONMENT -DoutputFile=resolve.tmp dependency:resolve"
+echo $MVN_CMD; $MVN_CMD
+
+# Install Sybase driver
+JCONNECT_VERSION=`grep com.sybase:jconnect resolve.tmp | awk --field-separator : '{ print $4 }'`
+JCONNECT_JAR=~/.m2/repository/com/sybase/jconnect/$JCONNECT_VERSION/jconnect-$JCONNECT_VERSION.jar
+if [ -f $JCONNECT_JAR ]; then
+ CP_CMD="cp $JCONNECT_JAR $JBOSS_HOME/server/$JBOSS_SERVER/deploy/jbpm/jbpm-service.sar"
+ echo $CP_CMD; $CP_CMD
fi
-# Install Oracle JDBC driver manually as it is not redistributable
-ORACLE_JDBC_DRIVER=~/.m2/repository/com/oracle/ojdbc14/10.2.0.4/ojdbc14-10.2.0.4.jar
-if [ -f $ORACLE_JDBC_DRIVER ]; then
- echo "cp $ORACLE_JDBC_DRIVER $JBOSS_HOME/server/$JBOSS_SERVER/deploy/jbpm/jbpm-service.sar"
- cp $ORACLE_JDBC_DRIVER $JBOSS_HOME/server/$JBOSS_SERVER/deploy/jbpm/jbpm-service.sar
+# Install Oracle driver
+OJDBC_VERSION=`grep com.oracle:ojdbc14:jar resolve.tmp | awk --field-separator : '{ print $4 }'`
+OJDBC_JAR=~/.m2/repository/com/oracle/ojdbc14/$OJDBC_VERSION/ojdbc14-$OJDBC_VERSION.jar
+if [ -f $OJDBC_JAR ]; then
+ CP_CMD="cp $OJDBC_JAR $JBOSS_HOME/server/$JBOSS_SERVER/deploy/jbpm/jbpm-service.sar"
+ echo $CP_CMD; $CP_CMD
fi
-# Install DB2 JDBC driver manually as it is not redistributable
-DB2_JDBC_DRIVER=~/.m2/repository/com/ibm/db2jcc/3.1.57/db2jcc-3.1.57.jar
-if [ -f $DB2_JDBC_DRIVER ]; then
- echo "cp $DB2_JDBC_DRIVER $JBOSS_HOME/server/$JBOSS_SERVER/deploy/jbpm/jbpm-service.sar"
- cp $DB2_JDBC_DRIVER $JBOSS_HOME/server/$JBOSS_SERVER/deploy/jbpm/jbpm-service.sar
+# Install DB2 driver
+DB2JCC_VERSION=`grep com.ibm:db2jcc:jar:jar resolve.tmp | awk --field-separator : '{ print $4 }'`
+DB2JCC_JAR=~/.m2/repository/com/ibm/db2jcc/$DB2JCC_VERSION/db2jcc-$DB2JCC_VERSION.jar
+if [ -f $DB2JCC_JAR ]; then
+ CP_CMD="cp $DB2JCC_JAR $JBOSS_HOME/server/$JBOSS_SERVER/deploy/jbpm/jbpm-service.sar"
+ echo $CP_CMD; $CP_CMD
fi
+DB2JCC_LICENSE=~/.m2/repository/com/ibm/db2jcc_license_cu/$DB2JCC_VERSION/db2jcc_license_cu-$DB2JCC_VERSION.jar
+if [ -f $DB2JCC_LICENSE ]; then
+ CP_CMD="cp $DB2JCC_LICENSE $JBOSS_HOME/server/$JBOSS_SERVER/deploy/jbpm/jbpm-service.sar"
+ echo $CP_CMD; $CP_CMD
+fi
+# Remove resolution output file
+rm resolve.tmp
+
#
# Start JBoss AS
#
15 years, 4 months
JBoss JBPM SVN: r5228 - jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm1072.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-07-04 23:55:25 -0400 (Sat, 04 Jul 2009)
New Revision: 5228
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm1072/JBPM1072Test.java
Log:
make JBPM1072Test resistant to stale state exceptions
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm1072/JBPM1072Test.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm1072/JBPM1072Test.java 2009-07-04 15:19:37 UTC (rev 5227)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm1072/JBPM1072Test.java 2009-07-05 03:55:25 UTC (rev 5228)
@@ -45,7 +45,7 @@
private static final int JOB_EXECUTOR_COUNT = 4;
private JobExecutor[] jobExecutors = new JobExecutor[JOB_EXECUTOR_COUNT];
- private long processDefinitionId;
+ private ProcessDefinition processDefinition;
private static final String PROCESS_DEFINITION = "<process-definition name='job-executors'>" +
" <event type='process-end'>" +
@@ -72,10 +72,9 @@
protected void setUp() throws Exception {
super.setUp();
- ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(PROCESS_DEFINITION);
+ processDefinition = ProcessDefinition.parseXmlString(PROCESS_DEFINITION);
jbpmContext.deployProcessDefinition(processDefinition);
newTransaction();
- processDefinitionId = processDefinition.getId();
startJobExecutors();
}
@@ -83,7 +82,7 @@
protected void tearDown() throws Exception {
stopJobExecutors();
- graphSession.deleteProcessDefinition(processDefinitionId);
+ graphSession.deleteProcessDefinition(processDefinition.getId());
EventCallback.clear();
super.tearDown();
@@ -93,10 +92,7 @@
// Won't Fix [JBPM-1072] Concurrent JobExecutors can process the same job in parallel
if (getHibernateDialect().indexOf("HSQL") != -1) return;
- Counter.resetCount();
-
// kick off process instance
- ProcessDefinition processDefinition = graphSession.loadProcessDefinition(processDefinitionId);
ProcessInstance processInstance = new ProcessInstance(processDefinition);
processInstance.getContextInstance().setVariable("eventCallback", new EventCallback());
processInstance.signal();
@@ -105,13 +101,14 @@
commitAndCloseSession();
try {
EventCallback.waitForEvent(Event.EVENTTYPE_PROCESS_END);
- assertEquals(2, Counter.getCount());
-
- waitForJobs(EventCallback.DEFAULT_TIMEOUT);
}
finally {
beginSessionTransaction();
}
+
+ processInstance = jbpmContext.loadProcessInstance(processInstance.getId());
+ Integer count = (Integer) processInstance.getContextInstance().getVariable("count");
+ assertEquals(2, count.intValue());
}
private void startJobExecutors() {
@@ -136,25 +133,14 @@
public static class Counter implements ActionHandler {
- private volatile static int count;
-
private static final long serialVersionUID = 1L;
public void execute(ExecutionContext exeContext) throws Exception {
- incrementCount();
+ Integer count = (Integer) exeContext.getVariable("count");
+ count = count != null ? new Integer(count.intValue() + 1) : new Integer(1);
+ exeContext.setVariable("count", count);
+
exeContext.leaveNode();
}
-
- public static int getCount() {
- return count;
- }
-
- public static void resetCount() {
- count = 0;
- }
-
- private static synchronized void incrementCount() {
- ++count;
- }
}
}
15 years, 4 months
JBoss JBPM SVN: r5227 - jbpm4/trunk/modules/migration.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-07-04 11:19:37 -0400 (Sat, 04 Jul 2009)
New Revision: 5227
Modified:
jbpm4/trunk/modules/migration/
Log:
added migration target to svn:ignore
Property changes on: jbpm4/trunk/modules/migration
___________________________________________________________________
Name: svn:ignore
+ target
15 years, 4 months
JBoss JBPM SVN: r5226 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/api/activity and 18 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-07-04 11:04:09 -0400 (Sat, 04 Jul 2009)
New Revision: 5226
Added:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/package.html
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/identity/package.html
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/jpdl/package.html
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/package.html
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Problem.java
Removed:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Problem.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Deployment.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/DeploymentQuery.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/IdentityService.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/JbpmException.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/JobQuery.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ManagementService.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/NewDeployment.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinitionQuery.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessEngine.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessInstanceQuery.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskQuery.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/ActivityBehaviour.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/ActivityExecution.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/ExternalActivityBehaviour.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/package.html
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryActivityInstance.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryActivityInstanceQuery.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryProcessInstance.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryProcessInstanceQuery.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/identity/Group.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/identity/User.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/job/Job.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/job/Timer.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/job/package.html
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/jpdl/DecisionHandler.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/listener/EventListener.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/listener/package.html
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/package.html
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/package.html
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-Incubation.xml
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ActivityParsingTest.java
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlParseTestCase.java
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlSchemaTest.java
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ProcessParsingTest.java
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TransitionParsingTest.java
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/test/xml/JpdlXmlTest.java
jbpm4/trunk/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReaderTest.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstanceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/DeploymentQueryImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemImpl.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/AutoWireTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/BasicTypeWireTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ClassWireTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ListWireTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/MapWireTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ObjectWireTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/PropertiesWireTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/RefWireTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/SetWireTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/WireTestCase.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/DeploymentQueryTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/identity/IdentityTest.java
Log:
JBPM-2372 complete javadocs
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Deployment.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Deployment.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Deployment.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -21,7 +21,7 @@
*/
package org.jbpm.api;
-/** represents a deployment in the repository.
+/** represents an existing deployment in the repository.
*
* @author Tom Baeyens
*/
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/DeploymentQuery.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/DeploymentQuery.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/DeploymentQuery.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -23,7 +23,7 @@
import java.util.List;
-/** find deployments in the repository.
+/** find existing deployments in the repository.
*
* @author Tom Baeyens
*/
@@ -33,9 +33,13 @@
String PROPERTY_TIMESTAMP = "timestamp";
String PROPERTY_STATE = "state";
+ /** only include a specific deployment by id */
DeploymentQuery deploymentDbid(long dbid);
+
+ /** only select suspended deployments */
DeploymentQuery suspended();
- DeploymentQuery active();
+
+ DeploymentQuery notSuspended();
DeploymentQuery orderAsc(String property);
DeploymentQuery orderDesc(String property);
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/IdentityService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/IdentityService.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/IdentityService.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -26,7 +26,9 @@
import org.jbpm.api.identity.Group;
import org.jbpm.api.identity.User;
-/**
+/** interface to expose the (configurable) identity component that is
+ * used by jBPM.
+ *
* @author Tom Baeyens
*/
public interface IdentityService {
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/JbpmException.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/JbpmException.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/JbpmException.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -21,6 +21,8 @@
*/
package org.jbpm.api;
+/** all exceptions that jBPM throws are JbpmException's
+ * (extends RuntimeException).*/
public class JbpmException extends RuntimeException {
private static final long serialVersionUID = 1L;
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/JobQuery.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/JobQuery.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/JobQuery.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -26,23 +26,47 @@
import org.jbpm.api.job.Job;
-/**
+/** query for jBPM related messages and timers.
+ *
+ * <p>Both {@link org.jbpm.api.job.Message messages} and
+ * {@link org.jbpm.api.job.Timer timers} are
+ * {@link org.jbpm.api.job.Job jobs}.</p>
+ *
* @author Tom Baeyens
*/
public interface JobQuery {
+ /** duedate property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
+ public static final String PROPERTY_DUEDATE = "dueDate";
+ /** state property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
+ public static final String PROPERTY_STATE = "state";
+
+ /** only select messages */
JobQuery messages();
+
+ /** only select timers */
JobQuery timers();
+ /** only select jobs related to the given process instance */
JobQuery processInstanceId(String processInstanceId);
+ /** only select jobs that were rolled back due to an exception */
JobQuery exception(boolean hasException);
+ /** order ascending for property {@link #PROPERTY_STATE}
+ * or {@link #PROPERTY_DUEDATE} */
JobQuery orderAsc(String property);
+
+ /** order descending for property {@link #PROPERTY_STATE}
+ * or {@link #PROPERTY_DUEDATE} */
JobQuery orderDesc(String property);
+ /** only select a specific page */
JobQuery page(int firstResult, int maxResults);
+ /** execute the query and get the result list */
List<Job> list();
+
+ /** execute the query and get the unique result */
Job uniqueResult();
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ManagementService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ManagementService.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ManagementService.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -22,8 +22,6 @@
package org.jbpm.api;
-
-
/** operations targeted to system operators that need to keep
* the process engine up and running. This functionality is typically
* exposed through a management web console.
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/NewDeployment.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/NewDeployment.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/NewDeployment.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -26,7 +26,7 @@
import java.net.URL;
import java.util.zip.ZipInputStream;
-/** extends a {@link Deployment} with method to create a new
+/** extends a {@link Deployment} with method for creating a new
* deployment.
*
* @see RepositoryService#createDeployment()
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Problem.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Problem.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Problem.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -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.api;
-
-/**
- * @author Tom Baeyens
- */
-public interface Problem {
-
- public abstract Throwable getCause();
-
- public abstract int getColumn();
-
- public abstract int getLine();
-
- public abstract String getMsg();
-
- public abstract String getResource();
-
- public abstract String getSeverity();
-
-}
\ No newline at end of file
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinitionQuery.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinitionQuery.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinitionQuery.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -23,31 +23,57 @@
import java.util.List;
-/**
+/** query for {@link ProcessDefinition process definitions}.
+ *
* @author Tom Baeyens
*/
public interface ProcessDefinitionQuery {
+ /** id property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
String PROPERTY_ID = "idProperty.stringValue";
+ /** key property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
String PROPERTY_KEY = "keyProperty.stringValue";
+ /** name property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
String PROPERTY_NAME = "idProperty.objectName";
+ /** version property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
String PROPERTY_VERSION = "versionProperty.longValue";
+ /** timestamp property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
String PROPERTY_DEPLOYMENT_TIMESTAMP = "deployment.timestamp";
+ /** select only the process definition with the given id */
ProcessDefinitionQuery processDefinitionId(String processDefinitionId);
+
+ /** select only process definitions with the given key */
ProcessDefinitionQuery processDefinitionKey(String key);
+
+ /** select only process definitions with a name like the
+ * given name (name can include % signs to act as wildcard)) */
ProcessDefinitionQuery processDefinitionNameLike(String name);
+
+ /** select only process definitions with an exact match for the given name */
ProcessDefinitionQuery processDefinitionName(String name);
+
+ /** select only process definitions within the given deployment */
ProcessDefinitionQuery deploymentId(String deploymentId);
+ /** select only suspended process definitions */
ProcessDefinitionQuery suspended();
+
+ /** select only process definitions that are not suspended */
ProcessDefinitionQuery notSuspended();
+ /** order selected process definitions ascending for certain {@link #PROPERTY_STATE properties} */
ProcessDefinitionQuery orderAsc(String property);
+
+ /** order selected process definitions descending for certain {@link #PROPERTY_STATE properties} */
ProcessDefinitionQuery orderDesc(String property);
+ /** select a specific page in the result set */
ProcessDefinitionQuery page(int firstResult, int maxResults);
+ /** execute the query and obtain the list of {@link ProcessDefinition}s */
List<ProcessDefinition> list();
+
+ /** execute the query and obtain the unique {@link ProcessDefinition} */
ProcessDefinition uniqueResult();
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessEngine.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessEngine.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessEngine.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -23,7 +23,10 @@
/** central starting point for all process engine API
- * interactions.
+ * interactions. This is a thread safe object so it can be
+ * kept in a static member field or in JNDI or something
+ * similar from which all threads (requests) will fetch the
+ * same ProcessEngine object.
*
* @author Tom Baeyens
*/
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessInstanceQuery.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessInstanceQuery.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessInstanceQuery.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -24,25 +24,39 @@
import java.util.List;
-/**
+/** query for {@link ProcessInstance process instances}.
+ *
* @author Tom Baeyens
*/
public interface ProcessInstanceQuery {
+ /** key property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
String PROPERTY_KEY = "key";
+ /** select only process instances for the given process definition */
ProcessInstanceQuery processDefinitionId(String processDefinitionId);
+ /** select only a specific process instances */
ProcessInstanceQuery processInstanceId(String processInstanceId);
+ /** select only suspended process definitions */
ProcessInstanceQuery suspended();
+
+ /** select only process definitions that are not suspended */
ProcessInstanceQuery notSuspended();
+ /** order selected process instances ascending for certain {@link #PROPERTY_KEY properties} */
ProcessInstanceQuery orderAsc(String property);
+
+ /** order selected process instances descending for certain {@link #PROPERTY_KEY properties} */
ProcessInstanceQuery orderDesc(String property);
+ /** select a specific page in the result set */
ProcessInstanceQuery page(int firstResult, int maxResults);
+ /** execute the query and obtain the list of {@link ProcessInstance}s */
List<ProcessInstance> list();
+
+ /** execute the query and obtain the unique {@link ProcessInstance} */
ProcessInstance uniqueResult();
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskQuery.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskQuery.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskQuery.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -26,23 +26,29 @@
import org.jbpm.api.task.Task;
-/**
+/** query for tasks.
+ *
* @author Tom Baeyens
- * @author Heiko Braun <heiko.braun(a)jboss.com>
- */
+ * @author Heiko Braun <heiko.braun(a)jboss.com> */
public interface TaskQuery {
- public static final String PROPERTY_NAME = "name";
- public static final String PROPERTY_ASSIGNEE = "assignee";
- public static final String PROPERTY_CREATEDATE = "create";
- public static final String PROPERTY_DUEDATE = "dueDate";
- public static final String PROPERTY_PRIORITY = "priority";
- public static final String PROPERTY_PROGRESS = "progress";
+ /** name property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
+ String PROPERTY_NAME = "name";
+ /** assignee property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
+ String PROPERTY_ASSIGNEE = "assignee";
+ /** createdate property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
+ String PROPERTY_CREATEDATE = "create";
+ /** duedate property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
+ String PROPERTY_DUEDATE = "dueDate";
+ /** priority property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
+ String PROPERTY_PRIORITY = "priority";
+ /** progress property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
+ String PROPERTY_PROGRESS = "progress";
- /** only find tasks for which the given user is the assignee */
+ /** only select tasks for which the given user is the assignee */
TaskQuery assignee(String userId);
- /** query for tasks that are unassigned.
+ /** only select tasks that are unassigned.
* These tasks can still potentially have candidates. */
TaskQuery unassigned();
@@ -52,26 +58,34 @@
* associated as a candidate group to the task. */
TaskQuery candidate(String userId);
- /** only query for tasks that are associated to the given process instance */
+ /** only select tasks that are associated to the given process instance */
TaskQuery processInstanceId(String processInstanceId);
- /** only query for tasks that are associated to the given process definition */
+ /** only select tasks that are associated to the given process definition */
TaskQuery processDefinitionId(String processDefinitionId);
- /** only query for tasks that are associated to the given activity name. This
+ /** only select tasks that are associated to the given activity name. This
* can be used in combination with the {@link #processDefinitionId(String)} */
TaskQuery activityName(String activityName);
- /** only query for suspended tasks */
+ /** only select suspended tasks */
TaskQuery suspended();
- /** exclude suspended tasks */
+ /** only select tasks that are not suspended */
TaskQuery notSuspended();
+ /** select a specific page in the result set */
TaskQuery page(int firstResult, int maxResults);
+
+ /** order selected tasks ascending for certain {@link #PROPERTY_NAME properties} */
TaskQuery orderAsc(String property);
+
+ /** order selected tasks descending for certain {@link #PROPERTY_NAME properties} */
TaskQuery orderDesc(String property);
+ /** execute the query and obtain the list of {@link Task}s */
List<Task> list();
+
+ /** execute the query and obtain the unique {@link Task} */
Task uniqueResult();
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/TaskService.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -30,8 +30,9 @@
import java.util.Map;
import java.util.Set;
-/**
- * Human task management facility.
+/** task management.
+ *
+ * @author Tome Baeyens
* @author Alejandro Guizar
* @author Heiko Braun <heiko.braun(a)jboss.com>
*/
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/ActivityBehaviour.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/ActivityBehaviour.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/ActivityBehaviour.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -23,26 +23,19 @@
import java.io.Serializable;
-/** piece of Java code that is to be included in a process as the runtime
- * activity behaviour.
+/** implements the runtime behaviour of an activity.
*
* @author Tom Baeyens
*/
public interface ActivityBehaviour extends Serializable {
- /** piece of Java code that is to be included in a process as activity behaviour
- * or as a hidden listener to process events.
+ /** invoked when an execution arrives in an activity.
*
- * <p>ActivityBehaviour's can be used to implement the behaviour of activities, in
- * which case this behaviour is associated to a graphical activity in the diagram.
- * </p>
- *
* <p>An ActivityBehaviour can control the propagation
* of execution. ActivityBehaviour's can become external activities when they
* invoke {@link ActivityExecution#waitForSignal()}. That means the
* activity will become a wait state. In that case, {@link ExternalActivityBehaviour}
- * should be implemented to also handle the external triggers.
- * </p>
- */
+ * should be implemented to also handle the external signals.
+ * </p> */
void execute(ActivityExecution execution) throws Exception;
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/ActivityExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/ActivityExecution.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/ActivityExecution.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -26,7 +26,7 @@
import org.jbpm.api.model.OpenExecution;
-/** view upon an {@link Execution path of execution} exposed to
+/** view upon an {@link Execution} exposed to
* {@link ActivityBehaviour} implementations.
*
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/ExternalActivityBehaviour.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/ExternalActivityBehaviour.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/ExternalActivityBehaviour.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -24,30 +24,26 @@
import java.util.Map;
import org.jbpm.api.Execution;
+import org.jbpm.api.ExecutionService;
/** extends {@link ActivityBehaviour} for handling external triggers after a wait state.
*
- * <p>Process languages will provide a set of these activity implementations. But
- * languages like jPDL even allow users to provide their own activity behaviour with
- * this interface.
- * </p>
- *
* @author Tom Baeyens
*/
public interface ExternalActivityBehaviour extends ActivityBehaviour {
- /** handles an external trigger.
+ /** handles an external signal.
*
- * <p>An external trigger that comes into an execution
- * through one of the {@link Execution#signal()} methods, will be delegated to
- * the activity in which the execution is positioned when it receives the external
- * trigger.
+ * <p>An external signal that comes into an execution
+ * through one of the {@link ExecutionService#signalExecutionById(String)} methods.
+ * It will be delegated to the activity in which the execution is positioned when it
+ * receives the external trigger.
* </p>
*
- * <p>The signal method implements how the
- * activity will react on that signal. For example, the outgoing transition
- * could be taken that corresponds with the given signal.
+ * <p>The signal method implements how the activity will react on that signal.
+ * For example, the outgoing transition could be taken that corresponds with the
+ * given signal.
* </p>
*
* @param execution the {@link Execution} for which the signal is given
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/package.html
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/package.html 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/package.html 2009-07-04 15:04:09 UTC (rev 5226)
@@ -1,4 +1,3 @@
-<body>interfaces for implementing
-{@link org.jbpm.pvm.activity.Activity activities}, which represent the
-runtime behaviour of activities.
+<body>interfaces for implementing customized
+{@link org.jbpm.api.activity.ActivityBehaviour runtime behaviour of activities}.
</body>
\ No newline at end of file
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryActivityInstance.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryActivityInstance.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryActivityInstance.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -23,19 +23,25 @@
import java.util.Date;
-/**
+/** represents one occurrence of an activity during a process
+ * instance.
+ *
* @author Tom Baeyens
*/
public interface HistoryActivityInstance {
+ /** name of the activity that was executed */
String getActivityName();
+ /** time when the activity was entered */
Date getStartTime();
+ /** might be null in case the activity is still active */
Date getEndTime();
+ /** duration in milleseconds */
long getDuration();
+ /** the execution that was related to this activity occurrence */
String getExecutionId();
-
}
\ No newline at end of file
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryActivityInstanceQuery.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryActivityInstanceQuery.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryActivityInstanceQuery.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -25,33 +25,57 @@
import java.util.List;
-/**
+/** query for {@link HistoryActivityInstance activity occurrences}.
+ *
* @author Tom Baeyens
*/
public interface HistoryActivityInstanceQuery {
+ /** starttime property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
String PROPERTY_STARTTIME = "startTime";
+ /** endtime property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
String PROPERTY_ENDTIME = "endTime";
+ /** executionId property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
String PROPERTY_EXECUTIONID = "executionId";
+ /** activityName property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
String PROPERTY_ACTIVITYNAME = "activityName";
+ /** duration property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
String PROPERTY_DURATION = "duration";
+ /** only select activity instances for the given process definition */
HistoryActivityInstanceQuery processDefinitionId(String processDefinitionId);
+
+ /** only select activity instances for the given execution */
HistoryActivityInstanceQuery executionId(String executionId);
+ /** only select activity instances started after the given time */
HistoryActivityInstanceQuery startedAfter(Date time);
+
+ /** only select activity instances started before the given time */
HistoryActivityInstanceQuery startedBefore(Date time);
+ /** only select activity instances for the given activity
+ * (this usually used in combination with {@link #processDefinitionId(String)}) */
HistoryActivityInstanceQuery activityName(String activityName);
+ /** only select activity instances that took longer then the given duration in milliseconds */
HistoryActivityInstanceQuery tookLongerThen(long durationInMillis);
+
+ /** only select activity instances that took less then the given duration in milliseconds */
HistoryActivityInstanceQuery tookLessThen(long durationInMillis);
+ /** order selected activity instances ascending for certain {@link #PROPERTY_STARTTIME properties} */
HistoryActivityInstanceQuery orderAsc(String property);
+
+ /** order selected process definitions descending for certain {@link #PROPERTY_STARTTIME properties} */
HistoryActivityInstanceQuery orderDesc(String property);
+ /** select a specific page in the result set */
HistoryActivityInstanceQuery page(int firstResult, int maxResults);
+ /** execute the query and obtain the list of {@link HistoryActivityInstance}s */
List<HistoryActivityInstance> list();
+
+ /** execute the query and obtain the unique {@link HistoryActivityInstance} */
HistoryActivityInstance uniqueResult();
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryProcessInstance.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryProcessInstance.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryProcessInstance.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -23,25 +23,50 @@
import java.util.Date;
-/**
+import org.jbpm.api.Execution;
+import org.jbpm.api.ExecutionService;
+import org.jbpm.api.ProcessInstance;
+
+/** one occurence of an execution of a process definition.
+ *
+ * Every {@link ProcessInstance} will have one HistoryProcessInstance
+ * associated. The difference is that the ProcessInstance will be
+ * deleted when it is ended. And the history information will remain
+ * in the DB. That keeps the runtime DB healthy and performant.
+ *
* @author Tom Baeyens
*/
public interface HistoryProcessInstance {
+ /** when the full process instance has come to an end */
String STATE_ENDED = "ended";
+
+ /** when the full process instance is still active */
String STATE_ACTIVE = "active";
+ /** the process instance id (== the root execution id) */
String getProcessInstanceId();
+ /** reference to the process definition */
String getProcessDefinitionId();
+ /** unique user provided business key
+ * (could be null if no such key is provided in
+ * {@link ExecutionService#startProcessInstanceById(String, java.util.Map, String)}) */
String getKey();
+ /** {@link #STATE_ACTIVE} or {@link #STATE_ENDED} (this more coarse grained
+ * state then {@link Execution#getState()}) */
String getState();
+ /** when the process instance started */
Date getStartTime();
+ /** when the process instance ended (only not null if the
+ * process instance already ended) */
Date getEndTime();
- long getDuration();
+ /** duration of the process instance in milliseconds or null
+ * if the process instance has not yet ended */
+ Long getDuration();
}
\ No newline at end of file
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryProcessInstanceQuery.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryProcessInstanceQuery.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/HistoryProcessInstanceQuery.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -24,27 +24,38 @@
import java.util.List;
-
-/**
+/** query for occurences of {@link HistoryProcessInstance process instances}.
+ *
* @author Tom Baeyens
*/
public interface HistoryProcessInstanceQuery {
+ /** starttime property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
String PROPERTY_STARTTIME = "startTime";
+ /** endtime property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
String PROPERTY_ENDTIME = "endTime";
+ /** id property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
String PROPERTY_ID = "id";
+ /** state property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
String PROPERTY_STATE = "state";
+ /** duration property to be used as property in {@link #orderAsc(String)} and {@link #orderDesc(String)} */
String PROPERTY_DURATION = "duration";
HistoryProcessInstanceQuery processInstanceId(String processInstanceId);
HistoryProcessInstanceQuery processDefinitionId(String processDefinitionId);
HistoryProcessInstanceQuery state(String state);
+ /** order selected process instances ascending for certain {@link #PROPERTY_STARTTIME properties} */
HistoryProcessInstanceQuery orderAsc(String property);
+ /** order selected process instances ascending for certain {@link #PROPERTY_STARTTIME properties} */
HistoryProcessInstanceQuery orderDesc(String property);
+ /** select a specific page in the result set */
HistoryProcessInstanceQuery page(int firstResult, int maxResults);
+ /** execute the query and obtain the list of {@link HistoryProcessInstance}s */
List<HistoryProcessInstance> list();
+
+ /** execute the query and obtain the unique {@link HistoryProcessInstance} */
HistoryProcessInstance uniqueResult();
}
Added: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/package.html
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/package.html (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/package.html 2009-07-04 15:04:09 UTC (rev 5226)
@@ -0,0 +1,2 @@
+<body>interfaces related to the {@link org.jbpm.api.HistoryService}.
+</body>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/history/package.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/identity/Group.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/identity/Group.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/identity/Group.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -22,15 +22,18 @@
package org.jbpm.api.identity;
-/** a group.
+/** a group of users.
*
* @author Tom Baeyens
*/
public interface Group {
- String TYPE_UNIT = "unit";
+ /** unique id for the group */
+ String getId();
- String getId();
+ /** name for the group (should be unique within one group type) */
String getName();
+
+ /** type or category of the group */
String getType();
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/identity/User.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/identity/User.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/identity/User.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -22,15 +22,21 @@
package org.jbpm.api.identity;
-/** a user
+/** a user.
+ *
* @author Tom Baeyens
*/
public interface User {
+ /** unique id for the user */
String getId();
+ /** given name (aka first name) */
String getGivenName();
+
+ /** given name (aka last name) */
String getFamilyName();
+ /** the email address for the user */
String getBusinessEmail();
}
Added: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/identity/package.html
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/identity/package.html (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/identity/package.html 2009-07-04 15:04:09 UTC (rev 5226)
@@ -0,0 +1,2 @@
+<body>User and Group interfaces related to the {@link org.jbpm.api.IdentityService}
+</body>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/identity/package.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/job/Job.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/job/Job.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/job/Job.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -31,20 +31,34 @@
*/
public interface Job {
+ /** unique id for this job that is used as a reference in the service methods */
String getId();
+ /** job executor identification that has acquired this job and is going to execute it */
String getLockOwner();
+ /** in case this is a timer, it is the time that the timer should fire, in case this
+ * is a message, it is null. */
Date getDueDate();
+ /** exception that occurred during the last execution of this job. The transaction
+ * of the job execution is rolled back. A synchronization is used to create
+ * a separate transaction to update the exception and decrement the retries. */
String getException();
+ /** number of retries left. This is only decremented when an exception occurs during job
+ * execution. The transaction of the job execution is rolled back. A synchronization is used to create
+ * a separate transaction to update the exception and decrement the retries. */
int getRetries();
+ /** indicates if this job should be executed separate from any other job
+ * in the same process instance */
boolean isExclusive();
+ /** the related execution */
Execution getExecution();
+ /** the related process instance */
Execution getProcessInstance();
Date getLockExpirationTime();
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/job/Timer.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/job/Timer.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/job/Timer.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -28,10 +28,15 @@
*/
public interface Timer extends Job {
+ /** the signal that sent to {@link #getExecution() the execution}
+ * when the timer fires */
String getSignalName();
+ /** the name of the event that is fired on {@link #getExecution() the execution}
+ * when the timer fires */
String getEventName();
+ /** indicates the delay for repeating this timer after successful execution */
String getRepeat();
}
\ No newline at end of file
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/job/package.html
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/job/package.html 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/job/package.html 2009-07-04 15:04:09 UTC (rev 5226)
@@ -1 +1,2 @@
-<body>timers and asynchronous messages</body>
\ No newline at end of file
+<body>Job, Message and Timer interfaces related to the {@link org.jbpm.api.ManagementService}
+</body>
\ No newline at end of file
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/jpdl/DecisionHandler.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/jpdl/DecisionHandler.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/jpdl/DecisionHandler.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -26,9 +26,9 @@
import org.jbpm.api.model.OpenExecution;
-/**
- * @author Tom Baeyens
- */
+/** interface for supplying user programmed decisions.
+ *
+ * @author Tom Baeyens */
public interface DecisionHandler extends Serializable {
/** the name of the selected outgoing transition */
Added: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/jpdl/package.html
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/jpdl/package.html (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/jpdl/package.html 2009-07-04 15:04:09 UTC (rev 5226)
@@ -0,0 +1,2 @@
+<body>specific jPDL interfaces
+</body>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/jpdl/package.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/listener/EventListener.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/listener/EventListener.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/listener/EventListener.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -24,11 +24,13 @@
import java.io.Serializable;
-/**
+/** listener to process execution events.
+ *
* @author Tom Baeyens
*/
public interface EventListener extends Serializable {
+ /** is invoked when an execution crosses the event on which this listener is registered */
void notify(EventListenerExecution execution) throws Exception;
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/listener/package.html
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/listener/package.html 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/listener/package.html 2009-07-04 15:04:09 UTC (rev 5226)
@@ -1,4 +1,4 @@
<body>interfaces for implementing
-{@link org.jbpm.pvm.listener.EventListener event listeners}, which represent
+{@link org.jbpm.api.listener.EventListener event listeners}, which represent
runtime behaviour that can be associated as listeners to process events.
</body>
\ No newline at end of file
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/package.html
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/package.html 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/package.html 2009-07-04 15:04:09 UTC (rev 5226)
@@ -1,2 +1,4 @@
-<body>common model base classes for the client, activity and event listener API's
+<body>common process execution model interfaces used in services and
+delegation interfaces like {@link org.jbpm.api.activity.ActivityBehaviour} and
+{@link org.jbpm.api.listener.EventListener}.
</body>
\ No newline at end of file
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/package.html
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/package.html 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/package.html 2009-07-04 15:04:09 UTC (rev 5226)
@@ -1,5 +1,5 @@
-<body>the primary facade interfaces to
-{@link org.jbpm.pvm.ProcessService the process repository},
-{@link org.jbpm.pvm.ExecutionService the execution repository}
-and {@link org.jbpm.pvm.ManagementService the management functionalities}.
+<body>the jBPM API, Start by creating a {@link org.jbpm.api.Configuration},
+build a {@link org.jbpm.api.ProcessEngine} from that, and then you can find
+the workflow methods on the services like {@link org.jbpm.api.ExecutionService},
+{@link org.jbpm.api.TaskService}.
</body>
\ No newline at end of file
Added: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/package.html
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/package.html (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/package.html 2009-07-04 15:04:09 UTC (rev 5226)
@@ -0,0 +1,2 @@
+<body>interfaces related to the {@link org.jbpm.api.TaskService}
+</body>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/task/package.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-Incubation.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-Incubation.xml 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-Incubation.xml 2009-07-04 15:04:09 UTC (rev 5226)
@@ -581,5 +581,31 @@
</section>
</section>
+
+ <section>
+ <title>Creating groups</title>
+ <para>The identity service methods to create groups are based on
+ component generated ID's.
+ </para>
+ <programlisting>public class IdentityService {
+ /** create a group new group
+ * @return the generated id for this group. */
+ String createGroup(String groupName);
+ /** create a group new group
+ * @return the generated id for this group. */
+ String createGroup(String groupName, String groupType);
+
+ /** create a group new group
+ * @return the generated id for this group. */
+ String createGroup(String groupName, String groupType, String parentGroupId);
+
+ ...
+
+}</programlisting>
+ <para>In the next release we might switch to user provided ID's for these 3 methods.
+ </para>
+
+ </section>
+
</chapter>
Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ActivityParsingTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ActivityParsingTest.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ActivityParsingTest.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -23,7 +23,7 @@
import java.util.List;
-import org.jbpm.api.Problem;
+import org.jbpm.pvm.internal.xml.Problem;
/**
Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlParseTestCase.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlParseTestCase.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlParseTestCase.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -23,9 +23,9 @@
import java.util.List;
-import org.jbpm.api.Problem;
import org.jbpm.jpdl.internal.xml.JpdlParser;
import org.jbpm.pvm.internal.client.ClientProcessDefinition;
+import org.jbpm.pvm.internal.xml.Problem;
import org.jbpm.test.BaseJbpmTestCase;
Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlSchemaTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlSchemaTest.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlSchemaTest.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -23,8 +23,8 @@
import java.util.List;
-import org.jbpm.api.Problem;
import org.jbpm.jpdl.internal.xml.JpdlParser;
+import org.jbpm.pvm.internal.xml.Problem;
/**
Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ProcessParsingTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ProcessParsingTest.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ProcessParsingTest.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -23,8 +23,8 @@
import java.util.List;
-import org.jbpm.api.Problem;
import org.jbpm.pvm.internal.client.ClientProcessDefinition;
+import org.jbpm.pvm.internal.xml.Problem;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TransitionParsingTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TransitionParsingTest.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TransitionParsingTest.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -23,10 +23,10 @@
import java.util.List;
-import org.jbpm.api.Problem;
import org.jbpm.pvm.internal.client.ClientProcessDefinition;
import org.jbpm.pvm.internal.model.Activity;
import org.jbpm.pvm.internal.model.Transition;
+import org.jbpm.pvm.internal.xml.Problem;
/**
Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/test/xml/JpdlXmlTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/test/xml/JpdlXmlTest.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/test/xml/JpdlXmlTest.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -23,8 +23,8 @@
import java.util.List;
-import org.jbpm.api.Problem;
import org.jbpm.jpdl.internal.xml.JpdlParser;
+import org.jbpm.pvm.internal.xml.Problem;
import org.jbpm.test.BaseJbpmTestCase;
/**
Modified: jbpm4/trunk/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReaderTest.java
===================================================================
--- jbpm4/trunk/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReaderTest.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReaderTest.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -25,10 +25,10 @@
import java.util.List;
import org.dom4j.Document;
-import org.jbpm.api.Problem;
import org.jbpm.jpdl.internal.xml.JpdlParser;
import org.jbpm.pvm.internal.cfg.JbpmConfiguration;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
+import org.jbpm.pvm.internal.xml.Problem;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstanceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstanceImpl.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstanceImpl.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -49,7 +49,7 @@
protected String endActivityName;
protected Date startTime;
protected Date endTime;
- protected long duration;
+ protected Long duration = null;
/** only here to get hibernate cascade deletes */
protected Set<HistoryActivityInstanceImpl> historyActivityInstances;
@@ -85,7 +85,7 @@
public Date getStartTime() {
return startTime;
}
- public long getDuration() {
+ public Long getDuration() {
return duration;
}
public String getProcessInstanceId() {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/DeploymentQueryImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/DeploymentQueryImpl.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/DeploymentQueryImpl.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -35,7 +35,7 @@
public class DeploymentQueryImpl extends AbstractQuery implements DeploymentQuery {
protected Long deploymentDbid = null;
- protected String state = null;
+ protected Boolean suspended = null;
public String hql() {
StringBuilder hql = new StringBuilder();
@@ -48,8 +48,12 @@
appendWhereClause("d.dbid = "+deploymentDbid+" ", hql);
}
- if (state!=null) {
- appendWhereClause(" d.state = '"+state+"' ", hql);
+ if (suspended!=null) {
+ if (suspended) {
+ appendWhereClause(" d.state = '"+Deployment.STATE_SUSPENDED+"' ", hql);
+ } else {
+ appendWhereClause(" d.state != '"+Deployment.STATE_SUSPENDED+"' ", hql);
+ }
}
return hql.toString();
@@ -63,13 +67,13 @@
return this;
}
- public DeploymentQuery active() {
- this.state = Deployment.STATE_ACTIVE;
+ public DeploymentQuery notSuspended() {
+ suspended = false;
return this;
}
public DeploymentQuery suspended() {
- this.state = Deployment.STATE_SUSPENDED;
+ suspended = true;
return this;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -25,9 +25,9 @@
import java.util.List;
import org.jbpm.api.JbpmException;
-import org.jbpm.api.Problem;
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.xml.Problem;
/**
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Problem.java (from rev 5219, jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Problem.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Problem.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Problem.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -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.xml;
+
+/**
+ * @author Tom Baeyens
+ */
+public interface Problem {
+
+ public abstract Throwable getCause();
+
+ public abstract int getColumn();
+
+ public abstract int getLine();
+
+ public abstract String getMsg();
+
+ public abstract String getResource();
+
+ public abstract String getSeverity();
+
+}
\ No newline at end of file
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemImpl.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemImpl.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -23,7 +23,6 @@
import java.io.Serializable;
-import org.jbpm.api.Problem;
import org.xml.sax.SAXParseException;
/**
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-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/ProblemList.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -27,7 +27,6 @@
import java.util.List;
import org.jbpm.api.JbpmException;
-import org.jbpm.api.Problem;
import org.jbpm.pvm.internal.repository.DeploymentImpl;
import org.w3c.dom.Element;
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/AutoWireTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/AutoWireTest.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/AutoWireTest.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -23,7 +23,7 @@
import java.util.List;
-import org.jbpm.api.Problem;
+import org.jbpm.pvm.internal.xml.Problem;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/BasicTypeWireTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/BasicTypeWireTest.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/BasicTypeWireTest.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -23,7 +23,7 @@
import java.util.List;
-import org.jbpm.api.Problem;
+import org.jbpm.pvm.internal.xml.Problem;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ClassWireTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ClassWireTest.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ClassWireTest.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -2,8 +2,8 @@
import java.util.List;
-import org.jbpm.api.Problem;
import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.xml.Problem;
/**
* Tests for the ClassDescriptor
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ListWireTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ListWireTest.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ListWireTest.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -25,7 +25,7 @@
import java.util.HashSet;
import java.util.List;
-import org.jbpm.api.Problem;
+import org.jbpm.pvm.internal.xml.Problem;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/MapWireTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/MapWireTest.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/MapWireTest.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -4,7 +4,7 @@
import java.util.Map;
import java.util.TreeMap;
-import org.jbpm.api.Problem;
+import org.jbpm.pvm.internal.xml.Problem;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ObjectWireTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ObjectWireTest.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ObjectWireTest.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -24,7 +24,7 @@
import java.util.List;
import org.jbpm.api.JbpmException;
-import org.jbpm.api.Problem;
+import org.jbpm.pvm.internal.xml.Problem;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/PropertiesWireTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/PropertiesWireTest.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/PropertiesWireTest.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -24,8 +24,8 @@
import java.util.List;
import java.util.Properties;
-import org.jbpm.api.Problem;
import org.jbpm.pvm.internal.util.FileUtil;
+import org.jbpm.pvm.internal.xml.Problem;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/RefWireTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/RefWireTest.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/RefWireTest.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -25,7 +25,7 @@
import java.util.Map;
import java.util.Set;
-import org.jbpm.api.Problem;
+import org.jbpm.pvm.internal.xml.Problem;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/SetWireTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/SetWireTest.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/SetWireTest.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -3,7 +3,7 @@
import java.util.List;
import java.util.Set;
-import org.jbpm.api.Problem;
+import org.jbpm.pvm.internal.xml.Problem;
public class SetWireTest extends WireTestCase {
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/WireTestCase.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/WireTestCase.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/WireTestCase.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -23,8 +23,8 @@
import java.util.List;
-import org.jbpm.api.Problem;
import org.jbpm.pvm.internal.wire.xml.WireParser;
+import org.jbpm.pvm.internal.xml.Problem;
import org.jbpm.test.BaseJbpmTestCase;
/**
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/DeploymentQueryTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/DeploymentQueryTest.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/DeploymentQueryTest.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -108,7 +108,7 @@
deployments = repositoryService
.createDeploymentQuery()
- .active()
+ .notSuspended()
.list();
expectedDeploymentNames = new HashSet<String>();
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/identity/IdentityTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/identity/IdentityTest.java 2009-07-04 13:45:15 UTC (rev 5225)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/identity/IdentityTest.java 2009-07-04 15:04:09 UTC (rev 5226)
@@ -47,17 +47,17 @@
}
public void testCreateGroup() throws Exception {
- String testGroupId = identityService.createGroup("testGroup", Group.TYPE_UNIT, null);
+ String testGroupId = identityService.createGroup("testGroup", "unit", null);
Group group = identityService.findGroupById(testGroupId);
assertEquals("testGroup", group.getName());
- assertEquals(Group.TYPE_UNIT, group.getType());
+ assertEquals("unit", group.getType());
identityService.deleteGroup(testGroupId);
}
public void testFindGroupsByUser() throws Exception {
- String redhatGroupId = identityService.createGroup("redhat", Group.TYPE_UNIT, null);
+ String redhatGroupId = identityService.createGroup("redhat", "unit", null);
identityService.createUser("jeffyu", "Jeff", "Yu");
identityService.createMembership("jeffyu", redhatGroupId);
@@ -82,10 +82,10 @@
public void testFindGroupByUserAndGroupType() throws Exception {
identityService.createUser("johndoe", "John", "Doe");
- String redhatGroupId = identityService.createGroup("redhat", Group.TYPE_UNIT, null);
+ String redhatGroupId = identityService.createGroup("redhat", "unit", null);
identityService.createMembership("johndoe", redhatGroupId, "developer");
- List<Group> groups = identityService.findGroupsByUserAndGroupType("johndoe", Group.TYPE_UNIT);
+ List<Group> groups = identityService.findGroupsByUserAndGroupType("johndoe", "unit");
assertTrue(groups.size() > 0);
Set<String> groupNames = new HashSet<String>();
@@ -107,15 +107,15 @@
identityService.createUser("joesmoe", "Joe", "Smoe");
identityService.createUser("jackblack", "Jack", "Black");
- String redhatGroupId = identityService.createGroup("redhat", Group.TYPE_UNIT, null);
- String jbossId = identityService.createGroup("jboss", Group.TYPE_UNIT, redhatGroupId);
- String jbpmId = identityService.createGroup("jbpm", Group.TYPE_UNIT, jbossId);
+ String redhatGroupId = identityService.createGroup("redhat", "unit", null);
+ String jbossId = identityService.createGroup("jboss", "unit", redhatGroupId);
+ String jbpmId = identityService.createGroup("jbpm", "unit", jbossId);
identityService.createMembership("johndoe", redhatGroupId, "developer");
identityService.createMembership("joesmoe", jbpmId, "leader");
identityService.createMembership("jackblack", jbossId, "manager");
- List<Group> groups = identityService.findGroupsByUserAndGroupType("johndoe", Group.TYPE_UNIT);
+ List<Group> groups = identityService.findGroupsByUserAndGroupType("johndoe", "unit");
assertEquals(1, groups.size());
Group group = groups.get(0);
15 years, 4 months
JBoss JBPM SVN: r5225 - jbpm3/branches/jbpm-3.2-soa/modules/enterprise/src/main/java/org/jbpm/ejb/impl.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-07-04 09:45:15 -0400 (Sat, 04 Jul 2009)
New Revision: 5225
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/enterprise/src/main/java/org/jbpm/ejb/impl/JobListenerBean.java
Log:
javadoc typo fix
Modified: jbpm3/branches/jbpm-3.2-soa/modules/enterprise/src/main/java/org/jbpm/ejb/impl/JobListenerBean.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/enterprise/src/main/java/org/jbpm/ejb/impl/JobListenerBean.java 2009-07-04 13:44:35 UTC (rev 5224)
+++ jbpm3/branches/jbpm-3.2-soa/modules/enterprise/src/main/java/org/jbpm/ejb/impl/JobListenerBean.java 2009-07-04 13:45:15 UTC (rev 5225)
@@ -9,7 +9,7 @@
/**
* Message-driven bean that listens for {@link Message messages} containing
- * a reference to a pending {@linkplain Job job. to support asynchronous
+ * a reference to a pending {@linkplain Job job}. to support asynchronous
* continuations.
*
* The message must have a property called <code>jobId</code> of type
15 years, 4 months
JBoss JBPM SVN: r5224 - in jbpm3/branches/jbpm-3.2-soa/modules/core/src: test/java/org/jbpm/perf and 1 other directory.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-07-04 09:44:35 -0400 (Sat, 04 Jul 2009)
New Revision: 5224
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/AbstractDbTestCase.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/perf/SimplePerformanceTest.java
Log:
prevent waitForJobs() from doing excessive polling,
made SimplePerformanceTest timeout based on duration of warmup phase
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/AbstractDbTestCase.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/AbstractDbTestCase.java 2009-07-04 13:41:56 UTC (rev 5223)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/AbstractDbTestCase.java 2009-07-04 13:44:35 UTC (rev 5224)
@@ -184,19 +184,48 @@
jobExecutor.start();
}
- protected void waitForJobs(long timeout) {
- long startTime = System.currentTimeMillis();
- while (getNbrOfJobsAvailable() > 0) {
- if (System.currentTimeMillis() - startTime > timeout) {
- fail("test execution exceeded treshold of " + timeout + " milliseconds");
+ protected void waitForJobs(final long timeout) {
+ final long startTime = System.currentTimeMillis();
+
+ int previousCount = 0;
+ long previousTime = 0L;
+
+ long waitPeriod = 500;
+
+ for (int currentCount; (currentCount = getNbrOfJobsAvailable()) > 0;) {
+ final long currentTime = System.currentTimeMillis();
+
+ final long elapsedTime = currentTime - startTime;
+ if (elapsedTime > timeout) {
+ fail("test execution exceeded threshold of " + timeout + " ms");
}
- log.debug("waiting for job executor to process more jobs");
+
+ if (currentCount < previousCount) {
+ waitPeriod = currentCount * (currentTime - previousTime) / (previousCount - currentCount);
+ if (waitPeriod < 500) waitPeriod = 500;
+ }
+ else {
+ waitPeriod <<= 1;
+ }
+
+ if (waitPeriod > 5000) {
+ waitPeriod = 5000;
+ }
+ else {
+ final long remainingTime = timeout - elapsedTime;
+ if (waitPeriod > remainingTime) waitPeriod = remainingTime;
+ }
+
+ log.debug("waiting " + waitPeriod + " ms for " + currentCount + " jobs to be executed");
try {
- Thread.sleep(500);
+ Thread.sleep(waitPeriod);
}
catch (InterruptedException e) {
- fail("wait for job executor to process more jobs got interrupted");
+ fail("wait for jobs got interrupted");
}
+
+ previousCount = currentCount;
+ previousTime = currentTime;
}
}
@@ -216,14 +245,9 @@
}
private int getNbrOfJobsAvailable(Session session) {
- int nbrOfJobsAvailable = 0;
Number jobs = (Number) session.createQuery("select count(*) from org.jbpm.job.Job")
.uniqueResult();
- log.debug("there are " + jobs + " jobs in the database");
- if (jobs != null) {
- nbrOfJobsAvailable = jobs.intValue();
- }
- return nbrOfJobsAvailable;
+ return jobs.intValue();
}
protected int getTimerCount() {
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/perf/SimplePerformanceTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/perf/SimplePerformanceTest.java 2009-07-04 13:41:56 UTC (rev 5223)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/perf/SimplePerformanceTest.java 2009-07-04 13:44:35 UTC (rev 5224)
@@ -37,7 +37,7 @@
public class SimplePerformanceTest extends AbstractDbTestCase {
private static final int WARMUP_INSTANCES = 100;
- private static final int MEASUREMENT_INSTANCES = 1000;
+ private static final int MEASURED_INSTANCES = 1000;
private static final long TIMEOUT = 5 * 60 * 1000;
private ProcessDefinition processDefinition;
@@ -60,20 +60,18 @@
}
public void testAsyncCall() {
+ long firstTime = System.currentTimeMillis();
launchProcessInstances(WARMUP_INSTANCES);
+ processJobs(TIMEOUT);
- long startTime = System.currentTimeMillis();
- launchProcessInstances(MEASUREMENT_INSTANCES);
- long duration = (System.currentTimeMillis() - startTime) / 1000;
+ long secondTime = System.currentTimeMillis();
+ launchProcessInstances(MEASURED_INSTANCES);
+ processJobs((secondTime - firstTime) * MEASURED_INSTANCES / WARMUP_INSTANCES);
- System.out.println("=== Test finished processing " +
- MEASUREMENT_INSTANCES +
- " instances in " +
- duration +
- " seconds ===");
- System.out.println("=== This is " +
- (MEASUREMENT_INSTANCES / duration) +
- " instances per second ===");
+ long duration = (System.currentTimeMillis() - secondTime) / 1000;
+ System.out.println("==> Processed " +
+ (MEASURED_INSTANCES / duration) +
+ " instances per second <==");
}
private void launchProcessInstances(int count) {
@@ -83,7 +81,5 @@
processInstance.signal();
jbpmContext.save(processInstance);
}
-
- processJobs(TIMEOUT);
}
}
15 years, 4 months