JBoss JBPM SVN: r6919 - jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/job/executor.
by do-not-reply@jboss.org
Author: jcoleman(a)redhat.com
Date: 2011-05-13 11:04:52 -0400 (Fri, 13 May 2011)
New Revision: 6919
Modified:
jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/job/executor/DispatcherThread.java
jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/job/executor/JobExecutor.java
jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java
Log:
Remove testing code accidently commited with revision 6918.
Modified: jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/job/executor/DispatcherThread.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/job/executor/DispatcherThread.java 2011-05-13 14:49:57 UTC (rev 6918)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/job/executor/DispatcherThread.java 2011-05-13 15:04:52 UTC (rev 6919)
@@ -101,7 +101,6 @@
if (firstJob.getException() != null) {
// decrease retry count
int retries = firstJob.getRetries() - 1;
-log.info("Has exception, retries = " + retries);
firstJob.setRetries(retries);
if (debug) log.debug(firstJob + " has " + retries + " retries remaining");
}
Modified: jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/job/executor/JobExecutor.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/job/executor/JobExecutor.java 2011-05-13 14:49:57 UTC (rev 6918)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/job/executor/JobExecutor.java 2011-05-13 15:04:52 UTC (rev 6919)
@@ -34,7 +34,7 @@
protected int nbrOfThreads;
protected int idleInterval;
protected int maxIdleInterval;
- private int retryInterval = 1000;
+ private int retryInterval;
/** @deprecated property has no effect */
protected int historyMaxSize;
Modified: jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java 2011-05-13 14:49:57 UTC (rev 6918)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java 2011-05-13 15:04:52 UTC (rev 6919)
@@ -146,11 +146,7 @@
}
if (log.isDebugEnabled()) log.debug("executing " + job);
-/* XXX
if (job.execute(jbpmContext)) jobSession.deleteJob(job);
-*/
- jbpmContext.setRollbackOnly();
- throw (new Exception());
}
catch (Exception e) {
jbpmContext.setRollbackOnly();
@@ -190,7 +186,6 @@
job.setLockTime(null);
int waitPeriod = jobExecutor.getRetryInterval() / 2;
waitPeriod += random.nextInt(waitPeriod) ;
-log.info("rescheduled: now + " + waitPeriod);
job.setDueDate(new Date(System.currentTimeMillis() + waitPeriod)) ;
}
catch (RuntimeException e) {
13 years
JBoss JBPM SVN: r6918 - in jbpm3/branches/jbpm-3.2-soa/core/src/main: java/org/jbpm/job/executor and 1 other directories.
by do-not-reply@jboss.org
Author: jcoleman(a)redhat.com
Date: 2011-05-13 10:49:57 -0400 (Fri, 13 May 2011)
New Revision: 6918
Modified:
jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/db/JobSession.java
jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/job/executor/DispatcherThread.java
jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/job/executor/JobExecutor.java
jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java
jbpm3/branches/jbpm-3.2-soa/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml
Log:
SOA-3007.
Fix problems with the split of the old JobExecutorThread(s) into the new
DispatcherThread + JobExecutorThread(s):
o the DispatcherThread busy-waits in a loop (and uses CPU)
o job processing could be deferred for an indeterminate time.
o crashing at certain points could leave jobs locked (not processed)
indefinitely
Fix by kconner@.
Modified: jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/db/JobSession.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/db/JobSession.java 2011-05-12 07:43:49 UTC (rev 6917)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/db/JobSession.java 2011-05-13 14:49:57 UTC (rev 6918)
@@ -275,4 +275,14 @@
}
return session.createCriteria(Job.class).add(Restrictions.in("id", jobs)).list();
}
+
+ public void releaseLockedJobs(final String lockOwner) {
+ try {
+ session.getNamedQuery("JobSession.releaseLockedJobs")
+ .setString("lockOwner", lockOwner)
+ .executeUpdate();
+ } catch (HibernateException e) {
+ throw new JbpmPersistenceException("could not release locked jobs by owner '" + lockOwner + "'", e);
+ }
+ }
}
Modified: jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/job/executor/DispatcherThread.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/job/executor/DispatcherThread.java 2011-05-12 07:43:49 UTC (rev 6917)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/job/executor/DispatcherThread.java 2011-05-13 14:49:57 UTC (rev 6918)
@@ -52,40 +52,28 @@
}
public void run() {
- int retryInterval = jobExecutor.getRetryInterval();
while (active) {
- // acquire job; on exception, call returns null
- Job job = acquireJob();
- // submit job
- if (job != null) submitJob(job);
+ if (jobExecutor.waitForFreeExecutorThread()) {
+ // acquire job; on exception, call returns null
+ Job job = acquireJob();
+ // submit job
+ if (job != null) {
+ submitJob(job);
+ continue ;
+ }
+ }
// if still active, wait or sleep
if (active) {
try {
- if (job != null) {
- // reset the current retry interval
- retryInterval = jobExecutor.getRetryInterval();
- // wait for next due job
- long waitPeriod = getWaitPeriod(jobExecutor.getIdleInterval());
- if (waitPeriod > 0) {
- synchronized (jobExecutor) {
+ // wait for next due job
+ long waitPeriod = getWaitPeriod(jobExecutor.getIdleInterval());
+ if (waitPeriod > 0) {
+ synchronized (jobExecutor) {
+ if (active)
jobExecutor.wait(waitPeriod);
- }
}
}
- else {
- // sleep instead of waiting on jobExecutor
- // to prevent message/scheduler service from waking up this thread
- sleep(retryInterval);
- // after an exception, double the current retry interval
- // to avoid continuous failures during anomalous conditions
- retryInterval *= 2;
- // enforce maximum idle interval
- int maxIdleInterval = jobExecutor.getMaxIdleInterval();
- if (retryInterval > maxIdleInterval || retryInterval < 0) {
- retryInterval = maxIdleInterval;
- }
- }
}
catch (InterruptedException e) {
if (log.isDebugEnabled()) log.debug(getName() + " got interrupted");
@@ -113,6 +101,7 @@
if (firstJob.getException() != null) {
// decrease retry count
int retries = firstJob.getRetries() - 1;
+log.info("Has exception, retries = " + retries);
firstJob.setRetries(retries);
if (debug) log.debug(firstJob + " has " + retries + " retries remaining");
}
@@ -144,12 +133,8 @@
}
private void submitJob(Job job) {
- try {
- jobExecutor.getQueue().put(job);
- }
- catch (InterruptedException e) {
+ if (!jobExecutor.submitJob(job)) {
unlockJob(job);
- if (log.isDebugEnabled()) log.debug(getName() + " got interrupted");
}
}
Modified: jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/job/executor/JobExecutor.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/job/executor/JobExecutor.java 2011-05-12 07:43:49 UTC (rev 6917)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/job/executor/JobExecutor.java 2011-05-13 14:49:57 UTC (rev 6918)
@@ -9,6 +9,7 @@
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -16,9 +17,13 @@
import org.apache.commons.logging.LogFactory;
import org.jbpm.JbpmConfiguration;
+import org.jbpm.JbpmContext;
+import org.jbpm.db.JobSession;
+import org.jbpm.job.Job;
-import edu.emory.mathcs.backport.java.util.concurrent.BlockingQueue;
-import edu.emory.mathcs.backport.java.util.concurrent.SynchronousQueue;
+import edu.emory.mathcs.backport.java.util.concurrent.locks.Condition;
+import edu.emory.mathcs.backport.java.util.concurrent.locks.Lock;
+import edu.emory.mathcs.backport.java.util.concurrent.locks.ReentrantLock;
public class JobExecutor implements Serializable {
@@ -29,7 +34,7 @@
protected int nbrOfThreads;
protected int idleInterval;
protected int maxIdleInterval;
- private int retryInterval;
+ private int retryInterval = 1000;
/** @deprecated property has no effect */
protected int historyMaxSize;
@@ -39,7 +44,13 @@
protected int lockBufferTime;
private ThreadGroup threadGroup;
- private BlockingQueue queue = new SynchronousQueue();
+ private int waitingExecutorCount ;
+ private boolean waitingDispatcher ;
+ private boolean dispatcherActive ;
+ private Lock waitingExecutorLock = new ReentrantLock() ;
+ private Condition waitingExecutorCondition = waitingExecutorLock.newCondition() ;
+ private Condition waitingDispatcherCondition = waitingExecutorLock.newCondition() ;
+ private LinkedList dispatchedJobs = new LinkedList();
/** @deprecated call {@link #getThreads()} instead */
protected Map threads;
@@ -56,6 +67,8 @@
if (!isStarted) {
log.info("starting " + name);
+ activateDispatcher() ;
+
// create thread group
threadGroup = new ThreadGroup(name) {
public void uncaughtException(Thread thread, Throwable throwable) {
@@ -119,6 +132,8 @@
}
}
+ deactivateDispatcher() ;
+
// return deactivated threads
return deactivatedThreads;
}
@@ -158,10 +173,6 @@
return threadGroup;
}
- BlockingQueue getQueue() {
- return queue;
- }
-
private String getThreadName(int index) {
return name + '@' + getHostAddress() + ":Executor-" + index;
}
@@ -418,5 +429,116 @@
this.nbrOfThreads = nbrOfThreads;
}
+ private boolean hasFreeExecutor() {
+ waitingExecutorLock.lock() ;
+ try {
+ return (waitingExecutorCount > dispatchedJobs.size()) ;
+ } finally {
+ waitingExecutorLock.unlock() ;
+ }
+ }
+ // return false when interrupted
+ boolean waitForFreeExecutorThread() {
+ waitingExecutorLock.lock() ;
+ try {
+ waitingDispatcher = true ;
+ if (dispatcherActive) {
+ if (hasFreeExecutor()) {
+ return true ;
+ } else {
+ waitingDispatcherCondition.await() ;
+ return hasFreeExecutor() ;
+ }
+ }
+ } catch (final InterruptedException ie) {
+ } finally {
+ waitingDispatcher = false ;
+ waitingExecutorLock.unlock() ;
+ }
+ return false ;
+ }
+
+ // return null when interrupted
+ Job getJob() {
+ waitingExecutorLock.lock() ;
+ try {
+ waitingExecutorCount++ ;
+ if (dispatcherActive) {
+ if (waitingDispatcher && hasFreeExecutor()) {
+ waitingDispatcherCondition.signal() ;
+ }
+ if (dispatchedJobs.isEmpty()) {
+ waitingExecutorCondition.await() ;
+ }
+ if (dispatchedJobs.size() > 0) {
+ return (Job)dispatchedJobs.remove() ;
+ }
+ }
+ } catch (final InterruptedException ie) {
+ } finally {
+ waitingExecutorCount-- ;
+ waitingExecutorLock.unlock() ;
+ }
+ return null ;
+ }
+
+ boolean submitJob(final Job job) {
+ waitingExecutorLock.lock() ;
+ try {
+ if (hasFreeExecutor()) {
+ dispatchedJobs.add(job) ;
+ waitingExecutorCondition.signal() ;
+ return true ;
+ }
+ } finally {
+ waitingExecutorLock.unlock() ;
+ }
+ return false ;
+ }
+
+ private void activateDispatcher() {
+ waitingExecutorLock.lock() ;
+ try {
+ if (!dispatcherActive) {
+ unlockOurJobs() ;
+ dispatcherActive = true ;
+ }
+ } finally {
+ waitingExecutorLock.unlock() ;
+ }
+ }
+
+ private void unlockOurJobs() {
+ final JbpmContext jbpmContext = getJbpmConfiguration().createJbpmContext();
+ try {
+ final String lockOwner = getName();
+ final JobSession jobSession = jbpmContext.getJobSession();
+ jobSession.releaseLockedJobs(lockOwner);
+ } catch (RuntimeException e) {
+ jbpmContext.setRollbackOnly();
+ if (log.isDebugEnabled()) log.debug("failed to release locked jobs", e);
+ } catch (Error e) {
+ jbpmContext.setRollbackOnly();
+ throw e;
+ } finally {
+ try {
+ jbpmContext.close();
+ } catch (RuntimeException e) {
+ if (log.isDebugEnabled()) log.debug("failed to release locked jobs", e);
+ }
+ }
+ }
+
+ private void deactivateDispatcher() {
+ waitingExecutorLock.lock() ;
+ try {
+ dispatcherActive = false ;
+ waitingDispatcherCondition.signal() ;
+ waitingExecutorCondition.signalAll() ;
+ } finally {
+ waitingExecutorLock.unlock() ;
+ }
+ }
+
private static Log log = LogFactory.getLog(JobExecutor.class);
}
Modified: jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java 2011-05-12 07:43:49 UTC (rev 6917)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java 2011-05-13 14:49:57 UTC (rev 6918)
@@ -7,6 +7,7 @@
import java.util.Date;
import java.util.Iterator;
import java.util.List;
+import java.util.Random;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -23,6 +24,7 @@
private final JobExecutor jobExecutor;
private volatile boolean active = true;
+ private Random random = new Random() ;
public JobExecutorThread(String name, JobExecutor jobExecutor) {
super(jobExecutor.getThreadGroup(), name);
@@ -42,7 +44,7 @@
public void run() {
while (active) {
// take on next job
- Job job = acquireJob();
+ Job job = jobExecutor.getJob();
// if an exception occurs, acquireJob() returns null
if (job != null) {
try {
@@ -126,16 +128,6 @@
return jobs;
}
- private Job acquireJob() {
- try {
- return (Job) jobExecutor.getQueue().take();
- }
- catch (InterruptedException e) {
- if (log.isDebugEnabled()) log.debug(getName() + " got interrupted");
- return null;
- }
- }
-
protected void executeJob(Job job) throws Exception {
JbpmContext jbpmContext = jobExecutor.getJbpmConfiguration().createJbpmContext();
try {
@@ -154,7 +146,11 @@
}
if (log.isDebugEnabled()) log.debug("executing " + job);
+/* XXX
if (job.execute(jbpmContext)) jobSession.deleteJob(job);
+*/
+ jbpmContext.setRollbackOnly();
+ throw (new Exception());
}
catch (Exception e) {
jbpmContext.setRollbackOnly();
@@ -192,10 +188,10 @@
// unlock job so it can be dispatched again
job.setLockOwner(null);
job.setLockTime(null);
- // notify job executor
- synchronized (jobExecutor) {
- jobExecutor.notify();
- }
+ int waitPeriod = jobExecutor.getRetryInterval() / 2;
+ waitPeriod += random.nextInt(waitPeriod) ;
+log.info("rescheduled: now + " + waitPeriod);
+ job.setDueDate(new Date(System.currentTimeMillis() + waitPeriod)) ;
}
catch (RuntimeException e) {
jbpmContext.setRollbackOnly();
@@ -213,6 +209,10 @@
log.warn("failed to save exception for " + job, e);
}
}
+ // notify job executor
+ synchronized (jobExecutor) {
+ jobExecutor.notify();
+ }
}
private void unlockJob(Job job) {
@@ -224,10 +224,6 @@
// unlock job
job.setLockOwner(null);
job.setLockTime(null);
- // notify job executor
- synchronized (jobExecutor) {
- jobExecutor.notify();
- }
}
catch (RuntimeException e) {
jbpmContext.setRollbackOnly();
@@ -246,6 +242,10 @@
log.warn("failed to unlock " + job, e);
}
}
+ // notify job executor
+ synchronized (jobExecutor) {
+ jobExecutor.notify();
+ }
}
/** @deprecated responsibility moved to DispatcherThread */
Modified: jbpm3/branches/jbpm-3.2-soa/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml 2011-05-12 07:43:49 UTC (rev 6917)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml 2011-05-13 14:49:57 UTC (rev 6918)
@@ -401,6 +401,16 @@
]]>
</query>
+ <query name="JobSession.releaseLockedJobs">
+ <![CDATA[
+ update org.jbpm.job.Job job
+ set job.lockOwner = null, job.lockTime = null
+ where (job.lockOwner = :lockOwner)
+ and job.retries > 0
+ and job.isSuspended = false
+ ]]>
+ </query>
+
<!-- related to Tasks -->
<!-- ########################### -->
13 years
JBoss JBPM SVN: r6917 - in jbpm3/branches/jbpm-3.2-soa/core/src/test: java/org/jbpm/soa2010 and 2 other directories.
by do-not-reply@jboss.org
Author: marco.rietveld
Date: 2011-05-12 03:43:49 -0400 (Thu, 12 May 2011)
New Revision: 6917
Added:
jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/soa2010/
jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/soa2010/SOA2010Test.java
jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/
jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/.gpd.processdefinition1.xml
jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/.gpd.processdefinition2.xml
jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/.gpd.processdefinitiona.xml
jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/.gpd.processdefinitionb.xml
jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/processdefinitiona.jpg
jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/processdefinitiona.xml
jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/processdefinitionb.jpg
jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/processdefinitionb.xml
Log:
SOA-2010 Conditional transition cannot be considered as a default one
Added: jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/soa2010/SOA2010Test.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/soa2010/SOA2010Test.java (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/soa2010/SOA2010Test.java 2011-05-12 07:43:49 UTC (rev 6917)
@@ -0,0 +1,90 @@
+/*
+ * 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.soa2010;
+
+import org.jbpm.JbpmException;
+import org.jbpm.db.AbstractDbTestCase;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ProcessInstance;
+
+/**
+ * Conditional transition cannot be considered as a default one (for a Node).
+ *
+ * @see <a href="https://jira.jboss.org/browse/SOA-2010">SOA-2010</a>
+ * @author Marco Rietveld
+ */
+public class SOA2010Test extends AbstractDbTestCase {
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ /**
+ * Illustrate the following:
+ * - node with no unconditional transitions
+ * - transition with a condition that evaluates to false, as first transition (in jpdl doc)
+ * - other conditional transitions also present from node
+ *
+ * will throw an exception because the first/default transition is conditional evaluating to false.
+ */
+ public void testNodeWithFalseDefaultConditionalTransition() {
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("org/jbpm/soa2010/processdefinitiona.xml");
+ deployProcessDefinition(processDefinition);
+
+ ProcessInstance processInstance = jbpmContext.newProcessInstance("soa2010a");
+ boolean exceptionThrown = false;
+ try {
+ processInstance.signal();
+ }
+ catch(JbpmException je) {
+ assertTrue("expected exception on condition", je.getMessage().contains("guarding Transition(to false) not met"));
+ exceptionThrown = true;
+ }
+ assertTrue("expected exception on condition", exceptionThrown);
+ }
+
+ /**
+ * Illustrate the following:
+ * - node with no unconditional transitions
+ * - transition with a condition that evaluates to true, as first transition (in jpdl doc)
+ * - other conditional transitions also present from node
+ *
+ * will succeed, because first/default is conditional that eval's to true.
+ *
+ * (otherwise EXACTLY the same jpdl/graph as previous test)
+ */
+ public void testNodeWithTrueDefaultConditionalTransition() {
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("org/jbpm/soa2010/processdefinitionb.xml");
+ deployProcessDefinition(processDefinition);
+
+ ProcessInstance processInstance = jbpmContext.newProcessInstance("soa2010b");
+ try {
+ processInstance.signal();
+ }
+ catch(JbpmException je) {
+ fail("Did not expect exception: " + je.getMessage() );
+ }
+ assertEquals("true-condition-end", processInstance.getRootToken().getNode().getName());
+
+ }
+
+}
Property changes on: jbpm3/branches/jbpm-3.2-soa/core/src/test/java/org/jbpm/soa2010/SOA2010Test.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/.gpd.processdefinition1.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/.gpd.processdefinition1.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/.gpd.processdefinition1.xml 2011-05-12 07:43:49 UTC (rev 6917)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root-container name="soa2010" width="931" height="666">
+ <node name="start" x="256" y="95" width="132" height="36">
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ <node name="node1" x="246" y="221" width="132" height="36">
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ <node name="false-condition-end" x="447" y="410" width="132" height="36"/>
+ <node name="true-condition-end" x="101" y="391" width="132" height="36"/>
+</root-container>
Property changes on: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/.gpd.processdefinition1.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/.gpd.processdefinition2.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/.gpd.processdefinition2.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/.gpd.processdefinition2.xml 2011-05-12 07:43:49 UTC (rev 6917)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root-container name="soa2010" width="931" height="666">
+ <node name="start" x="323" y="106" width="132" height="36">
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ <node name="node1" x="289" y="228" width="132" height="36">
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ <node name="false-condition-end" x="183" y="468" width="132" height="36"/>
+ <node name="true-condition-end" x="414" y="470" width="132" height="36"/>
+</root-container>
Property changes on: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/.gpd.processdefinition2.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/.gpd.processdefinitiona.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/.gpd.processdefinitiona.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/.gpd.processdefinitiona.xml 2011-05-12 07:43:49 UTC (rev 6917)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root-container name="soa2010a" width="931" height="666">
+ <node name="start" x="300" y="68" width="132" height="36">
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ <node name="node1" x="304" y="226" width="132" height="36">
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ <node name="false-condition-end" x="125" y="433" width="132" height="36"/>
+ <node name="true-condition-end" x="547" y="427" width="132" height="36"/>
+</root-container>
Property changes on: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/.gpd.processdefinitiona.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/.gpd.processdefinitionb.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/.gpd.processdefinitionb.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/.gpd.processdefinitionb.xml 2011-05-12 07:43:49 UTC (rev 6917)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root-container name="soa2010b" width="931" height="666">
+ <node name="start" x="292" y="54" width="132" height="36">
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ <node name="node1" x="294" y="184" width="132" height="36">
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ <node name="false-condition-end" x="66" y="345" width="132" height="36"/>
+ <node name="true-condition-end" x="547" y="347" width="132" height="36"/>
+</root-container>
Property changes on: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/.gpd.processdefinitionb.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/processdefinitiona.jpg
===================================================================
(Binary files differ)
Property changes on: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/processdefinitiona.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/processdefinitiona.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/processdefinitiona.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/processdefinitiona.xml 2011-05-12 07:43:49 UTC (rev 6917)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition name="soa2010a" xmlns="urn:jbpm.org:jpdl-3.2">
+
+ <start-state name="start">
+ <transition to="node1" />
+ </start-state>
+
+ <node name="node1">
+ <transition to="false-condition-end" condition="#{AAA != null}" name="to false"/>
+ <transition to="true-condition-end" condition="#{AAA == null}" name="to true" />
+ </node>
+
+ <end-state name="false-condition-end" />
+
+ <end-state name="true-condition-end" />
+
+</process-definition>
\ No newline at end of file
Property changes on: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/processdefinitiona.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/processdefinitionb.jpg
===================================================================
(Binary files differ)
Property changes on: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/processdefinitionb.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/processdefinitionb.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/processdefinitionb.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/processdefinitionb.xml 2011-05-12 07:43:49 UTC (rev 6917)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition name="soa2010b" xmlns="urn:jbpm.org:jpdl-3.2">
+
+ <start-state name="start">
+ <transition to="node1" />
+ </start-state>
+
+ <node name="node1">
+ <transition to="true-condition-end" condition="#{AAA == null}" name="to true" />
+ <transition to="false-condition-end" condition="#{AAA != null}" name="to false"/>
+ </node>
+
+ <end-state name="false-condition-end" />
+
+ <end-state name="true-condition-end" />
+
+</process-definition>
\ No newline at end of file
Property changes on: jbpm3/branches/jbpm-3.2-soa/core/src/test/resources/org/jbpm/soa2010/processdefinitionb.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years