JBoss JBPM SVN: r3859 - in jbpm3/trunk: modules/core/src/main/java/org/jbpm/context/exe and 11 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-02-12 21:11:33 -0500 (Thu, 12 Feb 2009)
New Revision: 3859
Added:
jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/exe/jbpm.converter.properties
jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jbpm1024/
jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jbpm1024/CustomSerializable.zip
Removed:
jbpm3/trunk/modules/core/src/main/resources/org/jbpm/db/hibernate/
jbpm3/trunk/modules/core/src/test/resources/org/jbpm/context/exe/CustomSerializable.zip
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/context/exe/JbpmType.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/context/exe/VariableInstance.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/context/exe/converter/SerializableToByteArrayConverter.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/hibernate/Converters.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/IoUtil.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/XmlUtil.java
jbpm3/trunk/modules/core/src/main/resources/org/jbpm/default.jbpm.cfg.xml
jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1024/JBPM1024Test.java
jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jbpm.test.cfg.xml
jbpm3/trunk/modules/identity/src/main/java/org/jbpm/identity/xml/IdentityXmlParser.java
jbpm3/trunk/pom.xml
Log:
clean up converters;
close exhausted streams;
fill in project info
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/context/exe/JbpmType.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/context/exe/JbpmType.java 2009-02-12 22:54:24 UTC (rev 3858)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/context/exe/JbpmType.java 2009-02-13 02:11:33 UTC (rev 3859)
@@ -31,60 +31,70 @@
import org.jbpm.configuration.ObjectFactory;
import org.jbpm.configuration.ObjectFactoryParser;
import org.jbpm.util.ClassLoaderUtil;
+import org.jbpm.util.CollectionUtil;
/**
- * specifies for one java-type how jbpm is able to persist objects of that type in the database.
+ * specifies for one java-type how jbpm is able to persist objects of that type in the database.
*/
public class JbpmType {
-
- static Map jbpmTypesCache = new HashMap();
-
+
+ static Map<ObjectFactory, List<JbpmType>> jbpmTypesCache = new HashMap<ObjectFactory, List<JbpmType>>();
+
JbpmTypeMatcher jbpmTypeMatcher = null;
Converter converter = null;
- Class variableInstanceClass = null;
+ Class<? extends VariableInstance> variableInstanceClass = null;
- public JbpmType(JbpmTypeMatcher jbpmTypeMatcher, Converter converter, Class variableInstanceClass) {
+ public JbpmType(JbpmTypeMatcher jbpmTypeMatcher, Converter converter,
+ Class<? extends VariableInstance> variableInstanceClass) {
this.jbpmTypeMatcher = jbpmTypeMatcher;
this.converter = converter;
this.variableInstanceClass = variableInstanceClass;
}
-
+
public boolean matches(Object value) {
return jbpmTypeMatcher.matches(value);
}
-
+
public VariableInstance newVariableInstance() {
VariableInstance variableInstance = null;
try {
- variableInstance = (VariableInstance) variableInstanceClass.newInstance();
+ variableInstance = variableInstanceClass.newInstance();
variableInstance.converter = converter;
- } catch (Exception e) {
- throw new JbpmException("couldn't instantiate variable instance class '"+variableInstanceClass.getName()+"'");
}
+ catch (Exception e) {
+ throw new JbpmException("couldn't instantiate variable instance class '"
+ + variableInstanceClass.getName()
+ + "'");
+ }
return variableInstance;
}
- public static List getJbpmTypes() {
- List jbpmTypes = null;
- synchronized(jbpmTypesCache) {
- ObjectFactory objectFactory = JbpmConfiguration.Configs.getObjectFactory();
- jbpmTypes = (List) jbpmTypesCache.get(objectFactory);
- if (jbpmTypes==null) {
- if (JbpmConfiguration.Configs.hasObject("jbpm.types")) {
- jbpmTypes = (List) JbpmConfiguration.Configs.getObject("jbpm.types");
- } else {
+ public static List<JbpmType> getJbpmTypes() {
+ List<JbpmType> jbpmTypes = null;
+ ObjectFactory objectFactory = JbpmConfiguration.Configs.getObjectFactory();
+ synchronized (jbpmTypesCache) {
+ jbpmTypes = jbpmTypesCache.get(objectFactory);
+
+ if (jbpmTypes == null) {
+ if (objectFactory.hasObject("jbpm.types")) {
+ jbpmTypes = CollectionUtil.checkList((List<?>) objectFactory.createObject("jbpm.types"),
+ JbpmType.class);
+ }
+ else {
jbpmTypes = getDefaultJbpmTypes();
}
+
jbpmTypesCache.put(objectFactory, jbpmTypes);
}
}
return jbpmTypes;
}
- private static List getDefaultJbpmTypes() {
+ private static List<JbpmType> getDefaultJbpmTypes() {
String resource = JbpmConfiguration.Configs.getString("resource.varmapping");
InputStream is = ClassLoaderUtil.getStream(resource);
ObjectFactory objectFactory = ObjectFactoryParser.parseInputStream(is);
- return (List) objectFactory.createObject("jbpm.types");
+ return CollectionUtil.checkList((List<?>) objectFactory.createObject("jbpm.types"),
+ JbpmType.class);
}
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/context/exe/VariableInstance.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/context/exe/VariableInstance.java 2009-02-12 22:54:24 UTC (rev 3858)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/context/exe/VariableInstance.java 2009-02-13 02:11:33 UTC (rev 3859)
@@ -22,7 +22,6 @@
package org.jbpm.context.exe;
import java.io.Serializable;
-import java.util.Iterator;
import org.jbpm.JbpmException;
import org.jbpm.context.exe.converter.SerializableToByteArrayConverter;
@@ -33,167 +32,157 @@
import org.jbpm.graph.exe.Token;
/**
- * is a jbpm-internal class that serves as a base class for classes that store
- * variable values in the database.
+ * is a jbpm-internal class that serves as a base class for classes that store variable values in
+ * the database.
*/
public abstract class VariableInstance implements Serializable {
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
- long id = 0;
- int version = 0;
- protected String name = null;
- protected Token token = null;
- protected TokenVariableMap tokenVariableMap = null;
- protected ProcessInstance processInstance = null;
- protected Converter converter = null;
- protected Object valueCache = null;
- protected boolean isValueCached = false;
+ long id = 0;
+ int version = 0;
+ protected String name = null;
+ protected Token token = null;
+ protected TokenVariableMap tokenVariableMap = null;
+ protected ProcessInstance processInstance = null;
+ protected Converter converter = null;
+ protected Object valueCache = null;
+ protected boolean isValueCached = false;
- // constructors /////////////////////////////////////////////////////////////
+ // constructors /////////////////////////////////////////////////////////////
- public VariableInstance() {}
+ public VariableInstance() {
+ }
- public static VariableInstance create(Token token, String name, Object value) {
+ public static VariableInstance create(Token token, String name, Object value) {
- VariableInstance variableInstance = null;
- if(value == null) {
- variableInstance = new NullInstance();
- }
- else {
- variableInstance = createVariableInstance(value);
- }
+ VariableInstance variableInstance = null;
+ if (value == null) {
+ variableInstance = new NullInstance();
+ }
+ else {
+ variableInstance = createVariableInstance(value);
+ }
- variableInstance.token = token;
- variableInstance.name = name;
- variableInstance.processInstance = (token != null ? token
- .getProcessInstance() : null);
- if(token != null) {
- token.addLog(new VariableCreateLog(variableInstance));
- }
- variableInstance.setValue(value);
- return variableInstance;
- }
+ variableInstance.token = token;
+ variableInstance.name = name;
+ variableInstance.processInstance = (token != null ? token.getProcessInstance() : null);
+ if (token != null) {
+ token.addLog(new VariableCreateLog(variableInstance));
+ }
+ variableInstance.setValue(value);
+ return variableInstance;
+ }
- public static VariableInstance createVariableInstance(Object value) {
- VariableInstance variableInstance = null;
+ public static VariableInstance createVariableInstance(Object value) {
+ for (JbpmType jbpmType : JbpmType.getJbpmTypes()) {
+ if (jbpmType.matches(value)) {
+ return jbpmType.newVariableInstance();
+ }
+ }
+ return new UnpersistableInstance();
+ }
- Iterator iter = JbpmType.getJbpmTypes().iterator();
- while((iter.hasNext()) && (variableInstance == null)) {
- JbpmType jbpmType = (JbpmType) iter.next();
+ // abstract methods /////////////////////////////////////////////////////////
- if(jbpmType.matches(value)) {
- variableInstance = jbpmType.newVariableInstance();
- }
- }
+ /**
+ * is true if this variable-instance supports the given value, false otherwise.
+ */
+ public abstract boolean isStorable(Object value);
- if(variableInstance == null) {
- variableInstance = new UnpersistableInstance();
- }
+ /**
+ * is the value, stored by this variable instance.
+ */
+ protected abstract Object getObject();
- return variableInstance;
- }
+ /**
+ * stores the value in this variable instance.
+ */
+ protected abstract void setObject(Object value);
- // abstract methods /////////////////////////////////////////////////////////
+ // variable management //////////////////////////////////////////////////////
- /**
- * is true if this variable-instance supports the given value, false
- * otherwise.
- */
- public abstract boolean isStorable(Object value);
+ public boolean supports(Object value) {
+ if (converter != null) {
+ return converter.supports(value);
+ }
+ return isStorable(value);
+ }
- /**
- * is the value, stored by this variable instance.
- */
- protected abstract Object getObject();
+ public void setValue(Object value) {
+ valueCache = value;
+ isValueCached = true;
- /**
- * stores the value in this variable instance.
- */
- protected abstract void setObject(Object value);
+ if (converter != null) {
+ if (!converter.supports(value)) {
+ throw new JbpmException("the converter '"
+ + converter.getClass().getName()
+ + "' in variable instance '"
+ + this.getClass().getName()
+ + "' does not support values of type '"
+ + value.getClass().getName()
+ + "'. to change the type of a variable, you have to delete it first");
+ }
+ value = converter.convert(value);
+ }
+ if ((value != null) && (!this.isStorable(value))) {
+ throw new JbpmException("variable instance '"
+ + this.getClass().getName()
+ + "' does not support values of type '"
+ + value.getClass().getName()
+ + "'. to change the type of a variable, you have to delete it first");
+ }
+ setObject(value);
+ }
- // variable management //////////////////////////////////////////////////////
+ public Object getValue() {
+ if (isValueCached) {
+ return valueCache;
+ }
+ Object value = getObject();
+ if ((value != null) && (converter != null)) {
+ if (converter instanceof SerializableToByteArrayConverter && processInstance != null) {
+ SerializableToByteArrayConverter s2bConverter = (SerializableToByteArrayConverter) converter;
+ value = s2bConverter.revert(value, processInstance.getProcessDefinition());
+ }
+ else {
+ value = converter.revert(value);
+ }
+ valueCache = value;
+ isValueCached = true;
+ }
+ return value;
+ }
- public boolean supports(Object value) {
- if(converter != null) {
- return converter.supports(value);
- }
- return isStorable(value);
- }
+ public void removeReferences() {
+ tokenVariableMap = null;
+ token = null;
+ processInstance = null;
+ }
- public void setValue(Object value) {
- valueCache = value;
- isValueCached = true;
+ // utility methods /////////////////////////////////////////////////////////
- if(converter != null) {
- if(!converter.supports(value)) {
- throw new JbpmException(
- "the converter '"
- + converter.getClass().getName()
- + "' in variable instance '"
- + this.getClass().getName()
- + "' does not support values of type '"
- + value.getClass().getName()
- + "'. to change the type of a variable, you have to delete it first");
- }
- value = converter.convert(value);
- }
- if((value != null) && (!this.isStorable(value))) {
- throw new JbpmException("variable instance '" + this.getClass().getName()
- + "' does not support values of type '" + value.getClass().getName()
- + "'. to change the type of a variable, you have to delete it first");
- }
- setObject(value);
- }
+ public String toString() {
+ return "${" + name + "}";
+ }
- public Object getValue() {
- if(isValueCached) {
- return valueCache;
- }
- Object value = getObject();
- if((value != null) && (converter != null)) {
- if(converter instanceof SerializableToByteArrayConverter && processInstance != null) {
- SerializableToByteArrayConverter s2bConverter = (SerializableToByteArrayConverter) converter;
- value = s2bConverter.revert(value, processInstance.getProcessDefinition());
- }
- else {
- value = converter.revert(value);
- }
- valueCache = value;
- isValueCached = true;
- }
- return value;
- }
+ // getters and setters //////////////////////////////////////////////////////
- public void removeReferences() {
- tokenVariableMap = null;
- token = null;
- processInstance = null;
- }
+ public String getName() {
+ return name;
+ }
- // utility methods /////////////////////////////////////////////////////////
+ public ProcessInstance getProcessInstance() {
+ return processInstance;
+ }
- public String toString() {
- return "${" + name + "}";
- }
+ public Token getToken() {
+ return token;
+ }
- // getters and setters //////////////////////////////////////////////////////
+ public void setTokenVariableMap(TokenVariableMap tokenVariableMap) {
+ this.tokenVariableMap = tokenVariableMap;
+ }
- public String getName() {
- return name;
- }
-
- public ProcessInstance getProcessInstance() {
- return processInstance;
- }
-
- public Token getToken() {
- return token;
- }
-
- public void setTokenVariableMap(TokenVariableMap tokenVariableMap) {
- this.tokenVariableMap = tokenVariableMap;
- }
-
- // private static Log log = LogFactory.getLog(VariableInstance.class);
+ // private static Log log = LogFactory.getLog(VariableInstance.class);
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/context/exe/converter/SerializableToByteArrayConverter.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/context/exe/converter/SerializableToByteArrayConverter.java 2009-02-12 22:54:24 UTC (rev 3858)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/context/exe/converter/SerializableToByteArrayConverter.java 2009-02-13 02:11:33 UTC (rev 3859)
@@ -34,7 +34,6 @@
import org.jbpm.bytes.ByteArray;
import org.jbpm.context.exe.Converter;
import org.jbpm.graph.def.ProcessDefinition;
-import org.jbpm.util.ClassLoaderUtil;
import org.jbpm.util.CustomLoaderObjectInputStream;
public class SerializableToByteArrayConverter implements Converter {
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/hibernate/Converters.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/hibernate/Converters.java 2009-02-12 22:54:24 UTC (rev 3858)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/hibernate/Converters.java 2009-02-13 02:11:33 UTC (rev 3859)
@@ -22,7 +22,6 @@
package org.jbpm.db.hibernate;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
@@ -37,53 +36,53 @@
/**
* provides access to the list of converters and ensures that the converter objects are unique.
*/
-public abstract class Converters {
-
- static final int CONVERTERS_BY_CLASS_NAMES = 0;
- static final int CONVERTERS_BY_DATABASE_ID = 1;
- static final int CONVERTERS_IDS = 2;
+public class Converters {
- static Map converterMapsMap = new HashMap();
-
+ private static Map<ObjectFactory, ConverterMaps> converterMapsMap = new HashMap<ObjectFactory, ConverterMaps>();
+
+ private Converters() {
+ // hide default constructor to 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");
+ Converter converter = getConvertersByClassNames().get(className);
+ if (converter == null) {
+ throw new JbpmException("converter '" + className + "' is not declared in resource.converter");
}
- return converter;
+ return converter;
}
public static Converter getConverterByDatabaseId(String converterDatabaseId) {
- return (Converter) getConvertersByDatabaseId().get(converterDatabaseId);
+ return getConvertersByDatabaseId().get(converterDatabaseId);
}
public static String getConverterId(Converter converter) {
- return (String) getConvertersIds().get(converter);
+ return getConvertersIds().get(converter);
}
// maps class names to unique converter objects
- static Map getConvertersByClassNames() {
- return getConverterMaps()[CONVERTERS_BY_CLASS_NAMES];
+ static Map<String, Converter> getConvertersByClassNames() {
+ return getConverterMaps().getConvertersByClassNames();
}
- // maps converter database-id-strings to unique converter objects
- static Map getConvertersByDatabaseId() {
- return getConverterMaps()[CONVERTERS_BY_DATABASE_ID];
+ // maps converter database-id-strings to unique converter objects
+ static Map<String, Converter> getConvertersByDatabaseId() {
+ return getConverterMaps().getConvertersByDatabaseId();
}
-
+
// maps unique converter objects to their database-id-string
- static Map getConvertersIds() {
- return getConverterMaps()[CONVERTERS_IDS];
+ static Map<Converter, String> getConvertersIds() {
+ return getConverterMaps().getConvertersIds();
}
- static Map[] getConverterMaps() {
- Map[] converterMaps = null;
- synchronized(converterMapsMap) {
- ObjectFactory objectFactory = JbpmConfiguration.Configs.getObjectFactory();
- converterMaps = (Map[]) converterMapsMap.get(objectFactory);
- if (converterMaps==null) {
+ static ConverterMaps getConverterMaps() {
+ ObjectFactory objectFactory = JbpmConfiguration.Configs.getObjectFactory();
+ ConverterMaps converterMaps;
+ synchronized (converterMapsMap) {
+ converterMaps = converterMapsMap.get(objectFactory);
+ if (converterMaps == null) {
converterMaps = createConverterMaps(objectFactory);
converterMapsMap.put(objectFactory, converterMaps);
}
@@ -91,44 +90,65 @@
return converterMaps;
}
- static Map[] createConverterMaps(ObjectFactory objectFactory) {
- Map[] converterMaps = new Map[3];
- converterMaps[CONVERTERS_BY_CLASS_NAMES] = new HashMap();
- converterMaps[CONVERTERS_BY_DATABASE_ID] = new HashMap();
- converterMaps[CONVERTERS_IDS] = new HashMap();
-
- Map convertersByClassNames = converterMaps[CONVERTERS_BY_CLASS_NAMES];
- Map convertersByDatabaseId = converterMaps[CONVERTERS_BY_DATABASE_ID];
- Map convertersIds = converterMaps[CONVERTERS_IDS];
-
- Properties converterProperties = null;
+ static ConverterMaps createConverterMaps(ObjectFactory objectFactory) {
+ Properties converterProperties;
if (objectFactory.hasObject("resource.converter")) {
String resource = (String) objectFactory.createObject("resource.converter");
converterProperties = ClassLoaderUtil.getProperties(resource);
- } else {
+ }
+ else {
converterProperties = new Properties();
}
- Iterator iter = converterProperties.keySet().iterator();
- while (iter.hasNext()) {
- String converterDatabaseId = (String) iter.next();
- if (converterDatabaseId.length()!=1) throw new JbpmException("converter-ids must be of length 1 (to be stored in a char)");
- if (convertersByDatabaseId.containsKey(converterDatabaseId)) throw new JbpmException("duplicate converter id : '"+converterDatabaseId+"'");
- String converterClassName = converterProperties.getProperty(converterDatabaseId);
+ ConverterMaps converterMaps = new ConverterMaps();
+ for (Map.Entry<Object, Object> entry : converterProperties.entrySet()) {
+ String databaseId = (String) entry.getKey();
+ String className = (String) entry.getValue();
+ converterMaps.registerConverter(databaseId, className);
+ }
+
+ return converterMaps;
+ }
+
+ static class ConverterMaps {
+
+ private final Map<String, Converter> convertersByClassNames = new HashMap<String, Converter>();
+ private final Map<String, Converter> convertersByDatabaseId = new HashMap<String, Converter>();
+ private final Map<Converter, String> convertersIds = new HashMap<Converter, String>();
+
+ public void registerConverter(String databaseId, String className) {
+ if (databaseId.length() != 1)
+ throw new JbpmException("converter-ids must be of length 1 (to be stored in a char)");
+ if (convertersByDatabaseId.containsKey(databaseId))
+ throw new JbpmException("duplicate converter id: '" + databaseId + "'");
+
try {
- Class converterClass = ClassLoaderUtil.classForName(converterClassName);
- Converter converter = (Converter) converterClass.newInstance();
- log.debug("adding converter '"+converterDatabaseId+"', '"+converterClassName+"'");
- convertersByClassNames.put(converterClassName, converter);
- convertersByDatabaseId.put(converterDatabaseId, converter);
- 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.
- log.debug("couldn't instantiate converter '"+converterClassName+"': "+e);
+ Class<? extends Converter> converterClass = ClassLoaderUtil.classForName(className)
+ .asSubclass(Converter.class);
+ Converter converter = converterClass.newInstance();
+ log.debug("adding converter '" + databaseId + "', '" + className + "'");
+ convertersByClassNames.put(className, converter);
+ convertersByDatabaseId.put(databaseId, converter);
+ convertersIds.put(converter, databaseId);
}
+ catch (Exception e) {
+ // NOTE that Errors are not caught because that might mask the original Error
+ // and halt the JVM
+ log.debug("couldn't instantiate converter '" + className + "': " + e);
+ }
}
- return converterMaps;
+ public Map<String, Converter> getConvertersByClassNames() {
+ return convertersByClassNames;
+ }
+
+ public Map<String, Converter> getConvertersByDatabaseId() {
+ return convertersByDatabaseId;
+ }
+
+ public Map<Converter, String> getConvertersIds() {
+ return convertersIds;
+ }
}
private static Log log = LogFactory.getLog(Converters.class);
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/IoUtil.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/IoUtil.java 2009-02-12 22:54:24 UTC (rev 3858)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/IoUtil.java 2009-02-13 02:11:33 UTC (rev 3859)
@@ -26,40 +26,30 @@
import java.io.InputStream;
import java.io.OutputStream;
-public class IoUtil
-{
+public class IoUtil {
private static final int BUFFERSIZE = 4096;
- // hide default constructor
- private IoUtil()
- {
+ private IoUtil() {
+ // hide default constructor to prevent instantiation
}
- public static byte[] readBytes(InputStream inputStream) throws IOException
- {
- if (inputStream == null)
- throw new IllegalArgumentException("InputStream cannot be null");
-
+ public static byte[] readBytes(InputStream inputStream) throws IOException {
+ if (inputStream == null) throw new IllegalArgumentException("InputStream cannot be null");
+
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
transfer(inputStream, outputStream);
- byte[] bytes = outputStream.toByteArray();
- outputStream.close();
- return bytes;
+ return outputStream.toByteArray();
}
- public static int transfer(InputStream in, OutputStream out) throws IOException
- {
+ public static int transfer(InputStream in, OutputStream out) throws IOException {
if (in == null || out == null)
throw new IllegalArgumentException("In/OutStream cannot be null");
-
+
int total = 0;
byte[] buffer = new byte[BUFFERSIZE];
- int bytesRead = in.read(buffer);
- while (bytesRead != -1)
- {
+ for (int bytesRead; (bytesRead = in.read(buffer)) != -1;) {
out.write(buffer, 0, bytesRead);
total += bytesRead;
- bytesRead = in.read(buffer);
}
return total;
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/XmlUtil.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/XmlUtil.java 2009-02-12 22:54:24 UTC (rev 3858)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/XmlUtil.java 2009-02-13 02:11:33 UTC (rev 3859)
@@ -22,6 +22,7 @@
package org.jbpm.util;
import java.io.ByteArrayInputStream;
+import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
@@ -31,7 +32,6 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.FactoryConfigurationError;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
@@ -46,6 +46,7 @@
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
public class XmlUtil {
@@ -59,10 +60,10 @@
}
/**
- * @param isJbpmConfiguration specifies if the resource should be loaded
- * with the "limited" bootstrap class loader for jbpm config.
+ * @param isJbpmConfiguration specifies if the resource should be loaded with the "limited"
+ * bootstrap class loader for jbpm config.
*/
- public static Document parseXmlResource(String resource, boolean isJbpmConfiguration) {
+ public static Document parseXmlResource(String resource, boolean isJbpmConfiguration) {
// decide which class loading mechanism to use for loading the jbpm
// configuration (see https://jira.jboss.org/jira/browse/JBPM-1148)
InputStream inputStream = null;
@@ -70,49 +71,62 @@
inputStream = ClassLoaderUtil.getJbpmConfigurationStream(resource);
else
inputStream = ClassLoaderUtil.getStream(resource);
-
+
if (inputStream == null)
- throw new IllegalArgumentException("Cannot load resource: " + resource);
- InputSource inputSource = new InputSource(inputStream);
- return parseXmlInputSource(inputSource);
+ throw new IllegalArgumentException("Cannot load resource: " + resource);
+
+ return parseXmlInputStream(inputStream);
}
public static Document parseXmlInputStream(InputStream inputStream) {
Document document = null;
try {
- document = getDocumentBuilder().parse(inputStream);
- } catch (Exception e) {
- throw new XmlException("couldn't parse xml", e);
+ document = getDocumentBuilder().parse(inputStream);
+ inputStream.close();
}
+ catch (IOException e) {
+ throw new XmlException("could not read xml stream", e);
+ }
+ catch (SAXException e) {
+ throw new XmlException("could not parse xml document", e);
+ }
return document;
}
public static Document parseXmlInputSource(InputSource inputSource) {
Document document = null;
try {
- document = getDocumentBuilder().parse(inputSource);
- } catch (Exception e) {
- throw new XmlException("couldn't parse xml", e);
+ document = getDocumentBuilder().parse(inputSource);
}
+ catch (IOException e) {
+ throw new XmlException("could not read xml stream", e);
+ }
+ catch (SAXException e) {
+ throw new XmlException("could not parse xml document", e);
+ }
return document;
}
- public static DocumentBuilder getDocumentBuilder() throws FactoryConfigurationError, ParserConfigurationException {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- return factory.newDocumentBuilder();
+ public static DocumentBuilder getDocumentBuilder() {
+ try {
+ return DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ }
+ catch (ParserConfigurationException e) {
+ throw new XmlException("could not create document builder", e);
+ }
}
- public static Iterator elementIterator(Element element, String tagName) {
+ public static Iterator<Element> elementIterator(Element element, String tagName) {
return elements(element, tagName).iterator();
}
- public static List elements(Element element, String tagName) {
+ public static List<Element> elements(Element element, String tagName) {
NodeList nodeList = element.getElementsByTagName(tagName);
- List elements = new ArrayList(nodeList.getLength());
- for (int i=0; i<nodeList.getLength(); i++) {
+ List<Element> elements = new ArrayList<Element>(nodeList.getLength());
+ for (int i = 0; i < nodeList.getLength(); i++) {
Node child = nodeList.item(i);
- if(child.getParentNode()==element) {
- elements.add(child);
+ if (child.getParentNode() == element) {
+ elements.add((Element) child);
}
}
return elements;
@@ -121,71 +135,71 @@
public static Element element(Element element, String name) {
Element childElement = null;
NodeList nodeList = element.getElementsByTagName(name);
- if (nodeList.getLength()>0) {
+ if (nodeList.getLength() > 0) {
childElement = (Element) nodeList.item(0);
}
return childElement;
}
- public static Iterator elementIterator(Element element) {
+ public static Iterator<Element> elementIterator(Element element) {
return elements(element).iterator();
}
- public static List elements(Element element) {
- List elements = new ArrayList();
+ public static List<Element> elements(Element element) {
+ List<Element> elements = new ArrayList<Element>();
NodeList nodeList = element.getChildNodes();
- for (int i=0; i<nodeList.getLength(); i++) {
+ for (int i = 0; i < nodeList.getLength(); i++) {
Node node = nodeList.item(i);
- if ( (node instanceof Element)
- && (element==node.getParentNode())
- ){
- elements.add(node);
+ if (node instanceof Element) {
+ elements.add((Element) node);
}
}
return elements;
}
-
public static Element element(Element element) {
- Element onlyChild = null;
- List elements = elements(element);
- if (! elements.isEmpty()) {
- onlyChild = (Element) elements.get(0);
+ NodeList nodeList = element.getChildNodes();
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node node = nodeList.item(i);
+ if (node instanceof Element) {
+ return (Element) node;
+ }
}
- return onlyChild;
+ return null;
}
public static String toString(Element element) {
- if (element==null) return "null";
+ if (element == null) return "null";
Source source = new DOMSource(element);
StringWriter stringWriter = new StringWriter();
PrintWriter printWriter = new PrintWriter(stringWriter);
Result result = new StreamResult(printWriter);
-
+
try {
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.transform(source, result);
- } catch (Exception e) {
- throw new XmlException("couldn't write element '"+element.getTagName()+"' to string", e);
}
-
+ catch (Exception e) {
+ throw new XmlException("couldn't write element '" + element.getTagName() + "' to string", e);
+ }
+
printWriter.close();
return stringWriter.toString();
}
public static String getContentText(Element element) {
- StringBuffer buffer = new StringBuffer();
+ StringBuilder text = new StringBuilder();
NodeList nodeList = element.getChildNodes();
- for (int i=0; i<nodeList.getLength(); i++) {
+ for (int i = 0; i < nodeList.getLength(); i++) {
Node node = nodeList.item(i);
if (node instanceof CharacterData) {
CharacterData characterData = (CharacterData) node;
- buffer.append(characterData.getData());
+ text.append(characterData.getData());
}
}
- return buffer.toString();
+ return text.toString();
}
}
\ No newline at end of file
Copied: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/exe/jbpm.converter.properties (from rev 3848, jbpm3/trunk/modules/core/src/main/resources/org/jbpm/db/hibernate/jbpm.converter.properties)
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/exe/jbpm.converter.properties (rev 0)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/exe/jbpm.converter.properties 2009-02-13 02:11:33 UTC (rev 3859)
@@ -0,0 +1,17 @@
+# this file contains the mappings between converter types
+# and the char that is used in the database. this mapping
+# is used by the ConverterEnumType to store the VariableInstance
+# converter field. The Converters class provides singleton access
+# to these converter classes.
+
+B org.jbpm.context.exe.converter.BooleanToStringConverter
+Y org.jbpm.context.exe.converter.BytesToByteArrayConverter
+E org.jbpm.context.exe.converter.ByteToLongConverter
+C org.jbpm.context.exe.converter.CharacterToStringConverter
+A org.jbpm.context.exe.converter.DateToLongConverter
+D org.jbpm.context.exe.converter.DoubleToStringConverter
+F org.jbpm.context.exe.converter.FloatToStringConverter
+G org.jbpm.context.exe.converter.FloatToDoubleConverter
+I org.jbpm.context.exe.converter.IntegerToLongConverter
+R org.jbpm.context.exe.converter.SerializableToByteArrayConverter
+H org.jbpm.context.exe.converter.ShortToLongConverter
Modified: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/default.jbpm.cfg.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/default.jbpm.cfg.xml 2009-02-12 22:54:24 UTC (rev 3858)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/default.jbpm.cfg.xml 2009-02-13 02:11:33 UTC (rev 3859)
@@ -1,11 +1,10 @@
<jbpm-configuration>
<!--
- This configuration is used when there is no jbpm.cfg.xml file found in the
- root of the classpath. It is a very basic configuration without persistence
- and message services. Only the authorization service installed.
- You can parse and create processes, but when you try to use one of the
- unavailable services, you'll get an exception.
+ This configuration file describes the default objects available to every
+ JbpmConfiguration instance obtained through the jBPM API.
+ Any custom object provided through an input source is added to
+ the default objects here, and overwrites any object with the same name.
-->
<jbpm-context>
@@ -25,7 +24,7 @@
<!-- configuration resource files pointing to default configuration files in jbpm-{version}.jar -->
<string name="resource.business.calendar" value="org/jbpm/calendar/jbpm.business.calendar.properties" />
<string name="resource.default.modules" value="org/jbpm/graph/def/jbpm.default.modules.properties" />
- <string name="resource.converter" value="org/jbpm/db/hibernate/jbpm.converter.properties" />
+ <string name="resource.converter" value="org/jbpm/context/exe/jbpm.converter.properties" />
<string name="resource.action.types" value="org/jbpm/graph/action/action.types.xml" />
<string name="resource.node.types" value="org/jbpm/graph/node/node.types.xml" />
<string name="resource.parsers" value="org/jbpm/jpdl/par/jbpm.parsers.xml" />
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1024/JBPM1024Test.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1024/JBPM1024Test.java 2009-02-12 22:54:24 UTC (rev 3858)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1024/JBPM1024Test.java 2009-02-13 02:11:33 UTC (rev 3859)
@@ -30,38 +30,39 @@
import org.jbpm.instantiation.ProcessClassLoader;
/**
- * Serializable variables are not being deserialized when retrieved from process
+ * Serializable variables are not being deserialized when retrieved from process.
+ * <p>
+ * The test case examines a serializable variable whose class file is stored in the process
+ * definition.
+ * </p>
*
- * https://jira.jboss.org/jira/browse/JBPM-1024
- *
- * Tests a serializable variable whose class file is stored in the process definition.
- *
+ * @see <a href="https://jira.jboss.org/jira/browse/JBPM-1024">JBPM-1024</a>
* @author Alejandro Guizar
*/
-public class JBPM1024Test extends AbstractDbTestCase
-{
+public class JBPM1024Test extends AbstractDbTestCase {
- public void testCustomSerializableVariableClass() throws IOException
- {
+ public void testCustomSerializableVariableClass() throws IOException {
// create and save the process definition
- ProcessDefinition processDefinition = ProcessDefinition.parseParResource("org/jbpm/context/exe/CustomSerializable.zip");
- graphSession.saveProcessDefinition(processDefinition);
- try
- {
+ ProcessDefinition processDefinition = ProcessDefinition.parseParResource("org/jbpm/jbpm1024/CustomSerializable.zip");
+ graphSession.deployProcessDefinition(processDefinition);
+
+ newTransaction();
+ try {
// create the process instance
ProcessInstance processInstance = new ProcessInstance(processDefinition);
processInstance = saveAndReload(processInstance);
// get the custom object from the context instance
- Object customSerializable = processInstance.getContextInstance().getVariable("custom serializable");
+ Object customSerializable = processInstance.getContextInstance().getVariable(
+ "custom serializable");
assertTrue(customSerializable instanceof Serializable);
- assertSame(ProcessClassLoader.class, customSerializable.getClass().getClassLoader().getClass());
+ assertSame(ProcessClassLoader.class, customSerializable.getClass()
+ .getClassLoader()
+ .getClass());
assertEquals("1984", customSerializable.toString());
}
- finally
- {
+ finally {
jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
}
-
}
}
Deleted: jbpm3/trunk/modules/core/src/test/resources/org/jbpm/context/exe/CustomSerializable.zip
===================================================================
(Binary files differ)
Modified: jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jbpm.test.cfg.xml
===================================================================
--- jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jbpm.test.cfg.xml 2009-02-12 22:54:24 UTC (rev 3858)
+++ jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jbpm.test.cfg.xml 2009-02-13 02:11:33 UTC (rev 3859)
@@ -1,2 +1 @@
-<jbpm-configuration>
-</jbpm-configuration>
+<jbpm-configuration />
Added: jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jbpm1024/CustomSerializable.zip
===================================================================
(Binary files differ)
Property changes on: jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jbpm1024/CustomSerializable.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: jbpm3/trunk/modules/identity/src/main/java/org/jbpm/identity/xml/IdentityXmlParser.java
===================================================================
--- jbpm3/trunk/modules/identity/src/main/java/org/jbpm/identity/xml/IdentityXmlParser.java 2009-02-12 22:54:24 UTC (rev 3858)
+++ jbpm3/trunk/modules/identity/src/main/java/org/jbpm/identity/xml/IdentityXmlParser.java 2009-02-13 02:11:33 UTC (rev 3859)
@@ -31,6 +31,7 @@
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
+import org.jbpm.JbpmException;
import org.jbpm.identity.Entity;
import org.jbpm.identity.Group;
import org.jbpm.identity.Membership;
@@ -62,7 +63,7 @@
document = new SAXReader().read(inputStream);
}
catch (DocumentException e) {
- throw new RuntimeException("couldn't parse identities from stream '" + inputStream + "'");
+ throw new JbpmException("could not parse identities", e);
}
Element identitiesRootElement = document.getRootElement();
@@ -112,7 +113,7 @@
if (parentName != null) {
Group parent = groups.get(parentName);
if (parent == null)
- throw new RuntimeException("unexisting parent group '" + parentName + "'");
+ throw new JbpmException("unexisting parent group '" + parentName + "'");
Group child = groups.get(childName);
parent.addChild(child);
@@ -125,12 +126,12 @@
String userName = membershipElement.attributeValue("user");
User user = users.get(userName);
if (user == null)
- throw new RuntimeException("unexisting membership user '" + userName + "'");
+ throw new JbpmException("unexisting membership user '" + userName + "'");
String groupName = membershipElement.attributeValue("group");
Group group = groups.get(groupName);
if (group == null)
- throw new RuntimeException("unexisting membership group '" + groupName + "'");
+ throw new JbpmException("unexisting membership group '" + groupName + "'");
Membership membership = new Membership();
membership.setRole(membershipElement.attributeValue("role"));
Modified: jbpm3/trunk/pom.xml
===================================================================
--- jbpm3/trunk/pom.xml 2009-02-12 22:54:24 UTC (rev 3858)
+++ jbpm3/trunk/pom.xml 2009-02-13 02:11:33 UTC (rev 3859)
@@ -18,6 +18,7 @@
<packaging>pom</packaging>
<version>3.2.6-SNAPSHOT</version>
+ <url>http://www.jboss.org/jbossjbpm/</url>
<!-- Parent -->
<parent>
@@ -411,6 +412,21 @@
<scope>test</scope>
</dependency>
</dependencies>
+ <issueManagement>
+ <system>JIRA</system>
+ <url>https://jira.jboss.org/jira/browse/JBPM</url>
+ </issueManagement>
+ <ciManagement>
+ <system>Hudson</system>
+ <url>http://jbpm.dyndns.org:8280/hudson/</url>
+ </ciManagement>
+ <scm>
+ <url>http://anonsvn.jboss.org/repos/jbpm/jbpm3/</url>
+ </scm>
+ <organization>
+ <name>JBoss, a division of Red Hat</name>
+ <url>http://www.jboss.org/</url>
+ </organization>
<!-- Plugins -->
<build>
17 years, 2 months
JBoss JBPM SVN: r3858 - in jbpm3/trunk/modules/userguide: src/main/docbook/en and 2 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-02-12 17:54:24 -0500 (Thu, 12 Feb 2009)
New Revision: 3858
Added:
jbpm3/trunk/modules/userguide/src/main/docbook/en/images/create_connection.png
jbpm3/trunk/modules/userguide/src/main/docbook/en/images/execute_script.png
jbpm3/trunk/modules/userguide/src/main/docbook/en/images/load_script.png
Removed:
jbpm3/trunk/modules/userguide/src/main/docbook/en/images/create_connection.jpg
jbpm3/trunk/modules/userguide/src/main/docbook/en/images/execute_script.jpg
jbpm3/trunk/modules/userguide/src/main/docbook/en/images/install_driver.jpg
jbpm3/trunk/modules/userguide/src/main/docbook/en/images/load_script.jpg
Modified:
jbpm3/trunk/modules/userguide/pom.xml
jbpm3/trunk/modules/userguide/src/main/docbook/en/master.xml
jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/async.xml
jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/context.xml
jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/database.xml
jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/introduction.xml
jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/mail.xml
jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/modelling.xml
jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/persistence.xml
jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/tutorial.xml
Log:
JBPM-1808: remove references to dbvisualizer and replace related images with pgadmin screenshots
fix many broken links
Modified: jbpm3/trunk/modules/userguide/pom.xml
===================================================================
--- jbpm3/trunk/modules/userguide/pom.xml 2009-02-12 20:55:57 UTC (rev 3857)
+++ jbpm3/trunk/modules/userguide/pom.xml 2009-02-12 22:54:24 UTC (rev 3858)
@@ -47,8 +47,9 @@
<imageResource>
<directory>${basedir}/src/main/docbook/en</directory>
<includes>
- <include>**/*.gif</include>
- <include>**/*.jpg</include>
+ <include>images/*.gif</include>
+ <include>images/*.jpg</include>
+ <include>images/*.png</include>
</includes>
</imageResource>
<formats>
Deleted: jbpm3/trunk/modules/userguide/src/main/docbook/en/images/create_connection.jpg
===================================================================
(Binary files differ)
Added: jbpm3/trunk/modules/userguide/src/main/docbook/en/images/create_connection.png
===================================================================
(Binary files differ)
Property changes on: jbpm3/trunk/modules/userguide/src/main/docbook/en/images/create_connection.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: jbpm3/trunk/modules/userguide/src/main/docbook/en/images/execute_script.jpg
===================================================================
(Binary files differ)
Added: jbpm3/trunk/modules/userguide/src/main/docbook/en/images/execute_script.png
===================================================================
(Binary files differ)
Property changes on: jbpm3/trunk/modules/userguide/src/main/docbook/en/images/execute_script.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: jbpm3/trunk/modules/userguide/src/main/docbook/en/images/install_driver.jpg
===================================================================
(Binary files differ)
Deleted: jbpm3/trunk/modules/userguide/src/main/docbook/en/images/load_script.jpg
===================================================================
(Binary files differ)
Added: jbpm3/trunk/modules/userguide/src/main/docbook/en/images/load_script.png
===================================================================
(Binary files differ)
Property changes on: jbpm3/trunk/modules/userguide/src/main/docbook/en/images/load_script.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: jbpm3/trunk/modules/userguide/src/main/docbook/en/master.xml
===================================================================
--- jbpm3/trunk/modules/userguide/src/main/docbook/en/master.xml 2009-02-12 20:55:57 UTC (rev 3857)
+++ jbpm3/trunk/modules/userguide/src/main/docbook/en/master.xml 2009-02-12 22:54:24 UTC (rev 3858)
@@ -21,7 +21,7 @@
<!ENTITY security SYSTEM "modules/security.xml">
<!ENTITY tdd SYSTEM "modules/tdd.xml">
<!ENTITY pluggable SYSTEM "modules/pluggable.xml">
-<!ENTITY version "3.2.3">
+<!ENTITY version "3.2.6.GA">
]>
<book lang="en">
<bookinfo>
Modified: jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/async.xml
===================================================================
--- jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/async.xml 2009-02-12 20:55:57 UTC (rev 3857)
+++ jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/async.xml 2009-02-12 22:54:24 UTC (rev 3858)
@@ -1,14 +1,14 @@
<chapter id="ch_asynchronouscontinuations">
<title>Asynchronous continuations</title>
- <section id="theconcept">
+ <section id="asynchronouscontinuations">
<title>The concept</title>
<para>jBPM is based on Graph Oriented Programming (GOP). Basically, GOP specifies a
simple state machine that can handle concurrent paths of execution. But in the execution
algorithm specified in GOP, all state transitions are done in a single operation in the
- thread of the client. If you're not familiar with the execution algorithm defined in
- <xref linkend="graphorientedprogramming" />, please read that first. By default, this
+ thread of the client.
+ By default, this
performing state transitions in the thread of the client is a good approach cause it fits
naturally with server side transactions. The process execution moves from one wait state
to another wait state in one transaction.
@@ -21,7 +21,7 @@
</para>
</section>
- <section id="anexample">
+ <section id="asynchronousexample">
<title>An example</title>
<para>Normally, a node is always executed after a token has entered the node. So the node is
Modified: jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/context.xml
===================================================================
--- jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/context.xml 2009-02-12 20:55:57 UTC (rev 3857)
+++ jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/context.xml 2009-02-12 22:54:24 UTC (rev 3858)
@@ -90,7 +90,7 @@
<title>Variables scopes</title>
<para>Each path of execution (read: token) has its own set of process variables.
Requesting a variable is always done on a token. Process instances have a tree
- of tokens (see <xref linkend="graphorientedprogramming"/>).
+ of tokens.
When requesting a variable without specifying a token, the default token is the
root token.
</para>
Modified: jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/database.xml
===================================================================
--- jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/database.xml 2009-02-12 20:55:57 UTC (rev 3857)
+++ jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/database.xml 2009-02-12 22:54:24 UTC (rev 3858)
@@ -57,29 +57,14 @@
</mediaobject>
</figure>
- <para>After the installation of the database, we can use a database
- viewer tool like DBVisualizer to look at the contents of the database.
- Before you can define a database connection with DBVisualizer, you might
- have to add the PostgreSQL JDBC driver to the driver manager. Select
- 'Tools->Driver Manager...' to open the driver manager window. Look at
- the figure below for an example of how to add the PostgreSQL JDBC
- driver.</para>
+ <para>After the installation of the database, we can use the pgAdmin III
+ Query tool to look at the contents of the database.</para>
- <figure>
- <title>Adding the JDBC driver to the driver manager</title>
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/install_driver.jpg" />
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Now everything is set to define a database connection in
- DBVisualizer to our newly created database. We will use this tool
+ <para>Before we do, we have to define a database connection in
+ pgAdmin to our newly created database. We will use this tool
further in this document to make sure the creation scripts and process
deployment are working as expected. For an example of creating the
- connection in DBVisualizer we refer to the following figure. As you can
+ connection in pgAdmin we refer to the following figure. As you will
see, there are no tables present yet in this database. We will create
them in the following section.</para>
@@ -88,7 +73,7 @@
<mediaobject>
<imageobject>
- <imagedata fileref="images/create_connection.jpg" />
+ <imagedata fileref="images/create_connection.png" />
</imageobject>
</mediaobject>
</figure>
@@ -120,7 +105,7 @@
</section>
<section>
- <title>Creating the JBoss jBPM Database with your new PostGreSQL or
+ <title>Creating the JBoss jBPM Database with your new PostgreSQL or
MySQL</title>
<para>In order to get the proper database scripts for your
@@ -128,7 +113,7 @@
Using your
database admin console, navigate to the database and then open and
execute the create script we just referenced. Below are screen shots
- doing this for PostGreSQL and MySQL under their respective admin
+ doing this for PostgreSQL and MySQL under their respective admin
consoles</para>
<section>
@@ -138,9 +123,9 @@
lot of the supported databases in the DB subproject. The database
scripts for PostgreSQL are found in the folder
'${jbpm-jpdl-home}/db. The creation script is
- called 'postgresql.create.sql'. Using DBVisualizer, you can load this
- script by switching to the 'SQL Commander' tab and then selecting
- 'File->Load...'. In the following dialog, navigate to the creation
+ called 'postgresql.create.sql'. Using pgAdmin, you can load this
+ script by selecting 'Tools->Query tool' and then
+ 'File->Open...'. In the following dialog, navigate to the creation
script file. The result of doing so is shown in the figure
below.</para>
@@ -149,13 +134,13 @@
<mediaobject>
<imageobject>
- <imagedata fileref="images/load_script.jpg" />
+ <imagedata fileref="images/load_script.png" />
</imageobject>
</mediaobject>
</figure>
- <para>To execute this script with DBVisualizer, you select
- 'Database->Execute'. After this step all JBoss jBPM tables are
+ <para>To execute this script with the pgAdmin Query tool, select
+ 'Query->Execute'. After this step all JBoss jBPM tables are
created. The situation is illustrated in the figure below.</para>
<figure>
@@ -163,7 +148,7 @@
<mediaobject>
<imageobject>
- <imagedata fileref="images/execute_script.jpg" />
+ <imagedata fileref="images/execute_script.png" />
</imageobject>
</mediaobject>
</figure>
@@ -302,8 +287,7 @@
you just created a new DataSource for your JBoss jBPM server. Well,
almost... To make things really work you will have to copy the correct
JDBC driver to the <literal>${jboss.home}/server/default/lib</literal> folder.
- We already used this JDBC driver above when we were installing it in
- DBVisualizer to be able to browse our newly created database. The file
+ The file
is named <literal>postgresql-8.1-*.jdbc3.jar</literal> and it can be found in the jdbc
subdirectory of your PostgreSQL installation folder.</para>
Modified: jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/introduction.xml
===================================================================
--- jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/introduction.xml 2009-02-12 20:55:57 UTC (rev 3857)
+++ jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/introduction.xml 2009-02-12 22:54:24 UTC (rev 3858)
@@ -22,7 +22,7 @@
database.</para>
<figure id="overview.image">
<title>Overview of the jPDL components</title>
- <mediaobject><imageobject><imagedata align="center" fileref="images/overview.png"/></imageobject></mediaobject>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/overview.gif"/></imageobject></mediaobject>
</figure>
</section>
@@ -70,10 +70,9 @@
<para>The plugin is available as a local update site (plain zip file) for
installation via the standard eclipse software updates mechanism. The
jPDL graphical process designer plugin is also included in
- <ulink url="http://www.jboss.org/tools/">JBossTools</ulink>,
+ <ulink url="http://www.jboss.org/tools/">JBoss Tools</ulink>,
<ulink url="http://www.redhat.com/developer_studio/">JBoss Developer Studio</ulink> and
- <ulink url="">the SOA Platform</ulink>.
- .</para>
+ the <ulink url="http://www.jboss.com/products/platforms/soa/">SOA Platform</ulink>.</para>
</section>
<section>
Modified: jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/mail.xml
===================================================================
--- jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/mail.xml 2009-02-12 20:55:57 UTC (rev 3857)
+++ jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/mail.xml 2009-02-12 22:54:24 UTC (rev 3858)
@@ -254,7 +254,7 @@
<section id="mailserver">
<title>Mail server</title>
- <para>If you need a mail server that is easy to install, checkout <ulink url="http://www.jboss.org/products/mailservices">JBossMail Server</ulink>
+ <para>If you need a mail server that is easy to install, check out <ulink url="http://buni.org/">Meldware</ulink>
or <ulink url="http://james.apache.org/">Apache James</ulink>
</para>
</section>
Modified: jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/modelling.xml
===================================================================
--- jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/modelling.xml 2009-02-12 20:55:57 UTC (rev 3857)
+++ jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/modelling.xml 2009-02-12 22:54:24 UTC (rev 3858)
@@ -96,10 +96,8 @@
<section id="nodes">
<title>Nodes</title>
- <para>A process graph is made up of nodes and transitions. For more information about the
- graph and its execution model, refer to <xref linkend="graphorientedprogramming" />.
- </para>
- <para>Each node has a specific type. The node type determines what will happen when
+ <para>A process graph is made up of nodes and transitions.
+ Each node has a specific type. The node type determines what will happen when
an execution arrives in the node at runtime. jBPM has a set of node types
that you can use. Alternatively, you can write custom code for implementing your own specific
node behavior.</para>
@@ -135,9 +133,9 @@
</itemizedlist>
<para>jBPM contains --as any workflow and BPM engine-- a set of pre-implemented node types
that have a specific documented configuration and behavior. But the unique thing about
- jBPM and the Graph Oriented Programming foundation<footnote><para><xref linkend="graphorientedprogramming"/>.</para></footnote>
+ jBPM and the Graph Oriented Programming foundation
is that we open up the model for developers. Developers can write their own node behavior
- very easy and use it in a process.
+ very easily and use it in a process.
</para>
<para>That is where traditional workflow and BPM systems are
much more closed. They usually supply a fixed set of node types (called the process language).
@@ -667,8 +665,8 @@
<section id="transactiondemarcation">
<title>Transaction demarcation</title>
- <para>As explained in <xref linkend="graphexecution" /> and
- <xref linkend="graphorientedprogramming" />, jBPM runs the process in the thread of
+ <para>As explained in <xref linkend="graphexecution" />,
+ jBPM runs the process in the thread of
the client and is by nature synchronous. Meaning that the <literal>token.signal()</literal>
or <literal>taskInstance.end()</literal> will only return when the process has entered a new
wait state.
Modified: jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/persistence.xml
===================================================================
--- jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/persistence.xml 2009-02-12 20:55:57 UTC (rev 3857)
+++ jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/persistence.xml 2009-02-12 22:54:24 UTC (rev 3858)
@@ -422,19 +422,11 @@
<programlisting language="xml"> <jbpm-context>
<service name="persistence">
- <factory>
- <bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
- <field name="isTransactionEnabled"><false /></field>
- <field name="isCurrentSessionEnabled"><true /></field>
- <field name="sessionFactoryJndiName">
- <string value="java:/myHibSessFactJndiName" />
- </field>
- </bean>
- </factory>
+ <factory class="org.jbpm.persistence.jta.JtaDbPersistenceServiceFactory"/>
</service>
</jbpm-context></programlisting>
- <para>Then you should specify in your hibernate session factory to use a datasource and
+ <para>Afterwards, you should specify in your hibernate session factory to use a datasource and
bind hibernate to the transaction manager. Make sure that you bind the datasource
to an XA datasource in case you are using more than one resource. For more information
about binding hibernate to your transaction manager, please, refer to
@@ -464,6 +456,7 @@
<para>These configurations allow for the enterprise beans to use CMT and still allow the
web console to use BMT. That is why the property 'jta.UserTransaction' is also specified.
+ Note that 'java:comp/UserTransaction' is the value used if 'jta.UserTransaction' is absent.
</para>
</section>
@@ -548,7 +541,7 @@
</section>
- <section>
+ <section id="customhibernateclasses">
<title>Combining your hibernate classes</title>
<para>In your project, you might use hibernate for your persistence. Combining your
@@ -576,7 +569,7 @@
</para>
</section>
- <section>
+ <section id="customizingmappings">
<title>Customizing the jBPM hibernate mapping files</title>
<para>To customize any of the jBPM hibernate mapping files, you can proceed as
follows:
Modified: jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/tutorial.xml
===================================================================
--- jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/tutorial.xml 2009-02-12 20:55:57 UTC (rev 3857)
+++ jbpm3/trunk/modules/userguide/src/main/docbook/en/modules/tutorial.xml 2009-02-12 22:54:24 UTC (rev 3858)
@@ -18,7 +18,7 @@
<para>jBPM includes a graphical designer tool for authoring the
XML that is shown in the examples. You can find download instructions
- for the graphical designer in <xref linkend="downloadablesoverview" />.
+ for the graphical designer in <xref linkend="downloadingandinstallingjbpm" />.
You don't need the graphical designer tool to complete this tutorial.
</para>
17 years, 2 months
JBoss JBPM SVN: r3857 - in jbpm3/trunk/modules/core: src/main/java/org/jbpm/db and 3 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-02-12 15:55:57 -0500 (Thu, 12 Feb 2009)
New Revision: 3857
Modified:
jbpm3/trunk/modules/core/pom.xml
jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/JobSession.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/msg/db/DbMessageService.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/scheduler/def/CreateTimerAction.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm2036/JBPM2036Test.java
Log:
JBPM-2036: prevent duplicate of Timer.action entity from being saved unnecessarily;
include test case again
Modified: jbpm3/trunk/modules/core/pom.xml
===================================================================
--- jbpm3/trunk/modules/core/pom.xml 2009-02-12 19:51:55 UTC (rev 3856)
+++ jbpm3/trunk/modules/core/pom.xml 2009-02-12 20:55:57 UTC (rev 3857)
@@ -254,8 +254,6 @@
<excludes>
<!-- [JBPM-1810] Fix clean, drop, create schema with JbpmSchema -->
<exclude>org/jbpm/db/JbpmSchemaDbTest.java</exclude>
- <!-- [JBPM-2036] StaleObjectStateException when repeating timer signals the token -->
- <exclude>org/jbpm/jbpm2036/JBPM2036Test.java</exclude>
</excludes>
</configuration>
</plugin>
@@ -283,8 +281,6 @@
<excludes>
<!-- [JBPM-1810] Fix clean, drop, create schema with JbpmSchema -->
<exclude>org/jbpm/db/JbpmSchemaDbTest.java</exclude>
- <!-- [JBPM-2036] StaleObjectStateException when repeating timer signals the token -->
- <exclude>org/jbpm/jbpm2036/JBPM2036Test.java</exclude>
</excludes>
</configuration>
</plugin>
@@ -314,8 +310,6 @@
<exclude>org/jbpm/seam/JobExecutorCustomizationTest.java</exclude>
<!-- [JBPM-1810] Fix clean, drop, create schema with JbpmSchema -->
<exclude>org/jbpm/db/JbpmSchemaDbTest.java</exclude>
- <!-- [JBPM-2036] StaleObjectStateException when repeating timer signals the token -->
- <exclude>org/jbpm/jbpm2036/JBPM2036Test.java</exclude>
</excludes>
</configuration>
</plugin>
@@ -343,8 +337,6 @@
<excludes>
<!-- [JBPM-1810] Fix clean, drop, create schema with JbpmSchema -->
<exclude>org/jbpm/db/JbpmSchemaDbTest.java</exclude>
- <!-- [JBPM-2036] StaleObjectStateException when repeating timer signals the token -->
- <exclude>org/jbpm/jbpm2036/JBPM2036Test.java</exclude>
</excludes>
</configuration>
</plugin>
@@ -372,8 +364,6 @@
<excludes>
<!-- [JBPM-1810] Fix clean, drop, create schema with JbpmSchema -->
<exclude>org/jbpm/db/JbpmSchemaDbTest.java</exclude>
- <!-- [JBPM-2036] StaleObjectStateException when repeating timer signals the token -->
- <exclude>org/jbpm/jbpm2036/JBPM2036Test.java</exclude>
</excludes>
</configuration>
</plugin>
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/JobSession.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/JobSession.java 2009-02-12 19:51:55 UTC (rev 3856)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/JobSession.java 2009-02-12 20:55:57 UTC (rev 3857)
@@ -33,7 +33,6 @@
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import org.jbpm.JbpmException;
-import org.jbpm.graph.def.Action;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.graph.exe.Token;
import org.jbpm.job.Job;
@@ -114,15 +113,7 @@
public void saveJob(Job job) {
try {
- if (job instanceof Timer) {
- Timer timer = (Timer) job;
- Action action = timer.getAction();
- if (action != null && !session.contains(action)) {
- log.debug("cascading save from " + timer + " to " + action);
- session.save(action);
- }
- }
- session.saveOrUpdate(job);
+ session.save(job);
}
catch (HibernateException e) {
throw new JbpmException("could not save " + job, e);
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/msg/db/DbMessageService.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/msg/db/DbMessageService.java 2009-02-12 19:51:55 UTC (rev 3856)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/msg/db/DbMessageService.java 2009-02-12 20:55:57 UTC (rev 3857)
@@ -49,7 +49,7 @@
public void send(Job job) {
jobSession.saveJob(job);
- log.debug("saved job["+job.getId()+", "+job.getClass().getName()+"]");
+ log.debug("saved "+job);
hasProducedJobs = true;
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/scheduler/def/CreateTimerAction.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/scheduler/def/CreateTimerAction.java 2009-02-12 19:51:55 UTC (rev 3856)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/scheduler/def/CreateTimerAction.java 2009-02-12 20:55:57 UTC (rev 3857)
@@ -113,7 +113,7 @@
} else {
durationString = dueDate;
}
- if (baseDate != null && (durationString == null || "".equals(durationString))) {
+ if (baseDate != null && (durationString == null || durationString.length() == 0)) {
dueDateDate = baseDate;
} else {
duration = new Duration(durationString);
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm2036/JBPM2036Test.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm2036/JBPM2036Test.java 2009-02-12 19:51:55 UTC (rev 3856)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm2036/JBPM2036Test.java 2009-02-12 20:55:57 UTC (rev 3857)
@@ -17,27 +17,26 @@
{
public void testTimerAction()
{
- ProcessDefinition pd = getProcessDefinition();
- jbpmContext.deployProcessDefinition(pd);
+ ProcessDefinition processDefinition = getProcessDefinition();
+ jbpmContext.deployProcessDefinition(processDefinition);
newTransaction();
try
{
- ProcessInstance pi = new ProcessInstance(pd);
- pi.signal();
- jbpmContext.save(pi);
+ ProcessInstance processInstance = new ProcessInstance(processDefinition);
+ processInstance.signal();
+ jbpmContext.save(processInstance);
processJobs(30000);
- long piId = pi.getId();
+ long piId = processInstance.getId();
assertTrue("expected process instance " + piId + " to have ended",
jbpmContext.loadProcessInstance(piId).hasEnded());
assertEquals(1, TimerAction.getExecutionCount());
}
finally
{
- // TODO Timer -> Action -> Delegation cascade is broken somewhere
- // graphSession.deleteProcessDefinition(pd.getId());
+ graphSession.deleteProcessDefinition(processDefinition.getId());
}
}
17 years, 2 months
JBoss JBPM SVN: r3856 - in jbpm3/trunk/modules/core: src/main/java/org/jbpm/db and 1 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-02-12 14:51:55 -0500 (Thu, 12 Feb 2009)
New Revision: 3856
Modified:
jbpm3/trunk/modules/core/pom.xml
jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/GraphSession.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessArchiveClassLoadingDbTest.java
Log:
exclude JBPM2036Test as it causes regressions in other tests
Modified: jbpm3/trunk/modules/core/pom.xml
===================================================================
--- jbpm3/trunk/modules/core/pom.xml 2009-02-12 19:06:31 UTC (rev 3855)
+++ jbpm3/trunk/modules/core/pom.xml 2009-02-12 19:51:55 UTC (rev 3856)
@@ -254,6 +254,8 @@
<excludes>
<!-- [JBPM-1810] Fix clean, drop, create schema with JbpmSchema -->
<exclude>org/jbpm/db/JbpmSchemaDbTest.java</exclude>
+ <!-- [JBPM-2036] StaleObjectStateException when repeating timer signals the token -->
+ <exclude>org/jbpm/jbpm2036/JBPM2036Test.java</exclude>
</excludes>
</configuration>
</plugin>
@@ -281,6 +283,8 @@
<excludes>
<!-- [JBPM-1810] Fix clean, drop, create schema with JbpmSchema -->
<exclude>org/jbpm/db/JbpmSchemaDbTest.java</exclude>
+ <!-- [JBPM-2036] StaleObjectStateException when repeating timer signals the token -->
+ <exclude>org/jbpm/jbpm2036/JBPM2036Test.java</exclude>
</excludes>
</configuration>
</plugin>
@@ -310,6 +314,8 @@
<exclude>org/jbpm/seam/JobExecutorCustomizationTest.java</exclude>
<!-- [JBPM-1810] Fix clean, drop, create schema with JbpmSchema -->
<exclude>org/jbpm/db/JbpmSchemaDbTest.java</exclude>
+ <!-- [JBPM-2036] StaleObjectStateException when repeating timer signals the token -->
+ <exclude>org/jbpm/jbpm2036/JBPM2036Test.java</exclude>
</excludes>
</configuration>
</plugin>
@@ -337,6 +343,8 @@
<excludes>
<!-- [JBPM-1810] Fix clean, drop, create schema with JbpmSchema -->
<exclude>org/jbpm/db/JbpmSchemaDbTest.java</exclude>
+ <!-- [JBPM-2036] StaleObjectStateException when repeating timer signals the token -->
+ <exclude>org/jbpm/jbpm2036/JBPM2036Test.java</exclude>
</excludes>
</configuration>
</plugin>
@@ -364,6 +372,8 @@
<excludes>
<!-- [JBPM-1810] Fix clean, drop, create schema with JbpmSchema -->
<exclude>org/jbpm/db/JbpmSchemaDbTest.java</exclude>
+ <!-- [JBPM-2036] StaleObjectStateException when repeating timer signals the token -->
+ <exclude>org/jbpm/jbpm2036/JBPM2036Test.java</exclude>
</excludes>
</configuration>
</plugin>
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/GraphSession.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/GraphSession.java 2009-02-12 19:06:31 UTC (rev 3855)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/GraphSession.java 2009-02-12 19:51:55 UTC (rev 3856)
@@ -406,8 +406,8 @@
if (includeJobs) {
log.debug("deleting jobs for " + processInstance);
int entityCount = session.getNamedQuery("GraphSession.deleteJobsForProcessInstance")
- .setEntity("processInstance", processInstance)
- .executeUpdate();
+ .setEntity("processInstance", processInstance)
+ .executeUpdate();
log.debug("deleted " + entityCount + " jobs for " + processInstance);
}
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessArchiveClassLoadingDbTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessArchiveClassLoadingDbTest.java 2009-02-12 19:06:31 UTC (rev 3855)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessArchiveClassLoadingDbTest.java 2009-02-12 19:51:55 UTC (rev 3856)
@@ -43,7 +43,10 @@
public static Log log = LogFactory.getLog(ProcessArchiveClassLoadingDbTest.class);
String getTestClassesDir() {
- return ProcessArchiveDeploymentDbTest.class.getProtectionDomain().getCodeSource().getLocation().getFile();
+ return ProcessArchiveDeploymentDbTest.class.getProtectionDomain()
+ .getCodeSource()
+ .getLocation()
+ .getFile();
}
public void testExecuteResourceUsingProcess() throws Exception {
@@ -51,8 +54,10 @@
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ZipOutputStream zipOutputStream = new ZipOutputStream(baos);
addEntry(zipOutputStream, "processdefinition.xml", "org/jbpm/jpdl/par/resourceprocess.xml");
- addEntry(zipOutputStream, "classes/org/jbpm/jpdl/par/ResourceAction.class", "org/jbpm/jpdl/par/ResourceAction.class");
- addEntry(zipOutputStream, "classes/org/jbpm/jpdl/par/classresource.txt", "org/jbpm/jpdl/par/classresource.txt");
+ addEntry(zipOutputStream, "classes/org/jbpm/jpdl/par/ResourceAction.class",
+ "org/jbpm/jpdl/par/ResourceAction.class");
+ addEntry(zipOutputStream, "classes/org/jbpm/jpdl/par/classresource.txt",
+ "org/jbpm/jpdl/par/classresource.txt");
addEntry(zipOutputStream, "archiveresource.txt", "org/jbpm/jpdl/par/archiveresource.txt");
zipOutputStream.close();
byte[] zipBytes = baos.toByteArray();
@@ -66,7 +71,8 @@
String resourceTmpName = resourceOriginalName + ".hiddenFromTestClasspath";
assertTrue(new File(resourceOriginalName).renameTo(new File(resourceTmpName)));
- String archiveResourceOriginalName = getTestClassesDir() + "org/jbpm/jpdl/par/archiveresource.txt";
+ String archiveResourceOriginalName = getTestClassesDir()
+ + "org/jbpm/jpdl/par/archiveresource.txt";
String archiveResourceTmpName = archiveResourceOriginalName + ".hiddenFromTestClasspath";
assertTrue(new File(archiveResourceOriginalName).renameTo(new File(archiveResourceTmpName)));
@@ -77,7 +83,8 @@
try {
Class.forName("org.jbpm.jpdl.par.ResourceAction", false, testClassLoader);
fail("expected exception");
- } catch (ClassNotFoundException e) {
+ }
+ catch (ClassNotFoundException e) {
// OK
}
@@ -85,15 +92,18 @@
ZipInputStream zipInputStream = new ZipInputStream(new ByteArrayInputStream(zipBytes));
ProcessDefinition processDefinition = ProcessDefinition.parseParZipInputStream(zipInputStream);
jbpmContext.deployProcessDefinition(processDefinition);
+
+ newTransaction();
try {
- newTransaction();
-
- ProcessInstance pi = jbpmContext.newProcessInstance("resourceprocess");
- pi.signal();
- } finally {
+ ProcessInstance processInstance = jbpmContext.newProcessInstance("resourceprocess");
+ processInstance.signal();
+ jbpmContext.save(processInstance);
+ }
+ finally {
jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
}
- } finally {
+ }
+ finally {
// put the files back into original position
new File(classTmpName).renameTo(new File(classOriginalName));
new File(resourceTmpName).renameTo(new File(resourceOriginalName));
@@ -106,17 +116,21 @@
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ZipOutputStream zipOutputStream = new ZipOutputStream(baos);
addEntry(zipOutputStream, "processdefinition.xml", "org/jbpm/jpdl/par/instantiateprocess.xml");
- addEntry(zipOutputStream, "classes/org/jbpm/jpdl/par/InstantiateAction.class", "org/jbpm/jpdl/par/InstantiateAction.class");
- addEntry(zipOutputStream, "classes/org/jbpm/jpdl/par/InstantiateClass.class", "org/jbpm/jpdl/par/InstantiateClass.class");
+ addEntry(zipOutputStream, "classes/org/jbpm/jpdl/par/InstantiateAction.class",
+ "org/jbpm/jpdl/par/InstantiateAction.class");
+ addEntry(zipOutputStream, "classes/org/jbpm/jpdl/par/InstantiateClass.class",
+ "org/jbpm/jpdl/par/InstantiateClass.class");
zipOutputStream.close();
byte[] zipBytes = baos.toByteArray();
// move the files
- String instantiateActionOriginalName = getTestClassesDir() + "org/jbpm/jpdl/par/InstantiateAction.class";
+ String instantiateActionOriginalName = getTestClassesDir()
+ + "org/jbpm/jpdl/par/InstantiateAction.class";
String instantiateActionTmpName = instantiateActionOriginalName + ".hiddenFromTestClasspath";
assertTrue(new File(instantiateActionOriginalName).renameTo(new File(instantiateActionTmpName)));
- String instantiateClassOriginalName = getTestClassesDir() + "org/jbpm/jpdl/par/InstantiateClass.class";
+ String instantiateClassOriginalName = getTestClassesDir()
+ + "org/jbpm/jpdl/par/InstantiateClass.class";
String instantiateClassTmpName = instantiateClassOriginalName + ".hiddenFromTestClasspath";
assertTrue(new File(instantiateClassOriginalName).renameTo(new File(instantiateClassTmpName)));
@@ -125,13 +139,16 @@
try {
Class.forName("org.jbpm.jpdl.par.InstantiateAction", false, testClassLoader);
fail("expected exception");
- } catch (ClassNotFoundException e) {
+ }
+ catch (ClassNotFoundException e) {
// OK
}
+
try {
Class.forName("org.jbpm.jpdl.par.InstantiateClass", false, testClassLoader);
fail("expected exception");
- } catch (ClassNotFoundException e) {
+ }
+ catch (ClassNotFoundException e) {
// OK
}
@@ -139,16 +156,18 @@
ZipInputStream zipInputStream = new ZipInputStream(new ByteArrayInputStream(zipBytes));
ProcessDefinition processDefinition = ProcessDefinition.parseParZipInputStream(zipInputStream);
jbpmContext.deployProcessDefinition(processDefinition);
+
+ newTransaction();
try {
- newTransaction();
-
ProcessInstance processInstance = jbpmContext.newProcessInstance("instantiateprocess");
processInstance.signal();
-
- } finally {
+ jbpmContext.save(processInstance);
+ }
+ finally {
jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
}
- } finally {
+ }
+ finally {
// put the files back into original position
new File(instantiateActionTmpName).renameTo(new File(instantiateActionOriginalName));
new File(instantiateClassTmpName).renameTo(new File(instantiateClassOriginalName));
@@ -160,12 +179,14 @@
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ZipOutputStream zipOutputStream = new ZipOutputStream(baos);
addEntry(zipOutputStream, "processdefinition.xml", "org/jbpm/jpdl/par/instantiateprocess.xml");
- addEntry(zipOutputStream, "classes/org/jbpm/jpdl/par/InstantiateAction.class", "org/jbpm/jpdl/par/InstantiateAction.class");
+ addEntry(zipOutputStream, "classes/org/jbpm/jpdl/par/InstantiateAction.class",
+ "org/jbpm/jpdl/par/InstantiateAction.class");
zipOutputStream.close();
byte[] zipBytes = baos.toByteArray();
// move the files
- String instantiateActionOriginalName = getTestClassesDir() + "org/jbpm/jpdl/par/InstantiateAction.class";
+ String instantiateActionOriginalName = getTestClassesDir()
+ + "org/jbpm/jpdl/par/InstantiateAction.class";
String instantiateActionTmpName = instantiateActionOriginalName + ".hiddenFromTestClasspath";
assertTrue(new File(instantiateActionOriginalName).renameTo(new File(instantiateActionTmpName)));
@@ -174,7 +195,8 @@
try {
Class.forName("org.jbpm.jpdl.par.InstantiateAction", false, testClassLoader);
fail("expected exception");
- } catch (ClassNotFoundException e) {
+ }
+ catch (ClassNotFoundException e) {
// OK
}
// InstantiateClass should be visible on the test classpath
@@ -184,29 +206,33 @@
ZipInputStream zipInputStream = new ZipInputStream(new ByteArrayInputStream(zipBytes));
ProcessDefinition processDefinition = ProcessDefinition.parseParZipInputStream(zipInputStream);
jbpmContext.deployProcessDefinition(processDefinition);
+
+ newTransaction();
try {
- newTransaction();
-
ProcessInstance processInstance = jbpmContext.newProcessInstance("instantiateprocess");
processInstance.signal();
-
- } finally {
+ jbpmContext.save(processInstance);
+ }
+ finally {
jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
}
- } finally {
+ }
+ finally {
// put the files back into original position
new File(instantiateActionTmpName).renameTo(new File(instantiateActionOriginalName));
}
}
- private static void addEntry(ZipOutputStream zipOutputStream, String entryName, String resource) throws IOException {
+ private static void addEntry(ZipOutputStream zipOutputStream, String entryName, String resource)
+ throws IOException {
InputStream inputStream = ClassLoaderUtil.getStream(resource);
byte[] bytes = IoUtil.readBytes(inputStream);
addEntry(zipOutputStream, entryName, bytes);
inputStream.close();
}
- private static void addEntry(ZipOutputStream zipOutputStream, String entryName, byte[] content) throws IOException {
+ private static void addEntry(ZipOutputStream zipOutputStream, String entryName, byte[] content)
+ throws IOException {
ZipEntry zipEntry = new ZipEntry(entryName);
zipOutputStream.putNextEntry(zipEntry);
zipOutputStream.write(content);
17 years, 2 months
JBoss JBPM SVN: r3855 - jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-02-12 14:06:31 -0500 (Thu, 12 Feb 2009)
New Revision: 3855
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/Node.java
Log:
JBPM-1686: accept null as a valid name for a node
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/Node.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/Node.java 2009-02-12 14:29:17 UTC (rev 3854)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/Node.java 2009-02-12 19:06:31 UTC (rev 3855)
@@ -500,9 +500,9 @@
*/
public void setName(String name)
{
- if (name == null || name.contains("/"))
+ if (name != null && name.contains("/"))
throw new IllegalArgumentException("Invalid node name: " + name);
-
+
if (isDifferent(this.name, name))
{
String oldName = this.name;
17 years, 2 months
JBoss JBPM SVN: r3854 - in jbpm4/trunk/modules/devguide/src/main/docbook/en: modules and 1 other directory.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-02-12 09:29:17 -0500 (Thu, 12 Feb 2009)
New Revision: 3854
Added:
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch11-History.xml
Removed:
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-History.xml
Modified:
jbpm4/trunk/modules/devguide/src/main/docbook/en/master.xml
Log:
first cut of history
Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/master.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/master.xml 2009-02-12 14:14:00 UTC (rev 3853)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/master.xml 2009-02-12 14:29:17 UTC (rev 3854)
@@ -11,6 +11,7 @@
<!ENTITY ch08-Timers SYSTEM "modules/ch08-Timers.xml">
<!ENTITY ch09-AsynchronousContinuations SYSTEM "modules/ch09-AsynchronousContinuations.xml">
<!ENTITY ch10-SoftwareLogging SYSTEM "modules/ch10-SoftwareLogging.xml">
+ <!ENTITY ch11-History SYSTEM "modules/ch11-History.xml">
]>
<book lang="en">
@@ -31,5 +32,6 @@
&ch08-Timers;
&ch09-AsynchronousContinuations;
&ch10-SoftwareLogging;
+ &ch11-History;
</book>
\ No newline at end of file
Copied: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch11-History.xml (from rev 3816, jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-History.xml)
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch11-History.xml (rev 0)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch11-History.xml 2009-02-12 14:29:17 UTC (rev 3854)
@@ -0,0 +1,42 @@
+<chapter id="history">
+ <title>History</title>
+
+ <section id="overview">
+ <title>Overview</title>
+
+ <para>HistoryEvents are fired during process execution.
+ </para>
+
+ <para>We maintain history information on 2 levels: process instance and activity instance.
+ </para>
+
+ <para>Process instance start and process instance end generate history events are fired directly
+ from within the implementation.
+ </para>
+
+ <para>ActivityBehaviour implementations are responsible for calling the historyXxx methods that
+ are exposed on the ActivityExecution
+ </para>
+
+ <para>All the HistoryEvents are delegated to a HistorySession. The default HistorySessionImpl
+ will invoke the process() method on the history events themselves.
+ </para>
+
+ <para>The HistoryEvents are temporary events. In the process method, they build up the information
+ in the history model. There is a HistoryProcessInstance and there is a whole class hierarchy starting with HistoryActivityInstance.
+ </para>
+
+ <para>In the HistoryEvent.process methods, the history events create model entities or merge
+ information into the model entities. For instance, a ProcessInstanceStart history event will
+ create a HistoryProcessInstance entity/record. And the ProcessInstanceEnd will set the endTime
+ property in the existing HistoryProcessInstance entity/record.
+ </para>
+
+ <para>Similar pattern for the activities. But for automatic activities, there is an optimisation
+ so that only 1 event is created and all the information is stored in one single insert (as all
+ this happens inside 1 transaction).
+ </para>
+
+ </section>
+
+</chapter>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch11-History.xml
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-History.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-History.xml 2009-02-12 14:14:00 UTC (rev 3853)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-History.xml 2009-02-12 14:29:17 UTC (rev 3854)
@@ -1,15 +0,0 @@
-<chapter id="history">
- <title>History</title>
-
- <section id="processlogs">
- <title>Process logs</title>
- </section>
-
- <section id="businessintelligence">
- <title>Business Intelligence (BI)</title>
- </section>
-
- <section id="businessactivitymonitoring">
- <title>Business Activity Monitoring (BAM)</title>
- </section>
-</chapter>
\ No newline at end of file
17 years, 2 months
JBoss JBPM SVN: r3853 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/activity and 15 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-02-12 09:14:00 -0500 (Thu, 12 Feb 2009)
New Revision: 3853
Added:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/HistoryProcessInstanceQuery.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/history/
jbpm4/trunk/modules/api/src/main/java/org/jbpm/history/HistoryProcessInstance.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ActivityEnd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ActivityStart.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/AutomaticEnd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ExclusiveEnd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskEnd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskStart.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryActivityInstanceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryAutomaticInstanceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryExclusiveInstanceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstanceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskInstanceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessInstanceEndedSynchronization.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryProcessInstanceQueryImpl.java
Removed:
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/CreateTimerActivity.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryActivityInstance.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstance.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskInstance.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessInstanceStoppedSynchronization.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/ExecutionService.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/listener/EventListenerExecution.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/PvmDbSession.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveConditionActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveExpressionActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveHandlerActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/HqlActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JavaActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ScriptActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StateActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/TaskActivity.java
jbpm4/trunk/modules/jpdl/src/main/resources/hibernate.properties.hsqldb.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceStart.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteActivity.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.execution.hbm.xml
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.history.hbm.xml
jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java
Log:
first cut of history
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/ExecutionService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/ExecutionService.java 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/ExecutionService.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -120,6 +120,9 @@
/** search for process instances with criteria */
ExecutionQuery createProcessInstanceQuery();
+ /** search for process instances in the history */
+ HistoryProcessInstanceQuery createHistoryProcessInstanceQuery();
+
/** creates or overwrites a variable value on the referenced execution */
Execution setVariable(String executionId, String name, Object value);
Added: jbpm4/trunk/modules/api/src/main/java/org/jbpm/HistoryProcessInstanceQuery.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/HistoryProcessInstanceQuery.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/HistoryProcessInstanceQuery.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm;
+
+import java.util.List;
+
+import org.jbpm.history.HistoryProcessInstance;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public interface HistoryProcessInstanceQuery {
+
+ String PROPERTY_STARTTIME = "startTime";
+ String PROPERTY_ENDTIME = "endTime";
+ String PROPERTY_ID = "id";
+
+ HistoryProcessInstanceQuery processDefinitionId(String processDefinitionId);
+
+ HistoryProcessInstanceQuery orderAsc(String property);
+ HistoryProcessInstanceQuery orderDesc(String property);
+
+ HistoryProcessInstanceQuery page(int firstResult, int maxResults);
+
+ List<HistoryProcessInstance> execute();
+}
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/HistoryProcessInstanceQuery.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -266,4 +266,26 @@
/** returns the previously taken transition only if {@link Activity#isPreviousNeeded()}
* is set to true. */
Transition getPreviousTransition();
+
+ /** record history event that specifies for an exclusive activity which transition
+ * has been taken. */
+ void historyExclusive(String transitionName);
+
+ /** records the end of an automatic event. This should be called at the end of
+ * the activity. Before the activity's execute method is invoked, the start time
+ * is automatically recorded. And invocation of this historyAutomatic will
+ * capture the end time. */
+ void historyAutomatic();
+
+ /** marks the start of an activity for history purposes. */
+ void historyActivityStart();
+
+ /** marks the end of an activity for history purposes. */
+ void historyActivityEnd();
+
+ /** marks the start of a user task for history purposes. */
+ void historyTaskStart(String assignee);
+
+ /** marks the end of a user task for history purposes. */
+ void historyTaskEnd(String outcome);
}
Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/history/HistoryProcessInstance.java (from rev 3843, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstance.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/history/HistoryProcessInstance.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/history/HistoryProcessInstance.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.history;
+
+import java.util.Date;
+
+/**
+ * @author Tom Baeyens
+ */
+public interface HistoryProcessInstance {
+
+ String getId();
+
+ String getKey();
+
+ String getState();
+
+ Date getStartTime();
+
+ Date getEndTime();
+
+ long getDuration();
+}
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/history/HistoryProcessInstance.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/listener/EventListenerExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/listener/EventListenerExecution.java 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/listener/EventListenerExecution.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -59,9 +59,6 @@
* registered to parent's of the given eventSource. */
void fire(String eventName, ObservableElement eventSource);
- /** the exception in case an exception handler is handling an exception. */
- Exception getException();
-
// extensions //////////////////////////////////////////////////////////////
/** way to access process language extensions in the execution without
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/PvmDbSession.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/PvmDbSession.java 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/PvmDbSession.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -73,9 +73,12 @@
/* find ids for all process instances for a given process definition. */
List<String> findProcessInstanceIds(String processDefinitionId);
- /** delete the process instance */
+ /** delete the process instance including the history. */
void deleteProcessInstance(String processInstanceId);
+ /** delete the process instance and optionally deletes the history. */
+ void deleteProcessInstance(String processInstanceId, boolean deleteHistory);
+
// job queries //////////////////////////////////////////////////////////////
/** timers */
@@ -87,4 +90,5 @@
/** the jobs for which all the retries have failed and which will not be
* picked up any more by the jobImpl executor */
public List<Job> findJobsWithException(int firstResult, int maxResults);
+
}
Deleted: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/CreateTimerActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/CreateTimerActivity.java 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/CreateTimerActivity.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -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.jpdl.activity;
-
-import org.jbpm.activity.ActivityExecution;
-
-
-/**
- * @author Tom Baeyens
- */
-public class CreateTimerActivity extends JpdlActivity {
-
- private static final long serialVersionUID = 1L;
-
-
-
- public void execute(ActivityExecution execution) {
- }
-}
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveConditionActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveConditionActivity.java 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveConditionActivity.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -42,6 +42,9 @@
if (transition==null) {
throw new JpdlException("no outgoing transition condition evaluated to true for exclusive "+execution.getActivity());
}
+ if (transition.getName()!=null) {
+ execution.historyExclusive(transition.getName());
+ }
execution.take(transition);
}
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveExpressionActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveExpressionActivity.java 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveExpressionActivity.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -55,6 +55,8 @@
if (transition==null) {
throw new JbpmException("expression '"+expr+"' in exclusive '"+activity.getName()+"' returned unexisting outgoing transition name: "+transitionName);
}
+
+ execution.historyExclusive(transitionName);
execution.take(transition);
}
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveHandlerActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveHandlerActivity.java 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveHandlerActivity.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -66,6 +66,8 @@
if (transition==null) {
throw new JbpmException("handler in exclusive '"+activity.getName()+"' returned unexisting outgoing transition name: "+transitionName);
}
+
+ execution.historyExclusive(transitionName);
execution.take(transition);
}
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/HqlActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/HqlActivity.java 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/HqlActivity.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -71,6 +71,8 @@
}
execution.setVariable(resultVariableName, result);
+
+ execution.historyAutomatic();
}
protected Query createQuery(Session session) {
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JavaActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JavaActivity.java 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JavaActivity.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -69,6 +69,9 @@
if (variableName!=null) {
execution.setVariable(variableName, returnValue);
}
+
+ execution.historyAutomatic();
+
} catch (WireException e) {
throw e;
} catch (Exception e) {
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ScriptActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ScriptActivity.java 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ScriptActivity.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -44,6 +44,8 @@
if (variableName!=null) {
execution.setVariable(variableName, returnValue);
}
+
+ execution.historyAutomatic();
}
public void setScript(String script) {
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StateActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StateActivity.java 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StateActivity.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -35,6 +35,8 @@
private static final long serialVersionUID = 1L;
public void execute(ActivityExecution execution) {
+ execution.historyActivityStart();
+
execution.waitForSignal();
}
@@ -49,6 +51,7 @@
Transition transition = activity.findOutgoingTransition(signalName);
if (transition!=null) {
+ execution.historyActivityEnd();
execution.take(transition);
} else {
execution.waitForSignal();
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/TaskActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/TaskActivity.java 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/TaskActivity.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -21,8 +21,13 @@
*/
package org.jbpm.jpdl.activity;
+import java.util.Map;
+
+import org.jbpm.JbpmException;
import org.jbpm.activity.ActivityExecution;
import org.jbpm.env.Environment;
+import org.jbpm.model.Activity;
+import org.jbpm.model.Transition;
import org.jbpm.task.internal.model.TaskImpl;
import org.jbpm.task.session.TaskDbSession;
@@ -30,7 +35,7 @@
/**
* @author Tom Baeyens
*/
-public class TaskActivity extends StateActivity {
+public class TaskActivity extends JpdlExternalActivity {
private static final long serialVersionUID = 1L;
@@ -43,8 +48,27 @@
task.setAssignee(assignee);
taskDbSession.saveTask(task);
+ execution.historyTaskStart(assignee);
execution.waitForSignal();
}
+
+ public void signal(ActivityExecution execution, String signalName, Map<String, Object> parameters) {
+ Activity activity = execution.getActivity();
+
+ if (parameters!=null) {
+ execution.setVariables(parameters);
+ }
+
+ execution.fire(signalName, activity);
+
+ Transition transition = activity.findOutgoingTransition(signalName);
+ if (transition!=null) {
+ execution.historyTaskEnd(signalName);
+ execution.take(transition);
+ } else {
+ throw new JbpmException("task outcome '"+signalName+"' doesn't match with the an outgoing transition "+activity.getOutgoingTransitions());
+ }
+ }
public void setAssignee(String assignee) {
this.assignee = assignee;
Modified: jbpm4/trunk/modules/jpdl/src/main/resources/hibernate.properties.hsqldb.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/resources/hibernate.properties.hsqldb.xml 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/jpdl/src/main/resources/hibernate.properties.hsqldb.xml 2009-02-12 14:14:00 UTC (rev 3853)
@@ -4,7 +4,7 @@
<!-- JDBC connection properties (begin) -->
<property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
- <property name="hibernate.connection.url">jdbc:hsqldb:mem:jbpm</property>
+ <property name="hibernate.connection.url">jdbc:hsqldb:mem:.</property>
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password"></property>
<!-- JDBC connection properties (end) -->
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -29,12 +29,14 @@
import org.jbpm.ProcessDefinition;
import org.jbpm.client.ClientExecution;
import org.jbpm.client.ClientProcessDefinition;
+import org.jbpm.history.HistoryProcessInstance;
import org.jbpm.job.Job;
import org.jbpm.job.Message;
import org.jbpm.job.Timer;
import org.jbpm.log.Log;
-import org.jbpm.pvm.internal.history.HistorySession;
-import org.jbpm.pvm.internal.history.model.HistoryProcessInstance;
+import org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl;
+import org.jbpm.pvm.internal.query.HistoryProcessInstanceQueryImpl;
+import org.jbpm.pvm.internal.svc.DefaultCommandService;
import org.jbpm.session.PvmDbSession;
/**
@@ -98,6 +100,19 @@
public void deleteProcessDefinition(String processDefinitionId, boolean deleteProcessInstances, boolean deleteHistory) {
List<String> processInstanceIds = findProcessInstanceIds(processDefinitionId);
+ if ( deleteHistory
+ // and if hibernate knows about the history class
+ && (session.getSessionFactory().getClassMetadata(HistoryProcessInstanceImpl.class)!=null)
+ ) {
+ List<HistoryProcessInstance> historyProcessInstances = new HistoryProcessInstanceQueryImpl(new DefaultCommandService())
+ .processDefinitionId(processDefinitionId)
+ .execute();
+
+ for (HistoryProcessInstance historyProcessInstance : historyProcessInstances) {
+ session.delete(historyProcessInstance);
+ }
+ }
+
if (deleteProcessInstances) {
for (String processInstanceId : processInstanceIds) {
deleteProcessInstance(processInstanceId);
@@ -108,17 +123,6 @@
}
}
- List<String> historyProcessInstanceIds = findHistoryProcessInstanceIds(processDefinitionId);
- if (deleteHistory) {
- for (String historyProcessInstanceId: historyProcessInstanceIds) {
- deleteHistoryProcessInstance(historyProcessInstanceId);
- }
- } else {
- if (historyProcessInstanceIds.size()>0) {
- throw new JbpmException("still "+historyProcessInstanceIds.size()+" history process instances for process definition "+processDefinitionId);
- }
- }
-
ProcessDefinition processDefinition = findProcessDefinitionById(processDefinitionId);
session.delete(processDefinition);
}
@@ -199,9 +203,39 @@
}
public void deleteProcessInstance(String processInstanceId) {
+ deleteProcessInstance(processInstanceId, true);
+ }
+
+ public void deleteProcessInstance(String processInstanceId, boolean deleteHistory) {
+ if (processInstanceId==null) {
+ throw new JbpmException("processInstanceId is null");
+ }
+
Execution processInstance = findExecutionById(processInstanceId);
- log.debug("deleting process instance "+processInstanceId);
- session.delete(processInstance);
+
+ // if history should be deleted
+ if ( deleteHistory
+ // and if hibernate knows about the history class
+ && (session.getSessionFactory().getClassMetadata(HistoryProcessInstanceImpl.class)!=null)
+ ) {
+ HistoryProcessInstanceImpl historyProcessInstance = (HistoryProcessInstanceImpl)
+ session.get(HistoryProcessInstanceImpl.class, processInstance.getId());
+
+ // if there is a history process instance in the db
+ if (historyProcessInstance!=null) {
+ if (log.isDebugEnabled()) {
+ log.debug("deleting history process instance "+processInstanceId);
+ }
+ session.delete(historyProcessInstance);
+ }
+ }
+
+ if (processInstance!=null) {
+ if (log.isDebugEnabled()) {
+ log.debug("deleting process instance "+processInstanceId);
+ }
+ session.delete(processInstance);
+ }
}
public List<String> findHistoryProcessInstanceIds(String processDefinitionId) {
@@ -209,9 +243,4 @@
query.setString("processDefinitionId", processDefinitionId);
return query.list();
}
-
- public void deleteHistoryProcessInstance(String historyProcessInstanceId) {
- HistoryProcessInstance historyProcessInstance = (HistoryProcessInstance) session.load(HistoryProcessInstance.class, historyProcessInstanceId);
- session.delete(historyProcessInstance);
- }
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionImpl.java 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionImpl.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -28,6 +28,8 @@
public class HistorySessionImpl implements HistorySession {
public void process(HistoryEvent historyEvent) {
- historyEvent.process();
+ if (historyEvent.execution.getId()!=null) {
+ historyEvent.process();
+ }
}
}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ActivityEnd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ActivityEnd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ActivityEnd.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.events;
+
+import org.hibernate.Session;
+import org.jbpm.env.Environment;
+import org.jbpm.pvm.internal.history.HistoryEvent;
+import org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl;
+import org.jbpm.pvm.internal.util.Clock;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ActivityEnd extends HistoryEvent {
+
+ private static final long serialVersionUID = 1L;
+
+ public void process() {
+ Session session = Environment.getFromCurrent(Session.class);
+ Long historyActivityInstanceDbId = execution.getHistoryActivityInstanceDbid();
+ HistoryActivityInstanceImpl historyActivityInstanceImpl = (HistoryActivityInstanceImpl)
+ session.load(getHistoryActivityInstanceClass(), historyActivityInstanceDbId);
+ historyActivityInstanceImpl.setEndTime(Clock.getCurrentTime());
+ updateActivitySpecificProperties(historyActivityInstanceImpl);
+ session.update(historyActivityInstanceImpl);
+ }
+
+ protected Class<? extends HistoryActivityInstanceImpl> getHistoryActivityInstanceClass() {
+ return HistoryActivityInstanceImpl.class;
+ }
+
+ protected void updateActivitySpecificProperties(HistoryActivityInstanceImpl historyActivityInstanceImpl) {
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ActivityEnd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ActivityStart.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ActivityStart.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ActivityStart.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.events;
+
+import org.hibernate.Session;
+import org.jbpm.env.Environment;
+import org.jbpm.history.HistoryProcessInstance;
+import org.jbpm.pvm.internal.history.HistoryEvent;
+import org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl;
+import org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ActivityStart extends HistoryEvent {
+
+ private static final long serialVersionUID = 1L;
+
+ public void process() {
+ Session session = Environment.getFromCurrent(Session.class);
+
+ HistoryProcessInstance historyProcessInstanceImpl = (HistoryProcessInstance)
+ session.load(HistoryProcessInstanceImpl.class, execution.getId());
+
+ HistoryActivityInstanceImpl historyActivityInstanceImpl =
+ createHistoryActivityInstance(historyProcessInstanceImpl);
+
+ session.save(historyActivityInstanceImpl);
+
+ execution.setHistoryActivityInstanceDbid(historyActivityInstanceImpl.getDbid());
+ }
+
+ protected HistoryActivityInstanceImpl createHistoryActivityInstance(HistoryProcessInstance historyProcessInstanceImpl) {
+ return new HistoryActivityInstanceImpl(historyProcessInstanceImpl, execution);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ActivityStart.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/AutomaticEnd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/AutomaticEnd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/AutomaticEnd.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -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.history.events;
+
+import org.jbpm.history.HistoryProcessInstance;
+import org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl;
+import org.jbpm.pvm.internal.history.model.HistoryAutomaticInstanceImpl;
+
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class AutomaticEnd extends ActivityStart {
+
+ private static final long serialVersionUID = 1L;
+
+ protected HistoryActivityInstanceImpl createHistoryActivityInstance(HistoryProcessInstance historyProcessInstanceImpl) {
+ return new HistoryAutomaticInstanceImpl(historyProcessInstanceImpl, execution);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/AutomaticEnd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ExclusiveEnd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ExclusiveEnd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ExclusiveEnd.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.events;
+
+import org.jbpm.history.HistoryProcessInstance;
+import org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl;
+import org.jbpm.pvm.internal.history.model.HistoryExclusiveInstanceImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ExclusiveEnd extends AutomaticEnd {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String transitionName;
+
+ public ExclusiveEnd(String transitionName) {
+ this.transitionName = transitionName;
+ }
+
+ protected HistoryActivityInstanceImpl createHistoryActivityInstance(HistoryProcessInstance historyProcessInstanceImpl) {
+ return new HistoryExclusiveInstanceImpl(historyProcessInstanceImpl, execution, transitionName);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ExclusiveEnd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -24,7 +24,7 @@
import org.hibernate.Session;
import org.jbpm.env.Environment;
import org.jbpm.pvm.internal.history.HistoryEvent;
-import org.jbpm.pvm.internal.history.model.HistoryProcessInstance;
+import org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl;
import org.jbpm.pvm.internal.util.Clock;
/**
@@ -35,11 +35,9 @@
private static final long serialVersionUID = 1L;
public void process() {
- String executionId = execution.getId();
- if (executionId!=null) {
- Session session = Environment.getFromCurrent(Session.class);
- HistoryProcessInstance historyProcessInstance = (HistoryProcessInstance) session.load(HistoryProcessInstance.class, executionId);
- historyProcessInstance.setEndTime(Clock.getCurrentTime());
- }
+ Session session = Environment.getFromCurrent(Session.class);
+ HistoryProcessInstanceImpl historyProcessInstanceImpl = (HistoryProcessInstanceImpl)
+ session.load(HistoryProcessInstanceImpl.class, execution.getId());
+ historyProcessInstanceImpl.setEndTime(Clock.getCurrentTime());
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceStart.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceStart.java 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceStart.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -25,8 +25,9 @@
import org.hibernate.Session;
import org.jbpm.env.Environment;
+import org.jbpm.history.HistoryProcessInstance;
import org.jbpm.pvm.internal.history.HistoryEvent;
-import org.jbpm.pvm.internal.history.model.HistoryProcessInstance;
+import org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl;
/**
@@ -37,11 +38,8 @@
private static final long serialVersionUID = 1L;
public void process() {
- if (execution.getId()!=null) {
- HistoryProcessInstance historyProcessInstance = new HistoryProcessInstance(execution);
-
- Session session = Environment.getFromCurrent(Session.class);
- session.save(historyProcessInstance);
- }
+ HistoryProcessInstance historyProcessInstanceImpl = new HistoryProcessInstanceImpl(execution);
+ Session session = Environment.getFromCurrent(Session.class);
+ session.save(historyProcessInstanceImpl);
}
}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskEnd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskEnd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskEnd.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.events;
+
+import org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl;
+import org.jbpm.pvm.internal.history.model.HistoryTaskInstanceImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskEnd extends ActivityEnd {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String outcome;
+
+ public TaskEnd(String outcome) {
+ this.outcome = outcome;
+ }
+
+ protected Class<? extends HistoryActivityInstanceImpl> getHistoryActivityInstanceClass() {
+ return HistoryTaskInstanceImpl.class;
+ }
+
+ protected void updateActivitySpecificProperties(HistoryActivityInstanceImpl historyActivityInstanceImpl) {
+ HistoryTaskInstanceImpl historyTaskInstanceImpl = (HistoryTaskInstanceImpl) historyActivityInstanceImpl;
+ historyTaskInstanceImpl.setOutcome(outcome);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskEnd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskStart.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskStart.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskStart.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.events;
+
+import org.jbpm.history.HistoryProcessInstance;
+import org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl;
+import org.jbpm.pvm.internal.history.model.HistoryTaskInstanceImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TaskStart extends ActivityStart {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String assignee;
+
+ public TaskStart(String assignee) {
+ this.assignee = assignee;
+ }
+
+ protected HistoryActivityInstanceImpl createHistoryActivityInstance(HistoryProcessInstance historyProcessInstanceImpl) {
+ return new HistoryTaskInstanceImpl(historyProcessInstanceImpl, execution, assignee);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskStart.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryActivityInstance.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryActivityInstance.java 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryActivityInstance.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -1,76 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.history.model;
-
-import java.util.Date;
-
-import org.jbpm.pvm.internal.model.ActivityImpl;
-import org.jbpm.pvm.internal.util.Clock;
-
-/**
- * @author Tom Baeyens
- */
-public class HistoryActivityInstance {
-
- protected long dbid;
- protected int dbversion;
-
- protected ActivityImpl activity;
- protected String activityName;
-
- protected Date createTime;
- protected Date endTime;
- protected long duration;
-
- public HistoryActivityInstance() {
- }
-
- public HistoryActivityInstance(ActivityImpl activity) {
- this.activity = activity;
- this.createTime = Clock.getCurrentTime();
- }
-
- public void setEndTime(Date endTime) {
- this.endTime = endTime;
- this.duration = endTime.getTime() - createTime.getTime();
- }
-
-
- public long getDbid() {
- return dbid;
- }
- public ActivityImpl getActivity() {
- return activity;
- }
- public String getActivityName() {
- return activityName;
- }
- public Date getCreateTime() {
- return createTime;
- }
- public Date getEndTime() {
- return endTime;
- }
- public long getDuration() {
- return duration;
- }
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryActivityInstanceImpl.java (from rev 3843, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryActivityInstance.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryActivityInstanceImpl.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryActivityInstanceImpl.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.model;
+
+import java.util.Date;
+
+import org.jbpm.history.HistoryProcessInstance;
+import org.jbpm.pvm.internal.model.ActivityImpl;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+
+/** base activity instance class.
+ *
+ * @author Tom Baeyens
+ */
+public class HistoryActivityInstanceImpl {
+
+ protected long dbid;
+ protected int dbversion;
+
+ protected HistoryProcessInstance historyProcessInstance;
+ protected String executionId;
+ protected ActivityImpl activity;
+ protected String activityName;
+
+ protected Date startTime;
+ protected Date endTime;
+ protected long duration;
+
+ public HistoryActivityInstanceImpl() {
+ }
+
+ public HistoryActivityInstanceImpl(HistoryProcessInstance historyProcessInstanceImpl, ExecutionImpl execution) {
+ this.historyProcessInstance = historyProcessInstanceImpl;
+ this.activity = execution.getActivity();
+ this.executionId = execution.getId();
+ this.activityName = activity.getName();
+ this.startTime = execution.getHistoryActivityStart();
+ }
+
+ public void setEndTime(Date endTime) {
+ this.endTime = endTime;
+ this.duration = endTime.getTime() - startTime.getTime();
+ }
+
+ public long getDbid() {
+ return dbid;
+ }
+ public ActivityImpl getActivity() {
+ return activity;
+ }
+ public String getActivityName() {
+ return activityName;
+ }
+ public Date getStartTime() {
+ return startTime;
+ }
+ public Date getEndTime() {
+ return endTime;
+ }
+ public long getDuration() {
+ return duration;
+ }
+ public HistoryProcessInstance getHistoryProcessInstance() {
+ return historyProcessInstance;
+ }
+ public String getExecutionId() {
+ return executionId;
+ }
+ public void setExecutionId(String executionId) {
+ this.executionId = executionId;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryActivityInstanceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryAutomaticInstanceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryAutomaticInstanceImpl.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryAutomaticInstanceImpl.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.model;
+
+import org.jbpm.history.HistoryProcessInstance;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.util.Clock;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HistoryAutomaticInstanceImpl extends HistoryActivityInstanceImpl {
+
+ public HistoryAutomaticInstanceImpl() {
+ }
+
+ public HistoryAutomaticInstanceImpl(HistoryProcessInstance historyProcessInstanceImpl, ExecutionImpl execution) {
+ super(historyProcessInstanceImpl, execution);
+ setEndTime(Clock.getCurrentTime());
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryAutomaticInstanceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryExclusiveInstanceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryExclusiveInstanceImpl.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryExclusiveInstanceImpl.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.model;
+
+import org.jbpm.history.HistoryProcessInstance;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HistoryExclusiveInstanceImpl extends HistoryAutomaticInstanceImpl {
+
+ protected String transitionName;
+
+ public HistoryExclusiveInstanceImpl() {
+ }
+
+ public HistoryExclusiveInstanceImpl(HistoryProcessInstance historyProcessInstanceImpl, ExecutionImpl execution, String transitionName) {
+ super(historyProcessInstanceImpl, execution);
+ this.transitionName = transitionName;
+ }
+
+ public String getTransitionName() {
+ return transitionName;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryExclusiveInstanceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstance.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstance.java 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstance.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -1,80 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.history.model;
-
-import java.util.Date;
-
-import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
-import org.jbpm.pvm.internal.util.Clock;
-
-
-/**
- * @author Tom Baeyens
- */
-public class HistoryProcessInstance {
-
- protected long dbid;
- protected int dbversion;
-
- protected ProcessDefinitionImpl processDefinition;
- protected String id;
- protected String key;
- protected Date startTime;
- protected Date endTime;
- protected long duration;
-
- public HistoryProcessInstance() {
- }
-
- public HistoryProcessInstance(ExecutionImpl processInstance) {
- this.processDefinition = processInstance.getProcessDefinition();
- this.dbid = processInstance.getDbid();
- this.id = processInstance.getId();
- this.key = processInstance.getKey();
- this.startTime = Clock.getCurrentTime();
- }
-
- public void setEndTime(Date endTime) {
- this.endTime = endTime;
- this.duration = endTime.getTime() - startTime.getTime();
- }
-
- public Date getEndTime() {
- return endTime;
- }
- public long getDbid() {
- return dbid;
- }
- public ProcessDefinitionImpl getProcessDefinition() {
- return processDefinition;
- }
- public Date getStartTime() {
- return startTime;
- }
- public long getDuration() {
- return duration;
- }
- public String getId() {
- return id;
- }
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstanceImpl.java (from rev 3843, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstance.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstanceImpl.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstanceImpl.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.model;
+
+import java.util.Date;
+import java.util.Set;
+
+import org.jbpm.history.HistoryProcessInstance;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+import org.jbpm.pvm.internal.util.Clock;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HistoryProcessInstanceImpl implements HistoryProcessInstance {
+
+ protected long dbid;
+ protected int dbversion;
+
+ protected ProcessDefinitionImpl processDefinition;
+ protected String id;
+ protected String key;
+ protected String state;
+ protected Date startTime;
+ protected Date endTime;
+ protected long duration;
+
+ /** only here to get hibernate cascade deletes */
+ protected Set<HistoryActivityInstanceImpl> historyActivityInstances;
+
+ public HistoryProcessInstanceImpl() {
+ }
+
+ public HistoryProcessInstanceImpl(ExecutionImpl processInstance) {
+ this.processDefinition = processInstance.getProcessDefinition();
+ this.dbid = processInstance.getDbid();
+ this.id = processInstance.getId();
+ this.key = processInstance.getKey();
+ this.state = "active";
+ this.startTime = Clock.getCurrentTime();
+ }
+
+ public void setEndTime(Date endTime) {
+ this.endTime = endTime;
+ this.duration = endTime.getTime() - startTime.getTime();
+ this.state = "ended";
+ }
+
+ public Date getEndTime() {
+ return endTime;
+ }
+ public long getDbid() {
+ return dbid;
+ }
+ public ProcessDefinitionImpl getProcessDefinition() {
+ return processDefinition;
+ }
+ public Date getStartTime() {
+ return startTime;
+ }
+ public long getDuration() {
+ return duration;
+ }
+ public String getId() {
+ return id;
+ }
+ public String getKey() {
+ return key;
+ }
+ public String getState() {
+ return state;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstanceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskInstance.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskInstance.java 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskInstance.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.history.model;
-
-import org.jbpm.pvm.internal.model.ActivityImpl;
-
-
-/**
- * @author Tom Baeyens
- */
-public class HistoryTaskInstance extends HistoryActivityInstance {
-
- protected String assignee;
-
- public HistoryTaskInstance() {
- }
-
- public HistoryTaskInstance(ActivityImpl activity, String assignee) {
- super(activity);
- this.assignee = assignee;
- }
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskInstanceImpl.java (from rev 3843, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskInstance.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskInstanceImpl.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskInstanceImpl.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.model;
+
+import org.jbpm.history.HistoryProcessInstance;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HistoryTaskInstanceImpl extends HistoryActivityInstanceImpl {
+
+ protected String assignee;
+ protected String outcome;
+
+ public HistoryTaskInstanceImpl() {
+ }
+
+ public HistoryTaskInstanceImpl(HistoryProcessInstance historyProcessInstanceImpl, ExecutionImpl execution, String assignee) {
+ super(historyProcessInstanceImpl, execution);
+ this.assignee = assignee;
+ }
+
+ public void setOutcome(String outcome) {
+ this.outcome = outcome;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskInstanceImpl.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/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -25,6 +25,7 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
+import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.LinkedList;
@@ -34,11 +35,11 @@
import java.util.Set;
import org.jbpm.Execution;
-import org.jbpm.ExecutionService;
import org.jbpm.JbpmException;
import org.jbpm.activity.ActivityExecution;
import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.client.ClientProcessInstance;
+import org.jbpm.cmd.CommandService;
import org.jbpm.env.Environment;
import org.jbpm.env.Transaction;
import org.jbpm.listener.EventListener;
@@ -53,8 +54,14 @@
import org.jbpm.model.Transition;
import org.jbpm.pvm.internal.history.HistoryEvent;
import org.jbpm.pvm.internal.history.HistorySession;
+import org.jbpm.pvm.internal.history.events.ActivityEnd;
+import org.jbpm.pvm.internal.history.events.ActivityStart;
+import org.jbpm.pvm.internal.history.events.AutomaticEnd;
+import org.jbpm.pvm.internal.history.events.ExclusiveEnd;
import org.jbpm.pvm.internal.history.events.ProcessInstanceEnd;
import org.jbpm.pvm.internal.history.events.ProcessInstanceStart;
+import org.jbpm.pvm.internal.history.events.TaskEnd;
+import org.jbpm.pvm.internal.history.events.TaskStart;
import org.jbpm.pvm.internal.job.MessageImpl;
import org.jbpm.pvm.internal.model.op.AtomicOperation;
import org.jbpm.pvm.internal.model.op.ExecuteActivity;
@@ -100,8 +107,6 @@
protected ProcessDefinitionImpl processDefinition;
- // current position /////////////////////////////////////////////////////////
-
/** current activity */
protected ActivityImpl activity;
@@ -134,14 +139,15 @@
/** the free text comments users make on this execution */
protected Set<CommentImpl> comments;
+
+ /** reference to the current activity instance history record */
+ protected Long historyActivityInstanceDbid;
+
+ /** start time of the activity for history purposes (not persisted) */
+ protected Date historyActivityStart;
protected int priority = Priority.NORMAL;
- /** maintains the index of the next log record. That way, the logs don't
- * have to be loaded to add one. Instead, for each log that is added to
- * this execution, the nextLogIndex is used and incremented. */
- protected int nextLogIndex;
-
/** caches the child executions by execution name. This member might be
* null and is only created from the executions in case its needed. Note
* that not all executions are forced to have a name and duplicates are allowed.
@@ -161,15 +167,7 @@
protected Activity previousActivity;
protected Transition previousTransition;
- protected Exception exception;
- // It's important that this refers to a separate entity. This
- // execution must do nullpointercheck before accessing the
- // process modifications. That way, good performance is guaranteed
- // for the most common scenario: a persistent execution without
- // process modifications.
- protected ProcessModificationsImpl processModifications;
-
// construction /////////////////////////////////////////////////////////////
public void initializeProcessInstance(ProcessDefinitionImpl processDefinition, String key) {
@@ -329,11 +327,11 @@
Environment environment = Environment.getCurrent();
if (environment!=null) {
Transaction transaction = environment.get(Transaction.class);
- ExecutionService executionService = environment.get(ExecutionService.class);
+ CommandService commandService = environment.get(CommandService.class);
if ( (transaction!=null)
- && (executionService!=null)
+ && (commandService!=null)
) {
- transaction.registerSynchronization(new ProcessInstanceStoppedSynchronization(this.getId(), executionService));
+ transaction.registerSynchronization(new ProcessInstanceEndedSynchronization(this.getId(), commandService));
}
}
}
@@ -934,10 +932,6 @@
}
}
- public int nextLogIndex() {
- return nextLogIndex++;
- }
-
// overriding the ScopeInstanceImpl methods /////////////////////////////////
public ScopeInstanceImpl getParentVariableScope() {
@@ -961,8 +955,33 @@
protected TransitionImpl findDefaultTransition() {
return activity.findDefaultTransition();
}
+
+ // history //////////////////////////////////////////////////////////////////
+ public void historyAutomatic() {
+ fireHistoryEvent(new AutomaticEnd());
+ }
+
+ public void historyExclusive(String transitionName) {
+ fireHistoryEvent(new ExclusiveEnd(transitionName));
+ }
+ public void historyActivityStart() {
+ fireHistoryEvent(new ActivityStart());
+ }
+
+ public void historyActivityEnd() {
+ fireHistoryEvent(new ActivityEnd());
+ }
+
+ public void historyTaskStart(String assignee) {
+ fireHistoryEvent(new TaskStart(assignee));
+ }
+
+ public void historyTaskEnd(String outcome) {
+ fireHistoryEvent(new TaskEnd(outcome));
+ }
+
// extensions ///////////////////////////////////////////////////////////////
public <T> T getExtension(Class<T> extensionClass) {
@@ -1049,18 +1068,6 @@
public void setTransitionOrigin(ActivityImpl transitionOrigin) {
this.transitionOrigin = transitionOrigin;
}
- public Exception getException() {
- return exception;
- }
- public void setException(Exception exception) {
- this.exception = exception;
- }
- public ProcessModificationsImpl getProcessModifications() {
- return processModifications;
- }
- public void setProcessModifications(ProcessModificationsImpl processModifications) {
- this.processModifications = processModifications;
- }
public String getKey() {
return key;
}
@@ -1118,4 +1125,16 @@
public void setId(String id) {
this.id = id;
}
+ public Long getHistoryActivityInstanceDbid() {
+ return historyActivityInstanceDbid;
+ }
+ public void setHistoryActivityInstanceDbid(Long historyActivityInstanceDbid) {
+ this.historyActivityInstanceDbid = historyActivityInstanceDbid;
+ }
+ public Date getHistoryActivityStart() {
+ return historyActivityStart;
+ }
+ public void setHistoryActivityStart(Date historyActivityStart) {
+ this.historyActivityStart = historyActivityStart;
+ }
}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessInstanceEndedSynchronization.java (from rev 3816, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessInstanceStoppedSynchronization.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessInstanceEndedSynchronization.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessInstanceEndedSynchronization.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.model;
+
+import javax.transaction.Status;
+import javax.transaction.Synchronization;
+
+import org.hibernate.Session;
+import org.jbpm.ExecutionService;
+import org.jbpm.cmd.Command;
+import org.jbpm.cmd.CommandService;
+import org.jbpm.env.Environment;
+import org.jbpm.session.PvmDbSession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ProcessInstanceEndedSynchronization implements Synchronization, Command<Void> {
+
+ private static final long serialVersionUID = 1L;
+
+ String processInstanceId;
+ CommandService commandService;
+
+ public ProcessInstanceEndedSynchronization(String processInstanceId, CommandService commandService) {
+ this.processInstanceId = processInstanceId;
+ this.commandService = commandService;
+ }
+
+ public void afterCompletion(int status) {
+ if (status==Status.STATUS_COMMITTED) {
+ commandService.execute(this);
+ }
+ }
+
+ public void beforeCompletion() {
+ }
+
+ public Void execute(Environment environment) {
+ PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
+ pvmDbSession.deleteProcessInstance(processInstanceId, false);
+ return null;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessInstanceEndedSynchronization.java
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessInstanceStoppedSynchronization.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessInstanceStoppedSynchronization.java 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessInstanceStoppedSynchronization.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.model;
-
-import javax.transaction.Status;
-import javax.transaction.Synchronization;
-
-import org.jbpm.ExecutionService;
-
-
-/**
- * @author Tom Baeyens
- */
-public class ProcessInstanceStoppedSynchronization implements Synchronization {
-
- String processInstanceId;
- ExecutionService executionService;
-
- public ProcessInstanceStoppedSynchronization(String processInstanceId, ExecutionService executionService) {
- this.processInstanceId = processInstanceId;
- this.executionService = executionService;
- }
-
- public void afterCompletion(int status) {
- if (status==Status.STATUS_COMMITTED) {
- executionService.deleteProcessInstance(processInstanceId);
- }
- }
-
- public void beforeCompletion() {
- }
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteActivity.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteActivity.java 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteActivity.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -27,6 +27,7 @@
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.model.ActivityImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl.Propagation;
+import org.jbpm.pvm.internal.util.Clock;
public class ExecuteActivity implements AtomicOperation {
@@ -51,7 +52,8 @@
try {
execution.setPropagation(Propagation.UNSPECIFIED);
-
+ execution.setHistoryActivityStart(Clock.getCurrentTime());
+
activityBehaviour.execute(execution);
} catch (Exception e) {
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryProcessInstanceQueryImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryProcessInstanceQueryImpl.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryProcessInstanceQueryImpl.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -0,0 +1,85 @@
+/*
+ * 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.query;
+
+import java.util.List;
+
+import org.hibernate.Query;
+import org.jbpm.HistoryProcessInstanceQuery;
+import org.jbpm.cmd.CommandService;
+import org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HistoryProcessInstanceQueryImpl extends AbstractQuery implements HistoryProcessInstanceQuery {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String processDefinitionId;
+
+ public HistoryProcessInstanceQueryImpl(CommandService commandService) {
+ super(commandService);
+ }
+
+ public String hql() {
+ StringBuffer hql = new StringBuffer();
+ hql.append("select hpi ");
+ hql.append("from ");
+ hql.append(HistoryProcessInstanceImpl.class.getName());
+ hql.append(" as hpi ");
+
+ if (processDefinitionId!=null) {
+ appendWhereClause(" hpi.processDefinition.id = '"+processDefinitionId+"' ", hql);
+ }
+
+ return hql.toString();
+ }
+
+ protected void applyParameters(Query query) {
+ }
+
+ public List<org.jbpm.history.HistoryProcessInstance> execute() {
+ return (List) commandService.execute(this);
+ }
+
+ public HistoryProcessInstanceQuery orderAsc(String property) {
+ addOrderByClause("hpi."+property+" asc");
+ return this;
+ }
+
+ public HistoryProcessInstanceQuery orderDesc(String property) {
+ addOrderByClause("hpi."+property+" asc");
+ return this;
+ }
+
+ public HistoryProcessInstanceQuery page(int firstResult, int maxResults) {
+ this.page = new Page(firstResult, maxResults);
+ return this;
+ }
+
+ public HistoryProcessInstanceQuery processDefinitionId(String processDefinitionId) {
+ this.processDefinitionId = processDefinitionId;
+ return this;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/HistoryProcessInstanceQueryImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ExecutionServiceImpl.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -29,6 +29,7 @@
import org.jbpm.Execution;
import org.jbpm.ExecutionQuery;
import org.jbpm.ExecutionService;
+import org.jbpm.HistoryProcessInstanceQuery;
import org.jbpm.cmd.CommandService;
import org.jbpm.pvm.internal.cmd.DeleteProcessInstance;
import org.jbpm.pvm.internal.cmd.FindExecutionsCmd;
@@ -40,6 +41,7 @@
import org.jbpm.pvm.internal.cmd.StartExecutionCmd;
import org.jbpm.pvm.internal.cmd.StartExecutionInLatestCmd;
import org.jbpm.pvm.internal.query.ExecutionQueryImpl;
+import org.jbpm.pvm.internal.query.HistoryProcessInstanceQueryImpl;
/**
@@ -170,4 +172,8 @@
cmd.setVariables(variables);
return commandService.execute(cmd);
}
+
+ public HistoryProcessInstanceQuery createHistoryProcessInstanceQuery() {
+ return new HistoryProcessInstanceQueryImpl(commandService);
+ }
}
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.execution.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.execution.hbm.xml 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.execution.hbm.xml 2009-02-12 14:14:00 UTC (rev 3853)
@@ -44,7 +44,7 @@
<property name="state" column="STATE_" />
<property name="priority" column="PRIORITY_" />
- <property name="nextLogIndex" column="NEXTLOGIDX_" />
+ <property name="historyActivityInstanceDbid" column="HISACTINST_" />
<many-to-one name="processDefinition"
class="org.jbpm.pvm.internal.model.ProcessDefinitionImpl"
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.history.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.history.hbm.xml 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.history.hbm.xml 2009-02-12 14:14:00 UTC (rev 3853)
@@ -4,7 +4,7 @@
<hibernate-mapping package="org.jbpm.pvm.internal.history.model" default-access="field">
<!-- ### HISTORY PROCESS INSTANCE ####################################### -->
- <class name="HistoryProcessInstance" table="JBPM_HIST_PROC_INST">
+ <class name="HistoryProcessInstanceImpl" table="JBPM_HIST_PROCINST">
<id name="id" column="ID_">
<generator class="assigned" />
</id>
@@ -17,18 +17,56 @@
<many-to-one name="processDefinition"
class="org.jbpm.pvm.internal.model.ProcessDefinitionImpl"
- column="PROCDEF_"
- foreign-key="FK_HPI_PROCDEF"
- index="IDX_HPI_PROCDEF" />
+ column="PROCESS_"
+ foreign-key="FK_HISTPI_PROCDEF"
+ index="IDX_HISTPI_PROCDEF" />
+
+ <set name="historyActivityInstances"
+ cascade="all">
+ <key>
+ <column name="HPI_" />
+ </key>
+ <one-to-many class="HistoryActivityInstanceImpl" />
+ </set>
+
</class>
- <query name="findHistoryProcessInstanceIds">
- <![CDATA[
- select historyExecution.id
- from org.jbpm.pvm.internal.history.model.HistoryProcessInstance historyExecution
- where historyExecution.processDefinition.id = :processDefinitionId
- ]]>
- </query>
-
+ <!-- ### HISTORY PROCESS INSTANCE ####################################### -->
+ <class name="HistoryActivityInstanceImpl" table="JBPM_HIST_ACTINST" discriminator-value="ACT">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+ <discriminator column="CLASS_" />
+ <version name="dbversion" column="DBVERSION_" />
+ <many-to-one name="historyProcessInstance"
+ class="HistoryProcessInstanceImpl"
+ column="HPI_"
+ foreign-key="FK_HAI_HPI"
+ index="IDX_HAI_HPI" />
+
+ <many-to-one name="activity"
+ class="org.jbpm.pvm.internal.model.ActivityImpl"
+ column="ACTIVITY_"
+ foreign-key="FK_HISTAI_ACT"
+ index="IDX_HISTAI_ACT" />
+
+ <property name="executionId" column="EXECUTION_" />
+ <property name="activityName" column="ACTIVITY_NAME_" />
+ <property name="startTime" column="START_" type="timestamp" />
+ <property name="endTime" column="END_" type="timestamp" />
+ <property name="duration" column="DURATION_" />
+
+ <subclass name="HistoryAutomaticInstanceImpl" discriminator-value="AUT">
+ <subclass name="HistoryExclusiveInstanceImpl" discriminator-value="EXCL">
+ <property name="transitionName" column="TRANSITION_" />
+ </subclass>
+ </subclass>
+
+ <subclass name="HistoryTaskInstanceImpl" discriminator-value="TASK">
+ <property name="assignee" column="ASSIGNEE_" />
+ <property name="outcome" column="TRANSITION_" />
+ </subclass>
+ </class>
+
</hibernate-mapping>
\ No newline at end of file
Modified: jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java 2009-02-12 13:51:43 UTC (rev 3852)
+++ jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/history/ProcessInstanceHistoryTest.java 2009-02-12 14:14:00 UTC (rev 3853)
@@ -21,6 +21,10 @@
*/
package org.jbpm.test.history;
+import java.util.List;
+
+import org.jbpm.HistoryProcessInstanceQuery;
+import org.jbpm.history.HistoryProcessInstance;
import org.jbpm.test.DbTestCase;
@@ -42,8 +46,14 @@
executionService.startExecutionByKey("ICL");
executionService.startExecutionByKey("ICL");
executionService.startExecutionByKey("ICL");
+
+ List<HistoryProcessInstance> historyProcessInstances = executionService
+ .createHistoryProcessInstanceQuery()
+ .processDefinitionId("ICL:1")
+ .orderAsc(HistoryProcessInstanceQuery.PROPERTY_STARTTIME)
+ .execute();
-
+ assertEquals(3, historyProcessInstances.size());
}
}
17 years, 2 months
JBoss JBPM SVN: r3852 - jbpm4/trunk/modules/distro/src/main/resources/installer.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-02-12 08:51:43 -0500 (Thu, 12 Feb 2009)
New Revision: 3852
Modified:
jbpm4/trunk/modules/distro/src/main/resources/installer/install-definition.xml
Log:
Cleanup install definitions
Modified: jbpm4/trunk/modules/distro/src/main/resources/installer/install-definition.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/installer/install-definition.xml 2009-02-12 13:28:41 UTC (rev 3851)
+++ jbpm4/trunk/modules/distro/src/main/resources/installer/install-definition.xml 2009-02-12 13:51:43 UTC (rev 3852)
@@ -149,8 +149,7 @@
<description>The jBPM4 JBoss Integration</description>
<!-- jbpm/jbpm-service.sar -->
- <fileset dir="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-service.sar" override="true">
- <include name="hibernate.properties"/>
+ <fileset dir="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-service.sar" override="true">
<include name="logging.properties"/>
</fileset>
17 years, 2 months
JBoss JBPM SVN: r3851 - jbpm4/trunk/modules/jpdl/src/main/resources.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-02-12 08:28:41 -0500 (Thu, 12 Feb 2009)
New Revision: 3851
Removed:
jbpm4/trunk/modules/jpdl/src/main/resources/hibernate.cfg.xml
Log:
remove legacy hibernate.cfg.xml
Deleted: jbpm4/trunk/modules/jpdl/src/main/resources/hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/resources/hibernate.cfg.xml 2009-02-12 13:22:56 UTC (rev 3850)
+++ jbpm4/trunk/modules/jpdl/src/main/resources/hibernate.cfg.xml 2009-02-12 13:28:41 UTC (rev 3851)
@@ -1,21 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-
-<!DOCTYPE hibernate-configuration PUBLIC
- "-//Hibernate/Hibernate Configuration DTD 2.0//EN"
- "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
-
-<hibernate-configuration>
-
- <session-factory>
- <mapping resource="jbpm.pvm.typedefs.hbm.xml" />
- <mapping resource="jbpm.pvm.wire.hbm.xml" />
- <mapping resource="jbpm.pvm.definition.hbm.xml" />
- <mapping resource="jbpm.pvm.execution.hbm.xml" />
- <mapping resource="jbpm.pvm.variable.hbm.xml" />
- <mapping resource="jbpm.pvm.job.hbm.xml" />
- <mapping resource="jbpm.pvm.history.hbm.xml" />
- <mapping resource="jbpm.task.hbm.xml" />
- <mapping resource="jbpm.jpdl.hbm.xml" />
- </session-factory>
-
-</hibernate-configuration>
17 years, 2 months
JBoss JBPM SVN: r3850 - in jbpm4/trunk: modules/enterprise and 1 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-02-12 08:22:56 -0500 (Thu, 12 Feb 2009)
New Revision: 3850
Modified:
jbpm4/trunk/modules/enterprise/jbpm4-enterprise.iml
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ModelAdaptor.java
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ProcessManagementImpl.java
jbpm4/trunk/pom.xml
Log:
Migrate console model to string based enitity ID's
Modified: jbpm4/trunk/modules/enterprise/jbpm4-enterprise.iml
===================================================================
--- jbpm4/trunk/modules/enterprise/jbpm4-enterprise.iml 2009-02-12 13:19:13 UTC (rev 3849)
+++ jbpm4/trunk/modules/enterprise/jbpm4-enterprise.iml 2009-02-12 13:22:56 UTC (rev 3850)
@@ -15,6 +15,8 @@
<orderEntry type="module" module-name="jbpm4-api" exported="" />
<orderEntry type="module" module-name="gwt-parent" exported="" />
<orderEntry type="module" module-name="jbpm4-pvm" exported="" />
+ <orderEntry type="module" module-name="gwt-rpc" />
+ <orderEntry type="module" module-name="gwt-server-integration" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: cargo:cargo:jar:0.5:test">
<CLASSES>
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ModelAdaptor.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ModelAdaptor.java 2009-02-12 13:19:13 UTC (rev 3849)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ModelAdaptor.java 2009-02-12 13:22:56 UTC (rev 3850)
@@ -24,11 +24,8 @@
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
import org.jboss.bpm.console.client.model.ProcessInstanceRef;
-import org.jbpm.ProcessDefinition;
-import org.jbpm.Execution;
import org.jbpm.model.OpenExecution;
import org.jbpm.model.OpenProcessDefinition;
-import org.jbpm.pvm.internal.model.ProcessElementImpl;
import java.util.Date;
@@ -40,7 +37,7 @@
public static ProcessDefinitionRef adoptDefinition(OpenProcessDefinition p0)
{
ProcessDefinitionRef def = new ProcessDefinitionRef();
- def.setProcessId( ((ProcessElementImpl)p0).getDbid() );
+ def.setId( p0.getId() );
def.setName(p0.getName());
def.setVersion(p0.getVersion());
@@ -55,9 +52,9 @@
public static ProcessInstanceRef adoptExecution(OpenExecution e0)
{
ProcessInstanceRef ref = new ProcessInstanceRef();
- ref.setInstanceId( e0.getDbid() );
+ ref.setId( e0.getId() );
ref.setKey(e0.getKey());
- ref.setDefinitionId(e0.getProcessDefinition().getDbid());
+ ref.setDefinitionId(e0.getProcessDefinition().getId() );
ref.setState( ProcessInstanceRef.STATE.RUNNING); // TODO: FIXME
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ProcessManagementImpl.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ProcessManagementImpl.java 2009-02-12 13:19:13 UTC (rev 3849)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ProcessManagementImpl.java 2009-02-12 13:22:56 UTC (rev 3850)
@@ -67,27 +67,34 @@
}
- public ProcessDefinitionRef getProcessDefinition(long procDefId)
+ public ProcessDefinitionRef getProcessDefinition(String procDefId)
{
ProcessService processService = this.processEngine.getProcessService();
- ProcessDefinition p0 = processService.findProcessDefinitionById(String.valueOf(procDefId));
+ ProcessDefinition p0 = processService.findProcessDefinitionById(procDefId);
return ModelAdaptor.adoptDefinition((OpenProcessDefinition)p0);
}
- public List<ProcessDefinitionRef> removeProcessDefinition(long procDefId)
+ public List<ProcessDefinitionRef> removeProcessDefinition(String procDefId)
{
ProcessService processService = this.processEngine.getProcessService();
- processService.deleteProcessDefinitionCascade(String.valueOf(procDefId));
+ processService.deleteProcessDefinitionCascade(procDefId);
return getProcessDefinitions();
}
- public List<ProcessInstanceRef> getProcessInstances(long procDefId)
+ public List<ProcessInstanceRef> getProcessInstances(String procDefId)
{
ExecutionService execService = this.processEngine.getExecutionService();
ExecutionQuery query = execService.createExecutionQuery();
query.processDefinitionId(String.valueOf(procDefId));
List<Execution> executions = query.execute();
+ List<ProcessInstanceRef> results = adoptTopLevelExecutions(executions);
+
+ return results;
+ }
+
+ private List<ProcessInstanceRef> adoptTopLevelExecutions(List<Execution> executions)
+ {
List<ProcessInstanceRef> results = new ArrayList<ProcessInstanceRef>();
for(Execution exec : executions)
{
@@ -96,21 +103,30 @@
results.add( ModelAdaptor.adoptExecution((OpenExecution)exec) );
}
}
-
return results;
}
- public ProcessInstanceRef getProcessInstance(long procId)
+ public ProcessInstanceRef getProcessInstance(String instanceId)
{
- throw new RuntimeException("Not implemented");
+ ExecutionService execService = this.processEngine.getExecutionService();
+ ExecutionQuery query = execService.createProcessInstanceQuery();
+ query.processInstanceId(instanceId);
+ List<Execution> executions = query.execute();
+
+ if(executions.size()>1 || executions.isEmpty())
+ throw new IllegalStateException("No precise match for instanceId " + instanceId +". Num results "+executions);
+
+ return ModelAdaptor.adoptExecution( (OpenExecution)executions.get(0));
}
- public ProcessInstanceRef newInstance(long procDefId)
+ public ProcessInstanceRef newInstance(String definitionId)
{
- throw new RuntimeException("Not implemented");
+ ExecutionService execService = this.processEngine.getExecutionService();
+ Execution exec = execService.startExecutionById(definitionId);
+ return ModelAdaptor.adoptExecution((OpenExecution)exec);
}
- public void setProcessState(long procId, ProcessInstanceRef.STATE nextState)
+ public void setProcessState(String procId, ProcessInstanceRef.STATE nextState)
{
throw new RuntimeException("Not implemented");
}
Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml 2009-02-12 13:19:13 UTC (rev 3849)
+++ jbpm4/trunk/pom.xml 2009-02-12 13:22:56 UTC (rev 3850)
@@ -218,7 +218,7 @@
<groupId>org.livetribe</groupId>
<artifactId>livetribe-jsr223</artifactId>
<version>${jsr233.version}</version>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
@@ -304,17 +304,6 @@
</configuration>
</plugin>
<plugin>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<failIfNoTests>false</failIfNoTests>
@@ -327,17 +316,6 @@
</systemProperties>
</configuration>
</plugin>
- <plugin>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-javadocs</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
@@ -400,6 +378,28 @@
<skipTests>true</skipTests>
</configuration>
</plugin>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</profile>
17 years, 2 months