Author: alex.guizar(a)jboss.com
Date: 2010-02-23 03:47:50 -0500 (Tue, 23 Feb 2010)
New Revision: 6192
Added:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2778/
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2778/JBPM2778Test.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2778/
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2778/gpd.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2778/processdefinition.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jpdl/xml/.gpd.testStartState.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jpdl/xml/.gpd.testTask.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jpdl/xml/.gpd.testTaskNode.xml
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/JbpmConfiguration.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/calendar/Day.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/action/MailAction.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/action/Script.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Action.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Node.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/ProcessDefinition.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/exe/ExecutionContext.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/exe/Token.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/job/Timer.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/jpdl/xml/JpdlXmlReader.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/scheduler/def/CancelTimerAction.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/scheduler/def/CreateTimerAction.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.2.xsd
Log:
JBPM-2778: read accept-propagated-events and async attributes for any action
accept async attribute in script element and accept-propagated-events attribute in mail
element
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/JbpmConfiguration.java
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/JbpmConfiguration.java 2010-02-23
00:10:51 UTC (rev 6191)
+++
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/JbpmConfiguration.java 2010-02-23
08:47:50 UTC (rev 6192)
@@ -46,7 +46,6 @@
import org.jbpm.svc.ServiceFactory;
import org.jbpm.svc.Services;
import org.jbpm.util.ClassLoaderUtil;
-import org.jbpm.util.ClassUtil;
/**
* configuration of one jBPM instance.
@@ -72,8 +71,7 @@
* or
* <pre>
* String myXmlResource = "...";
- * JbpmConfiguration jbpmConfiguration =
- * JbpmConfiguration.getInstance(myXmlResource);
+ * JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance(myXmlResource);
* </pre>
* </li>
*
@@ -278,22 +276,20 @@
if (defaultObjectFactory != null) {
if (log.isDebugEnabled()) {
log.debug("creating configuration from default object factory: "
- + defaultObjectFactory);
+ + defaultObjectFactory);
}
instance = new JbpmConfiguration(defaultObjectFactory);
}
else {
log.info("using configuration resource: " + resource);
- InputStream jbpmCfgXmlStream =
- ClassLoaderUtil.getStream(resource, false);
+ InputStream jbpmCfgXmlStream = ClassLoaderUtil.getStream(resource, false);
/*
* if a custom resource is specified, but not found in the classpath,
* log a warning; otherwise, users who want to load custom stuff will
* not receive any feedback when their resource cannot be found
*/
if (jbpmCfgXmlStream == null &&
!"jbpm.cfg.xml".equals(resource)) {
- log.warn("configuration resource '" + resource
- + "' could not be found");
+ log.warn("configuration resource '" + resource + "'
was not found");
}
ObjectFactory objectFactory = parseObjectFactory(jbpmCfgXmlStream);
instance = createJbpmConfiguration(objectFactory);
@@ -313,7 +309,8 @@
log.debug("loading defaults in jbpm configuration");
ObjectFactoryParser objectFactoryParser = new ObjectFactoryParser();
ObjectFactoryImpl objectFactoryImpl = new ObjectFactoryImpl();
-
objectFactoryParser.parseElementsFromResource("org/jbpm/default.jbpm.cfg.xml",
objectFactoryImpl);
+
objectFactoryParser.parseElementsFromResource("org/jbpm/default.jbpm.cfg.xml",
+ objectFactoryImpl);
if (inputStream != null) {
log.debug("loading specific configuration...");
@@ -333,14 +330,12 @@
return createJbpmConfiguration(objectFactory);
}
- protected static JbpmConfiguration createJbpmConfiguration(
- ObjectFactory objectFactory) {
+ protected static JbpmConfiguration createJbpmConfiguration(ObjectFactory objectFactory)
{
JbpmConfiguration jbpmConfiguration = new JbpmConfiguration(objectFactory);
// make the bean jbpm.configuration always available
if (objectFactory instanceof ObjectFactoryImpl) {
ObjectFactoryImpl objectFactoryImpl = (ObjectFactoryImpl) objectFactory;
- ObjectInfo jbpmConfigurationInfo =
- new ValueInfo("jbpmConfiguration", jbpmConfiguration);
+ ObjectInfo jbpmConfigurationInfo = new ValueInfo("jbpmConfiguration",
jbpmConfiguration);
objectFactoryImpl.addObjectInfo(jbpmConfigurationInfo);
}
// honor hide stale state exceptions setting
@@ -350,11 +345,9 @@
return jbpmConfiguration;
}
- private static boolean getHideStaleObjectExceptions(
- ObjectFactory objectFactory) {
+ private static boolean getHideStaleObjectExceptions(ObjectFactory objectFactory) {
if (objectFactory.hasObject("jbpm.hide.stale.object.exceptions")) {
- Object hide =
- objectFactory.createObject("jbpm.hide.stale.object.exceptions");
+ Object hide =
objectFactory.createObject("jbpm.hide.stale.object.exceptions");
if (Boolean.FALSE.equals(hide)) return false;
}
return true;
@@ -399,8 +392,7 @@
return getServiceFactory(serviceName, JbpmContext.DEFAULT_JBPM_CONTEXT_NAME);
}
- public ServiceFactory getServiceFactory(String serviceName,
- String jbpmContextName) {
+ public ServiceFactory getServiceFactory(String serviceName, String jbpmContextName) {
JbpmContext jbpmContext = createJbpmContext(jbpmContextName);
try {
return jbpmContext.getServices().getServiceFactory(serviceName);
@@ -410,12 +402,10 @@
}
}
- public static ClassLoader getProcessClassLoader(
- ProcessDefinition processDefinition) {
+ public static ClassLoader getProcessClassLoader(ProcessDefinition processDefinition) {
ProcessClassLoaderFactory factory;
if (Configs.hasObject("process.class.loader.factory")) {
- factory =
- (ProcessClassLoaderFactory)
Configs.getObject("process.class.loader.factory");
+ factory = (ProcessClassLoaderFactory)
Configs.getObject("process.class.loader.factory");
}
else {
factory = new DefaultProcessClassLoaderFactory();
@@ -500,9 +490,9 @@
getPersistenceServiceFactory(jbpmContextName).dropSchema();
}
- private DbPersistenceServiceFactory getPersistenceServiceFactory(
- String jbpmContextName) {
- return (DbPersistenceServiceFactory)
getServiceFactory(Services.SERVICENAME_PERSISTENCE, jbpmContextName);
+ private DbPersistenceServiceFactory getPersistenceServiceFactory(String
jbpmContextName) {
+ return (DbPersistenceServiceFactory)
getServiceFactory(Services.SERVICENAME_PERSISTENCE,
+ jbpmContextName);
}
public boolean isClosed() {
@@ -559,8 +549,7 @@
JbpmConfiguration currentJbpmConfiguration = null;
List stack = getJbpmConfigurationStack();
if (!stack.isEmpty()) {
- currentJbpmConfiguration =
- (JbpmConfiguration) stack.get(stack.size() - 1);
+ currentJbpmConfiguration = (JbpmConfiguration) stack.get(stack.size() - 1);
}
return currentJbpmConfiguration;
}
@@ -597,14 +586,13 @@
List stack = getJbpmConfigurationStack();
int index = stack.lastIndexOf(this);
if (index == -1) {
- throw new JbpmException(this
- + " does not appear in the thread-local stack");
+ log.warn(this + " was not found in thread-local stack;"
+ + "do not access JbpmContext instances from multiple threads");
}
else {
if (index != stack.size() - 1) {
- log.warn(this
- + " was closed in some order that differs from creation\n"
- + "check your try-finally clauses around JbpmContext blocks");
+ log.warn(this + " was not closed in reverse creation order;"
+ + " check your try-finally clauses around JbpmContext blocks");
}
// prevent configuration from remaining in the stack, no matter what
stack.remove(index);
@@ -634,14 +622,13 @@
List stack = getJbpmContextStack();
int index = stack.lastIndexOf(jbpmContext);
if (index == -1) {
- log.warn(jbpmContext + " does not appear in the thread-local stack\n"
- + "avoid manipulating JbpmContext instances from multiple threads");
+ log.warn(jbpmContext + " was not found in thread-local stack;"
+ + " do not access JbpmContext instances from multiple threads");
}
else {
if (index != stack.size() - 1) {
- log.warn(jbpmContext
- + " was closed in some order that differs from creation\n"
- + "check your try-finally clauses around JbpmContext blocks");
+ log.warn(jbpmContext + " was not closed in reverse creation order;"
+ + " check your try-finally clauses around JbpmContext blocks");
}
// prevent context from remaining in the stack, no matter what
stack.remove(index);
@@ -666,16 +653,15 @@
ensureOpen();
if (jobExecutor == null) {
- jobExecutor =
- (JobExecutor) objectFactory.createObject("jbpm.job.executor");
+ jobExecutor = (JobExecutor)
objectFactory.createObject("jbpm.job.executor");
}
return jobExecutor;
}
public String toString() {
- return ClassUtil.getSimpleName(JbpmConfiguration.class)
- + (resourceName != null ? resourceName : "@"
- + Integer.toHexString(hashCode()));
+ return "JbpmConfiguration"
+ + (resourceName != null ? '(' + resourceName + ')'
+ : '@' + Integer.toHexString(hashCode()));
}
private static Log log = LogFactory.getLog(JbpmConfiguration.class);
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/calendar/Day.java
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/calendar/Day.java 2010-02-23
00:10:51 UTC (rev 6191)
+++
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/calendar/Day.java 2010-02-23
08:47:50 UTC (rev 6192)
@@ -24,47 +24,49 @@
import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
-import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
-import java.util.List;
import java.util.Properties;
-import java.util.StringTokenizer;
/**
* is a day on a business calendar.
*/
public class Day implements Serializable {
-
+
private static final long serialVersionUID = 1L;
-
- DayPart[] dayParts = null;
- BusinessCalendar businessCalendar = null;
- public static Day[] parseWeekDays(Properties calendarProperties, BusinessCalendar
businessCalendar) {
+ DayPart[] dayParts;
+ BusinessCalendar businessCalendar;
+
+ public static Day[] parseWeekDays(Properties calendarProperties,
+ BusinessCalendar businessCalendar) {
DateFormat dateFormat = new
SimpleDateFormat(calendarProperties.getProperty("hour.format"));
- Day[] weekDays = new Day[8];
- weekDays[Calendar.MONDAY] = new Day(
calendarProperties.getProperty("weekday.monday"), dateFormat, businessCalendar
);
- weekDays[Calendar.TUESDAY] = new Day(
calendarProperties.getProperty("weekday.tuesday"), dateFormat, businessCalendar
);
- weekDays[Calendar.WEDNESDAY] = new Day(
calendarProperties.getProperty("weekday.wednesday"), dateFormat,
businessCalendar );
- weekDays[Calendar.THURSDAY] = new Day(
calendarProperties.getProperty("weekday.thursday"), dateFormat, businessCalendar
);
- weekDays[Calendar.FRIDAY] = new Day(
calendarProperties.getProperty("weekday.friday"), dateFormat, businessCalendar
);
- weekDays[Calendar.SATURDAY] = new Day(
calendarProperties.getProperty("weekday.saturday"), dateFormat, businessCalendar
);
- weekDays[Calendar.SUNDAY] = new Day(
calendarProperties.getProperty("weekday.sunday"), dateFormat, businessCalendar
);
+ String[] weekDayKeys = {
+ null, "weekday.sunday", "weekday.monday",
"weekday.tuesday", "weekday.wednesday",
+ "weekday.thursday", "weekday.friday",
"weekday.saturday"
+ };
+
+ Day[] weekDays = new Day[weekDayKeys.length];
+ for (int i = Calendar.SUNDAY; i <= Calendar.SATURDAY; i++) {
+ weekDays[i] = new Day(calendarProperties.getProperty(weekDayKeys[i]), dateFormat,
+ businessCalendar);
+ }
return weekDays;
}
public Day(String dayPartsText, DateFormat dateFormat, BusinessCalendar
businessCalendar) {
this.businessCalendar = businessCalendar;
-
- List dayPartsList = new ArrayList();
- StringTokenizer tokenizer = new StringTokenizer(dayPartsText, "&");
- while (tokenizer.hasMoreTokens()) {
- String dayPartText = tokenizer.nextToken().trim();
- dayPartsList.add(new DayPart(dayPartText, dateFormat, this, dayPartsList.size()));
+
+ String[] dayPartTexts = dayPartsText.split("[\\s\\&]+");
+ if (dayPartTexts.length > 1 || dayPartTexts[0].length() > 0) {
+ dayParts = new DayPart[dayPartTexts.length];
+ for (int i = 0; i < dayParts.length; i++) {
+ dayParts[i] = new DayPart(dayPartTexts[i], dateFormat, this, i);
+ }
}
-
- dayParts = (DayPart[]) dayPartsList.toArray(new DayPart[dayPartsList.size()]);
+ else {
+ dayParts = new DayPart[0];
+ }
}
public void findNextDayPartStart(int dayPartIndex, Date date, Object[] result) {
@@ -73,10 +75,12 @@
if (dayParts[dayPartIndex].isStartAfter(date)) {
result[0] = dayParts[dayPartIndex].getStartTime(date);
result[1] = dayParts[dayPartIndex];
- } else {
- findNextDayPartStart(dayPartIndex+1, date, result);
}
- } else {
+ else {
+ findNextDayPartStart(dayPartIndex + 1, date, result);
+ }
+ }
+ else {
// descend recursively
date = businessCalendar.findStartOfNextDay(date);
Day nextDay = businessCalendar.findDay(date);
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/action/MailAction.java
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/action/MailAction.java 2010-02-23
00:10:51 UTC (rev 6191)
+++
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/action/MailAction.java 2010-02-23
08:47:50 UTC (rev 6192)
@@ -16,4 +16,8 @@
String text = jpdlReader.getProperty("text", element);
actionDelegation = jpdlReader.createMailDelegation(template, actors, to, subject,
text);
}
+
+ public String toString() {
+ return "MailAction(" + actionDelegation.getConfiguration() + ')';
+ }
}
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/action/Script.java
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/action/Script.java 2010-02-23
00:10:51 UTC (rev 6191)
+++
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/action/Script.java 2010-02-23
08:47:50 UTC (rev 6192)
@@ -48,8 +48,8 @@
private static final long serialVersionUID = 1L;
- protected String expression = null;
- protected Set variableAccesses = null;
+ protected String expression;
+ protected Set variableAccesses;
public void read(Element scriptElement, JpdlXmlReader jpdlReader) {
if (scriptElement.isTextOnly()) {
@@ -66,6 +66,10 @@
setVariables(outputMap, executionContext);
}
+ public String toString() {
+ return "Script(" + expression + ')';
+ }
+
public Map eval(Token token) throws Exception {
return eval(new ExecutionContext(token));
}
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Action.java
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Action.java 2010-02-23
00:10:51 UTC (rev 6191)
+++
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Action.java 2010-02-23
08:47:50 UTC (rev 6192)
@@ -88,19 +88,6 @@
jpdlReader.addWarning("action does not have class nor ref-name attribute:
"
+ actionElement.getPath());
}
-
- String acceptPropagatedEvents =
- actionElement.attributeValue("accept-propagated-events");
- isPropagationAllowed = jpdlReader.readBoolean(acceptPropagatedEvents, true);
-
- String asyncText = actionElement.attributeValue("async");
- if ("true".equalsIgnoreCase(asyncText)) {
- isAsync = true;
- }
- else if ("exclusive".equalsIgnoreCase(asyncText)) {
- isAsync = true;
- isAsyncExclusive = true;
- }
}
public void write(Element actionElement) {
@@ -136,25 +123,6 @@
}
}
- public void setName(String name) {
- // if the process definition is already set
- if (processDefinition != null) {
- // update the process definition action map
- Map actionMap = processDefinition.getActions();
- // the != string comparison is to avoid null pointer checks.
- // no problem if the body is executed a few times too much :-)
- if (this.name != name && actionMap != null) {
- actionMap.remove(this.name);
- actionMap.put(name, this);
- }
- }
-
- // then update the name
- this.name = name;
- }
-
- // equals ///////////////////////////////////////////////////////////////////
-
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Action)) return false;
@@ -218,10 +186,31 @@
return name;
}
+ public void setName(String name) {
+ // if the process definition is already set
+ if (processDefinition != null) {
+ // update the process definition action map
+ Map actionMap = processDefinition.getActions();
+ // the != string comparison is to avoid null pointer checks.
+ // no problem if the body is executed a few times too much :-)
+ if (this.name != name && actionMap != null) {
+ actionMap.remove(this.name);
+ actionMap.put(name, this);
+ }
+ }
+
+ // then update the name
+ this.name = name;
+ }
+
public Event getEvent() {
return event;
}
+ public void setEvent(Event event) {
+ this.event = event;
+ }
+
public ProcessDefinition getProcessDefinition() {
return processDefinition;
}
@@ -250,10 +239,19 @@
return isAsync;
}
+ public void setAsync(boolean isAsync) {
+ this.isAsync = isAsync;
+ }
+
public boolean isAsyncExclusive() {
return isAsyncExclusive;
}
+ public void setAsyncExclusive(boolean asyncExclusive) {
+ isAsyncExclusive = asyncExclusive;
+ if (asyncExclusive) isAsync = true;
+ }
+
public String getActionExpression() {
return actionExpression;
}
@@ -261,12 +259,4 @@
public void setActionExpression(String actionExpression) {
this.actionExpression = actionExpression;
}
-
- public void setEvent(Event event) {
- this.event = event;
- }
-
- public void setAsync(boolean isAsync) {
- this.isAsync = isAsync;
- }
}
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Node.java
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Node.java 2010-02-23
00:10:51 UTC (rev 6191)
+++
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Node.java 2010-02-23
08:47:50 UTC (rev 6192)
@@ -565,5 +565,6 @@
public void setAsyncExclusive(boolean isAsyncExclusive) {
this.isAsyncExclusive = isAsyncExclusive;
+ if (isAsyncExclusive) isAsync = true;
}
}
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/ProcessDefinition.java
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/ProcessDefinition.java 2010-02-23
00:10:51 UTC (rev 6191)
+++
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/ProcessDefinition.java 2010-02-23
08:47:50 UTC (rev 6192)
@@ -32,7 +32,6 @@
import java.util.List;
import java.util.Map;
import java.util.Properties;
-import java.util.StringTokenizer;
import java.util.zip.ZipInputStream;
import org.xml.sax.InputSource;
@@ -66,14 +65,12 @@
// event types //////////////////////////////////////////////////////////////
public static final String[] supportedEventTypes = {
- Event.EVENTTYPE_PROCESS_START, Event.EVENTTYPE_PROCESS_END,
- Event.EVENTTYPE_NODE_ENTER, Event.EVENTTYPE_NODE_LEAVE,
- Event.EVENTTYPE_TASK_CREATE, Event.EVENTTYPE_TASK_ASSIGN,
- Event.EVENTTYPE_TASK_START, Event.EVENTTYPE_TASK_END,
- Event.EVENTTYPE_TRANSITION, Event.EVENTTYPE_BEFORE_SIGNAL,
- Event.EVENTTYPE_AFTER_SIGNAL, Event.EVENTTYPE_SUPERSTATE_ENTER,
- Event.EVENTTYPE_SUPERSTATE_LEAVE, Event.EVENTTYPE_SUBPROCESS_CREATED,
- Event.EVENTTYPE_SUBPROCESS_END, Event.EVENTTYPE_TIMER
+ Event.EVENTTYPE_PROCESS_START, Event.EVENTTYPE_PROCESS_END,
Event.EVENTTYPE_NODE_ENTER,
+ Event.EVENTTYPE_NODE_LEAVE, Event.EVENTTYPE_TASK_CREATE,
Event.EVENTTYPE_TASK_ASSIGN,
+ Event.EVENTTYPE_TASK_START, Event.EVENTTYPE_TASK_END, Event.EVENTTYPE_TRANSITION,
+ Event.EVENTTYPE_BEFORE_SIGNAL, Event.EVENTTYPE_AFTER_SIGNAL,
+ Event.EVENTTYPE_SUPERSTATE_ENTER, Event.EVENTTYPE_SUPERSTATE_LEAVE,
+ Event.EVENTTYPE_SUBPROCESS_CREATED, Event.EVENTTYPE_SUBPROCESS_END,
Event.EVENTTYPE_TIMER
};
public String[] getSupportedEventTypes() {
@@ -95,15 +92,16 @@
for (Iterator iter = defaultModulesProperties.keySet().iterator(); iter.hasNext();)
{
String moduleClassName = (String) iter.next();
try {
- ModuleDefinition moduleDefinition = (ModuleDefinition)
ClassLoaderUtil.classForName(
- moduleClassName)
- .newInstance();
+ ModuleDefinition moduleDefinition = (ModuleDefinition)
ClassLoaderUtil.classForName(moduleClassName)
+ .newInstance();
processDefinition.addDefinition(moduleDefinition);
}
- catch (Exception e) {
- throw new JbpmException("could not instantiate module '"
- + moduleClassName + '\'', e);
+ catch (InstantiationException e) {
+ throw new JbpmException("could not instantiate " + moduleClassName,
e);
}
+ catch (IllegalAccessException e) {
+ throw new JbpmException("illegal access to " + moduleClassName, e);
+ }
}
return processDefinition;
}
@@ -133,7 +131,7 @@
public void setProcessDefinition(ProcessDefinition processDefinition) {
if (!equals(processDefinition)) {
throw new IllegalArgumentException(
- "process definition cannot reference another process definition");
+ "process definition cannot reference another process definition");
}
}
@@ -146,8 +144,7 @@
ProcessDefinition other = (ProcessDefinition) o;
if (id != 0 && id == other.getId()) return true;
- return name != null && name.equals(other.getName())
- && version == other.getVersion();
+ return name != null && name.equals(other.getName()) && version ==
other.getVersion();
}
public int hashCode() {
@@ -181,8 +178,7 @@
if (resourceURL == null) {
throw new JpdlException("resource not found: " + xmlResource);
}
- JpdlXmlReader jpdlReader = new JpdlXmlReader(new InputSource(
- resourceURL.toString()));
+ JpdlXmlReader jpdlReader = new JpdlXmlReader(new
InputSource(resourceURL.toString()));
return jpdlReader.readProcessDefinition();
}
@@ -211,8 +207,8 @@
*
* @throws org.jbpm.jpdl.JpdlException if parsing reported an error.
*/
- public static ProcessDefinition parseParZipInputStream(
- ZipInputStream zipInputStream) throws IOException {
+ public static ProcessDefinition parseParZipInputStream(ZipInputStream zipInputStream)
+ throws IOException {
return new ProcessArchive(zipInputStream).parseProcessDefinition();
}
@@ -221,10 +217,8 @@
*
* @throws org.jbpm.jpdl.JpdlException if parsing reported an error.
*/
- public static ProcessDefinition parseParResource(String parResource)
- throws IOException {
- return parseParZipInputStream(new ZipInputStream(
- ClassLoaderUtil.getStream(parResource)));
+ public static ProcessDefinition parseParResource(String parResource) throws IOException
{
+ return parseParZipInputStream(new
ZipInputStream(ClassLoaderUtil.getStream(parResource)));
}
// nodes ////////////////////////////////////////////////////////////////////
@@ -304,8 +298,8 @@
nodes.add(newIndex, node);
}
else {
- throw new IndexOutOfBoundsException("could not move node from "
- + oldIndex + " to " + newIndex);
+ throw new IndexOutOfBoundsException("could not move node from " +
oldIndex + " to "
+ + newIndex);
}
}
@@ -341,35 +335,39 @@
return false;
}
- public static Node findNode(NodeCollection nodeCollection,
- String hierarchicalName) {
- Node node = null;
- if (hierarchicalName != null && hierarchicalName.trim().length() > 0) {
+ public static Node findNode(NodeCollection nodeCollection, String hierarchicalName) {
+ String[] nameParts = hierarchicalName.split("/");
- if (hierarchicalName.charAt(0) == '/'
- && nodeCollection instanceof SuperState) {
- nodeCollection = ((SuperState) nodeCollection).getProcessDefinition();
- }
+ if (nameParts.length == 1) {
+ String nodeName = nameParts[0];
+ return nodeName.length() > 0 ? nodeCollection.getNode(nodeName) : null;
+ }
- StringTokenizer tokenizer = new StringTokenizer(hierarchicalName, "/");
- while (tokenizer.hasMoreElements()) {
- String namePart = tokenizer.nextToken();
- if ("..".equals(namePart)) {
- if (nodeCollection instanceof ProcessDefinition) {
- throw new JbpmException("could not find node '" +
hierarchicalName
- + "' because of a '..' on the process definition.");
- }
- nodeCollection = (NodeCollection) ((GraphElement) nodeCollection).getParent();
- }
- else if (tokenizer.hasMoreElements()) {
- nodeCollection = (NodeCollection) nodeCollection.getNode(namePart);
- }
- else {
- node = nodeCollection.getNode(namePart);
- }
+ GraphElement currentElement = (GraphElement) nodeCollection;
+ int startIndex = 0;
+ if (nameParts[0].length() == 0) {
+ // hierarchical name started with a '/'
+ currentElement = currentElement.getProcessDefinition();
+ startIndex = 1;
+ }
+
+ for (int i = startIndex; i < nameParts.length; i++) {
+ String namePart = nameParts[i];
+ if ("..".equals(namePart)) {
+ // namePart calls for parent, but current element is absent
+ if (currentElement == null) return null;
+ currentElement = currentElement.getParent();
}
+ else {
+ // namePart calls for child, but current element is not a collection
+ if (!(currentElement instanceof NodeCollection)) return null;
+ NodeCollection currentCollection = (NodeCollection) currentElement;
+ currentElement = currentCollection.getNode(namePart);
+ }
}
- return node;
+
+ // current element could be the process definition or might be absent
+ return currentElement instanceof Node ? (Node) currentElement : null;
}
public void setStartState(StartState startState) {
@@ -421,8 +419,7 @@
}
if (actions != null) {
if (!actions.containsValue(action)) {
- throw new IllegalArgumentException(
- "action is not present in process definition");
+ throw new IllegalArgumentException("action is not present in process
definition");
}
actions.remove(action.getName());
action.processDefinition = null;
@@ -466,7 +463,7 @@
ModuleDefinition removedDefinition = null;
if (definitions != null) {
removedDefinition = (ModuleDefinition)
definitions.remove(moduleDefinition.getClass()
- .getName());
+ .getName());
if (removedDefinition != null) {
moduleDefinition.setProcessDefinition(null);
}
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/exe/ExecutionContext.java
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/exe/ExecutionContext.java 2010-02-23
00:10:51 UTC (rev 6191)
+++
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/exe/ExecutionContext.java 2010-02-23
08:47:50 UTC (rev 6192)
@@ -21,10 +21,13 @@
*/
package org.jbpm.graph.exe;
-import java.util.Stack;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
import org.jbpm.JbpmContext;
-import org.jbpm.JbpmException;
import org.jbpm.context.exe.ContextInstance;
import org.jbpm.graph.def.Action;
import org.jbpm.graph.def.Event;
@@ -74,9 +77,7 @@
public void setAction(Action action) {
this.action = action;
- if (action != null) {
- this.event = action.getEvent();
- }
+ if (action != null) this.event = action.getEvent();
}
public ProcessInstance getProcessInstance() {
@@ -84,7 +85,7 @@
}
public String toString() {
- return "ExecutionContext[" + token + "]";
+ return "ExecutionContext(" + token.getName() + ')';
}
// convenience methods //////////////////////////////////////////////////////
@@ -105,36 +106,32 @@
* get a process variable.
*/
public Object getVariable(String name) {
- if (taskInstance != null) {
- return taskInstance.getVariable(name);
- }
- else {
- return getContextInstance().getVariable(name, token);
- }
+ return taskInstance != null ? taskInstance.getVariable(name)
+ : getContextInstance().getVariable(name, token);
}
/**
- * leave this node over the default transition. This method is only available on node
actions.
- * Not on actions that are executed on events. Actions on events cannot change the flow
of
- * execution.
+ * leave this node over the default transition. This method is only available
+ * on node actions. Not on actions that are executed on events. Actions on
+ * events cannot change the flow of execution.
*/
public void leaveNode() {
getNode().leave(this);
}
/**
- * leave this node over the given transition. This method is only available on node
actions.
- * Not on actions that are executed on events. Actions on events cannot change the flow
of
- * execution.
+ * leave this node over the given transition. This method is only available on
+ * node actions. Not on actions that are executed on events. Actions on events
+ * cannot change the flow of execution.
*/
public void leaveNode(String transitionName) {
getNode().leave(this, transitionName);
}
/**
- * leave this node over the given transition. This method is only available on node
actions.
- * Not on actions that are executed on events. Actions on events cannot change the flow
of
- * execution.
+ * leave this node over the given transition. This method is only available on
+ * node actions. Not on actions that are executed on events. Actions on events
+ * cannot change the flow of execution.
*/
public void leaveNode(Transition transition) {
getNode().leave(this, transition);
@@ -145,8 +142,11 @@
}
public ModuleInstance getInstance(Class clazz) {
- ProcessInstance processInstance = (token != null ? token.getProcessInstance() :
null);
- return (processInstance != null ? processInstance.getInstance(clazz) : null);
+ if (token != null) {
+ ProcessInstance processInstance = token.getProcessInstance();
+ if (processInstance != null) return processInstance.getInstance(clazz);
+ }
+ return null;
}
public ContextInstance getContextInstance() {
@@ -165,7 +165,7 @@
public void setTaskInstance(TaskInstance taskInstance) {
this.taskInstance = taskInstance;
- this.task = (taskInstance != null ? taskInstance.getTask() : null);
+ this.task = taskInstance != null ? taskInstance.getTask() : null;
}
public Token getToken() {
@@ -246,34 +246,41 @@
// thread local execution context
- static ThreadLocal threadLocalContextStack = new ThreadLocal();
+ static ThreadLocal threadLocalContextStack = new ThreadLocal() {
+ protected Object initialValue() {
+ return new ArrayList();
+ }
+ };
- static Stack getContextStack() {
- Stack stack = (Stack) threadLocalContextStack.get();
- if (stack == null) {
- stack = new Stack();
- threadLocalContextStack.set(stack);
- }
- return stack;
+ static List getContextStack() {
+ return (List) threadLocalContextStack.get();
}
public static void pushCurrentContext(ExecutionContext executionContext) {
- getContextStack().push(executionContext);
+ getContextStack().add(executionContext);
}
public static void popCurrentContext(ExecutionContext executionContext) {
- if (getContextStack().pop() != executionContext) {
- throw new JbpmException(
- "current execution context mismatch. make sure that every pushed context
gets popped");
+ List stack = getContextStack();
+ int index = stack.lastIndexOf(executionContext);
+ if (index == -1) {
+ log.warn(executionContext + " was not found in thread-local stack;"
+ + " do not access ExecutionContext instances from multiple threads");
}
+ else {
+ if (index < stack.size() - 1) {
+ log.warn(executionContext + " was not popped in reverse push order;"
+ + " make sure you pop every context you push");
+ }
+ // remove execution context from stack, no matter what
+ stack.remove(index);
+ }
}
public static ExecutionContext currentExecutionContext() {
- ExecutionContext executionContext = null;
- Stack stack = getContextStack();
- if (!stack.isEmpty()) {
- executionContext = (ExecutionContext) stack.peek();
- }
- return executionContext;
+ List stack = getContextStack();
+ return stack.isEmpty() ? null : (ExecutionContext) stack.get(stack.size() - 1);
}
+
+ private static final Log log = LogFactory.getLog(ExecutionContext.class);
}
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/exe/Token.java
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/exe/Token.java 2010-02-23
00:10:51 UTC (rev 6191)
+++
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/exe/Token.java 2010-02-23
08:47:50 UTC (rev 6192)
@@ -136,10 +136,11 @@
if (node == null) {
throw new JbpmException(this + " is not positioned in a node");
}
- if (node.getDefaultLeavingTransition() == null) {
+ Transition defaultTransition = node.getDefaultLeavingTransition();
+ if (defaultTransition == null) {
throw new JbpmException(node + " has no default transition");
}
- signal(node.getDefaultLeavingTransition(), new ExecutionContext(this));
+ signal(defaultTransition, new ExecutionContext(this));
}
/**
@@ -148,7 +149,7 @@
*/
public void signal(String transitionName) {
if (node == null) {
- throw new JbpmException(this + "' is not positioned in a node");
+ throw new JbpmException(this + " is not positioned in a node");
}
Transition leavingTransition = node.getLeavingTransition(transitionName);
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/job/Timer.java
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/job/Timer.java 2010-02-23
00:10:51 UTC (rev 6191)
+++
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/job/Timer.java 2010-02-23
08:47:50 UTC (rev 6192)
@@ -44,7 +44,7 @@
// first fire the event if there is a graph element specified
if (graphElement != null) {
- graphElement.fireAndPropagateEvent(Event.EVENTTYPE_TIMER, executionContext);
+ graphElement.fireEvent(Event.EVENTTYPE_TIMER, executionContext);
}
// then execute the action if there is one
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/jpdl/xml/JpdlXmlReader.java
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/jpdl/xml/JpdlXmlReader.java 2010-02-23
00:10:51 UTC (rev 6191)
+++
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/jpdl/xml/JpdlXmlReader.java 2010-02-23
08:47:50 UTC (rev 6192)
@@ -29,7 +29,6 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.StringTokenizer;
import org.dom4j.Document;
import org.dom4j.DocumentException;
@@ -202,8 +201,7 @@
else {
Task startTask = taskMgmtDefinition.getStartTask();
if (startTask == null || startTask.getSwimlane() != swimlane) {
- addWarning("swimlane '" + swimlaneName
- + "' does not have an assignment");
+ addWarning("swimlane '" + swimlaneName + "' does not
have an assignment");
}
}
taskMgmtDefinition.addSwimlane(swimlane);
@@ -224,8 +222,7 @@
node.setProcessDefinition(processDefinition);
// check for duplicate start-states
- if (node instanceof StartState
- && processDefinition.getStartState() != null) {
+ if (node instanceof StartState && processDefinition.getStartState() !=
null) {
addError("max one start-state allowed in a process");
}
else {
@@ -262,8 +259,8 @@
}
}
- public Task readTask(Element taskElement,
- TaskMgmtDefinition taskMgmtDefinition, TaskNode taskNode) {
+ public Task readTask(Element taskElement, TaskMgmtDefinition taskMgmtDefinition,
+ TaskNode taskNode) {
Task task = new Task();
task.setProcessDefinition(processDefinition);
@@ -353,8 +350,8 @@
// if no assignment or swimlane is specified
else {
// user has to manage assignment manually, so better inform him/her
- addProblem(new Problem(Problem.LEVEL_INFO,
- "no assignment specified for task: " + taskElement.getPath()));
+ addProblem(new Problem(Problem.LEVEL_INFO, "no assignment specified for task:
"
+ + taskElement.getPath()));
}
// notify
@@ -366,11 +363,7 @@
event = new Event(notificationEvent);
task.addEvent(event);
}
- Delegation delegation = createMailDelegation(notificationEvent,
- null,
- null,
- null,
- null);
+ Delegation delegation = createMailDelegation(notificationEvent, null, null, null,
null);
Action action = new Action(delegation);
action.setProcessDefinition(processDefinition);
action.setName(task.getName());
@@ -404,8 +397,7 @@
if (expression != null) {
assignmentDelegation.setProcessDefinition(processDefinition);
assignmentDelegation.setClassName("org.jbpm.identity.assignment.ExpressionAssignmentHandler");
- assignmentDelegation.setConfiguration("<expression>" + expression
- + "</expression>");
+ assignmentDelegation.setConfiguration("<expression>" + expression +
"</expression>");
}
else if (actorId != null || pooledActors != null) {
assignmentDelegation.setProcessDefinition(processDefinition);
@@ -464,15 +456,11 @@
TaskMgmtDefinition taskMgmtDefinition = processDefinition.getTaskMgmtDefinition();
Task startTask = readTask(startTaskElement, taskMgmtDefinition, null);
startTask.setStartState(startState);
- if (startTask.getName() == null) {
- startTask.setName(startState.getName());
- }
+ if (startTask.getName() == null) startTask.setName(startState.getName());
taskMgmtDefinition.setStartTask(startTask);
}
- public void readNode(Element nodeElement, Node node,
- NodeCollection nodeCollection) {
-
+ public void readNode(Element nodeElement, Node node, NodeCollection nodeCollection) {
// first put the node in its collection. this is done so that the
// setName later on will be able to differentiate between nodes contained in
// processDefinitions and nodes contained in superstates
@@ -484,8 +472,7 @@
node.setName(name);
// check if this is the initial node
- if (initialNodeName != null
- && initialNodeName.equals(node.getFullyQualifiedName())) {
+ if (initialNodeName != null &&
initialNodeName.equals(node.getFullyQualifiedName())) {
processDefinition.setStartState(node);
}
}
@@ -497,12 +484,11 @@
}
String asyncText = nodeElement.attributeValue("async");
- if ("true".equalsIgnoreCase(asyncText)) {
- node.setAsync(true);
+ if ("exclusive".equalsIgnoreCase(asyncText)) {
+ node.setAsyncExclusive(true);
}
- else if ("exclusive".equalsIgnoreCase(asyncText)) {
+ else if (readBoolean(asyncText, false)) {
node.setAsync(true);
- node.setAsyncExclusive(true);
}
// parse common subelements
@@ -562,37 +548,30 @@
action = readSingleAction(timerElement);
}
else {
- Delegation delegation = createMailDelegation("task-reminder",
- null,
- null,
- null,
- null);
+ Delegation delegation = createMailDelegation("task-reminder", null, null,
null, null);
action = new Action(delegation);
}
createTimerAction.setTimerAction(action);
addAction(task, Event.EVENTTYPE_TASK_CREATE, createTimerAction);
// read the cancel-event types
- Collection cancelEventTypes = new ArrayList();
-
- String cancelEventTypeText = timerElement.attributeValue("cancel-event");
- if (cancelEventTypeText != null) {
+ String cancelEventText = timerElement.attributeValue("cancel-event");
+ if (cancelEventText != null) {
// cancel-event is a comma separated list of events
- StringTokenizer tokenizer = new StringTokenizer(cancelEventTypeText,
",");
- while (tokenizer.hasMoreTokens()) {
- cancelEventTypes.add(tokenizer.nextToken().trim());
+ String[] cancelEventTypes = cancelEventText.split("[\\s,]+");
+ if (cancelEventTypes.length > 1 || cancelEventTypes[0].length() > 0) {
+ for (int i = 0; i < cancelEventTypes.length; i++) {
+ CancelTimerAction cancelTimerAction = new CancelTimerAction();
+ cancelTimerAction.setTimerName(name);
+ addAction(task, cancelEventTypes[i], cancelTimerAction);
+ }
}
}
else {
- // set the default
- cancelEventTypes.add(Event.EVENTTYPE_TASK_END);
- }
-
- for (Iterator iter = cancelEventTypes.iterator(); iter.hasNext();) {
- String cancelEventType = (String) iter.next();
+ // cancel on task end by default
CancelTimerAction cancelTimerAction = new CancelTimerAction();
cancelTimerAction.setTimerName(name);
- addAction(task, cancelEventType, cancelTimerAction);
+ addAction(task, Event.EVENTTYPE_TASK_END, cancelTimerAction);
}
}
@@ -607,8 +586,7 @@
}
}
- public void readActions(Element eventElement, GraphElement graphElement,
- String eventType) {
+ public void readActions(Element eventElement, GraphElement graphElement, String
eventType) {
// for all the elements in the event element
for (Iterator iter = eventElement.elementIterator(); iter.hasNext();) {
Element actionElement = (Element) iter.next();
@@ -623,8 +601,7 @@
}
}
- protected void addAction(GraphElement graphElement, String eventType,
- Action action) {
+ protected void addAction(GraphElement graphElement, String eventType, Action action) {
Event event = graphElement.getEvent(eventType);
if (event == null) {
event = new Event(eventType);
@@ -651,8 +628,10 @@
try {
// instantiate action
Action action = (Action) actionType.newInstance();
- // read the common node parts of the action
+ // read the common action parts of the element
readAction(actionElement, action);
+ // let action parse its special configuration
+ action.read(actionElement, this);
return action;
}
catch (InstantiationException e) {
@@ -663,29 +642,35 @@
}
}
- public void readAction(Element element, Action action) {
+ public void readAction(Element actionElement, Action action) {
// if a name is specified for this action
- String actionName = element.attributeValue("name");
+ String actionName = actionElement.attributeValue("name");
if (actionName != null) {
action.setName(actionName);
// add the action to the named process action repository
processDefinition.addAction(action);
}
- // let action parse its special configuration
- action.read(element, this);
+ String acceptPropagatedEvents =
actionElement.attributeValue("accept-propagated-events");
+ action.setPropagationAllowed(readBoolean(acceptPropagatedEvents, true));
+
+ String asyncText = actionElement.attributeValue("async");
+ if ("exclusive".equalsIgnoreCase(asyncText)) {
+ action.setAsyncExclusive(true);
+ }
+ else if (readBoolean(asyncText, false)) {
+ action.setAsync(true);
+ }
}
- protected void readExceptionHandlers(Element graphDomElement,
- GraphElement graphElement) {
+ protected void readExceptionHandlers(Element graphDomElement, GraphElement
graphElement) {
for (Iterator iter = graphDomElement.elementIterator("exception-handler");
iter.hasNext();) {
Element exceptionHandlerElement = (Element) iter.next();
readExceptionHandler(exceptionHandlerElement, graphElement);
}
}
- protected void readExceptionHandler(Element exceptionHandlerElement,
- GraphElement graphElement) {
+ protected void readExceptionHandler(Element exceptionHandlerElement, GraphElement
graphElement) {
// create the exception handler
ExceptionHandler exceptionHandler = new ExceptionHandler();
exceptionHandler.setExceptionClassName(exceptionHandlerElement.attributeValue("exception-class"));
@@ -731,8 +716,7 @@
* (useful, if you want to override this method to read additional
* configuration properties)
*/
- public Transition resolveTransitionDestination(Element transitionElement,
- Node node) {
+ public Transition resolveTransitionDestination(Element transitionElement, Node node) {
Transition transition = new Transition();
transition.setProcessDefinition(processDefinition);
@@ -764,8 +748,7 @@
else {
Node to = ((NodeCollection) node.getParent()).findNode(toName);
if (to == null) {
- addWarning("transition to='" + toName + "' on node
'"
- + node.getFullyQualifiedName() + "' cannot be resolved");
+ addWarning("transition to '" + toName + "' from " +
node + " cannot be resolved");
}
else {
to.addArrivingTransition(transition);
@@ -802,19 +785,15 @@
public void verifySwimlaneAssignments() {
TaskMgmtDefinition taskMgmtDefinition = processDefinition.getTaskMgmtDefinition();
Map swimlanes;
- if (taskMgmtDefinition != null
- && (swimlanes = taskMgmtDefinition.getSwimlanes()) != null) {
+ if (taskMgmtDefinition != null && (swimlanes =
taskMgmtDefinition.getSwimlanes()) != null) {
for (Iterator iter = swimlanes.values().iterator(); iter.hasNext();) {
Swimlane swimlane = (Swimlane) iter.next();
Task startTask = taskMgmtDefinition.getStartTask();
- Swimlane startTaskSwimlane = startTask != null ? startTask.getSwimlane()
- : null;
+ Swimlane startTaskSwimlane = startTask != null ? startTask.getSwimlane() : null;
- if (swimlane.getAssignmentDelegation() == null
- && swimlane != startTaskSwimlane) {
- addWarning("swimlane '" + swimlane.getName()
- + "' does not have an assignment");
+ if (swimlane.getAssignmentDelegation() == null && swimlane !=
startTaskSwimlane) {
+ addWarning("swimlane '" + swimlane.getName() + "' does
not have an assignment");
}
}
}
@@ -822,8 +801,8 @@
// mail delegations /////////////////////////////////////////////////////////
- public Delegation createMailDelegation(String template, String actors,
- String to, String subject, String text) {
+ public Delegation createMailDelegation(String template, String actors, String to,
+ String subject, String text) {
StringBuffer config = new StringBuffer();
if (template != null) {
config.append("<template>");
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/scheduler/def/CancelTimerAction.java
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/scheduler/def/CancelTimerAction.java 2010-02-23
00:10:51 UTC (rev 6191)
+++
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/scheduler/def/CancelTimerAction.java 2010-02-23
08:47:50 UTC (rev 6192)
@@ -48,6 +48,10 @@
schedulerService.deleteTimersByName(timerName, executionContext.getToken());
}
+ public String toString() {
+ return "CancelTimerAction(" + timerName + ')';
+ }
+
public String getTimerName() {
return timerName;
}
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/scheduler/def/CreateTimerAction.java
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/scheduler/def/CreateTimerAction.java 2010-02-23
00:10:51 UTC (rev 6191)
+++
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/scheduler/def/CreateTimerAction.java 2010-02-23
08:47:50 UTC (rev 6192)
@@ -79,6 +79,10 @@
schedulerService.createTimer(timer);
}
+ public String toString() {
+ return "CreateTimerAction(" + timerName + ')';
+ }
+
protected Timer createTimer(ExecutionContext executionContext) {
Timer timer = new Timer(executionContext.getToken());
timer.setName(timerName);
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.2.xsd
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.2.xsd 2010-02-23
00:10:51 UTC (rev 6191)
+++
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/jpdl/xml/jpdl-3.2.xsd 2010-02-23
08:47:50 UTC (rev 6192)
@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema xmlns= "urn:jbpm.org:jpdl-3.2"
- targetNamespace="urn:jbpm.org:jpdl-3.2"
-
xmlns:xs="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified">
+<xs:schema xmlns="urn:jbpm.org:jpdl-3.2"
targetNamespace="urn:jbpm.org:jpdl-3.2"
+
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<!-- PROCESS-DEFINITION -->
<!-- ################## -->
@@ -13,8 +11,8 @@
<xs:element ref="description" />
<xs:element ref="swimlane" />
<xs:element ref="start-state" />
- <xs:group ref="node-elements"/>
- <xs:group ref="action-elements" />
+ <xs:group ref="node-elements" />
+ <xs:group ref="action-elements" />
<xs:element ref="event" />
<xs:element ref="exception-handler" />
<xs:element ref="task" />
@@ -28,7 +26,7 @@
<xs:element name="swimlane">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="1">
- <xs:element ref="assignment"/>
+ <xs:element ref="assignment" />
</xs:sequence>
<xs:attribute name="name" type="xs:string"
use="required" />
</xs:complexType>
@@ -40,12 +38,12 @@
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="description" />
- <xs:element ref="task"/>
- <xs:element ref="transition"/>
- <xs:element ref="event"/>
- <xs:element ref="exception-handler"/>
+ <xs:element ref="task" />
+ <xs:element ref="transition" />
+ <xs:element ref="event" />
+ <xs:element ref="exception-handler" />
</xs:choice>
- <xs:attribute name="name" type="xs:string"/>
+ <xs:attribute name="name" type="xs:string" />
</xs:complexType>
</xs:element>
@@ -53,11 +51,12 @@
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="description" />
- <xs:element ref="event"/>
- <xs:element ref="exception-handler"/>
+ <xs:element ref="event" />
+ <xs:element ref="exception-handler" />
</xs:choice>
- <xs:attribute name="name" type="xs:string"
use="required"/>
- <xs:attribute name="end-complete-process" type="booleanType"
use="optional" default="false"/>
+ <xs:attribute name="name" type="xs:string"
use="required" />
+ <xs:attribute name="end-complete-process" type="booleanType"
use="optional"
+ default="false" />
</xs:complexType>
</xs:element>
@@ -66,13 +65,13 @@
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="description" />
<xs:element name="handler" type="delegation" />
- <xs:element ref="event"/>
- <xs:element ref="exception-handler"/>
- <xs:element ref="transition"/>
+ <xs:element ref="event" />
+ <xs:element ref="exception-handler" />
+ <xs:element ref="transition" />
</xs:choice>
- <xs:attribute name="name" type="xs:string"
use="required"/>
+ <xs:attribute name="name" type="xs:string"
use="required" />
<xs:attribute name="expression" type="xs:string" />
- <xs:attribute name="async" type="xs:string"
default="false" />
+ <xs:attribute name="async" type="asyncType"
default="false" />
</xs:complexType>
</xs:element>
@@ -82,18 +81,18 @@
<xs:element ref="script" />
<xs:group ref="node-content-elements" />
</xs:choice>
- <xs:attribute name="name" type="xs:string"
use="required"/>
- <xs:attribute name="async" type="xs:string"
default="false" />
+ <xs:attribute name="name" type="xs:string"
use="required" />
+ <xs:attribute name="async" type="asyncType"
default="false" />
</xs:complexType>
</xs:element>
-
+
<xs:element name="join">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="node-content-elements" />
</xs:choice>
- <xs:attribute name="name" type="xs:string"
use="required"/>
- <xs:attribute name="async" type="xs:string"
default="false" />
+ <xs:attribute name="name" type="xs:string"
use="required" />
+ <xs:attribute name="async" type="asyncType"
default="false" />
</xs:complexType>
</xs:element>
@@ -107,49 +106,48 @@
<xs:group ref="node-content-elements" />
</xs:choice>
</xs:sequence>
- <xs:attribute name="name" type="xs:string"
use="required"/>
- <xs:attribute name="async" type="xs:string"
default="false" />
+ <xs:attribute name="name" type="xs:string"
use="required" />
+ <xs:attribute name="async" type="asyncType"
default="false" />
</xs:complexType>
</xs:element>
<xs:element name="process-state">
<xs:complexType>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="sub-process">
- <xs:complexType>
- <xs:attribute name="name" type="xs:string"
- use="required" />
- <xs:attribute name="version" type="xs:integer" />
- <xs:attribute name="binding" type="xs:string" />
- </xs:complexType>
- </xs:element>
- <xs:element ref="variable" />
- <xs:group ref="node-content-elements" />
- </xs:choice>
- <xs:attribute name="name" type="xs:string"
use="required" />
- <xs:attribute name="async" type="xs:string"
default="false" />
- <xs:attribute name="binding"
type="bindingType"></xs:attribute>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="sub-process">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string"
use="required" />
+ <xs:attribute name="version" type="xs:integer" />
+ <xs:attribute name="binding" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+ <xs:element ref="variable" />
+ <xs:group ref="node-content-elements" />
+ </xs:choice>
+ <xs:attribute name="name" type="xs:string"
use="required" />
+ <xs:attribute name="async" type="asyncType"
default="false" />
+ <xs:attribute name="binding" type="bindingType" />
</xs:complexType>
</xs:element>
<xs:element name="state">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:group ref="node-content-elements"/>
+ <xs:group ref="node-content-elements" />
</xs:choice>
- <xs:attribute name="name" type="xs:string"
use="required"/>
- <xs:attribute name="async" type="xs:string"
default="false" />
+ <xs:attribute name="name" type="xs:string"
use="required" />
+ <xs:attribute name="async" type="asyncType"
default="false" />
</xs:complexType>
</xs:element>
<xs:element name="super-state">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:group ref="node-elements"/>
- <xs:group ref="node-content-elements"/>
+ <xs:group ref="node-elements" />
+ <xs:group ref="node-content-elements" />
</xs:choice>
- <xs:attribute name="name" type="xs:string"
use="required"/>
- <xs:attribute name="async" type="xs:string"
default="false" />
+ <xs:attribute name="name" type="xs:string"
use="required" />
+ <xs:attribute name="async" type="asyncType"
default="false" />
</xs:complexType>
</xs:element>
@@ -159,22 +157,22 @@
<xs:element ref="task" />
<xs:group ref="node-content-elements" />
</xs:choice>
- <xs:attribute name="name" type="xs:string"
use="required"/>
+ <xs:attribute name="name" type="xs:string"
use="required" />
<xs:attribute name="create-tasks" type="booleanType"
default="true" />
<xs:attribute name="end-tasks" type="booleanType"
default="false" />
<xs:attribute name="signal" default="last">
<xs:simpleType>
<xs:restriction base="xs:string">
- <xs:enumeration value="unsynchronized"/>
- <xs:enumeration value="never"/>
- <xs:enumeration value="first"/>
- <xs:enumeration value="first-wait"/>
- <xs:enumeration value="last"/>
- <xs:enumeration value="last-wait"/>
+ <xs:enumeration value="unsynchronized" />
+ <xs:enumeration value="never" />
+ <xs:enumeration value="first" />
+ <xs:enumeration value="first-wait" />
+ <xs:enumeration value="last" />
+ <xs:enumeration value="last-wait" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
- <xs:attribute name="async" type="xs:string"
default="false" />
+ <xs:attribute name="async" type="asyncType"
default="false" />
</xs:complexType>
</xs:element>
@@ -183,15 +181,15 @@
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="subject" />
<xs:element ref="text" />
- <xs:group ref="node-content-elements"/>
+ <xs:group ref="node-content-elements" />
</xs:choice>
- <xs:attribute name="name" type="xs:string"
use="required"/>
- <xs:attribute name="async" type="xs:string"
default="false" />
- <xs:attribute name="template" type="xs:string"/>
- <xs:attribute name="actors" type="xs:string"/>
- <xs:attribute name="to" type="xs:string"/>
- <xs:attribute name="subject" type="xs:string"/>
- <xs:attribute name="text" type="xs:string"/>
+ <xs:attribute name="name" type="xs:string"
use="required" />
+ <xs:attribute name="async" type="asyncType"
default="false" />
+ <xs:attribute name="template" type="xs:string" />
+ <xs:attribute name="actors" type="xs:string" />
+ <xs:attribute name="to" type="xs:string" />
+ <xs:attribute name="subject" type="xs:string" />
+ <xs:attribute name="text" type="xs:string" />
</xs:complexType>
</xs:element>
@@ -201,16 +199,16 @@
<xs:element name="transition">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element ref="description" />
- <xs:element name="condition">
- <xs:complexType mixed="true">
- <xs:sequence minOccurs="0" maxOccurs="unbounded">
- <xs:any processContents="lax" minOccurs="0"
maxOccurs="unbounded" />
- </xs:sequence>
- <xs:attribute name="expression" type="xs:string"
/>
- </xs:complexType>
- </xs:element>
- <xs:group ref="action-elements"/>
+ <xs:element ref="description" />
+ <xs:element name="condition">
+ <xs:complexType mixed="true">
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:any processContents="lax" minOccurs="0"
maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:attribute name="expression" type="xs:string"
/>
+ </xs:complexType>
+ </xs:element>
+ <xs:group ref="action-elements" />
<xs:element ref="exception-handler" />
</xs:choice>
<xs:attribute name="to" type="xs:string"
use="required" />
@@ -231,7 +229,7 @@
<xs:attribute name="ref-name" type="xs:string" />
<xs:attribute name="accept-propagated-events"
type="booleanType" default="true" />
<xs:attribute name="expression" type="xs:string" />
- <xs:attribute name="async" type="xs:string" />
+ <xs:attribute name="async" type="asyncType"
default="false" />
</xs:complexType>
</xs:element>
@@ -243,9 +241,9 @@
<xs:element name="create-timer">
<xs:complexType>
- <xs:choice minOccurs="0">
- <xs:element ref="action"/>
- <xs:element ref="script"/>
+ <xs:choice minOccurs="0">
+ <xs:element ref="action" />
+ <xs:element ref="script" />
</xs:choice>
<xs:attribute name="duedate" type="xs:string"
use="required" />
<xs:attribute name="name" type="xs:string" />
@@ -255,12 +253,13 @@
</xs:element>
<xs:element name="script">
- <xs:complexType mixed="true">
+ <xs:complexType mixed="true">
<xs:sequence>
<xs:any processContents="lax" minOccurs="0"
maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="name" type="xs:string" />
<xs:attribute name="accept-propagated-events"
type="booleanType" default="true" />
+ <xs:attribute name="async" type="asyncType"
default="false" />
</xs:complexType>
</xs:element>
@@ -270,13 +269,14 @@
<xs:element ref="subject" />
<xs:element ref="text" />
</xs:choice>
- <xs:attribute name="name" type="xs:string"
use="required"/>
- <xs:attribute name="async" type="xs:string"
default="false" />
- <xs:attribute name="template" type="xs:string"/>
- <xs:attribute name="actors" type="xs:string"/>
- <xs:attribute name="to" type="xs:string"/>
- <xs:attribute name="subject" type="xs:string"/>
- <xs:attribute name="text" type="xs:string"/>
+ <xs:attribute name="name" type="xs:string"
use="required" />
+ <xs:attribute name="async" type="asyncType"
default="false" />
+ <xs:attribute name="template" type="xs:string" />
+ <xs:attribute name="actors" type="xs:string" />
+ <xs:attribute name="to" type="xs:string" />
+ <xs:attribute name="subject" type="xs:string" />
+ <xs:attribute name="text" type="xs:string" />
+ <xs:attribute name="accept-propagated-events"
type="booleanType" default="true" />
</xs:complexType>
</xs:element>
@@ -285,31 +285,31 @@
<xs:element name="event">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:group ref="action-elements"/>
+ <xs:group ref="action-elements" />
</xs:choice>
<xs:attribute name="type" use="required">
<xs:simpleType>
<xs:union>
<xs:simpleType>
- <xs:restriction base="xs:string"/>
+ <xs:restriction base="xs:string" />
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="xs:string">
- <xs:enumeration value="node-enter"/>
- <xs:enumeration value="node-leave"/>
- <xs:enumeration value="process-start"/>
- <xs:enumeration value="process-end"/>
- <xs:enumeration value="task-create"/>
- <xs:enumeration value="task-assign"/>
- <xs:enumeration value="task-start"/>
- <xs:enumeration value="task-end"/>
- <xs:enumeration value="before-signal"/>
- <xs:enumeration value="after-signal"/>
- <xs:enumeration value="superstate-enter"/>
- <xs:enumeration value="superstate-leave"/>
- <xs:enumeration value="timer-create"/>
- <xs:enumeration value="subprocess-created"/>
- <xs:enumeration value="subprocess-end"/>
+ <xs:enumeration value="node-enter" />
+ <xs:enumeration value="node-leave" />
+ <xs:enumeration value="process-start" />
+ <xs:enumeration value="process-end" />
+ <xs:enumeration value="task-create" />
+ <xs:enumeration value="task-assign" />
+ <xs:enumeration value="task-start" />
+ <xs:enumeration value="task-end" />
+ <xs:enumeration value="before-signal" />
+ <xs:enumeration value="after-signal" />
+ <xs:enumeration value="superstate-enter" />
+ <xs:enumeration value="superstate-leave" />
+ <xs:enumeration value="timer-create" />
+ <xs:enumeration value="subprocess-created" />
+ <xs:enumeration value="subprocess-end" />
</xs:restriction>
</xs:simpleType>
</xs:union>
@@ -323,10 +323,10 @@
<xs:element name="exception-handler">
<xs:complexType>
<xs:choice minOccurs="1" maxOccurs="unbounded">
- <xs:element ref="action"/>
- <xs:element ref="script"/>
+ <xs:element ref="action" />
+ <xs:element ref="script" />
</xs:choice>
- <xs:attribute name="exception-class" type="xs:string"/>
+ <xs:attribute name="exception-class" type="xs:string" />
</xs:complexType>
</xs:element>
@@ -336,10 +336,10 @@
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="description" />
- <xs:element ref="assignment"/>
- <xs:element ref="controller"/>
- <xs:element ref="event"/>
- <xs:element ref="timer"/>
+ <xs:element ref="assignment" />
+ <xs:element ref="controller" />
+ <xs:element ref="event" />
+ <xs:element ref="timer" />
<xs:element name="reminder">
<xs:complexType>
<xs:attribute name="duedate" type="xs:string"
use="required" />
@@ -348,16 +348,16 @@
</xs:element>
</xs:choice>
<xs:attribute name="name" type="xs:string" />
- <xs:attribute name="blocking" type="booleanType"
default="false"/>
- <xs:attribute name="signalling" type="booleanType"
default="true"/>
+ <xs:attribute name="blocking" type="booleanType"
default="false" />
+ <xs:attribute name="signalling" type="booleanType"
default="true" />
<xs:attribute name="description" type="xs:string" />
<xs:attribute name="duedate" type="xs:string" />
<xs:attribute name="swimlane" type="xs:string" />
<xs:attribute name="priority" type="priorityType"
default="normal" />
- <xs:attribute name="notify" type="booleanType"
default="false"/>
+ <xs:attribute name="notify" type="booleanType"
default="false" />
</xs:complexType>
</xs:element>
-
+
<xs:element name="controller" type="delegation" />
<xs:element name="assignment">
@@ -391,19 +391,19 @@
<xs:sequence>
<xs:any processContents="lax" minOccurs="0"
maxOccurs="unbounded" />
</xs:sequence>
- <xs:attribute name="name" type="xs:string"
use="required"/>
- <xs:attribute name="access" type="xs:string"
default="read,write"/>
+ <xs:attribute name="name" type="xs:string"
use="required" />
+ <xs:attribute name="access" type="xs:string"
default="read,write" />
<xs:attribute name="mapped-name" type="xs:string" />
</xs:complexType>
</xs:element>
<!-- MAIL -->
<!-- #### -->
- <xs:element name="to" type="xs:string"/>
- <xs:element name="recipients" type="xs:string"/>
- <xs:element name="subject" type="xs:string"/>
- <xs:element name="text" type="xs:string"/>
- <xs:element name="template" type="xs:string"/>
+ <xs:element name="to" type="xs:string" />
+ <xs:element name="recipients" type="xs:string" />
+ <xs:element name="subject" type="xs:string" />
+ <xs:element name="text" type="xs:string" />
+ <xs:element name="template" type="xs:string" />
<!-- TYPES AND GROUPS -->
<!-- ################ -->
@@ -420,80 +420,87 @@
<xs:simpleType name="configType">
<xs:restriction base="xs:string">
- <xs:enumeration value="field"/>
- <xs:enumeration value="bean"/>
- <xs:enumeration value="constructor"/>
- <xs:enumeration value="configuration-property"/>
+ <xs:enumeration value="field" />
+ <xs:enumeration value="bean" />
+ <xs:enumeration value="constructor" />
+ <xs:enumeration value="configuration-property" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="booleanType">
<xs:restriction base="xs:string">
- <xs:enumeration value="yes"/>
- <xs:enumeration value="no"/>
- <xs:enumeration value="true"/>
- <xs:enumeration value="false"/>
- <xs:enumeration value="on"/>
- <xs:enumeration value="off"/>
+ <xs:enumeration value="yes" />
+ <xs:enumeration value="no" />
+ <xs:enumeration value="true" />
+ <xs:enumeration value="false" />
+ <xs:enumeration value="on" />
+ <xs:enumeration value="off" />
</xs:restriction>
</xs:simpleType>
-
+
<xs:simpleType name="priorityType">
- <xs:union>
+ <xs:union memberTypes="xs:int">
<xs:simpleType>
<xs:restriction base="xs:string">
- <xs:enumeration value="highest"/>
- <xs:enumeration value="high"/>
- <xs:enumeration value="normal"/>
- <xs:enumeration value="low"/>
- <xs:enumeration value="lowest"/>
+ <xs:enumeration value="highest" />
+ <xs:enumeration value="high" />
+ <xs:enumeration value="normal" />
+ <xs:enumeration value="low" />
+ <xs:enumeration value="lowest" />
</xs:restriction>
</xs:simpleType>
- <xs:simpleType>
- <xs:restriction base="xs:int"/>
- </xs:simpleType>
</xs:union>
</xs:simpleType>
<xs:group name="node-elements">
<xs:choice>
- <xs:element ref="node"/>
- <xs:element ref="state"/>
- <xs:element ref="task-node"/>
- <xs:element ref="super-state"/>
- <xs:element ref="process-state"/>
- <xs:element ref="fork"/>
- <xs:element ref="join"/>
- <xs:element ref="decision"/>
- <xs:element ref="end-state"/>
- <xs:element ref="mail-node"/>
+ <xs:element ref="node" />
+ <xs:element ref="state" />
+ <xs:element ref="task-node" />
+ <xs:element ref="super-state" />
+ <xs:element ref="process-state" />
+ <xs:element ref="fork" />
+ <xs:element ref="join" />
+ <xs:element ref="decision" />
+ <xs:element ref="end-state" />
+ <xs:element ref="mail-node" />
</xs:choice>
</xs:group>
-
+
<xs:group name="action-elements">
<xs:choice>
- <xs:element ref="action"/>
- <xs:element ref="script"/>
- <xs:element ref="create-timer"/>
- <xs:element ref="cancel-timer"/>
- <xs:element ref="mail"/>
+ <xs:element ref="action" />
+ <xs:element ref="script" />
+ <xs:element ref="create-timer" />
+ <xs:element ref="cancel-timer" />
+ <xs:element ref="mail" />
</xs:choice>
</xs:group>
-
+
<xs:group name="node-content-elements">
<xs:choice>
<xs:element ref="description" />
- <xs:element ref="event"/>
- <xs:element ref="exception-handler"/>
- <xs:element ref="timer"/>
- <xs:element ref="transition"/>
+ <xs:element ref="event" />
+ <xs:element ref="exception-handler" />
+ <xs:element ref="timer" />
+ <xs:element ref="transition" />
</xs:choice>
</xs:group>
<xs:simpleType name="bindingType">
- <xs:restriction base="xs:string">
- <xs:enumeration value="late"></xs:enumeration>
- <xs:enumeration value="early"></xs:enumeration>
- </xs:restriction>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="late" />
+ <xs:enumeration value="early" />
+ </xs:restriction>
</xs:simpleType>
+
+ <xs:simpleType name="asyncType">
+ <xs:union memberTypes="booleanType">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="exclusive" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
</xs:schema>
Added:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2778/JBPM2778Test.java
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2778/JBPM2778Test.java
(rev 0)
+++
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2778/JBPM2778Test.java 2010-02-23
08:47:50 UTC (rev 6192)
@@ -0,0 +1,43 @@
+package org.jbpm.jbpm2778;
+
+import org.jbpm.db.AbstractDbTestCase;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ProcessInstance;
+
+/**
+ * accept-propagated-events does not affect script.
+ *
+ * @author Alejandro Guizar
+ * @see <a
href="https://jira.jboss.org/jira/browse/JBPM-2778">JBPM-277...
+ */
+public class JBPM2778Test extends AbstractDbTestCase {
+
+ private long processDefinitionId;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ ProcessDefinition processDefinition =
ProcessDefinition.parseXmlResource("org/jbpm/jbpm2778/processdefinition.xml");
+ jbpmContext.deployProcessDefinition(processDefinition);
+ processDefinitionId = processDefinition.getId();
+
+ newTransaction();
+ }
+
+ protected void tearDown() throws Exception {
+ newTransaction();
+ graphSession.deleteProcessDefinition(processDefinitionId);
+ super.tearDown();
+ }
+
+ public void testProcess() throws Exception {
+ ProcessInstance processInstance =
jbpmContext.newProcessInstanceForUpdate("jbpm2778");
+ processInstance.signal();
+
+ Integer calls = (Integer)
processInstance.getContextInstance().getVariable("calls");
+ assertEquals(1, calls.intValue());
+
+ processInstance.signal();
+ assert processInstance.hasEnded() : "expected " + processInstance + "
to have ended";
+ }
+}
Property changes on:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2778/JBPM2778Test.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2778/gpd.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2778/gpd.xml
(rev 0)
+++
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2778/gpd.xml 2010-02-23
08:47:50 UTC (rev 6192)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root-container name="jbpm2778" width="850"
height="563">
+ <node name="start" x="75" y="50" width="132"
height="36">
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ <node-container name="super" x="49" y="122"
width="186" height="89">
+ <node name="sub" x="21" y="22" width="132"
height="36">
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ </node-container>
+ <node name="end" x="78" y="250" width="132"
height="36"/>
+</root-container>
Property changes on:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2778/gpd.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2778/processdefinition.xml
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2778/processdefinition.xml
(rev 0)
+++
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2778/processdefinition.xml 2010-02-23
08:47:50 UTC (rev 6192)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition xmlns="urn:jbpm.org:jpdl-3.2"
name="jbpm2778">
+ <description>accept-propagated-event check</description>
+
+ <start-state name="start">
+ <event type="node-leave">
+ <script>
+ executionContext.setVariable("calls", 0);
+ </script>
+ </event>
+ <transition to="super" />
+ </start-state>
+
+ <super-state name="super">
+ <state name="sub">
+ <transition to="../end" />
+ </state>
+ <event type="node-enter">
+ <script accept-propagated-events="false">
+ executionContext.setVariable("calls", calls + 1);
+ </script>
+ </event>
+ </super-state>
+
+ <end-state name="end" />
+</process-definition>
\ No newline at end of file
Property changes on:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2778/processdefinition.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jpdl/xml/.gpd.testStartState.xml
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jpdl/xml/.gpd.testStartState.xml
(rev 0)
+++
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jpdl/xml/.gpd.testStartState.xml 2010-02-23
08:47:50 UTC (rev 6192)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root-container/>
\ No newline at end of file
Property changes on:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jpdl/xml/.gpd.testStartState.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jpdl/xml/.gpd.testTask.xml
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jpdl/xml/.gpd.testTask.xml
(rev 0)
+++
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jpdl/xml/.gpd.testTask.xml 2010-02-23
08:47:50 UTC (rev 6192)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root-container/>
\ No newline at end of file
Property changes on:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jpdl/xml/.gpd.testTask.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jpdl/xml/.gpd.testTaskNode.xml
===================================================================
---
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jpdl/xml/.gpd.testTaskNode.xml
(rev 0)
+++
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jpdl/xml/.gpd.testTaskNode.xml 2010-02-23
08:47:50 UTC (rev 6192)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root-container/>
\ No newline at end of file
Property changes on:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jpdl/xml/.gpd.testTaskNode.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native