JBoss JBPM SVN: r1644 - in jbpm4/pvm/trunk/modules/core/src: main/java/org/jbpm/pvm/internal/jobexecutor and 3 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2008-07-15 18:17:15 -0400 (Tue, 15 Jul 2008)
New Revision: 1644
Added:
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/ejb/ExecuteTimerCmd.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/AcquireJobsCmd.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/ExecuteJobCmd.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/GetNextDueDateCmd.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/custom/InsertPhraseCmd.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/custom/RemovePhraseCmd.java
Removed:
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/ejb/ExecuteTimer.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/AcquireJobs.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/ExecuteJobCommand.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/NextDueDate.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/custom/InsertPhrase.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/custom/RemovePhrase.java
Modified:
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/ejb/CommandReceiverMDB.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/ejb/TimerEB.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutor.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorThread.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/job/JobTestHelper.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/CommandExecutorTest.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/CommandReceiverTest.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/EnterpriseTimerSessionTest.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/TimerTest.java
Log:
renamed several commands for consistency
Modified: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/ejb/CommandReceiverMDB.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/ejb/CommandReceiverMDB.java 2008-07-15 16:26:12 UTC (rev 1643)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/ejb/CommandReceiverMDB.java 2008-07-15 22:17:15 UTC (rev 1644)
@@ -41,7 +41,7 @@
import javax.naming.NamingException;
import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.jobexecutor.ExecuteJobCommand;
+import org.jbpm.pvm.internal.jobexecutor.ExecuteJobCmd;
import org.jbpm.pvm.internal.log.Log;
/**
@@ -149,7 +149,7 @@
long jobId = message.getLongProperty("jobId");
log.debug("received message with jobImpl id " + jobId);
// create a command with the given jobId
- command = new ExecuteJobCommand(jobId);
+ command = new ExecuteJobCmd(jobId);
}
else {
log.info("WARNING: ignoring message, unknown format: " + message);
Deleted: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/ejb/ExecuteTimer.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/ejb/ExecuteTimer.java 2008-07-15 16:26:12 UTC (rev 1643)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/ejb/ExecuteTimer.java 2008-07-15 22:17:15 UTC (rev 1644)
@@ -1,60 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.ejb;
-
-import java.util.Date;
-import org.jbpm.pvm.env.Environment;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.job.TimerImpl;
-import org.jbpm.pvm.internal.log.Log;
-import org.jbpm.pvm.session.DbSession;
-
-
-/**
- * @author Tom Baeyens
- * @author Alejandro Guizar
- */
-public class ExecuteTimer implements Command<Date> {
-
- private final long timerDbid;
-
- private static final long serialVersionUID = 1L;
- private static final Log log = Log.getLog(ExecuteTimer.class.getName());
-
- public ExecuteTimer(long timerDbid) {
- this.timerDbid = timerDbid;
- }
-
- public Date execute(Environment environment) throws Exception {
- DbSession dbSession = environment.get(DbSession.class);
- TimerImpl timerImpl = dbSession.get(TimerImpl.class, timerDbid);
- if (timerImpl == null) {
- log.debug("timer not found: " + timerDbid);
- return null; // i.e. delete this timer
- }
- return timerImpl.execute(environment) ? null : timerImpl.getDueDate();
- }
-
- public String toString() {
- return ExecuteTimer.class.getSimpleName() + '(' + timerDbid + ')';
- }
-}
Copied: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/ejb/ExecuteTimerCmd.java (from rev 1643, jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/ejb/ExecuteTimer.java)
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/ejb/ExecuteTimerCmd.java (rev 0)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/ejb/ExecuteTimerCmd.java 2008-07-15 22:17:15 UTC (rev 1644)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.ejb;
+
+import java.util.Date;
+import org.jbpm.pvm.env.Environment;
+import org.jbpm.pvm.internal.cmd.Command;
+import org.jbpm.pvm.internal.job.TimerImpl;
+import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.pvm.session.DbSession;
+
+
+/**
+ * @author Tom Baeyens
+ * @author Alejandro Guizar
+ */
+public class ExecuteTimerCmd implements Command<Date> {
+
+ private final long timerDbid;
+
+ private static final long serialVersionUID = 1L;
+ private static final Log log = Log.getLog(ExecuteTimerCmd.class.getName());
+
+ public ExecuteTimerCmd(long timerDbid) {
+ this.timerDbid = timerDbid;
+ }
+
+ public Date execute(Environment environment) throws Exception {
+ DbSession dbSession = environment.get(DbSession.class);
+ TimerImpl timerImpl = dbSession.get(TimerImpl.class, timerDbid);
+ if (timerImpl == null) {
+ log.debug("timer not found: " + timerDbid);
+ return null; // i.e. delete this timer
+ }
+ return timerImpl.execute(environment) ? null : timerImpl.getDueDate();
+ }
+
+ public String toString() {
+ return ExecuteTimerCmd.class.getSimpleName() + '(' + timerDbid + ')';
+ }
+}
Modified: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/ejb/TimerEB.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/ejb/TimerEB.java 2008-07-15 16:26:12 UTC (rev 1643)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/ejb/TimerEB.java 2008-07-15 22:17:15 UTC (rev 1644)
@@ -114,7 +114,7 @@
}
public void ejbTimeout(Timer timer) {
- Date nextDueDate = commandExecutor.execute(new ExecuteTimer(getDbid()));
+ Date nextDueDate = commandExecutor.execute(new ExecuteTimerCmd(getDbid()));
if (nextDueDate != null) {
schedule(nextDueDate);
}
Deleted: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/AcquireJobs.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/AcquireJobs.java 2008-07-15 16:26:12 UTC (rev 1643)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/AcquireJobs.java 2008-07-15 22:17:15 UTC (rev 1644)
@@ -1,88 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.jobexecutor;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
-import org.jbpm.pvm.env.Environment;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.job.JobImpl;
-import org.jbpm.pvm.internal.log.Log;
-
-
-/**
- * @author Tom Baeyens
- */
-public class AcquireJobs implements Command<Collection<Long>> {
-
- private static final long serialVersionUID = 1L;
-
- private static final Log log = Log.getLog(AcquireJobs.class.getName());
- private static final DateFormat timeFormat = new SimpleDateFormat("HH:mm:ss,SSS");
-
- JobExecutor jobExecutor;
-
- public AcquireJobs(JobExecutor jobExecutor) {
- this.jobExecutor = jobExecutor;
- }
-
- public Collection<Long> execute(Environment environment) throws Exception {
- Collection<Long> acquiredJobDbids = new ArrayList<Long>();
-
- Collection<JobImpl<?>> acquiredJobs = new ArrayList<JobImpl<?>>();
-
- JobDbSession jobDbSession = environment.get(JobDbSession.class);
- log.debug("start querying first acquirable jobImpl...");
-
- JobImpl<?> job = jobDbSession.findFirstAcquirableJob();
-
- if (job!=null) {
- if (job.isExclusive()) {
- log.trace("exclusive acquirable jobImpl found ("+job+"). querying for other exclusive jobs to lock them all in one tx...");
- List<JobImpl<?>> otherExclusiveJobs = jobDbSession.findExclusiveJobs(job.getProcessInstance());
- acquiredJobs.addAll(otherExclusiveJobs);
- } else {
- acquiredJobs.add(job);
- }
-
- for (JobImpl<?> acquiredJob: acquiredJobs) {
- long lockExpirationTime = System.currentTimeMillis()+jobExecutor.getLockMillis();
- log.trace("trying to obtain a lock for '"+acquiredJob+"' with exp "+timeFormat.format(new Date(lockExpirationTime)));
- acquiredJob.setLockExpirationTime(new Date(lockExpirationTime));
- acquiredJob.setLockOwner(jobExecutor.getName());
- acquiredJobDbids.add(acquiredJob.getDbid());
- }
-
- } else {
- log.trace("no acquirable jobs in jobImpl table");
- }
-
- log.debug("locking jobs "+acquiredJobDbids);
-
- return acquiredJobDbids;
- }
-
-}
Copied: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/AcquireJobsCmd.java (from rev 1643, jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/AcquireJobs.java)
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/AcquireJobsCmd.java (rev 0)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/AcquireJobsCmd.java 2008-07-15 22:17:15 UTC (rev 1644)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.jobexecutor;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import org.jbpm.pvm.env.Environment;
+import org.jbpm.pvm.internal.cmd.Command;
+import org.jbpm.pvm.internal.job.JobImpl;
+import org.jbpm.pvm.internal.log.Log;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class AcquireJobsCmd implements Command<Collection<Long>> {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Log log = Log.getLog(AcquireJobsCmd.class.getName());
+ private static final DateFormat timeFormat = new SimpleDateFormat("HH:mm:ss,SSS");
+
+ JobExecutor jobExecutor;
+
+ public AcquireJobsCmd(JobExecutor jobExecutor) {
+ this.jobExecutor = jobExecutor;
+ }
+
+ public Collection<Long> execute(Environment environment) throws Exception {
+ Collection<Long> acquiredJobDbids = new ArrayList<Long>();
+
+ Collection<JobImpl<?>> acquiredJobs = new ArrayList<JobImpl<?>>();
+
+ JobDbSession jobDbSession = environment.get(JobDbSession.class);
+ log.debug("start querying first acquirable jobImpl...");
+
+ JobImpl<?> job = jobDbSession.findFirstAcquirableJob();
+
+ if (job!=null) {
+ if (job.isExclusive()) {
+ log.trace("exclusive acquirable jobImpl found ("+job+"). querying for other exclusive jobs to lock them all in one tx...");
+ List<JobImpl<?>> otherExclusiveJobs = jobDbSession.findExclusiveJobs(job.getProcessInstance());
+ acquiredJobs.addAll(otherExclusiveJobs);
+ } else {
+ acquiredJobs.add(job);
+ }
+
+ for (JobImpl<?> acquiredJob: acquiredJobs) {
+ long lockExpirationTime = System.currentTimeMillis()+jobExecutor.getLockMillis();
+ log.trace("trying to obtain a lock for '"+acquiredJob+"' with exp "+timeFormat.format(new Date(lockExpirationTime)));
+ acquiredJob.setLockExpirationTime(new Date(lockExpirationTime));
+ acquiredJob.setLockOwner(jobExecutor.getName());
+ acquiredJobDbids.add(acquiredJob.getDbid());
+ }
+
+ } else {
+ log.trace("no acquirable jobs in jobImpl table");
+ }
+
+ log.debug("locking jobs "+acquiredJobDbids);
+
+ return acquiredJobDbids;
+ }
+
+}
Copied: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/ExecuteJobCmd.java (from rev 1643, jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/ExecuteJobCommand.java)
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/ExecuteJobCmd.java (rev 0)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/ExecuteJobCmd.java 2008-07-15 22:17:15 UTC (rev 1644)
@@ -0,0 +1,101 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.jobexecutor;
+
+import java.util.Date;
+
+import org.hibernate.Session;
+import org.jbpm.pvm.PvmException;
+import org.jbpm.pvm.env.Environment;
+import org.jbpm.pvm.env.Transaction;
+import org.jbpm.pvm.internal.cmd.Command;
+import org.jbpm.pvm.internal.cmd.CommandService;
+import org.jbpm.pvm.internal.job.JobImpl;
+import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.pvm.job.Job;
+
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ExecuteJobCmd implements Command<Job> {
+ private static final long serialVersionUID = 1L;
+
+ private static final Log log = Log.getLog(ExecuteJobCmd.class.getName());
+
+ protected long jobDbid;
+
+ public ExecuteJobCmd(long jobDbid) {
+ this.jobDbid = jobDbid;
+ }
+
+ public Job execute(Environment environment) throws Exception {
+ Session session = environment.get(Session.class);
+ if (session==null) {
+ throw new PvmException("no hibernate-session configured to get job "+jobDbid+" for execution");
+ }
+ JobImpl<?> job = (JobImpl<?>) session.get(JobImpl.class, jobDbid);
+
+ // in case of exclusive jobs, the jobImpl might have been deleted
+ // before we execute it (they are in a list)
+ if (job != null) {
+ try {
+ log.debug("executing job "+job+"...");
+ job.execute(environment);
+
+ // if this job is locked too long, it could be unlocked by the lockmonitor and
+ // executed by another thread.
+ Date lockExpirationDate = job.getLockExpirationTime();
+ // can be null if it was rescheduled
+ if (lockExpirationDate != null) {
+ long lockExpiration = lockExpirationDate.getTime();
+ long currentTime = System.currentTimeMillis();
+ if (currentTime>lockExpiration) {
+ throw new PvmException("job took too long: lock expired "+(currentTime-lockExpiration)+"ms ago");
+ }
+ }
+ } catch (Throwable exception) {
+ log.error("exception while executing '"+job+"'", exception);
+ handleJobExecutionException(environment, job, exception);
+ }
+
+ log.debug("executed job "+job);
+ } else {
+ log.debug("job " + jobDbid + " no longer exists");
+ }
+ return job;
+ }
+
+ /** This transaction will be marked for rollback. A command will be associated with the
+ * Transaction.EVENT_AFTERCOMPLETION (after the jobImpl locks of the current transaction are
+ * released). Then the command will update the JobImpl with the exception details in a separate
+ * transaction. */
+ protected void handleJobExecutionException(Environment environment, JobImpl<?> job, Throwable exception) {
+ Transaction transaction = environment.get(Transaction.class);
+ transaction.setRollbackOnly();
+
+ CommandService commandService = (CommandService) environment.get(CommandService.class);
+ JobExceptionHandler jobExceptionHandler = new JobExceptionHandler(job.getDbid(), exception, commandService);
+ transaction.addListener(jobExceptionHandler, Transaction.EVENT_AFTERCOMPLETION);
+ }
+}
Deleted: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/ExecuteJobCommand.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/ExecuteJobCommand.java 2008-07-15 16:26:12 UTC (rev 1643)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/ExecuteJobCommand.java 2008-07-15 22:17:15 UTC (rev 1644)
@@ -1,101 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.jobexecutor;
-
-import java.util.Date;
-
-import org.hibernate.Session;
-import org.jbpm.pvm.PvmException;
-import org.jbpm.pvm.env.Environment;
-import org.jbpm.pvm.env.Transaction;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.cmd.CommandService;
-import org.jbpm.pvm.internal.job.JobImpl;
-import org.jbpm.pvm.internal.log.Log;
-import org.jbpm.pvm.job.Job;
-
-
-
-/**
- * @author Tom Baeyens
- */
-public class ExecuteJobCommand implements Command<Job> {
- private static final long serialVersionUID = 1L;
-
- private static final Log log = Log.getLog(ExecuteJobCommand.class.getName());
-
- protected long jobDbid;
-
- public ExecuteJobCommand(long jobDbid) {
- this.jobDbid = jobDbid;
- }
-
- public Job execute(Environment environment) throws Exception {
- Session session = environment.get(Session.class);
- if (session==null) {
- throw new PvmException("no hibernate-session configured to get job "+jobDbid+" for execution");
- }
- JobImpl<?> job = (JobImpl<?>) session.get(JobImpl.class, jobDbid);
-
- // in case of exclusive jobs, the jobImpl might have been deleted
- // before we execute it (they are in a list)
- if (job != null) {
- try {
- log.debug("executing job "+job+"...");
- job.execute(environment);
-
- // if this job is locked too long, it could be unlocked by the lockmonitor and
- // executed by another thread.
- Date lockExpirationDate = job.getLockExpirationTime();
- // can be null if it was rescheduled
- if (lockExpirationDate != null) {
- long lockExpiration = lockExpirationDate.getTime();
- long currentTime = System.currentTimeMillis();
- if (currentTime>lockExpiration) {
- throw new PvmException("job took too long: lock expired "+(currentTime-lockExpiration)+"ms ago");
- }
- }
- } catch (Throwable exception) {
- log.error("exception while executing '"+job+"'", exception);
- handleJobExecutionException(environment, job, exception);
- }
-
- log.debug("executed job "+job);
- } else {
- log.debug("job " + jobDbid + " no longer exists");
- }
- return job;
- }
-
- /** This transaction will be marked for rollback. A command will be associated with the
- * Transaction.EVENT_AFTERCOMPLETION (after the jobImpl locks of the current transaction are
- * released). Then the command will update the JobImpl with the exception details in a separate
- * transaction. */
- protected void handleJobExecutionException(Environment environment, JobImpl<?> job, Throwable exception) {
- Transaction transaction = environment.get(Transaction.class);
- transaction.setRollbackOnly();
-
- CommandService commandService = (CommandService) environment.get(CommandService.class);
- JobExceptionHandler jobExceptionHandler = new JobExceptionHandler(job.getDbid(), exception, commandService);
- transaction.addListener(jobExceptionHandler, Transaction.EVENT_AFTERCOMPLETION);
- }
-}
Copied: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/GetNextDueDateCmd.java (from rev 1643, jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/NextDueDate.java)
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/GetNextDueDateCmd.java (rev 0)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/GetNextDueDateCmd.java 2008-07-15 22:17:15 UTC (rev 1644)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.jobexecutor;
+
+import java.util.Date;
+import org.jbpm.pvm.env.Environment;
+import org.jbpm.pvm.internal.cmd.Command;
+import org.jbpm.pvm.internal.job.JobImpl;
+import org.jbpm.pvm.internal.log.Log;
+
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class GetNextDueDateCmd implements Command<Date> {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Log log = Log.getLog(GetNextDueDateCmd.class.getName());
+
+ JobExecutor jobExecutor;
+
+ public GetNextDueDateCmd(JobExecutor jobExecutor) {
+ this.jobExecutor = jobExecutor;
+ }
+
+ public Date execute(Environment environment) throws Exception {
+ Date nextDueDate = null;
+ log.debug("getting next due date...");
+ JobDbSession jobDbSession = environment.get(JobDbSession.class);
+ JobImpl<?> job = jobDbSession.findFirstDueJob();
+ if (job!=null) {
+ nextDueDate = job.getDueDate();
+ }
+ log.debug("next due date is "+nextDueDate);
+ return nextDueDate;
+ }
+
+}
Modified: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutor.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutor.java 2008-07-15 16:26:12 UTC (rev 1643)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutor.java 2008-07-15 22:17:15 UTC (rev 1644)
@@ -77,8 +77,8 @@
throw new PvmException("no command executor available in jobImpl executor");
}
if (! isActive) {
- acquireJobsCommand = new AcquireJobs(this);
- nextDueDateCommand = new NextDueDate(this);
+ acquireJobsCommand = new AcquireJobsCmd(this);
+ nextDueDateCommand = new GetNextDueDateCmd(this);
// the max capacity of the jobDbidsQueue is set to nbrOfJobExecutorThreads.
// That way, the distpatcher thread will be stalled if enough jobs are acquired.
Modified: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorThread.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorThread.java 2008-07-15 16:26:12 UTC (rev 1643)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorThread.java 2008-07-15 22:17:15 UTC (rev 1644)
@@ -59,7 +59,7 @@
for (Long jobDbid: jobDbids) {
CommandService commandService = jobExecutor.getCommandExecutor();
- commandService.execute(new ExecuteJobCommand(jobDbid));
+ commandService.execute(new ExecuteJobCmd(jobDbid));
}
} catch (InterruptedException e) {
log.trace("waiting for acquired jobs got interrupted");
Deleted: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/NextDueDate.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/NextDueDate.java 2008-07-15 16:26:12 UTC (rev 1643)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/jobexecutor/NextDueDate.java 2008-07-15 22:17:15 UTC (rev 1644)
@@ -1,59 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.jobexecutor;
-
-import java.util.Date;
-import org.jbpm.pvm.env.Environment;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.job.JobImpl;
-import org.jbpm.pvm.internal.log.Log;
-
-
-
-/**
- * @author Tom Baeyens
- */
-public class NextDueDate implements Command<Date> {
-
- private static final long serialVersionUID = 1L;
-
- private static final Log log = Log.getLog(NextDueDate.class.getName());
-
- JobExecutor jobExecutor;
-
- public NextDueDate(JobExecutor jobExecutor) {
- this.jobExecutor = jobExecutor;
- }
-
- public Date execute(Environment environment) throws Exception {
- Date nextDueDate = null;
- log.debug("getting next due date...");
- JobDbSession jobDbSession = environment.get(JobDbSession.class);
- JobImpl<?> job = jobDbSession.findFirstDueJob();
- if (job!=null) {
- nextDueDate = job.getDueDate();
- }
- log.debug("next due date is "+nextDueDate);
- return nextDueDate;
- }
-
-}
Modified: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/job/JobTestHelper.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/job/JobTestHelper.java 2008-07-15 16:26:12 UTC (rev 1643)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/job/JobTestHelper.java 2008-07-15 22:17:15 UTC (rev 1644)
@@ -29,7 +29,7 @@
import org.jbpm.pvm.internal.cmd.CommandService;
import org.jbpm.pvm.internal.job.MessageImpl;
import org.jbpm.pvm.internal.job.TimerImpl;
-import org.jbpm.pvm.internal.jobexecutor.ExecuteJobCommand;
+import org.jbpm.pvm.internal.jobexecutor.ExecuteJobCmd;
/** helper class for testing that executes messages and timers
@@ -55,7 +55,7 @@
query.setLong("executionDbid", executionDbid);
query.setMaxResults(1);
Long messageDbid = (Long) query.uniqueResult();
- ExecuteJobCommand executeJobCommand = new ExecuteJobCommand(messageDbid);
+ ExecuteJobCmd executeJobCommand = new ExecuteJobCmd(messageDbid);
Job job = executeJobCommand.execute(environment);
job.getExecution().getNode().getName();
return job.getExecution();
@@ -76,7 +76,7 @@
query.setLong("timerDbid", timerDbid);
query.setMaxResults(1);
Long timerDbid = (Long) query.uniqueResult();
- ExecuteJobCommand executeJobCommand = new ExecuteJobCommand(timerDbid);
+ ExecuteJobCmd executeJobCommand = new ExecuteJobCmd(timerDbid);
Job job = executeJobCommand.execute(environment);
return job.getExecution();
}
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/CommandExecutorTest.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/CommandExecutorTest.java 2008-07-15 16:26:12 UTC (rev 1643)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/CommandExecutorTest.java 2008-07-15 22:17:15 UTC (rev 1644)
@@ -27,8 +27,8 @@
import org.apache.cactus.ServletTestCase;
-import org.jbpm.enterprise.custom.InsertPhrase;
-import org.jbpm.enterprise.custom.RemovePhrase;
+import org.jbpm.enterprise.custom.InsertPhraseCmd;
+import org.jbpm.enterprise.custom.RemovePhraseCmd;
import org.jbpm.pvm.internal.ejb.CommandExecutorSLSB;
import org.jbpm.pvm.internal.ejb.LocalCommandExecutor;
import org.jbpm.pvm.internal.ejb.LocalCommandExecutorHome;
@@ -73,43 +73,43 @@
* <h3>Preconditions</h3>
* The TEST_PHRASE table does not contain any row with the specified text.
* <h3>Behavior</h3>
- * The {@link InsertPhrase} command creates a row with the specified text.
+ * The {@link InsertPhraseCmd} command creates a row with the specified text.
* <h3>Postconditions</h3>
* A new row with the specified text exists in the table. The
- * {@link RemovePhrase} command removes the row, and the return value confirms
+ * {@link RemovePhraseCmd} command removes the row, and the return value confirms
* it was there.
*/
public void testHappyCommand() throws CreateException {
String text = "been there, done that";
- commandExecutor.execute(new InsertPhrase(text));
+ commandExecutor.execute(new InsertPhraseCmd(text));
// verify phrase was inserted
- assertTrue(commandExecutor.execute(new RemovePhrase(text)));
+ assertTrue(commandExecutor.execute(new RemovePhraseCmd(text)));
}
/**
* This scenario tests a command that throws a checked exception inside the
- * {@link InsertPhrase#execute(org.jbpm.env.Environment) execute} method.
+ * {@link InsertPhraseCmd#execute(org.jbpm.env.Environment) execute} method.
* <h3>Preconditions</h3>
* The TEST_PHRASE table does not contain any row with the specified text.
* <h3>Behavior</h3>
- * The {@link InsertPhrase} command creates a row with the specified text. The
+ * The {@link InsertPhraseCmd} command creates a row with the specified text. The
* command is configured to throw a checked exception before completing.
* <h3>Postconditions</h3>
* The command executor throws an {@link EJBException} and rolls back the
* managed transaction. No row with the specified text exists in the database.
- * The {@link RemovePhrase} command return value confirms the row was not
+ * The {@link RemovePhraseCmd} command return value confirms the row was not
* there.
*/
public void testNoisyCommand() throws CreateException {
String text = "houston, we have a problem";
// insert phrase via command
try {
- commandExecutor.execute(new InsertPhrase(text, /* fail? */true));
+ commandExecutor.execute(new InsertPhraseCmd(text, /* fail? */true));
fail("expected: " + EJBException.class.getSimpleName());
} catch (EJBException e) {
log.info("noisy command threw exception", e);
// verify phrase was NOT inserted
- assertFalse(commandExecutor.execute(new RemovePhrase(text)));
+ assertFalse(commandExecutor.execute(new RemovePhraseCmd(text)));
}
}
}
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/CommandReceiverTest.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/CommandReceiverTest.java 2008-07-15 16:26:12 UTC (rev 1643)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/CommandReceiverTest.java 2008-07-15 22:17:15 UTC (rev 1644)
@@ -35,8 +35,8 @@
import org.apache.cactus.ServletTestCase;
-import org.jbpm.enterprise.custom.InsertPhrase;
-import org.jbpm.enterprise.custom.RemovePhrase;
+import org.jbpm.enterprise.custom.InsertPhraseCmd;
+import org.jbpm.enterprise.custom.RemovePhraseCmd;
import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.ejb.CommandReceiverMDB;
@@ -84,12 +84,12 @@
* <h3>Preconditions</h3>
* The TEST_PHRASE table does not contain any row with the specified text.
* <h3>Behavior</h3>
- * The {@link InsertPhrase} command message creates a row with the specified
+ * The {@link InsertPhraseCmd} command message creates a row with the specified
* text. Once the command completes, the command receiver sends the result to
* the reply queue.
* <h3>Postconditions</h3>
* A new row with the specified text exists in the table. The
- * {@link RemovePhrase} command message removes the row. The result sent to
+ * {@link RemovePhraseCmd} command message removes the row. The result sent to
* the reply queue confirms the row was there.
*/
public void testHappyMessage() throws JMSException {
@@ -97,7 +97,7 @@
Session jmsSession = jmsConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
try {
// send insert command
- Command<Void> insertCommand = new InsertPhrase(text, /* fail? */false);
+ Command<Void> insertCommand = new InsertPhraseCmd(text, /* fail? */false);
Message insertMessage = jmsSession.createObjectMessage(insertCommand);
Destination replyTo = jmsSession.createTemporaryQueue();
insertMessage.setJMSReplyTo(replyTo);
@@ -110,7 +110,7 @@
assertNull(responseMessage.getObject());
// send remove command
- Command<Boolean> removeCommand = new RemovePhrase(text);
+ Command<Boolean> removeCommand = new RemovePhraseCmd(text);
Message removeMessage = jmsSession.createObjectMessage(removeCommand);
removeMessage.setJMSReplyTo(replyTo);
producer.send(removeMessage);
@@ -127,19 +127,19 @@
/**
* This scenario tests a command message that throws a checked exception
- * inside the {@link InsertPhrase#execute(org.jbpm.env.Environment) execute}
+ * inside the {@link InsertPhraseCmd#execute(org.jbpm.env.Environment) execute}
* method.
* <h3>Preconditions</h3>
* The TEST_PHRASE table does not contain any row with the specified text.
* <h3>Behavior</h3>
- * The {@link InsertPhrase} command message creates a row with the specified
+ * The {@link InsertPhraseCmd} command message creates a row with the specified
* text. The command is configured to throw a checked exception before
* completing. The exception prevents the command receiver from sending the
* result to the reply queue.
* <h3>Postconditions</h3>
* The command receiver rolls back the managed transaction and puts the
* insertion message back in the command queue. No row with the specified
- * exists in the database. The {@link RemovePhrase} command result sent to the
+ * exists in the database. The {@link RemovePhraseCmd} command result sent to the
* reply queue confirms the row was not there.
*/
public void testNoisyMessage() throws JMSException {
@@ -148,7 +148,7 @@
Session jmsSession = jmsConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
try {
// send insert command
- Command<Void> insertCommand = new InsertPhrase(text, /* fail? */true);
+ Command<Void> insertCommand = new InsertPhraseCmd(text, /* fail? */true);
Message insertMessage = jmsSession.createObjectMessage(insertCommand);
Destination replyTo = jmsSession.createTemporaryQueue();
insertMessage.setJMSReplyTo(replyTo);
@@ -161,7 +161,7 @@
assertNull(insertResponse);
// send remove command
- Command<Boolean> removeCommand = new RemovePhrase(text);
+ Command<Boolean> removeCommand = new RemovePhraseCmd(text);
Message removeMessage = jmsSession.createObjectMessage(removeCommand);
removeMessage.setJMSReplyTo(replyTo);
producer.send(removeMessage);
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/EnterpriseTimerSessionTest.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/EnterpriseTimerSessionTest.java 2008-07-15 16:26:12 UTC (rev 1643)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/EnterpriseTimerSessionTest.java 2008-07-15 22:17:15 UTC (rev 1644)
@@ -40,7 +40,6 @@
import org.jbpm.pvm.internal.ejb.LocalCommandExecutorHome;
import org.jbpm.pvm.internal.job.TimerImpl;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-import org.jbpm.pvm.job.Timer;
import org.jbpm.pvm.model.ProcessDefinition;
import org.jbpm.pvm.model.ProcessFactory;
import org.jbpm.pvm.session.DbSession;
@@ -91,7 +90,7 @@
* <h3>Preconditions</h3>
* The activity has not executed.
* <h3>Behavior</h3>
- * The {@link ScheduleTimer} command activates a timerImpl. After that, the test
+ * The {@link ScheduleTimerCmd} command activates a timerImpl. After that, the test
* waits for the activity to execute. Upon timeout, the
* {@linkplain HappyActivity activity} notifies the test of its execution.
* <h3>Postconditions</h3>
@@ -116,8 +115,8 @@
* <h3>Preconditions</h3>
* The activity has not executed.
* <h3>Behavior</h3>
- * The {@link ScheduleTimer} command activates a timerImpl, which is immediately
- * disabled by the {@link CancelTimer} command. After that, the test waits
+ * The {@link ScheduleTimerCmd} command activates a timerImpl, which is immediately
+ * disabled by the {@link CancelTimerCmd} command. After that, the test waits
* past the timerImpl's due date.
* <h3>Postconditions</h3>
* The activity does not execute, ever.
@@ -130,13 +129,13 @@
assertNull(executionDate);
}
- static class ScheduleTimer implements Command<Void> {
+ static class ScheduleTimerCmd implements Command<Void> {
private final TimerImpl timer;
private static final long serialVersionUID = 1L;
- ScheduleTimer(TimerImpl timer) {
+ ScheduleTimerCmd(TimerImpl timer) {
this.timer = timer;
}
@@ -147,13 +146,13 @@
}
}
- static class CancelTimer implements Command<Void> {
+ static class CancelTimerCmd implements Command<Void> {
private final long timerDbid;
private static final long serialVersionUID = 1L;
- CancelTimer(long timerDbid) {
+ CancelTimerCmd(long timerDbid) {
this.timerDbid = timerDbid;
}
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/TimerTest.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/TimerTest.java 2008-07-15 16:26:12 UTC (rev 1643)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/TimerTest.java 2008-07-15 22:17:15 UTC (rev 1644)
@@ -100,7 +100,7 @@
* <h3>Preconditions</h3>
* The activity has not executed.
* <h3>Behavior</h3>
- * The {@link CreateTimer} command subscribes a timerImpl bean to the EJB timerImpl
+ * The {@link CreateTimerCmd} command subscribes a timerImpl bean to the EJB timerImpl
* service. After that, the test waits for the activity to execute. Upon
* timeout, the {@linkplain HappyActivity activity} notifies the test of its
* execution.
@@ -118,7 +118,7 @@
timerImpl.setEventName("timeout");
timerImpl.setDueDate(dueDate);
timerImpl.setExecution(execution);
- commandExecutor.execute(new CreateTimer(timerImpl));
+ commandExecutor.execute(new CreateTimerCmd(timerImpl));
Date executionDate = HappyActivity.waitFor();
assertTrue(dueDate.compareTo(executionDate) <= 0);
@@ -130,7 +130,7 @@
* <h3>Preconditions</h3>
* The activity has not executed.
* <h3>Behavior</h3>
- * The {@link CreateTimer} command subscribes a timerImpl bean to the EJB timerImpl
+ * The {@link CreateTimerCmd} command subscribes a timerImpl bean to the EJB timerImpl
* service. After that, the test waits for the activity to execute. Upon
* timeout, the {@linkplain NoisyActivity activity} notifies the test of its
* execution, sets a variable and throws a checked exception.
@@ -149,7 +149,7 @@
timerImpl.setEventName("timeout");
timerImpl.setDueDate(dueDate);
timerImpl.setExecution(execution);
- commandExecutor.execute(new CreateTimer(timerImpl));
+ commandExecutor.execute(new CreateTimerCmd(timerImpl));
Date executionDate = NoisyActivity.waitFor();
assertTrue(dueDate.compareTo(executionDate) <= 0);
@@ -164,7 +164,7 @@
* <h3>Preconditions</h3>
* The activity has not executed.
* <h3>Behavior</h3>
- * The {@link CreateTimer} command subscribes a timerImpl bean to the EJB timerImpl
+ * The {@link CreateTimerCmd} command subscribes a timerImpl bean to the EJB timerImpl
* service. After that, the test waits for the first execution of the
* activity, and then for the subsequent <em>n</em> executions of the
* activity. Upon each timeout, the {@linkplain HappyActivity activity}
@@ -186,7 +186,7 @@
timerImpl.setDueDate(dueDate);
timerImpl.setRepeat(REPEAT + " milliseconds");
timerImpl.setExecution(execution);
- commandExecutor.execute(new CreateTimer(timerImpl));
+ commandExecutor.execute(new CreateTimerCmd(timerImpl));
try {
Date executionTime = HappyActivity.waitFor();
@@ -199,17 +199,17 @@
assertTrue(dueDate.compareTo(executionTime) <= 0);
}
} finally {
- commandExecutor.execute(new CancelTimer(timerImpl.getDbid()));
+ commandExecutor.execute(new CancelTimerCmd(timerImpl.getDbid()));
}
}
- static class CreateTimer implements Command<Void> {
+ static class CreateTimerCmd implements Command<Void> {
private final TimerImpl timerImpl;
private static final long serialVersionUID = 1L;
- CreateTimer(TimerImpl timerImpl) {
+ CreateTimerCmd(TimerImpl timerImpl) {
this.timerImpl = timerImpl;
}
@@ -226,17 +226,17 @@
}
public String toString() {
- return CreateTimer.class.getSimpleName() + '(' + timerImpl + ')';
+ return CreateTimerCmd.class.getSimpleName() + '(' + timerImpl + ')';
}
}
- static class CancelTimer implements Command<Void> {
+ static class CancelTimerCmd implements Command<Void> {
private final long timerDbid;
private static final long serialVersionUID = 1L;
- CancelTimer(long timerDbid) {
+ CancelTimerCmd(long timerDbid) {
this.timerDbid = timerDbid;
}
@@ -247,7 +247,7 @@
}
public String toString() {
- return CancelTimer.class.getSimpleName() + '(' + timerDbid + ')';
+ return CancelTimerCmd.class.getSimpleName() + '(' + timerDbid + ')';
}
}
}
Deleted: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/custom/InsertPhrase.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/custom/InsertPhrase.java 2008-07-15 16:26:12 UTC (rev 1643)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/custom/InsertPhrase.java 2008-07-15 22:17:15 UTC (rev 1644)
@@ -1,62 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.enterprise.custom;
-
-import java.sql.SQLException;
-
-import org.jbpm.pvm.env.Environment;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.session.DbSession;
-
-/**
- * @author Alejandro Guizar
- */
-public class InsertPhrase implements Command<Void> {
-
- private final String text;
- private final boolean fail;
-
- private static final long serialVersionUID = 1L;
-
- public InsertPhrase(String text) {
- this(text, false);
- }
-
- public InsertPhrase(String text, boolean fail) {
- this.text = text;
- this.fail = fail;
- }
-
- public Void execute(Environment environment) throws Exception {
- Phrase phrase = new Phrase();
- phrase.setText(text);
- environment.get(DbSession.class).save(phrase);
- if (fail)
- throw new SQLException("simulated failure");
- return null;
- }
-
- @Override
- public String toString() {
- return InsertPhrase.class.getSimpleName() + '(' + text + ')';
- }
-}
\ No newline at end of file
Copied: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/custom/InsertPhraseCmd.java (from rev 1643, jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/custom/InsertPhrase.java)
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/custom/InsertPhraseCmd.java (rev 0)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/custom/InsertPhraseCmd.java 2008-07-15 22:17:15 UTC (rev 1644)
@@ -0,0 +1,62 @@
+/*
+ * 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.enterprise.custom;
+
+import java.sql.SQLException;
+
+import org.jbpm.pvm.env.Environment;
+import org.jbpm.pvm.internal.cmd.Command;
+import org.jbpm.pvm.session.DbSession;
+
+/**
+ * @author Alejandro Guizar
+ */
+public class InsertPhraseCmd implements Command<Void> {
+
+ private final String text;
+ private final boolean fail;
+
+ private static final long serialVersionUID = 1L;
+
+ public InsertPhraseCmd(String text) {
+ this(text, false);
+ }
+
+ public InsertPhraseCmd(String text, boolean fail) {
+ this.text = text;
+ this.fail = fail;
+ }
+
+ public Void execute(Environment environment) throws Exception {
+ Phrase phrase = new Phrase();
+ phrase.setText(text);
+ environment.get(DbSession.class).save(phrase);
+ if (fail)
+ throw new SQLException("simulated failure");
+ return null;
+ }
+
+ @Override
+ public String toString() {
+ return InsertPhraseCmd.class.getSimpleName() + '(' + text + ')';
+ }
+}
\ No newline at end of file
Deleted: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/custom/RemovePhrase.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/custom/RemovePhrase.java 2008-07-15 16:26:12 UTC (rev 1643)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/custom/RemovePhrase.java 2008-07-15 22:17:15 UTC (rev 1644)
@@ -1,62 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.enterprise.custom;
-
-import java.util.List;
-
-import org.hibernate.Session;
-import org.hibernate.criterion.Restrictions;
-
-import org.jbpm.pvm.env.Environment;
-import org.jbpm.pvm.internal.cmd.Command;
-
-/**
- * @author Alejandro Guizar
- */
-public class RemovePhrase implements Command<Boolean> {
-
- private final String text;
-
- private static final long serialVersionUID = 1L;
-
- public RemovePhrase(String text) {
- this.text = text;
- }
-
- public Boolean execute(Environment environment) throws Exception {
- Session session = environment.get(Session.class);
- List<?> phrases = session.createCriteria(Phrase.class)
- .add(Restrictions.eq("text", text))
- .setMaxResults(1)
- .list();
- if (phrases.isEmpty())
- return false;
- Phrase phrase = (Phrase) phrases.get(0);
- session.delete(phrase);
- return true;
- }
-
- @Override
- public String toString() {
- return RemovePhrase.class.getSimpleName() + '(' + text + ')';
- }
-}
\ No newline at end of file
Copied: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/custom/RemovePhraseCmd.java (from rev 1643, jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/custom/RemovePhrase.java)
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/custom/RemovePhraseCmd.java (rev 0)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/enterprise/custom/RemovePhraseCmd.java 2008-07-15 22:17:15 UTC (rev 1644)
@@ -0,0 +1,61 @@
+/*
+ * 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.enterprise.custom;
+
+import java.util.List;
+
+import org.hibernate.Session;
+import org.hibernate.criterion.Restrictions;
+
+import org.jbpm.pvm.env.Environment;
+import org.jbpm.pvm.internal.cmd.Command;
+
+/**
+ * @author Alejandro Guizar
+ */
+public class RemovePhraseCmd implements Command<Boolean> {
+
+ private final String text;
+
+ private static final long serialVersionUID = 1L;
+
+ public RemovePhraseCmd(String text) {
+ this.text = text;
+ }
+
+ public Boolean execute(Environment environment) throws Exception {
+ Session session = environment.get(Session.class);
+ List<?> phrases = session.createCriteria(Phrase.class)
+ .add(Restrictions.eq("text", text))
+ .setMaxResults(1)
+ .list();
+ if (phrases.isEmpty())
+ return false;
+ Phrase phrase = (Phrase) phrases.get(0);
+ session.delete(phrase);
+ return true;
+ }
+
+ public String toString() {
+ return RemovePhraseCmd.class.getSimpleName() + '(' + text + ')';
+ }
+}
\ No newline at end of file
17 years, 9 months
JBoss JBPM SVN: r1643 - api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-15 12:26:12 -0400 (Tue, 15 Jul 2008)
New Revision: 1643
Modified:
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/RuntimeProcess.java
Log:
javadoc
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/RuntimeProcess.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/RuntimeProcess.java 2008-07-15 16:25:20 UTC (rev 1642)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/RuntimeProcess.java 2008-07-15 16:26:12 UTC (rev 1643)
@@ -43,7 +43,6 @@
/**
* Get the {@link FlowScheduler} for this {@link Process}
- * @return
*/
MutableFlowScheduler getFlowScheduler();
}
\ No newline at end of file
17 years, 9 months
JBoss JBPM SVN: r1642 - in api/trunk/modules/api/src/main/java/org/jboss/bpm: model/internal and 1 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-15 12:25:20 -0400 (Tue, 15 Jul 2008)
New Revision: 1642
Added:
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/RuntimeProcessImpl.java
Modified:
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ProcessImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/RuntimeProcess.java
Log:
Introduce RuntimeProcess
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.java 2008-07-15 16:10:20 UTC (rev 1641)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.java 2008-07-15 16:25:20 UTC (rev 1642)
@@ -68,10 +68,11 @@
}
@Override
- public Future<Result> startProcess(RuntimeProcess proc, Attachments att)
+ public Future<Result> startProcess(RuntimeProcess rtProc, Attachments att)
{
+ Process proc = rtProc.getProcess();
throwSignal(new Signal(proc, Signal.Type.ENTER_PROCESS));
- MutableFlowScheduler flowScheduler = proc.getFlowScheduler();
+ MutableFlowScheduler flowScheduler = rtProc.getFlowScheduler();
try
{
Token initalToken = new Token(proc, att);
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ProcessImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ProcessImpl.java 2008-07-15 16:10:20 UTC (rev 1641)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ProcessImpl.java 2008-07-15 16:25:20 UTC (rev 1642)
@@ -34,6 +34,7 @@
import org.jboss.bpm.model.EndEvent;
import org.jboss.bpm.model.FlowObject;
import org.jboss.bpm.model.NamedFlowObject;
+import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.Result;
import org.jboss.bpm.model.StartEvent;
import org.jboss.bpm.model.internal.jaxb.JAXBComplexGateway;
@@ -48,8 +49,6 @@
import org.jboss.bpm.model.internal.jaxb.JAXBSubProcess;
import org.jboss.bpm.model.internal.jaxb.JAXBTask;
import org.jboss.bpm.runtime.Attachments;
-import org.jboss.bpm.runtime.MutableFlowScheduler;
-import org.jboss.bpm.runtime.RuntimeProcess;
/**
* A Process is any Activity performed within a company or organization.
@@ -57,11 +56,10 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public class ProcessImpl extends ActivityImpl implements RuntimeProcess
+public class ProcessImpl extends ActivityImpl implements Process
{
private List<FlowObject> flowObjects = new ArrayList<FlowObject>();
private ProcessState processState = ProcessState.CREATED;
- private MutableFlowScheduler scheduler = new FlowSchedulerImpl();
public ProcessImpl(String name)
{
@@ -132,7 +130,7 @@
processState = ProcessState.STARTED;
ExecutionManager exm = ExecutionManager.locateExecutionManager();
- return exm.startProcess(this, att);
+ return exm.startProcess(new RuntimeProcessImpl(this), att);
}
public FlowObject findFlowObject(String name)
@@ -161,11 +159,6 @@
return processState;
}
- public MutableFlowScheduler getFlowScheduler()
- {
- return scheduler;
- }
-
/**
* Set the process state
*/
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/RuntimeProcessImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/RuntimeProcessImpl.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/RuntimeProcessImpl.java 2008-07-15 16:25:20 UTC (rev 1642)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.model.internal;
+
+//$Id$
+
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.runtime.MutableFlowScheduler;
+import org.jboss.bpm.runtime.RuntimeProcess;
+
+/**
+ * A RuntimeProcess add runtime behaviour to the {@link Process}
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class RuntimeProcessImpl implements RuntimeProcess
+{
+ private Process process;
+ private MutableFlowScheduler scheduler = new FlowSchedulerImpl();
+
+ public RuntimeProcessImpl(Process process)
+ {
+ super();
+ this.process = process;
+ }
+
+ public Process getProcess()
+ {
+ return process;
+ }
+
+ public MutableFlowScheduler getFlowScheduler()
+ {
+ return scheduler;
+ }
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/RuntimeProcessImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/RuntimeProcess.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/RuntimeProcess.java 2008-07-15 16:10:20 UTC (rev 1641)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/RuntimeProcess.java 2008-07-15 16:25:20 UTC (rev 1642)
@@ -27,12 +27,20 @@
/**
* A RuntimeProcess add runtime behaviour to the {@link Process}
+ * <p/>
+ * To protect the engine from maligious user code it does not extend
+ * {@link Process} directly.
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface RuntimeProcess extends Process
+public interface RuntimeProcess
{
+ /**
+ * Get the associated {@link Process}
+ */
+ Process getProcess();
+
/**
* Get the {@link FlowScheduler} for this {@link Process}
* @return
17 years, 9 months
JBoss JBPM SVN: r1641 - api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-15 12:10:20 -0400 (Tue, 15 Jul 2008)
New Revision: 1641
Modified:
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Token.java
Log:
javadoc
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Token.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Token.java 2008-07-15 16:03:55 UTC (rev 1640)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Token.java 2008-07-15 16:10:20 UTC (rev 1641)
@@ -42,22 +42,37 @@
private Process proc;
private ExecutionContext context;
+ /**
+ * Construct a Token with a given {@link Process} and {@link Attachments}
+ */
public Token(Process proc, Attachments att)
{
this.proc = proc;
this.context = new InitialContext(att);
}
+ /**
+ * Get the associated {@link Process}
+ */
public Process getProcess()
{
return proc;
}
+ /**
+ * Get the associated {@link ExecutionContext}
+ */
public ExecutionContext getExecutionContext()
{
return context;
}
+ /**
+ * Create a schallow copy of this Token.
+ * <p/>
+ * The content in the {@link ExecutionContext} will be
+ * copied by reference.
+ */
public Token createCopy()
{
return new Token(proc, context);
17 years, 9 months
JBoss JBPM SVN: r1640 - in api/trunk/modules/api/src/main/java/org/jboss/bpm: client/internal and 3 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-15 12:03:55 -0400 (Tue, 15 Jul 2008)
New Revision: 1640
Added:
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/FlowSchedulerImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/HandlerSetterSupport.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/FlowScheduler.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/MutableFlowScheduler.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/RuntimeProcess.java
Removed:
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/HandlerSetterSupport.java
Modified:
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilderFactory.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/EndEventImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/EventImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/FlowHandlerImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/GatewayImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/IntermediateEventImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ParallelGatewayImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ProcessImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/StartEventImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SubProcessImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/TaskImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/FlowHandler.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Token.java
Log:
Introduce FlowScheduler
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java 2008-07-15 14:58:26 UTC (rev 1639)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java 2008-07-15 16:03:55 UTC (rev 1640)
@@ -26,13 +26,13 @@
import java.util.concurrent.Future;
import org.jboss.bpm.model.FlowObject;
-import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.Result;
import org.jboss.bpm.model.Signal;
import org.jboss.bpm.runtime.Attachments;
import org.jboss.bpm.runtime.ExecutionHandler;
import org.jboss.bpm.runtime.FlowHandler;
import org.jboss.bpm.runtime.HandlerSupport;
+import org.jboss.bpm.runtime.RuntimeProcess;
import org.jboss.bpm.runtime.SignalHandler;
/**
@@ -57,7 +57,7 @@
* @param att The Attachments in the ExecutionContext
* @return The Future from which to obtain the process result
*/
- public abstract Future<Result> startProcess(Process proc, Attachments att);
+ public abstract Future<Result> startProcess(RuntimeProcess proc, Attachments att);
/**
* Locate the signal manager
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.java 2008-07-15 14:58:26 UTC (rev 1639)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.java 2008-07-15 16:03:55 UTC (rev 1640)
@@ -45,8 +45,11 @@
import org.jboss.bpm.runtime.Attachments;
import org.jboss.bpm.runtime.ExecutionHandler;
import org.jboss.bpm.runtime.FlowHandler;
+import org.jboss.bpm.runtime.MutableFlowScheduler;
+import org.jboss.bpm.runtime.RuntimeProcess;
import org.jboss.bpm.runtime.SignalHandler;
import org.jboss.bpm.runtime.Token;
+import org.jboss.bpm.runtime.FlowScheduler.Tuple;
/**
* The process manager is the entry point to create, find and otherwise manage processes.
@@ -65,19 +68,23 @@
}
@Override
- public Future<Result> startProcess(Process proc, Attachments att)
+ public Future<Result> startProcess(RuntimeProcess proc, Attachments att)
{
throwSignal(new Signal(proc, Signal.Type.ENTER_PROCESS));
+ MutableFlowScheduler flowScheduler = proc.getFlowScheduler();
try
{
- Token token = new Token(proc, att);
+ Token initalToken = new Token(proc, att);
StartEvent start = proc.getStartEvent();
- token.addTailFlow(new InitialFlow(start));
+ Tuple tuple = new Tuple(new InitialFlow(start), initalToken);
+ flowScheduler.scheduleTuple(tuple);
- while (token.peekHeadFlow() != null)
+ while (flowScheduler.peekHeadTuple() != null)
{
// Peek the head flow
- Flow flow = token.peekHeadFlow();
+ tuple = flowScheduler.peekHeadTuple();
+ Flow flow = tuple.getFlow();
+ Token token = tuple.getToken();
// Get the target and its handlers
FlowObject target = flow.getTarget();
@@ -96,11 +103,11 @@
throwSignal(sigHandler.getExitSignal());
}
- // Remove the head flow
- token.removeHeadFlow();
+ // Remove the head tuple
+ flowScheduler.removeHeadTuple();
// Transfer the token to the FlowHandler
- flowHandler.execute(token);
+ flowHandler.execute(flowScheduler, token);
}
}
finally
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilderFactory.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilderFactory.java 2008-07-15 14:58:26 UTC (rev 1639)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilderFactory.java 2008-07-15 16:03:55 UTC (rev 1640)
@@ -33,6 +33,11 @@
*/
public abstract class ProcessBuilderFactory
{
+ // Hide the constructor
+ private ProcessBuilderFactory()
+ {
+ }
+
/**
* Get a {@link ProcessBuilder} for a given process name.
*/
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/EndEventImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/EndEventImpl.java 2008-07-15 14:58:26 UTC (rev 1639)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/EndEventImpl.java 2008-07-15 16:03:55 UTC (rev 1640)
@@ -34,6 +34,7 @@
import org.jboss.bpm.runtime.Attachments;
import org.jboss.bpm.runtime.ExecutionHandler;
import org.jboss.bpm.runtime.FlowHandler;
+import org.jboss.bpm.runtime.FlowScheduler;
import org.jboss.bpm.runtime.SignalHandler;
import org.jboss.bpm.runtime.Token;
@@ -123,7 +124,7 @@
{
handler = new FlowHandler()
{
- public void execute(Token token)
+ public void execute(FlowScheduler scheduler, Token token)
{
log.debug("End reached in: " + getName());
}
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/EventImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/EventImpl.java 2008-07-15 14:58:26 UTC (rev 1639)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/EventImpl.java 2008-07-15 16:03:55 UTC (rev 1640)
@@ -25,7 +25,6 @@
import org.jboss.bpm.model.internal.jaxb.JAXBEvent;
import org.jboss.bpm.runtime.ExecutionHandler;
import org.jboss.bpm.runtime.FlowHandler;
-import org.jboss.bpm.runtime.HandlerSetterSupport;
import org.jboss.bpm.runtime.SignalHandler;
//$Id$
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/FlowHandlerImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/FlowHandlerImpl.java 2008-07-15 14:58:26 UTC (rev 1639)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/FlowHandlerImpl.java 2008-07-15 16:03:55 UTC (rev 1640)
@@ -25,6 +25,7 @@
import org.jboss.bpm.model.internal.jaxb.JAXBFlowHandler;
import org.jboss.bpm.runtime.FlowHandler;
+import org.jboss.bpm.runtime.FlowScheduler;
import org.jboss.bpm.runtime.Token;
/**
@@ -47,13 +48,13 @@
super(delegate);
}
- public void execute(Token token)
+ public void execute(FlowScheduler scheduler, Token token)
{
if (handler == null)
{
handler = newInstance(FlowHandler.class);
}
- handler.execute(token);
+ handler.execute(scheduler, token);
}
public static FlowHandler adaptHandler(JAXBFlowHandler jaxb)
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/FlowSchedulerImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/FlowSchedulerImpl.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/FlowSchedulerImpl.java 2008-07-15 16:03:55 UTC (rev 1640)
@@ -0,0 +1,59 @@
+/*
+ * 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.jboss.bpm.model.internal;
+
+//$Id$
+
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+import org.jboss.bpm.model.Flow;
+import org.jboss.bpm.runtime.FlowHandler;
+import org.jboss.bpm.runtime.MutableFlowScheduler;
+import org.jboss.bpm.runtime.Token;
+
+/**
+ * The {@link FlowHandler} invokes the FlowScheduler to schedule
+ * {@link Flow} objects together with their associated {@link Token}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class FlowSchedulerImpl implements MutableFlowScheduler
+{
+ private Queue<Tuple> flowQueue = new ConcurrentLinkedQueue<Tuple>();
+
+ public void scheduleTuple(Tuple tuple)
+ {
+ flowQueue.add(tuple);
+ }
+
+ public Tuple peekHeadTuple()
+ {
+ return flowQueue.peek();
+ }
+
+ public Tuple removeHeadTuple()
+ {
+ return flowQueue.remove();
+ }
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/FlowSchedulerImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/GatewayImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/GatewayImpl.java 2008-07-15 14:58:26 UTC (rev 1639)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/GatewayImpl.java 2008-07-15 16:03:55 UTC (rev 1640)
@@ -37,9 +37,10 @@
import org.jboss.bpm.model.internal.jaxb.JAXBGateway;
import org.jboss.bpm.runtime.ExecutionHandler;
import org.jboss.bpm.runtime.FlowHandler;
-import org.jboss.bpm.runtime.HandlerSetterSupport;
+import org.jboss.bpm.runtime.FlowScheduler;
import org.jboss.bpm.runtime.SignalHandler;
import org.jboss.bpm.runtime.Token;
+import org.jboss.bpm.runtime.FlowScheduler.Tuple;
/**
* Gateways are modelling elements that are used to control how Sequence Flow interact as they converge and diverge within a Process. If the flow does not need to be
@@ -128,9 +129,10 @@
{
handler = new FlowHandler()
{
- public void execute(Token token)
+ public void execute(FlowScheduler scheduler, Token token)
{
- token.addTailFlow(outFlows.get(0));
+ Tuple tuple = new Tuple(outFlows.get(0), token);
+ scheduler.scheduleTuple(tuple);
}
};
}
Copied: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/HandlerSetterSupport.java (from rev 1637, api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/HandlerSetterSupport.java)
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/HandlerSetterSupport.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/HandlerSetterSupport.java 2008-07-15 16:03:55 UTC (rev 1640)
@@ -0,0 +1,48 @@
+/*
+ * 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.jboss.bpm.model.internal;
+
+import org.jboss.bpm.runtime.ExecutionHandler;
+import org.jboss.bpm.runtime.FlowHandler;
+import org.jboss.bpm.runtime.HandlerSupport;
+import org.jboss.bpm.runtime.SignalHandler;
+
+
+//$Id$
+
+/**
+ * A combined interface for execution aspects
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface HandlerSetterSupport extends HandlerSupport
+{
+ /** Set the associated ExecutionHandler */
+ void setExecutionHandler(ExecutionHandler handler);
+
+ /** Set the associated SignalHandler */
+ void setSignalHandler(SignalHandler handler);
+
+ /** Set the associated FlowHandler */
+ void setFlowHandler(FlowHandler handler);
+}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/IntermediateEventImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/IntermediateEventImpl.java 2008-07-15 14:58:26 UTC (rev 1639)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/IntermediateEventImpl.java 2008-07-15 16:03:55 UTC (rev 1640)
@@ -33,8 +33,10 @@
import org.jboss.bpm.model.internal.jaxb.JAXBIntermediateEvent;
import org.jboss.bpm.runtime.ExecutionHandler;
import org.jboss.bpm.runtime.FlowHandler;
+import org.jboss.bpm.runtime.FlowScheduler;
import org.jboss.bpm.runtime.SignalHandler;
import org.jboss.bpm.runtime.Token;
+import org.jboss.bpm.runtime.FlowScheduler.Tuple;
/**
* An Intermediate Event is an Event that occurs after a Process has been started. It will affect the Flow of the Process, but will not start or (directly) terminate
@@ -119,9 +121,10 @@
{
handler = new FlowHandler()
{
- public void execute(Token token)
+ public void execute(FlowScheduler scheduler, Token token)
{
- token.addTailFlow(getOutFlow());
+ Tuple tuple = new Tuple(getOutFlow(), token);
+ scheduler.scheduleTuple(tuple);
}
};
}
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ParallelGatewayImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ParallelGatewayImpl.java 2008-07-15 14:58:26 UTC (rev 1639)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ParallelGatewayImpl.java 2008-07-15 16:03:55 UTC (rev 1640)
@@ -27,7 +27,9 @@
import org.jboss.bpm.model.ParallelGateway;
import org.jboss.bpm.model.internal.jaxb.JAXBParallelGateway;
import org.jboss.bpm.runtime.FlowHandler;
+import org.jboss.bpm.runtime.FlowScheduler;
import org.jboss.bpm.runtime.Token;
+import org.jboss.bpm.runtime.FlowScheduler.Tuple;
/**
@@ -59,10 +61,13 @@
{
handler = new FlowHandler()
{
- public void execute(Token token)
+ public void execute(FlowScheduler scheduler, Token token)
{
for(Flow outFlow : getOutFlows())
- token.addTailFlow(outFlow);
+ {
+ Tuple tuple = new Tuple(outFlow, token.createCopy());
+ scheduler.scheduleTuple(tuple);
+ }
}
};
}
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderImpl.java 2008-07-15 14:58:26 UTC (rev 1639)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderImpl.java 2008-07-15 16:03:55 UTC (rev 1640)
@@ -28,7 +28,6 @@
import org.jboss.bpm.model.ProcessBuilder;
import org.jboss.bpm.runtime.ExecutionHandler;
import org.jboss.bpm.runtime.FlowHandler;
-import org.jboss.bpm.runtime.HandlerSetterSupport;
import org.jboss.bpm.runtime.SignalHandler;
/**
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ProcessImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ProcessImpl.java 2008-07-15 14:58:26 UTC (rev 1639)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ProcessImpl.java 2008-07-15 16:03:55 UTC (rev 1640)
@@ -34,7 +34,6 @@
import org.jboss.bpm.model.EndEvent;
import org.jboss.bpm.model.FlowObject;
import org.jboss.bpm.model.NamedFlowObject;
-import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.Result;
import org.jboss.bpm.model.StartEvent;
import org.jboss.bpm.model.internal.jaxb.JAXBComplexGateway;
@@ -49,6 +48,8 @@
import org.jboss.bpm.model.internal.jaxb.JAXBSubProcess;
import org.jboss.bpm.model.internal.jaxb.JAXBTask;
import org.jboss.bpm.runtime.Attachments;
+import org.jboss.bpm.runtime.MutableFlowScheduler;
+import org.jboss.bpm.runtime.RuntimeProcess;
/**
* A Process is any Activity performed within a company or organization.
@@ -56,10 +57,11 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public class ProcessImpl extends ActivityImpl implements Process
+public class ProcessImpl extends ActivityImpl implements RuntimeProcess
{
private List<FlowObject> flowObjects = new ArrayList<FlowObject>();
private ProcessState processState = ProcessState.CREATED;
+ private MutableFlowScheduler scheduler = new FlowSchedulerImpl();
public ProcessImpl(String name)
{
@@ -159,6 +161,11 @@
return processState;
}
+ public MutableFlowScheduler getFlowScheduler()
+ {
+ return scheduler;
+ }
+
/**
* Set the process state
*/
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/StartEventImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/StartEventImpl.java 2008-07-15 14:58:26 UTC (rev 1639)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/StartEventImpl.java 2008-07-15 16:03:55 UTC (rev 1640)
@@ -32,8 +32,10 @@
import org.jboss.bpm.model.internal.jaxb.JAXBStartEvent;
import org.jboss.bpm.runtime.ExecutionHandler;
import org.jboss.bpm.runtime.FlowHandler;
+import org.jboss.bpm.runtime.FlowScheduler;
import org.jboss.bpm.runtime.SignalHandler;
import org.jboss.bpm.runtime.Token;
+import org.jboss.bpm.runtime.FlowScheduler.Tuple;
/**
* A Start Event indicates where a particular Process will start. In terms of Sequence Flow, the Start Event starts the Flow of the Process, and thus, will not have any
@@ -95,9 +97,10 @@
{
handler = new FlowHandler()
{
- public void execute(Token token)
+ public void execute(FlowScheduler scheduler, Token token)
{
- token.addTailFlow(outFlow);
+ Tuple tuple = new Tuple(outFlow, token);
+ scheduler.scheduleTuple(tuple);
}
};
}
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SubProcessImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SubProcessImpl.java 2008-07-15 14:58:26 UTC (rev 1639)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SubProcessImpl.java 2008-07-15 16:03:55 UTC (rev 1640)
@@ -31,9 +31,10 @@
import org.jboss.bpm.model.internal.jaxb.JAXBSubProcess;
import org.jboss.bpm.runtime.ExecutionHandler;
import org.jboss.bpm.runtime.FlowHandler;
-import org.jboss.bpm.runtime.HandlerSetterSupport;
+import org.jboss.bpm.runtime.FlowScheduler;
import org.jboss.bpm.runtime.SignalHandler;
import org.jboss.bpm.runtime.Token;
+import org.jboss.bpm.runtime.FlowScheduler.Tuple;
/**
* A Sub-Process is Process that is included within another Process.
@@ -114,9 +115,10 @@
{
handler = new FlowHandler()
{
- public void execute(Token token)
+ public void execute(FlowScheduler scheduler, Token token)
{
- token.addTailFlow(outFlow);
+ Tuple tuple = new Tuple(outFlow, token);
+ scheduler.scheduleTuple(tuple);
}
};
}
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/TaskImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/TaskImpl.java 2008-07-15 14:58:26 UTC (rev 1639)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/TaskImpl.java 2008-07-15 16:03:55 UTC (rev 1640)
@@ -30,9 +30,10 @@
import org.jboss.bpm.model.internal.jaxb.JAXBTask;
import org.jboss.bpm.runtime.ExecutionHandler;
import org.jboss.bpm.runtime.FlowHandler;
-import org.jboss.bpm.runtime.HandlerSetterSupport;
+import org.jboss.bpm.runtime.FlowScheduler;
import org.jboss.bpm.runtime.SignalHandler;
import org.jboss.bpm.runtime.Token;
+import org.jboss.bpm.runtime.FlowScheduler.Tuple;
//$Id$
@@ -127,9 +128,10 @@
{
handler = new FlowHandler()
{
- public void execute(Token token)
+ public void execute(FlowScheduler scheduler, Token token)
{
- token.addTailFlow(outFlow);
+ Tuple tuple = new Tuple(outFlow, token);
+ scheduler.scheduleTuple(tuple);
}
};
}
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/FlowHandler.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/FlowHandler.java 2008-07-15 14:58:26 UTC (rev 1639)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/FlowHandler.java 2008-07-15 16:03:55 UTC (rev 1640)
@@ -41,6 +41,6 @@
* The FlowHandler will add the active outgoing @{link Flow}s to
* some @{link Flow} queue for the {@link ProcessEngine} to execute.
*/
- void execute(Token token);
+ void execute(FlowScheduler scheduler, Token token);
}
\ No newline at end of file
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/FlowScheduler.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/FlowScheduler.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/FlowScheduler.java 2008-07-15 16:03:55 UTC (rev 1640)
@@ -0,0 +1,72 @@
+/*
+ * 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.jboss.bpm.runtime;
+
+//$Id$
+
+import org.jboss.bpm.model.Flow;
+
+/**
+ * The {@link FlowHandler} invokes the FlowScheduler to schedule
+ * {@link Flow} objects together with their associated {@link Token}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface FlowScheduler
+{
+ /**
+ * Schedule the given {@link Flow} and {@link Token}
+ */
+ void scheduleTuple(Tuple tuple);
+
+ /**
+ * A tuple of Flow and Token
+ */
+ class Tuple
+ {
+ private Flow flow;
+ private Token token;
+ /**
+ * Construct the Tuple with a given flow and Token
+ */
+ public Tuple(Flow flow, Token token)
+ {
+ this.flow = flow;
+ this.token = token;
+ }
+ /**
+ * Get the Flow
+ */
+ public Flow getFlow()
+ {
+ return flow;
+ }
+ /**
+ * Get the Token
+ */
+ public Token getToken()
+ {
+ return token;
+ }
+ }
+}
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/FlowScheduler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/HandlerSetterSupport.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/HandlerSetterSupport.java 2008-07-15 14:58:26 UTC (rev 1639)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/HandlerSetterSupport.java 2008-07-15 16:03:55 UTC (rev 1640)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.runtime;
-
-
-//$Id$
-
-/**
- * A combined interface for execution aspects
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface HandlerSetterSupport extends HandlerSupport
-{
- /** Set the associated ExecutionHandler */
- void setExecutionHandler(ExecutionHandler handler);
-
- /** Set the associated SignalHandler */
- void setSignalHandler(SignalHandler handler);
-
- /** Set the associated FlowHandler */
- void setFlowHandler(FlowHandler handler);
-}
\ No newline at end of file
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/MutableFlowScheduler.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/MutableFlowScheduler.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/MutableFlowScheduler.java 2008-07-15 16:03:55 UTC (rev 1640)
@@ -0,0 +1,44 @@
+/*
+ * 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.jboss.bpm.runtime;
+
+//$Id$
+
+
+/**
+ * The {@link FlowScheduler} that can be manipulated.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface MutableFlowScheduler extends FlowScheduler
+{
+ /**
+ * Peek the head {@link Tuple}
+ */
+ Tuple peekHeadTuple();
+
+ /**
+ * Remove the head {@link Tuple}
+ */
+ Tuple removeHeadTuple();
+}
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/MutableFlowScheduler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/RuntimeProcess.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/RuntimeProcess.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/RuntimeProcess.java 2008-07-15 16:03:55 UTC (rev 1640)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.runtime;
+
+//$Id$
+
+import org.jboss.bpm.model.Process;
+
+/**
+ * A RuntimeProcess add runtime behaviour to the {@link Process}
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface RuntimeProcess extends Process
+{
+ /**
+ * Get the {@link FlowScheduler} for this {@link Process}
+ * @return
+ */
+ MutableFlowScheduler getFlowScheduler();
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/RuntimeProcess.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Token.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Token.java 2008-07-15 14:58:26 UTC (rev 1639)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Token.java 2008-07-15 16:03:55 UTC (rev 1640)
@@ -23,12 +23,7 @@
//$Id$
-import java.util.Queue;
-import java.util.concurrent.ConcurrentLinkedQueue;
-
-import org.jboss.bpm.model.Flow;
import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.internal.FlowImpl;
/**
* A Token is a descriptive construct used to describe how the flow of a Process will proceed at runtime.
@@ -46,7 +41,6 @@
{
private Process proc;
private ExecutionContext context;
- private Queue<Flow> flowQueue = new ConcurrentLinkedQueue<Flow>();
public Token(Process proc, Attachments att)
{
@@ -64,21 +58,11 @@
return context;
}
- public Flow peekHeadFlow()
+ public Token createCopy()
{
- return flowQueue.peek();
+ return new Token(proc, context);
}
- public Flow removeHeadFlow()
- {
- return flowQueue.remove();
- }
-
- public void addTailFlow(Flow flow)
- {
- flowQueue.add(flow);
- }
-
static class InitialContext extends BasicAttachments implements ExecutionContext
{
InitialContext(Attachments att)
17 years, 9 months
JBoss JBPM SVN: r1639 - in api/trunk/modules/api/src/main/java/org/jboss/bpm/model: internal and 1 other directory.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-15 10:58:26 -0400 (Tue, 15 Jul 2008)
New Revision: 1639
Added:
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ComplexGateway.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExclusiveGateway.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/InclusiveGateway.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/MessageFlow.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ParallelGateway.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SequenceFlow.java
Modified:
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilder.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ComplexGatewayImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ExclusiveGatewayImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/InclusiveGatewayImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/MessageFlowImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ParallelGatewayImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SequenceFlowImpl.java
Log:
Add gateway and flow interfaces
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ComplexGateway.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ComplexGateway.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ComplexGateway.java 2008-07-15 14:58:26 UTC (rev 1639)
@@ -0,0 +1,37 @@
+/*
+ * 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.jboss.bpm.model;
+
+
+// $Id$
+
+/**
+ * A Complex Gateway handles situations that are not easily handled through the other types of Gateways. Complex Gateways can also be used to combine a set of linked
+ * simple Gateways into a single, more compact situation. Modelers can provide complex expressions that determine the merging and/or splitting behavior of the Gateway.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface ComplexGateway extends Gateway
+{
+
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ComplexGateway.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExclusiveGateway.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExclusiveGateway.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExclusiveGateway.java 2008-07-15 14:58:26 UTC (rev 1639)
@@ -0,0 +1,36 @@
+/*
+ * 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.jboss.bpm.model;
+
+
+//$Id$
+
+/**
+ * A point in the workflow process where, based on a decision or workflow control data, one of several branches is chosen.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface ExclusiveGateway extends Gateway
+{
+
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExclusiveGateway.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/InclusiveGateway.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/InclusiveGateway.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/InclusiveGateway.java 2008-07-15 14:58:26 UTC (rev 1639)
@@ -0,0 +1,37 @@
+/*
+ * 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.jboss.bpm.model;
+
+//$Id$
+
+/**
+ * This Decision represents a branching point where Alternatives are based on conditional expressions contained within outgoing Sequence Flow.
+ * However, in this case, the True evaluation of one condition expression does not exclude the evaluation of other condition expressions.
+ * All Sequence Flow with a True evaluation will be traversed by a Token.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface InclusiveGateway extends Gateway
+{
+
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/InclusiveGateway.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/MessageFlow.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/MessageFlow.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/MessageFlow.java 2008-07-15 14:58:26 UTC (rev 1639)
@@ -0,0 +1,36 @@
+/*
+ * 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.jboss.bpm.model;
+
+//$Id$
+
+/**
+ * A Message Flow is a dashed line that is used to show the flow of messages between two entities that are prepared to send and receive them.
+ * In BPMN, two separate Pools in the Diagram will represent the two entities.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface MessageFlow extends Flow
+{
+
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/MessageFlow.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ParallelGateway.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ParallelGateway.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ParallelGateway.java 2008-07-15 14:58:26 UTC (rev 1639)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.model;
+
+//$Id$
+
+/**
+ * Parallel Gateway is required when two or more Activities need to be executed in parallel.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface ParallelGateway extends Gateway
+{
+
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ParallelGateway.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java 2008-07-15 14:44:45 UTC (rev 1638)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java 2008-07-15 14:58:26 UTC (rev 1639)
@@ -41,7 +41,14 @@
*/
enum ProcessState
{
- CREATED, INITIALIZED, STARTED, ENDED
+ /** The Process is created but not yet initialized */
+ CREATED,
+ /** The Process is initialized but not yet started */
+ INITIALIZED,
+ /** The Process is started but has not yet ended */
+ STARTED,
+ /** The Process has ended */
+ ENDED
};
/**
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilder.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilder.java 2008-07-15 14:44:45 UTC (rev 1638)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilder.java 2008-07-15 14:58:26 UTC (rev 1639)
@@ -91,7 +91,7 @@
ProcessBuilder addSubProcess(String name);
/**
- * Add an {@link ItermediateEvent} with a given name
+ * Add an {@link IntermediateEvent} with a given name
*/
ProcessBuilder addItermediateEvent(String name);
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SequenceFlow.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SequenceFlow.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SequenceFlow.java 2008-07-15 14:58:26 UTC (rev 1639)
@@ -0,0 +1,36 @@
+/*
+ * 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.jboss.bpm.model;
+
+//$Id$
+
+/**
+ * A Sequence Flow is a solid graphical line that is used to show the order that Activities will be performed in a Process.
+ * Each Flow has only one source and only one target.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface SequenceFlow extends Flow
+{
+
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SequenceFlow.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ComplexGatewayImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ComplexGatewayImpl.java 2008-07-15 14:44:45 UTC (rev 1638)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ComplexGatewayImpl.java 2008-07-15 14:58:26 UTC (rev 1639)
@@ -21,6 +21,7 @@
*/
package org.jboss.bpm.model.internal;
+import org.jboss.bpm.model.ComplexGateway;
import org.jboss.bpm.model.internal.jaxb.JAXBComplexGateway;
// $Id$
@@ -32,7 +33,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public class ComplexGatewayImpl extends GatewayImpl
+public class ComplexGatewayImpl extends GatewayImpl implements ComplexGateway
{
public ComplexGatewayImpl(String name)
{
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ExclusiveGatewayImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ExclusiveGatewayImpl.java 2008-07-15 14:44:45 UTC (rev 1638)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ExclusiveGatewayImpl.java 2008-07-15 14:58:26 UTC (rev 1639)
@@ -21,6 +21,7 @@
*/
package org.jboss.bpm.model.internal;
+import org.jboss.bpm.model.ExclusiveGateway;
import org.jboss.bpm.model.internal.jaxb.JAXBExclusiveGateway;
//$Id$
@@ -31,7 +32,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public class ExclusiveGatewayImpl extends GatewayImpl
+public class ExclusiveGatewayImpl extends GatewayImpl implements ExclusiveGateway
{
public ExclusiveGatewayImpl(String name)
{
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/InclusiveGatewayImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/InclusiveGatewayImpl.java 2008-07-15 14:44:45 UTC (rev 1638)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/InclusiveGatewayImpl.java 2008-07-15 14:58:26 UTC (rev 1639)
@@ -23,6 +23,7 @@
//$Id$
+import org.jboss.bpm.model.InclusiveGateway;
import org.jboss.bpm.model.internal.jaxb.JAXBInclusiveGateway;
@@ -35,7 +36,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public class InclusiveGatewayImpl extends GatewayImpl
+public class InclusiveGatewayImpl extends GatewayImpl implements InclusiveGateway
{
public InclusiveGatewayImpl(String name)
{
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/MessageFlowImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/MessageFlowImpl.java 2008-07-15 14:44:45 UTC (rev 1638)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/MessageFlowImpl.java 2008-07-15 14:58:26 UTC (rev 1639)
@@ -23,6 +23,7 @@
//$Id$
+import org.jboss.bpm.model.MessageFlow;
import org.jboss.bpm.model.internal.jaxb.JAXBMessageFlow;
/**
@@ -32,7 +33,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public class MessageFlowImpl extends FlowImpl
+public class MessageFlowImpl extends FlowImpl implements MessageFlow
{
public MessageFlowImpl(String targetName)
{
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ParallelGatewayImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ParallelGatewayImpl.java 2008-07-15 14:44:45 UTC (rev 1638)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ParallelGatewayImpl.java 2008-07-15 14:58:26 UTC (rev 1639)
@@ -24,6 +24,7 @@
//$Id$
import org.jboss.bpm.model.Flow;
+import org.jboss.bpm.model.ParallelGateway;
import org.jboss.bpm.model.internal.jaxb.JAXBParallelGateway;
import org.jboss.bpm.runtime.FlowHandler;
import org.jboss.bpm.runtime.Token;
@@ -35,7 +36,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public class ParallelGatewayImpl extends GatewayImpl
+public class ParallelGatewayImpl extends GatewayImpl implements ParallelGateway
{
public ParallelGatewayImpl(String name)
{
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SequenceFlowImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SequenceFlowImpl.java 2008-07-15 14:44:45 UTC (rev 1638)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SequenceFlowImpl.java 2008-07-15 14:58:26 UTC (rev 1639)
@@ -23,6 +23,7 @@
//$Id$
+import org.jboss.bpm.model.SequenceFlow;
import org.jboss.bpm.model.internal.jaxb.JAXBSequenceFlow;
/**
@@ -32,7 +33,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public class SequenceFlowImpl extends FlowImpl
+public class SequenceFlowImpl extends FlowImpl implements SequenceFlow
{
public SequenceFlowImpl(String targetName)
{
17 years, 9 months
JBoss JBPM SVN: r1638 - in api/trunk/modules/api/src/main/java/org/jboss/bpm/model: internal and 1 other directory.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-15 10:44:45 -0400 (Tue, 15 Jul 2008)
New Revision: 1638
Added:
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/MultipleInFlowSetterSupport.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/MultipleOutFlowSetterSupport.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SingleInFlowSetterSupport.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SingleOutFlowSetterSupport.java
Modified:
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/MultipleInFlowSupport.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/MultipleOutFlowSupport.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SingleInFlowSupport.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SingleOutFlowSupport.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/EndEventImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/FlowObjectImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/GatewayImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/IntermediateEventImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/StartEventImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SubProcessImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/TaskImpl.java
Log:
Remove access to Flow setters
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/MultipleInFlowSupport.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/MultipleInFlowSupport.java 2008-07-15 14:26:52 UTC (rev 1637)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/MultipleInFlowSupport.java 2008-07-15 14:44:45 UTC (rev 1638)
@@ -37,9 +37,4 @@
* Get the list of in flows
*/
List<Flow> getInFlows();
-
- /**
- * TODO: remove from the API
- */
- void addInFlow(Flow flow);
}
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/MultipleOutFlowSupport.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/MultipleOutFlowSupport.java 2008-07-15 14:26:52 UTC (rev 1637)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/MultipleOutFlowSupport.java 2008-07-15 14:44:45 UTC (rev 1638)
@@ -26,7 +26,7 @@
//$Id$
/**
- * Implementing {@link FlowObject}s support multiple outgoing {@link Flow}s.
+ * Implementing {@link FlowObject} support multiple outgoing {@link Flow}.
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
@@ -37,10 +37,4 @@
* Get the list of out flows
*/
List<Flow> getOutFlows();
-
- /**
- * TODO: remove from the API
- */
- void addOutFlow(Flow flow);
-
}
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SingleInFlowSupport.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SingleInFlowSupport.java 2008-07-15 14:26:52 UTC (rev 1637)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SingleInFlowSupport.java 2008-07-15 14:44:45 UTC (rev 1638)
@@ -21,11 +21,10 @@
*/
package org.jboss.bpm.model;
-
//$Id$
/**
- * Implementing {@link FlowObject}s support a single incomming {@link Flow}s.
+ * Implementing {@link FlowObject} support a single incomming {@link Flow}.
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
@@ -36,9 +35,4 @@
* Get the out flow
*/
Flow getInFlow();
-
- /**
- * TODO: remove from the API
- */
- void setInFlow(Flow flow);
}
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SingleOutFlowSupport.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SingleOutFlowSupport.java 2008-07-15 14:26:52 UTC (rev 1637)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SingleOutFlowSupport.java 2008-07-15 14:44:45 UTC (rev 1638)
@@ -36,9 +36,4 @@
* Get the out flow
*/
Flow getOutFlow();
-
- /**
- * TODO: remove from the API
- */
- void setOutFlow(Flow flow);
}
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/EndEventImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/EndEventImpl.java 2008-07-15 14:26:52 UTC (rev 1637)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/EndEventImpl.java 2008-07-15 14:44:45 UTC (rev 1638)
@@ -46,7 +46,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public class EndEventImpl extends EventImpl implements EndEvent
+public class EndEventImpl extends EventImpl implements EndEvent, SingleInFlowSetterSupport
{
// provide logging
private static final Log log = LogFactory.getLog(EndEventImpl.class);
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/FlowObjectImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/FlowObjectImpl.java 2008-07-15 14:26:52 UTC (rev 1637)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/FlowObjectImpl.java 2008-07-15 14:44:45 UTC (rev 1638)
@@ -134,14 +134,14 @@
if (target == null)
throw new InvalidProcessException("Cannot find target for out flow: " + name);
- if (target instanceof SingleInFlowSupport)
+ if (target instanceof SingleInFlowSetterSupport)
{
- SingleInFlowSupport sif = (SingleInFlowSupport)target;
+ SingleInFlowSetterSupport sif = (SingleInFlowSetterSupport)target;
sif.setInFlow(flow);
}
- else if (target instanceof MultipleInFlowSupport)
+ else if (target instanceof MultipleInFlowSetterSupport)
{
- MultipleInFlowSupport mif = (MultipleInFlowSupport)target;
+ MultipleInFlowSetterSupport mif = (MultipleInFlowSetterSupport)target;
mif.addInFlow(flow);
}
else
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/GatewayImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/GatewayImpl.java 2008-07-15 14:26:52 UTC (rev 1637)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/GatewayImpl.java 2008-07-15 14:44:45 UTC (rev 1638)
@@ -48,7 +48,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public class GatewayImpl extends FlowObjectImpl implements Gateway, HandlerSetterSupport
+public class GatewayImpl extends FlowObjectImpl implements Gateway, HandlerSetterSupport, MultipleInFlowSetterSupport, MultipleOutFlowSetterSupport
{
// provide logging
private static final Log log = LogFactory.getLog(GatewayImpl.class);
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/IntermediateEventImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/IntermediateEventImpl.java 2008-07-15 14:26:52 UTC (rev 1637)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/IntermediateEventImpl.java 2008-07-15 14:44:45 UTC (rev 1638)
@@ -44,7 +44,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public class IntermediateEventImpl extends EventImpl implements IntermediateEvent
+public class IntermediateEventImpl extends EventImpl implements IntermediateEvent, SingleInFlowSetterSupport, SingleOutFlowSetterSupport
{
// provide logging
private static final Log log = LogFactory.getLog(IntermediateEventImpl.class);
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/MultipleInFlowSetterSupport.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/MultipleInFlowSetterSupport.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/MultipleInFlowSetterSupport.java 2008-07-15 14:44:45 UTC (rev 1638)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.model.internal;
+
+import org.jboss.bpm.model.Flow;
+import org.jboss.bpm.model.FlowObject;
+import org.jboss.bpm.model.MultipleInFlowSupport;
+
+
+//$Id$
+
+/**
+ * Implementing {@link FlowObject} support multiple incomming {@link Flow}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface MultipleInFlowSetterSupport extends MultipleInFlowSupport
+{
+ /**
+ * Add an incomming Flow
+ */
+ void addInFlow(Flow flow);
+}
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/MultipleInFlowSetterSupport.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/MultipleOutFlowSetterSupport.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/MultipleOutFlowSetterSupport.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/MultipleOutFlowSetterSupport.java 2008-07-15 14:44:45 UTC (rev 1638)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.model.internal;
+
+import org.jboss.bpm.model.Flow;
+import org.jboss.bpm.model.FlowObject;
+import org.jboss.bpm.model.MultipleOutFlowSupport;
+
+//$Id$
+
+/**
+ * Implementing {@link FlowObject} support multiple outgoing {@link Flow}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface MultipleOutFlowSetterSupport extends MultipleOutFlowSupport
+{
+ /**
+ * Add an outgoing Flow
+ */
+ void addOutFlow(Flow flow);
+
+}
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/MultipleOutFlowSetterSupport.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderImpl.java 2008-07-15 14:26:52 UTC (rev 1637)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderImpl.java 2008-07-15 14:44:45 UTC (rev 1638)
@@ -24,10 +24,8 @@
//$Id$
import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.MultipleOutFlowSupport;
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.SingleOutFlowSupport;
import org.jboss.bpm.runtime.ExecutionHandler;
import org.jboss.bpm.runtime.FlowHandler;
import org.jboss.bpm.runtime.HandlerSetterSupport;
@@ -65,14 +63,14 @@
public ProcessBuilder addSequenceFlow(String name)
{
- if (flowObject instanceof SingleOutFlowSupport)
+ if (flowObject instanceof SingleOutFlowSetterSupport)
{
- SingleOutFlowSupport outFlow = (SingleOutFlowSupport)flowObject;
+ SingleOutFlowSetterSupport outFlow = (SingleOutFlowSetterSupport)flowObject;
outFlow.setOutFlow(new SequenceFlowImpl(name));
}
- else if (flowObject instanceof MultipleOutFlowSupport)
+ else if (flowObject instanceof MultipleOutFlowSetterSupport)
{
- MultipleOutFlowSupport outFlow = (MultipleOutFlowSupport)flowObject;
+ MultipleOutFlowSetterSupport outFlow = (MultipleOutFlowSetterSupport)flowObject;
outFlow.addOutFlow(new SequenceFlowImpl(name));
}
else
@@ -84,14 +82,14 @@
public ProcessBuilder addMessageFlow(String name)
{
- if (flowObject instanceof SingleOutFlowSupport)
+ if (flowObject instanceof SingleOutFlowSetterSupport)
{
- SingleOutFlowSupport outFlow = (SingleOutFlowSupport)flowObject;
+ SingleOutFlowSetterSupport outFlow = (SingleOutFlowSetterSupport)flowObject;
outFlow.setOutFlow(new MessageFlowImpl(name));
}
- else if (flowObject instanceof MultipleOutFlowSupport)
+ else if (flowObject instanceof MultipleOutFlowSetterSupport)
{
- MultipleOutFlowSupport outFlow = (MultipleOutFlowSupport)flowObject;
+ MultipleOutFlowSetterSupport outFlow = (MultipleOutFlowSetterSupport)flowObject;
outFlow.addOutFlow(new MessageFlowImpl(name));
}
else
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SingleInFlowSetterSupport.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SingleInFlowSetterSupport.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SingleInFlowSetterSupport.java 2008-07-15 14:44:45 UTC (rev 1638)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.model.internal;
+
+import org.jboss.bpm.model.Flow;
+import org.jboss.bpm.model.FlowObject;
+import org.jboss.bpm.model.SingleInFlowSupport;
+
+
+//$Id$
+
+/**
+ * Implementing {@link FlowObject} support a single incomming {@link Flow}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface SingleInFlowSetterSupport extends SingleInFlowSupport
+{
+ /**
+ * Set the incomming Flow
+ */
+ void setInFlow(Flow flow);
+}
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SingleInFlowSetterSupport.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SingleOutFlowSetterSupport.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SingleOutFlowSetterSupport.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SingleOutFlowSetterSupport.java 2008-07-15 14:44:45 UTC (rev 1638)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.model.internal;
+
+import org.jboss.bpm.model.Flow;
+import org.jboss.bpm.model.FlowObject;
+import org.jboss.bpm.model.SingleOutFlowSupport;
+
+
+//$Id$
+
+/**
+ * Implementing {@link FlowObject}s support a single outgoing {@link Flow}s.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface SingleOutFlowSetterSupport extends SingleOutFlowSupport
+{
+ /**
+ * Set the outgoing Flow
+ */
+ void setOutFlow(Flow flow);
+}
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SingleOutFlowSetterSupport.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/StartEventImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/StartEventImpl.java 2008-07-15 14:26:52 UTC (rev 1637)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/StartEventImpl.java 2008-07-15 14:44:45 UTC (rev 1638)
@@ -42,7 +42,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public class StartEventImpl extends EventImpl implements StartEvent
+public class StartEventImpl extends EventImpl implements StartEvent, SingleOutFlowSetterSupport
{
// provide logging
private static final Log log = LogFactory.getLog(StartEventImpl.class);
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SubProcessImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SubProcessImpl.java 2008-07-15 14:26:52 UTC (rev 1637)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SubProcessImpl.java 2008-07-15 14:44:45 UTC (rev 1638)
@@ -41,7 +41,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public class SubProcessImpl extends ProcessImpl implements SubProcess, HandlerSetterSupport
+public class SubProcessImpl extends ProcessImpl implements SubProcess, HandlerSetterSupport, SingleInFlowSetterSupport, SingleOutFlowSetterSupport
{
private Flow inFlow;
private Flow outFlow;
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/TaskImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/TaskImpl.java 2008-07-15 14:26:52 UTC (rev 1637)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/TaskImpl.java 2008-07-15 14:44:45 UTC (rev 1638)
@@ -45,7 +45,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public class TaskImpl extends ActivityImpl implements Task, HandlerSetterSupport
+public class TaskImpl extends ActivityImpl implements Task, HandlerSetterSupport, SingleInFlowSetterSupport, SingleOutFlowSetterSupport
{
// provide logging
private static final Log log = LogFactory.getLog(TaskImpl.class);
17 years, 9 months
JBoss JBPM SVN: r1637 - in api/trunk/modules: api/src/main/java/org/jboss/bpm/client/internal and 6 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-15 10:26:52 -0400 (Tue, 15 Jul 2008)
New Revision: 1637
Added:
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalListener.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/ExecutionHandler.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/FlowHandler.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Handler.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/SignalHandler.java
Removed:
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExecutionHandler.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowHandler.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Handler.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SignalHandler.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/SignalListener.java
Modified:
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalManager.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilder.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/EndEventImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/EventImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ExecutionHandlerImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/FlowHandlerImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/GatewayImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/HandlerImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/IntermediateEventImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ParallelGatewayImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SignalHandlerImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/StartEventImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SubProcessImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/TaskImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/HandlerSetterSupport.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/HandlerSupport.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/test/AbstractAPITestCase.java
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/TaskA.java
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/TaskA.java
Log:
Remove default handlers
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -25,15 +25,15 @@
import java.util.concurrent.Future;
-import org.jboss.bpm.model.ExecutionHandler;
-import org.jboss.bpm.model.FlowHandler;
import org.jboss.bpm.model.FlowObject;
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.Result;
import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.model.SignalHandler;
import org.jboss.bpm.runtime.Attachments;
+import org.jboss.bpm.runtime.ExecutionHandler;
+import org.jboss.bpm.runtime.FlowHandler;
import org.jboss.bpm.runtime.HandlerSupport;
+import org.jboss.bpm.runtime.SignalHandler;
/**
* The ExecutionManager executes processes
@@ -70,23 +70,20 @@
protected ExecutionHandler getExecutionHandler(FlowObject target)
{
- HandlerSupport exfo = getExecutable(target);
- ExecutionHandler handler = exfo.getExecutionHandler();
- return handler != null ? handler : exfo.getDefaultExecutionHandler();
+ HandlerSupport exfo = getHandlerSupport(target);
+ return exfo.getExecutionHandler();
}
protected SignalHandler getSignalHandler(FlowObject target)
{
- HandlerSupport exfo = getExecutable(target);
- SignalHandler handler = exfo.getSignalHandler();
- return handler != null ? handler : exfo.getDefaultSignalHandler();
+ HandlerSupport exfo = getHandlerSupport(target);
+ return exfo.getSignalHandler();
}
protected FlowHandler getFlowHandler(FlowObject target)
{
- HandlerSupport exfo = getExecutable(target);
- FlowHandler handler = exfo.getFlowHandler();
- return handler != null ? handler : exfo.getDefaultFlowHandler();
+ HandlerSupport exfo = getHandlerSupport(target);
+ return exfo.getFlowHandler();
}
protected void throwSignal(Signal signal)
@@ -95,7 +92,7 @@
sm.throwSignal(signal);
}
- private HandlerSupport getExecutable(FlowObject fo)
+ private HandlerSupport getHandlerSupport(FlowObject fo)
{
if (fo instanceof HandlerSupport == false)
throw new IllegalStateException("Flow object is not executable: " + fo);
Copied: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalListener.java (from rev 1636, api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/SignalListener.java)
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalListener.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalListener.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.client;
+
+import org.jboss.bpm.model.Signal;
+
+//$Id$
+
+
+/**
+ * A signal listener that can be registered with the ProcessEngine
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface SignalListener
+{
+ /**
+ * Catch a signal from the process that this listener is registered with
+ */
+ void catchSignal(Signal signal);
+}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalManager.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalManager.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalManager.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -31,7 +31,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.runtime.SignalListener;
/**
* The signal manager is the entry point for signal processing
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -34,18 +34,18 @@
import org.jboss.bpm.client.ExecutionManager;
import org.jboss.bpm.client.ProcessEngine;
import org.jboss.bpm.model.EndEvent;
-import org.jboss.bpm.model.ExecutionHandler;
import org.jboss.bpm.model.Flow;
-import org.jboss.bpm.model.FlowHandler;
import org.jboss.bpm.model.FlowObject;
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.Result;
import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.model.SignalHandler;
import org.jboss.bpm.model.StartEvent;
import org.jboss.bpm.model.internal.SequenceFlowImpl;
import org.jboss.bpm.model.internal.jaxb.JAXBSequenceFlow;
import org.jboss.bpm.runtime.Attachments;
+import org.jboss.bpm.runtime.ExecutionHandler;
+import org.jboss.bpm.runtime.FlowHandler;
+import org.jboss.bpm.runtime.SignalHandler;
import org.jboss.bpm.runtime.Token;
/**
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExecutionHandler.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExecutionHandler.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExecutionHandler.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.model;
-
-//$Id$
-
-import org.jboss.bpm.client.ProcessEngine;
-import org.jboss.bpm.runtime.HandlerSupport;
-import org.jboss.bpm.runtime.Token;
-
-/**
- * The {@link ProcessEngine} invokes the ExecutionHandler on an {@link HandlerSupport}
- * {@link FlowObject} to execute user provided business logic.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface ExecutionHandler extends Handler
-{
- /**
- * Execute business logic associated with a {@link FlowObject}
- */
- void execute(Token token);
-
-}
\ No newline at end of file
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowHandler.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowHandler.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowHandler.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.model;
-
-//$Id$
-
-import org.jboss.bpm.client.ProcessEngine;
-import org.jboss.bpm.runtime.HandlerSupport;
-import org.jboss.bpm.runtime.Token;
-
-/**
- * The {@link ProcessEngine} invokes the FlowHandler on an {@link HandlerSupport}
- * {@link FlowObject} to move the {@link Token} to the next {@link FlowObject}.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface FlowHandler extends Handler
-{
- /**
- * Execute the the FlowHandler.
- * <p/>
- * The FlowHandler will add the active outgoing @{link Flow}s to
- * some @{link Flow} queue for the {@link ProcessEngine} to execute.
- */
- void execute(Token token);
-
-}
\ No newline at end of file
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Handler.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Handler.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Handler.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.model;
-
-//$Id$
-
-/**
- * The generic base for handlers that can be associated with a {@link FlowObject}.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface Handler
-{
-
-}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilder.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilder.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilder.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -22,6 +22,9 @@
package org.jboss.bpm.model;
import org.jboss.bpm.client.ProcessManager;
+import org.jboss.bpm.runtime.ExecutionHandler;
+import org.jboss.bpm.runtime.FlowHandler;
+import org.jboss.bpm.runtime.SignalHandler;
//$Id$
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SignalHandler.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SignalHandler.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SignalHandler.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.model;
-
-//$Id$
-
-import org.jboss.bpm.client.ProcessEngine;
-import org.jboss.bpm.client.SignalManager;
-import org.jboss.bpm.runtime.HandlerSupport;
-
-/**
- * The {@link ProcessEngine} invokes the SignalHandler on an {@link HandlerSupport}
- * {@link FlowObject} to send {@link Signal}s to the {@link SignalManager}.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface SignalHandler extends Handler
-{
- /**
- * Get signal for enter
- */
- Signal getEnterSignal();
-
- /**
- * Get signal for exit
- */
- Signal getExitSignal();
-}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/EndEventImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/EndEventImpl.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/EndEventImpl.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -27,21 +27,21 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.model.EndEvent;
import org.jboss.bpm.model.Flow;
-import org.jboss.bpm.model.FlowHandler;
import org.jboss.bpm.model.FlowObject;
import org.jboss.bpm.model.Result;
import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.model.SignalHandler;
import org.jboss.bpm.model.internal.jaxb.JAXBEndEvent;
import org.jboss.bpm.runtime.Attachments;
+import org.jboss.bpm.runtime.ExecutionHandler;
+import org.jboss.bpm.runtime.FlowHandler;
+import org.jboss.bpm.runtime.SignalHandler;
import org.jboss.bpm.runtime.Token;
/**
- * As the name implies, the End Event indicates where a Process will end.
+ * As the name implies, the End Event indicates where a Process will end.
*
- * In terms of Sequence Flow, the End Event ends the flow of the Process, and thus, will not have any outgoing Sequence Flow.
- * An End Event can have a specific Result that will appear as a marker within the center of the End Event shape.
- * End Event Results are Message, Error, Compensation, Link, and Multiple.
+ * In terms of Sequence Flow, the End Event ends the flow of the Process, and thus, will not have any outgoing Sequence Flow. An End Event can have a specific Result
+ * that will appear as a marker within the center of the End Event shape. End Event Results are Message, Error, Compensation, Link, and Multiple.
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
@@ -50,10 +50,10 @@
{
// provide logging
private static final Log log = LogFactory.getLog(EndEventImpl.class);
-
+
private Result result;
private Flow inFlow;
-
+
public EndEventImpl(String name)
{
this(new JAXBEndEvent());
@@ -64,22 +64,22 @@
{
super(delegate);
}
-
+
public String getName()
{
return getDelegate().getName();
}
-
+
public void setName(String name)
{
getDelegate().setName(name);
}
-
+
public Flow getInFlow()
{
return inFlow;
}
-
+
/**
* Set the in flow
*/
@@ -87,65 +87,78 @@
{
this.inFlow = inFlow;
}
-
+
public Result getResult()
{
return result;
}
- public FlowHandler getDefaultFlowHandler()
+ public ExecutionHandler getExecutionHandler()
{
- return new FlowHandlerImpl()
+ ExecutionHandler handler = super.getExecutionHandler();
+ if (handler == null)
{
- @Override
- public void execute(Token token)
+ handler = new ExecutionHandler()
{
- log.debug("End reached in: " + getName());
- }
- };
+ public void execute(final Token token)
+ {
+ // Provide the result
+ result = new Result()
+ {
+ public Attachments getAttachments()
+ {
+ return token.getExecutionContext();
+ }
+ };
+ }
+ };
+ }
+ return handler;
}
- public SignalHandler getDefaultSignalHandler()
+ public FlowHandler getFlowHandler()
{
- final FlowObject end = this;
- return new SignalHandlerImpl()
+ FlowHandler handler = super.getFlowHandler();
+ if (handler == null)
{
- public Signal getEnterSignal()
+ handler = new FlowHandler()
{
- return new Signal(end, Signal.Type.ENTER_END_EVENT);
- }
-
- public Signal getExitSignal()
- {
- return new Signal(end, Signal.Type.EXIT_END_EVENT);
- }
- };
+ public void execute(Token token)
+ {
+ log.debug("End reached in: " + getName());
+ }
+ };
+ }
+ return handler;
}
- public ExecutionHandlerImpl getDefaultExecutionHandler()
+ public SignalHandler getSignalHandler()
{
- return new ExecutionHandlerImpl()
+ SignalHandler handler = super.getSignalHandler();
+ if (handler == null)
{
- @Override
- public void execute(final Token token)
+ final FlowObject end = this;
+ handler = new SignalHandler()
{
- // Provide the result
- result = new Result()
+ public Signal getEnterSignal()
{
- public Attachments getAttachments()
- {
- return token.getExecutionContext();
- }
- };
- }
- };
+ return new Signal(end, Signal.Type.ENTER_END_EVENT);
+ }
+
+ public Signal getExitSignal()
+ {
+ return new Signal(end, Signal.Type.EXIT_END_EVENT);
+ }
+ };
+ }
+ return handler;
}
-
+
public JAXBEndEvent getDelegate()
{
return (JAXBEndEvent)super.getDelegate();
}
-
+
public String toString()
{
return "EndEvent[" + getName() + "]";
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/EventImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/EventImpl.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/EventImpl.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -22,11 +22,11 @@
package org.jboss.bpm.model.internal;
import org.jboss.bpm.model.Event;
-import org.jboss.bpm.model.ExecutionHandler;
-import org.jboss.bpm.model.FlowHandler;
-import org.jboss.bpm.model.SignalHandler;
import org.jboss.bpm.model.internal.jaxb.JAXBEvent;
+import org.jboss.bpm.runtime.ExecutionHandler;
+import org.jboss.bpm.runtime.FlowHandler;
import org.jboss.bpm.runtime.HandlerSetterSupport;
+import org.jboss.bpm.runtime.SignalHandler;
//$Id$
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ExecutionHandlerImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ExecutionHandlerImpl.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ExecutionHandlerImpl.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -23,8 +23,8 @@
//$Id$
-import org.jboss.bpm.model.ExecutionHandler;
import org.jboss.bpm.model.internal.jaxb.JAXBExecutionHandler;
+import org.jboss.bpm.runtime.ExecutionHandler;
import org.jboss.bpm.runtime.Token;
/**
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/FlowHandlerImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/FlowHandlerImpl.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/FlowHandlerImpl.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -23,8 +23,8 @@
//$Id$
-import org.jboss.bpm.model.FlowHandler;
import org.jboss.bpm.model.internal.jaxb.JAXBFlowHandler;
+import org.jboss.bpm.runtime.FlowHandler;
import org.jboss.bpm.runtime.Token;
/**
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/GatewayImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/GatewayImpl.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/GatewayImpl.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -29,16 +29,16 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.bpm.model.ExecutionHandler;
import org.jboss.bpm.model.Flow;
-import org.jboss.bpm.model.FlowHandler;
import org.jboss.bpm.model.FlowObject;
import org.jboss.bpm.model.Gateway;
import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.model.SignalHandler;
import org.jboss.bpm.model.internal.jaxb.JAXBFlow;
import org.jboss.bpm.model.internal.jaxb.JAXBGateway;
+import org.jboss.bpm.runtime.ExecutionHandler;
+import org.jboss.bpm.runtime.FlowHandler;
import org.jboss.bpm.runtime.HandlerSetterSupport;
+import org.jboss.bpm.runtime.SignalHandler;
import org.jboss.bpm.runtime.Token;
/**
@@ -102,7 +102,18 @@
public ExecutionHandler getExecutionHandler()
{
- return executionHandler;
+ ExecutionHandler handler = executionHandler;
+ if (handler == null)
+ {
+ handler = new ExecutionHandler()
+ {
+ public void execute(Token token)
+ {
+ log.debug("Nothing to do in gateway: " + getName());
+ }
+ };
+ }
+ return handler;
}
public void setExecutionHandler(ExecutionHandler executionHandler)
@@ -112,7 +123,18 @@
public FlowHandler getFlowHandler()
{
- return flowHandler;
+ FlowHandler handler = flowHandler;
+ if (handler == null && outFlows.size() == 1)
+ {
+ handler = new FlowHandler()
+ {
+ public void execute(Token token)
+ {
+ token.addTailFlow(outFlows.get(0));
+ }
+ };
+ }
+ return handler;
}
public void setFlowHandler(FlowHandler flowHandler)
@@ -122,54 +144,29 @@
public SignalHandler getSignalHandler()
{
- return signalHandler;
- }
-
- public void setSignalHandler(SignalHandler signalHandler)
- {
- this.signalHandler = signalHandler;
- }
-
- public FlowHandler getDefaultFlowHandler()
- {
- return new FlowHandlerImpl()
+ SignalHandler handler = signalHandler;
+ if (handler == null)
{
- @Override
- public void execute(Token token)
+ final FlowObject gateway = this;
+ handler = new SignalHandler()
{
- if (outFlows.size() == 1)
- token.addTailFlow(outFlows.get(0));
- }
- };
- }
+ public Signal getEnterSignal()
+ {
+ return new Signal(gateway, Signal.Type.ENTER_GATEWAY);
+ }
- public SignalHandler getDefaultSignalHandler()
- {
- final FlowObject gateway = this;
- return new SignalHandlerImpl()
- {
- public Signal getEnterSignal()
- {
- return new Signal(gateway, Signal.Type.ENTER_GATEWAY);
- }
-
- public Signal getExitSignal()
- {
- return new Signal(gateway, Signal.Type.EXIT_GATEWAY);
- }
- };
+ public Signal getExitSignal()
+ {
+ return new Signal(gateway, Signal.Type.EXIT_GATEWAY);
+ }
+ };
+ }
+ return handler;
}
- public ExecutionHandlerImpl getDefaultExecutionHandler()
+ public void setSignalHandler(SignalHandler signalHandler)
{
- return new ExecutionHandlerImpl()
- {
- @Override
- public void execute(Token token)
- {
- log.debug("Nothing to do in gateway: " + getName());
- }
- };
+ this.signalHandler = signalHandler;
}
public JAXBGateway getDelegate()
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/HandlerImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/HandlerImpl.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/HandlerImpl.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -23,8 +23,8 @@
//$Id$
-import org.jboss.bpm.model.Handler;
import org.jboss.bpm.model.internal.jaxb.JAXBHandler;
+import org.jboss.bpm.runtime.Handler;
import org.jboss.bpm.NotImplementedException;
/**
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/IntermediateEventImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/IntermediateEventImpl.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/IntermediateEventImpl.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -25,14 +25,15 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.bpm.model.Event;
import org.jboss.bpm.model.Flow;
-import org.jboss.bpm.model.FlowHandler;
-import org.jboss.bpm.model.FlowObject;
import org.jboss.bpm.model.IntermediateEvent;
import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.model.SignalHandler;
import org.jboss.bpm.model.internal.jaxb.JAXBFlow;
import org.jboss.bpm.model.internal.jaxb.JAXBIntermediateEvent;
+import org.jboss.bpm.runtime.ExecutionHandler;
+import org.jboss.bpm.runtime.FlowHandler;
+import org.jboss.bpm.runtime.SignalHandler;
import org.jboss.bpm.runtime.Token;
/**
@@ -95,45 +96,58 @@
getDelegate().setOutFlow(jaxb);
}
- public FlowHandler getDefaultFlowHandler()
+ public ExecutionHandler getExecutionHandler()
{
- return new FlowHandlerImpl()
+ ExecutionHandler handler = super.getExecutionHandler();
+ if (handler == null)
{
- @Override
- public void execute(Token token)
+ handler = new ExecutionHandler()
{
- token.addTailFlow(getOutFlow());
- }
- };
+ public void execute(Token token)
+ {
+ log.debug("Nothing to do in event");
+ }
+ };
+ }
+ return handler;
}
- public SignalHandler getDefaultSignalHandler()
+ public FlowHandler getFlowHandler()
{
- final FlowObject event = this;
- return new SignalHandlerImpl()
+ FlowHandler handler = super.getFlowHandler();
+ if (handler == null)
{
- public Signal getEnterSignal()
+ handler = new FlowHandler()
{
- return new Signal(event, Signal.Type.ENTER_EVENT);
- }
-
- public Signal getExitSignal()
- {
- return new Signal(event, Signal.Type.EXIT_EVENT);
- }
- };
+ public void execute(Token token)
+ {
+ token.addTailFlow(getOutFlow());
+ }
+ };
+ }
+ return handler;
}
- public ExecutionHandlerImpl getDefaultExecutionHandler()
+ public SignalHandler getSignalHandler()
{
- return new ExecutionHandlerImpl()
+ SignalHandler handler = super.getSignalHandler();
+ if (handler == null)
{
- @Override
- public void execute(Token token)
+ final Event event = this;
+ handler = new SignalHandler()
{
- log.debug("Nothing to do in start-event");
- }
- };
+ public Signal getEnterSignal()
+ {
+ return new Signal(event, Signal.Type.ENTER_EVENT);
+ }
+
+ public Signal getExitSignal()
+ {
+ return new Signal(event, Signal.Type.EXIT_EVENT);
+ }
+ };
+ }
+ return handler;
}
public JAXBIntermediateEvent getDelegate()
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ParallelGatewayImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ParallelGatewayImpl.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ParallelGatewayImpl.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -24,8 +24,8 @@
//$Id$
import org.jboss.bpm.model.Flow;
-import org.jboss.bpm.model.FlowHandler;
import org.jboss.bpm.model.internal.jaxb.JAXBParallelGateway;
+import org.jboss.bpm.runtime.FlowHandler;
import org.jboss.bpm.runtime.Token;
@@ -49,20 +49,23 @@
}
/**
- * The DefaultFlowHandler adds all out flows to the queue
+ * The default FlowHandler adds all out flows to the queue
*/
- @Override
- public FlowHandler getDefaultFlowHandler()
+ public FlowHandler getFlowHandler()
{
- return new FlowHandlerImpl()
+ FlowHandler handler = super.getFlowHandler();
+ if (handler == null)
{
- @Override
- public void execute(Token token)
+ handler = new FlowHandler()
{
- for(Flow outFlow : getOutFlows())
- token.addTailFlow(outFlow);
- }
- };
+ public void execute(Token token)
+ {
+ for(Flow outFlow : getOutFlows())
+ token.addTailFlow(outFlow);
+ }
+ };
+ }
+ return handler;
}
public String toString()
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderImpl.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderImpl.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -24,14 +24,14 @@
//$Id$
import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.ExecutionHandler;
-import org.jboss.bpm.model.FlowHandler;
import org.jboss.bpm.model.MultipleOutFlowSupport;
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.SignalHandler;
import org.jboss.bpm.model.SingleOutFlowSupport;
+import org.jboss.bpm.runtime.ExecutionHandler;
+import org.jboss.bpm.runtime.FlowHandler;
import org.jboss.bpm.runtime.HandlerSetterSupport;
+import org.jboss.bpm.runtime.SignalHandler;
/**
* The ProcessBuilder can be used to dynamically build {@link Process}es.
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SignalHandlerImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SignalHandlerImpl.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SignalHandlerImpl.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -24,8 +24,8 @@
//$Id$
import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.model.SignalHandler;
import org.jboss.bpm.model.internal.jaxb.JAXBSignalHandler;
+import org.jboss.bpm.runtime.SignalHandler;
/**
* Implement to get signals on enter and exit.
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/StartEventImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/StartEventImpl.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/StartEventImpl.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -26,13 +26,13 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.model.Flow;
-import org.jboss.bpm.model.FlowHandler;
-import org.jboss.bpm.model.FlowObject;
import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.model.SignalHandler;
import org.jboss.bpm.model.StartEvent;
import org.jboss.bpm.model.internal.jaxb.JAXBFlow;
import org.jboss.bpm.model.internal.jaxb.JAXBStartEvent;
+import org.jboss.bpm.runtime.ExecutionHandler;
+import org.jboss.bpm.runtime.FlowHandler;
+import org.jboss.bpm.runtime.SignalHandler;
import org.jboss.bpm.runtime.Token;
/**
@@ -72,47 +72,60 @@
getDelegate().setOutFlow(jaxb);
}
- public FlowHandler getDefaultFlowHandler()
+ public ExecutionHandler getExecutionHandler()
{
- return new FlowHandlerImpl()
+ ExecutionHandler handler = super.getExecutionHandler();
+ if (handler == null)
{
- @Override
- public void execute(Token token)
+ handler = new ExecutionHandler()
{
- token.addTailFlow(outFlow);
- }
- };
+ public void execute(Token token)
+ {
+ log.debug("Nothing to do in start-event");
+ }
+ };
+ }
+ return handler;
}
- public SignalHandler getDefaultSignalHandler()
+ public FlowHandler getFlowHandler()
{
- final FlowObject start = this;
- return new SignalHandlerImpl()
+ FlowHandler handler = super.getFlowHandler();
+ if (handler == null)
{
- public Signal getEnterSignal()
+ handler = new FlowHandler()
{
- return new Signal(start, Signal.Type.ENTER_START_EVENT);
- }
-
- public Signal getExitSignal()
- {
- return new Signal(start, Signal.Type.EXIT_START_EVENT);
- }
- };
+ public void execute(Token token)
+ {
+ token.addTailFlow(outFlow);
+ }
+ };
+ }
+ return handler;
}
- public ExecutionHandlerImpl getDefaultExecutionHandler()
+ public SignalHandler getSignalHandler()
{
- return new ExecutionHandlerImpl()
+ SignalHandler handler = super.getSignalHandler();
+ if (handler == null)
{
- @Override
- public void execute(Token token)
+ final StartEvent start = this;
+ handler = new SignalHandler()
{
- log.debug("Nothing to do in start-event");
- }
- };
+ public Signal getEnterSignal()
+ {
+ return new Signal(start, Signal.Type.ENTER_START_EVENT);
+ }
+
+ public Signal getExitSignal()
+ {
+ return new Signal(start, Signal.Type.EXIT_START_EVENT);
+ }
+ };
+ }
+ return handler;
}
-
+
public JAXBStartEvent getDelegate()
{
return (JAXBStartEvent)super.getDelegate();
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SubProcessImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SubProcessImpl.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SubProcessImpl.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -23,16 +23,16 @@
//$Id$
-import org.jboss.bpm.model.ExecutionHandler;
import org.jboss.bpm.model.Flow;
-import org.jboss.bpm.model.FlowHandler;
import org.jboss.bpm.model.FlowObject;
import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.model.SignalHandler;
import org.jboss.bpm.model.SubProcess;
import org.jboss.bpm.model.internal.jaxb.JAXBFlow;
import org.jboss.bpm.model.internal.jaxb.JAXBSubProcess;
+import org.jboss.bpm.runtime.ExecutionHandler;
+import org.jboss.bpm.runtime.FlowHandler;
import org.jboss.bpm.runtime.HandlerSetterSupport;
+import org.jboss.bpm.runtime.SignalHandler;
import org.jboss.bpm.runtime.Token;
/**
@@ -88,7 +88,18 @@
public ExecutionHandler getExecutionHandler()
{
- return executionHandler;
+ ExecutionHandler handler = executionHandler;
+ if (handler == null)
+ {
+ handler = new ExecutionHandler()
+ {
+ public void execute(Token token)
+ {
+ startProcess(token.getExecutionContext());
+ }
+ };
+ }
+ return handler;
}
public void setExecutionHandler(ExecutionHandler executionHandler)
@@ -98,7 +109,18 @@
public FlowHandler getFlowHandler()
{
- return flowHandler;
+ FlowHandler handler = flowHandler;
+ if (handler == null)
+ {
+ handler = new FlowHandler()
+ {
+ public void execute(Token token)
+ {
+ token.addTailFlow(outFlow);
+ }
+ };
+ }
+ return handler;
}
public void setFlowHandler(FlowHandler flowHandler)
@@ -108,53 +130,29 @@
public SignalHandler getSignalHandler()
{
- return signalHandler;
- }
-
- public void setSignalHandler(SignalHandler signalHandler)
- {
- this.signalHandler = signalHandler;
- }
-
- public FlowHandler getDefaultFlowHandler()
- {
- return new FlowHandlerImpl()
+ SignalHandler handler = signalHandler;
+ if (handler == null)
{
- @Override
- public void execute(Token token)
+ final FlowObject subproc = this;
+ handler = new SignalHandler()
{
- token.addTailFlow(outFlow);
- }
- };
- }
+ public Signal getEnterSignal()
+ {
+ return new Signal(subproc, Signal.Type.ENTER_SUB_PROCESS);
+ }
- public SignalHandler getDefaultSignalHandler()
- {
- final FlowObject subproc = this;
- return new SignalHandlerImpl()
- {
- public Signal getEnterSignal()
- {
- return new Signal(subproc, Signal.Type.ENTER_SUB_PROCESS);
- }
-
- public Signal getExitSignal()
- {
- return new Signal(subproc, Signal.Type.EXIT_SUB_PROCESS);
- }
- };
+ public Signal getExitSignal()
+ {
+ return new Signal(subproc, Signal.Type.EXIT_SUB_PROCESS);
+ }
+ };
+ }
+ return handler;
}
- public ExecutionHandlerImpl getDefaultExecutionHandler()
+ public void setSignalHandler(SignalHandler signalHandler)
{
- return new ExecutionHandlerImpl()
- {
- @Override
- public void execute(Token token)
- {
- startProcess(token.getExecutionContext());
- }
- };
+ this.signalHandler = signalHandler;
}
public JAXBSubProcess getDelegate()
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/TaskImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/TaskImpl.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/TaskImpl.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -23,16 +23,15 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.bpm.model.ExecutionHandler;
import org.jboss.bpm.model.Flow;
-import org.jboss.bpm.model.FlowHandler;
-import org.jboss.bpm.model.FlowObject;
import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.model.SignalHandler;
import org.jboss.bpm.model.Task;
import org.jboss.bpm.model.internal.jaxb.JAXBFlow;
import org.jboss.bpm.model.internal.jaxb.JAXBTask;
+import org.jboss.bpm.runtime.ExecutionHandler;
+import org.jboss.bpm.runtime.FlowHandler;
import org.jboss.bpm.runtime.HandlerSetterSupport;
+import org.jboss.bpm.runtime.SignalHandler;
import org.jboss.bpm.runtime.Token;
//$Id$
@@ -102,7 +101,18 @@
public ExecutionHandler getExecutionHandler()
{
- return executionHandler;
+ ExecutionHandler handler = executionHandler;
+ if (handler == null)
+ {
+ handler = new ExecutionHandler()
+ {
+ public void execute(Token token)
+ {
+ log.debug("Nothing to do in task: " + getName());
+ }
+ };
+ }
+ return handler;
}
public void setExecutionHandler(ExecutionHandler executionHandler)
@@ -112,7 +122,18 @@
public FlowHandler getFlowHandler()
{
- return flowHandler;
+ FlowHandler handler = flowHandler;
+ if (handler == null)
+ {
+ handler = new FlowHandler()
+ {
+ public void execute(Token token)
+ {
+ token.addTailFlow(outFlow);
+ }
+ };
+ }
+ return handler;
}
public void setFlowHandler(FlowHandler flowHandler)
@@ -122,55 +143,31 @@
public SignalHandler getSignalHandler()
{
- return signalHandler;
- }
-
- public void setSignalHandler(SignalHandler signalHandler)
- {
- this.signalHandler = signalHandler;
- }
-
- public FlowHandler getDefaultFlowHandler()
- {
- return new FlowHandlerImpl()
+ SignalHandler handler = signalHandler;
+ if (handler == null)
{
- @Override
- public void execute(Token token)
+ final Task task = this;
+ handler = new SignalHandler()
{
- token.addTailFlow(outFlow);
- }
- };
- }
+ public Signal getEnterSignal()
+ {
+ return new Signal(task, Signal.Type.ENTER_TASK);
+ }
- public SignalHandler getDefaultSignalHandler()
- {
- final FlowObject task = this;
- return new SignalHandlerImpl()
- {
- public Signal getEnterSignal()
- {
- return new Signal(task, Signal.Type.ENTER_TASK);
- }
-
- public Signal getExitSignal()
- {
- return new Signal(task, Signal.Type.EXIT_TASK);
- }
- };
+ public Signal getExitSignal()
+ {
+ return new Signal(task, Signal.Type.EXIT_TASK);
+ }
+ };
+ }
+ return handler;
}
- public ExecutionHandler getDefaultExecutionHandler()
+ public void setSignalHandler(SignalHandler signalHandler)
{
- return new ExecutionHandlerImpl()
- {
- @Override
- public void execute(Token token)
- {
- log.debug("Nothing to do in task: " + getName());
- }
- };
+ this.signalHandler = signalHandler;
}
-
+
public JAXBTask getDelegate()
{
return (JAXBTask)super.getDelegate();
Copied: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/ExecutionHandler.java (from rev 1636, api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExecutionHandler.java)
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/ExecutionHandler.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/ExecutionHandler.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.runtime;
+
+//$Id$
+
+import org.jboss.bpm.client.ProcessEngine;
+import org.jboss.bpm.model.FlowObject;
+
+/**
+ * The {@link ProcessEngine} invokes the ExecutionHandler on an {@link HandlerSupport}
+ * {@link FlowObject} to execute user provided business logic.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface ExecutionHandler extends Handler
+{
+ /**
+ * Execute business logic associated with a {@link FlowObject}
+ */
+ void execute(Token token);
+
+}
\ No newline at end of file
Copied: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/FlowHandler.java (from rev 1636, api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowHandler.java)
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/FlowHandler.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/FlowHandler.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.runtime;
+
+//$Id$
+
+import org.jboss.bpm.client.ProcessEngine;
+import org.jboss.bpm.model.FlowObject;
+
+/**
+ * The {@link ProcessEngine} invokes the FlowHandler on an {@link HandlerSupport}
+ * {@link FlowObject} to move the {@link Token} to the next {@link FlowObject}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface FlowHandler extends Handler
+{
+ /**
+ * Execute the the FlowHandler.
+ * <p/>
+ * The FlowHandler will add the active outgoing @{link Flow}s to
+ * some @{link Flow} queue for the {@link ProcessEngine} to execute.
+ */
+ void execute(Token token);
+
+}
\ No newline at end of file
Copied: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Handler.java (from rev 1636, api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Handler.java)
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Handler.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Handler.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -0,0 +1,37 @@
+/*
+ * 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.jboss.bpm.runtime;
+
+import org.jboss.bpm.model.FlowObject;
+
+//$Id$
+
+/**
+ * The generic base for handlers that can be associated with a {@link FlowObject}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface Handler
+{
+
+}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/HandlerSetterSupport.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/HandlerSetterSupport.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/HandlerSetterSupport.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -21,9 +21,6 @@
*/
package org.jboss.bpm.runtime;
-import org.jboss.bpm.model.ExecutionHandler;
-import org.jboss.bpm.model.FlowHandler;
-import org.jboss.bpm.model.SignalHandler;
//$Id$
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/HandlerSupport.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/HandlerSupport.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/HandlerSupport.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -21,9 +21,6 @@
*/
package org.jboss.bpm.runtime;
-import org.jboss.bpm.model.ExecutionHandler;
-import org.jboss.bpm.model.FlowHandler;
-import org.jboss.bpm.model.SignalHandler;
//$Id$
@@ -38,18 +35,9 @@
/** Get the associated ExecutionHandler */
ExecutionHandler getExecutionHandler();
- /** Get the default ExecutionHandler */
- ExecutionHandler getDefaultExecutionHandler();
-
/** Get the associated SignalHandler */
SignalHandler getSignalHandler();
- /** Get the default SignalHandler */
- SignalHandler getDefaultSignalHandler();
-
/** Get the associated FlowHandler */
FlowHandler getFlowHandler();
-
- /** Get the default FlowHandler */
- FlowHandler getDefaultFlowHandler();
}
\ No newline at end of file
Copied: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/SignalHandler.java (from rev 1636, api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SignalHandler.java)
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/SignalHandler.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/SignalHandler.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.runtime;
+
+//$Id$
+
+import org.jboss.bpm.client.ProcessEngine;
+import org.jboss.bpm.client.SignalManager;
+import org.jboss.bpm.model.FlowObject;
+import org.jboss.bpm.model.Signal;
+
+/**
+ * The {@link ProcessEngine} invokes the SignalHandler on an {@link HandlerSupport}
+ * {@link FlowObject} to send {@link Signal}s to the {@link SignalManager}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface SignalHandler extends Handler
+{
+ /**
+ * Get signal for enter
+ */
+ Signal getEnterSignal();
+
+ /**
+ * Get signal for exit
+ */
+ Signal getExitSignal();
+}
\ No newline at end of file
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/SignalListener.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/SignalListener.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/SignalListener.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.runtime;
-
-import org.jboss.bpm.model.Signal;
-
-//$Id$
-
-
-/**
- * A signal listener that can be registered with the ProcessEngine
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface SignalListener
-{
- /**
- * Catch a signal from the process that this listener is registered with
- */
- void catchSignal(Signal signal);
-}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/test/AbstractAPITestCase.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/test/AbstractAPITestCase.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/test/AbstractAPITestCase.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -33,9 +33,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.JBPMException;
+import org.jboss.bpm.client.SignalListener;
import org.jboss.bpm.client.internal.EmbeddedBeansDeployer;
import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.runtime.SignalListener;
public abstract class AbstractAPITestCase extends TestCase implements SignalListener
{
Modified: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/TaskA.java
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/TaskA.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/TaskA.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -23,8 +23,8 @@
// $Id$
-import org.jboss.bpm.model.ExecutionHandler;
import org.jboss.bpm.runtime.ExecutionContext;
+import org.jboss.bpm.runtime.ExecutionHandler;
import org.jboss.bpm.runtime.Token;
/**
Modified: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/TaskA.java
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/TaskA.java 2008-07-15 13:05:25 UTC (rev 1636)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/TaskA.java 2008-07-15 14:26:52 UTC (rev 1637)
@@ -23,8 +23,8 @@
// $Id$
-import org.jboss.bpm.model.ExecutionHandler;
import org.jboss.bpm.runtime.ExecutionContext;
+import org.jboss.bpm.runtime.ExecutionHandler;
import org.jboss.bpm.runtime.Token;
/**
17 years, 9 months
JBoss JBPM SVN: r1636 - in api/trunk/modules: api/src/main/java/org/jboss/bpm/client and 15 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-15 09:05:25 -0400 (Tue, 15 Jul 2008)
New Revision: 1636
Added:
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilderFactory.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/HandlerSetterSupport.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/HandlerSupport.java
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/parallelsplit/
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/parallelsplit/ParallelSplitTest.java
api/trunk/modules/testsuite/src/test/resources/samples/parallelsplit/
api/trunk/modules/testsuite/src/test/resources/samples/parallelsplit/parallel-split-api10.xml
api/trunk/modules/testsuite/src/test/resources/samples/parallelsplit/parallel-split.bpmn
api/trunk/modules/testsuite/src/test/resources/samples/parallelsplit/parallel-split.bpmn_diagram
api/trunk/modules/testsuite/src/test/resources/samples/parallelsplit/parallel-split.png
Removed:
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Executable.java
api/trunk/modules/api/src/test/java/org/jboss/bpm/pattern/
Modified:
api/trunk/modules/api/pom.xml
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Event.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExecutionHandler.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowHandler.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilder.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SignalHandler.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Task.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/EventImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/GatewayImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/HandlerImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SubProcessImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/TaskImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/jaxb/JAXBHandler.java
api/trunk/modules/api/src/test/java/org/jboss/bpm/model/ProcessMarshallerTest.java
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/TaskA.java
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/TaskA.java
api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence-api10.xml
api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task-api10.xml
Log:
[JBPM-1321] ParallelSplit
Modified: api/trunk/modules/api/pom.xml
===================================================================
--- api/trunk/modules/api/pom.xml 2008-07-15 10:23:31 UTC (rev 1635)
+++ api/trunk/modules/api/pom.xml 2008-07-15 13:05:25 UTC (rev 1636)
@@ -62,18 +62,17 @@
<plugins>
<plugin>
<!--
- ~/.m2/settings.xml
+ ~/.m2/settings.xml
+ <pluginGroups>
+ <pluginGroup>com.sun.tools.jxc.maven2</pluginGroup>
+ </pluginGroups>
- <pluginGroups>
- <pluginGroup>com.sun.tools.jxc.maven2</pluginGroup>
- </pluginGroups>
-
- mvn jaxb-schemagen:generate
+ mvn jaxb-schemagen:generate
-->
<groupId>com.sun.tools.jxc.maven2</groupId>
<artifactId>maven-jaxb-schemagen-plugin</artifactId>
<configuration>
- <srcdir>src/main/java/org/jboss/bpm/model</srcdir>
+ <srcdir>${basedir}/src/main/java/org/jboss/bpm/model/internal/jaxb</srcdir>
<destdir>target/schema</destdir>
<schemas>
<schema>
@@ -82,37 +81,29 @@
</schema>
</schemas>
<includes>
+ <include>JAXBActivity.java</include>
+ <include>JAXBComplexGateway.java</include>
+ <include>JAXBEndEvent.java</include>
+ <include>JAXBEvent.java</include>
+ <include>JAXBExclusiveGateway.java</include>
+ <include>JAXBExecutionHandler.java</include>
+ <include>JAXBFlowHandler.java</include>
+ <include>JAXBFlow.java</include>
+ <include>JAXBFlowObject.java</include>
+ <include>JAXBGateway.java</include>
+ <include>JAXBHandler.java</include>
+ <include>JAXBInclusiveGateway.java</include>
+ <include>JAXBIntermediateEvent.java</include>
+ <include>JAXBMessageFlow.java</include>
+ <include>JAXBParallelGateway.java</include>
+ <include>JAXBProcess.java</include>
+ <include>JAXBSequenceFlow.java</include>
+ <include>JAXBSignalHandler.java</include>
+ <include>JAXBStartEvent.java</include>
+ <include>JAXBSubProcess.java</include>
+ <include>JAXBTask.java</include>
+ <include>ObjectFactory.java</include>
<include>package-info.java</include>
- <include>AbstractActivity.java</include>
- <include>AbstractEndEvent.java</include>
- <include>AbstractEvent.java</include>
- <include>AbstractFlow.java</include>
- <include>AbstractFlowObject.java</include>
- <include>AbstractGateway.java</include>
- <include>AbstractItermediateEvent.java</include>
- <include>AbstractProcess.java</include>
- <include>AbstractStartEvent.java</include>
- <include>AbstractSubProcess.java</include>
- <include>AbstractTask.java</include>
-
- <include>Activity.java</include>
- <include>ComplexGateway.java</include>
- <include>EndEvent.java</include>
- <include>Event.java</include>
- <include>ExclusiveGateway.java</include>
- <include>FlowObject.java</include>
- <include>Flow.java</include>
- <include>Gateway.java</include>
- <include>InclusiveGateway.java</include>
- <include>ItermediateEvent.java</include>
- <include>MessageFlow.java</include>
- <include>ParallelGateway.java</include>
- <include>Process.java</include>
- <include>SequenceFlow.java</include>
- <include>Signal.java</include>
- <include>StartEvent.java</include>
- <include>SubProcess.java</include>
- <include>Task.java</include>
</includes>
<verbose>false</verbose>
</configuration>
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java 2008-07-15 10:23:31 UTC (rev 1635)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -25,7 +25,6 @@
import java.util.concurrent.Future;
-import org.jboss.bpm.model.Executable;
import org.jboss.bpm.model.ExecutionHandler;
import org.jboss.bpm.model.FlowHandler;
import org.jboss.bpm.model.FlowObject;
@@ -34,6 +33,7 @@
import org.jboss.bpm.model.Signal;
import org.jboss.bpm.model.SignalHandler;
import org.jboss.bpm.runtime.Attachments;
+import org.jboss.bpm.runtime.HandlerSupport;
/**
* The ExecutionManager executes processes
@@ -70,21 +70,21 @@
protected ExecutionHandler getExecutionHandler(FlowObject target)
{
- Executable exfo = getExecutable(target);
+ HandlerSupport exfo = getExecutable(target);
ExecutionHandler handler = exfo.getExecutionHandler();
return handler != null ? handler : exfo.getDefaultExecutionHandler();
}
protected SignalHandler getSignalHandler(FlowObject target)
{
- Executable exfo = getExecutable(target);
+ HandlerSupport exfo = getExecutable(target);
SignalHandler handler = exfo.getSignalHandler();
return handler != null ? handler : exfo.getDefaultSignalHandler();
}
protected FlowHandler getFlowHandler(FlowObject target)
{
- Executable exfo = getExecutable(target);
+ HandlerSupport exfo = getExecutable(target);
FlowHandler handler = exfo.getFlowHandler();
return handler != null ? handler : exfo.getDefaultFlowHandler();
}
@@ -95,10 +95,10 @@
sm.throwSignal(signal);
}
- private Executable getExecutable(FlowObject fo)
+ private HandlerSupport getExecutable(FlowObject fo)
{
- if (fo instanceof Executable == false)
+ if (fo instanceof HandlerSupport == false)
throw new IllegalStateException("Flow object is not executable: " + fo);
- return (Executable)fo;
+ return (HandlerSupport)fo;
}
}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Event.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Event.java 2008-07-15 10:23:31 UTC (rev 1635)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Event.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -21,6 +21,7 @@
*/
package org.jboss.bpm.model;
+
//$Id$
/**
@@ -31,7 +32,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface Event extends FlowObject, Executable
+public interface Event extends FlowObject
{
}
\ No newline at end of file
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Executable.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Executable.java 2008-07-15 10:23:31 UTC (rev 1635)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Executable.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.model;
-
-//$Id$
-
-/**
- * A combined interface for execution aspects
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface Executable
-{
- /** Get the associated ExecutionHandler */
- ExecutionHandler getExecutionHandler();
-
- /** Get the default ExecutionHandler */
- ExecutionHandler getDefaultExecutionHandler();
-
- /** Get the associated SignalHandler */
- SignalHandler getSignalHandler();
-
- /** Get the default SignalHandler */
- SignalHandler getDefaultSignalHandler();
-
- /** Get the associated FlowHandler */
- FlowHandler getFlowHandler();
-
- /** Get the default FlowHandler */
- FlowHandler getDefaultFlowHandler();
-}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExecutionHandler.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExecutionHandler.java 2008-07-15 10:23:31 UTC (rev 1635)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExecutionHandler.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -24,10 +24,11 @@
//$Id$
import org.jboss.bpm.client.ProcessEngine;
+import org.jboss.bpm.runtime.HandlerSupport;
import org.jboss.bpm.runtime.Token;
/**
- * The {@link ProcessEngine} invokes the ExecutionHandler on an {@link Executable}
+ * The {@link ProcessEngine} invokes the ExecutionHandler on an {@link HandlerSupport}
* {@link FlowObject} to execute user provided business logic.
*
* @author thomas.diesler(a)jboss.com
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowHandler.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowHandler.java 2008-07-15 10:23:31 UTC (rev 1635)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowHandler.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -24,10 +24,11 @@
//$Id$
import org.jboss.bpm.client.ProcessEngine;
+import org.jboss.bpm.runtime.HandlerSupport;
import org.jboss.bpm.runtime.Token;
/**
- * The {@link ProcessEngine} invokes the FlowHandler on an {@link Executable}
+ * The {@link ProcessEngine} invokes the FlowHandler on an {@link HandlerSupport}
* {@link FlowObject} to move the {@link Token} to the next {@link FlowObject}.
*
* @author thomas.diesler(a)jboss.com
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java 2008-07-15 10:23:31 UTC (rev 1635)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -21,6 +21,7 @@
*/
package org.jboss.bpm.model;
+
//$Id: ExecutionHandlerImpl.java 1627 2008-07-14 15:16:28Z thomas.diesler(a)jboss.com $
/**
@@ -31,7 +32,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface Gateway extends FlowObject, NamedFlowObject, Executable, MultipleOutFlowSupport, MultipleInFlowSupport
+public interface Gateway extends FlowObject, NamedFlowObject, MultipleOutFlowSupport, MultipleInFlowSupport
{
}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilder.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilder.java 2008-07-15 10:23:31 UTC (rev 1635)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilder.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -21,142 +21,94 @@
*/
package org.jboss.bpm.model;
+import org.jboss.bpm.client.ProcessManager;
+
//$Id$
-import org.jboss.bpm.model.internal.ComplexGatewayImpl;
-import org.jboss.bpm.model.internal.EndEventImpl;
-import org.jboss.bpm.model.internal.ExclusiveGatewayImpl;
-import org.jboss.bpm.model.internal.FlowObjectImpl;
-import org.jboss.bpm.model.internal.InclusiveGatewayImpl;
-import org.jboss.bpm.model.internal.IntermediateEventImpl;
-import org.jboss.bpm.model.internal.MessageFlowImpl;
-import org.jboss.bpm.model.internal.ParallelGatewayImpl;
-import org.jboss.bpm.model.internal.ProcessImpl;
-import org.jboss.bpm.model.internal.SequenceFlowImpl;
-import org.jboss.bpm.model.internal.StartEventImpl;
-import org.jboss.bpm.model.internal.SubProcessImpl;
-import org.jboss.bpm.model.internal.TaskImpl;
/**
- * The ProcessBuilder can be used to dynamically build {@link Process}es.
+ * The ProcessBuilder can be used to build a {@link Process} dynamically.
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public class ProcessBuilder
+public interface ProcessBuilder
{
- private ProcessImpl proc;
- private FlowObjectImpl flowObject;
-
- public ProcessBuilder (String procName)
- {
- proc = new ProcessImpl(procName);
- }
-
- public Process getProcess()
- {
- proc.initialize();
- return proc;
- }
-
- public ProcessBuilder addStartEvent()
- {
- flowObject = new StartEventImpl();
- proc.addFlowObject(flowObject);
- return this;
- }
-
- public ProcessBuilder addSequenceFlow(String name)
- {
- if (flowObject instanceof SingleOutFlowSupport)
- {
- SingleOutFlowSupport outFlow = (SingleOutFlowSupport)flowObject;
- outFlow.setOutFlow(new SequenceFlowImpl(name));
- }
- else if (flowObject instanceof MultipleOutFlowSupport)
- {
- MultipleOutFlowSupport outFlow = (MultipleOutFlowSupport)flowObject;
- outFlow.addOutFlow(new SequenceFlowImpl(name));
- }
- else
- {
- throw new IllegalStateException("Cannot add a sequence flow to: " + flowObject);
- }
- return this;
- }
-
- public ProcessBuilder addMessageFlow(String name)
- {
- if (flowObject instanceof SingleOutFlowSupport)
- {
- SingleOutFlowSupport outFlow = (SingleOutFlowSupport)flowObject;
- outFlow.setOutFlow(new MessageFlowImpl(name));
- }
- else if (flowObject instanceof MultipleOutFlowSupport)
- {
- MultipleOutFlowSupport outFlow = (MultipleOutFlowSupport)flowObject;
- outFlow.addOutFlow(new MessageFlowImpl(name));
- }
- else
- {
- throw new IllegalStateException("Cannot add a message flow to: " + flowObject);
- }
- return this;
- }
-
- public ProcessBuilder addTask(String name)
- {
- flowObject = new TaskImpl(name);
- proc.addFlowObject(flowObject);
- return this;
- }
-
- public ProcessBuilder addExclusiveGateway(String name)
- {
- flowObject = new ExclusiveGatewayImpl(name);
- proc.addFlowObject(flowObject);
- return this;
- }
-
- public ProcessBuilder addInclusiveGateway(String name)
- {
- flowObject = new InclusiveGatewayImpl(name);
- proc.addFlowObject(flowObject);
- return this;
- }
-
- public ProcessBuilder addComplexGateway(String name)
- {
- flowObject = new ComplexGatewayImpl(name);
- proc.addFlowObject(flowObject);
- return this;
- }
-
- public ProcessBuilder addParallelGateway(String name)
- {
- flowObject = new ParallelGatewayImpl(name);
- proc.addFlowObject(flowObject);
- return this;
- }
-
- public ProcessBuilder addSubProcess(String name)
- {
- flowObject = new SubProcessImpl(name);
- proc.addFlowObject(flowObject);
- return this;
- }
-
- public ProcessBuilder addItermediateEvent(String name)
- {
- flowObject = new IntermediateEventImpl(name);
- proc.addFlowObject(flowObject);
- return this;
- }
-
- public ProcessBuilder addEndEvent(String name)
- {
- flowObject = new EndEventImpl(name);
- proc.addFlowObject(flowObject);
- return this;
- }
+ /**
+ * Create the {@link Process}.
+ * <p/>
+ * This is the final call to the ProcessBuilder after all elements have been added.
+ * Internally it registers the {@link Process} with the {@link ProcessManager}.
+ */
+ Process createProcess();
+
+ /**
+ * Add a {@link StartEvent}
+ */
+ ProcessBuilder addStartEvent();
+
+ /**
+ * Add a {@link SequenceFlow} with a given name
+ */
+ ProcessBuilder addSequenceFlow(String name);
+
+ /**
+ * Add a {@link MessageFlow} with a given name
+ */
+ ProcessBuilder addMessageFlow(String name);
+
+ /**
+ * Add a {@link Task} with a given name
+ */
+ ProcessBuilder addTask(String name);
+
+ /**
+ * Add an {@link ExclusiveGateway} with a given name
+ */
+ ProcessBuilder addExclusiveGateway(String name);
+
+ /**
+ * Add an {@link InclusiveGateway} with a given name
+ */
+ ProcessBuilder addInclusiveGateway(String name);
+
+ /**
+ * Add a {@link ComplexGateway} with a given name
+ */
+ ProcessBuilder addComplexGateway(String name);
+
+ /**
+ * Add a {@link ParallelGateway} with a given name
+ */
+ ProcessBuilder addParallelGateway(String name);
+
+ /**
+ * Add a {@link SubProcess} with a given name
+ */
+ ProcessBuilder addSubProcess(String name);
+
+ /**
+ * Add an {@link ItermediateEvent} with a given name
+ */
+ ProcessBuilder addItermediateEvent(String name);
+
+ /**
+ * Add an {@link EndEvent} with a given name
+ */
+ ProcessBuilder addEndEvent(String name);
+
+ /**
+ * Add an {@link ExecutionHandler} with a given Class
+ */
+ ProcessBuilder addExecutionHandler(Class<?> clazz);
+
+ /**
+ * Add an {@link FlowHandler} with a given Class
+ */
+ ProcessBuilder addFlowHandler(Class<?> clazz);
+
+ /**
+ * Add an {@link SignalHandler} with a given Class
+ */
+ ProcessBuilder addSignalHandler(Class<?> clazz);
}
\ No newline at end of file
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilderFactory.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilderFactory.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilderFactory.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -0,0 +1,44 @@
+/*
+ * 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.jboss.bpm.model;
+
+import org.jboss.bpm.model.internal.ProcessBuilderImpl;
+
+//$Id$
+
+/**
+ * A Factory for the {@link ProcessBuilder}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public abstract class ProcessBuilderFactory
+{
+ /**
+ * Get a {@link ProcessBuilder} for a given process name.
+ */
+ public static ProcessBuilder newInstance(String processName)
+ {
+ return new ProcessBuilderImpl(processName);
+ }
+
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilderFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SignalHandler.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SignalHandler.java 2008-07-15 10:23:31 UTC (rev 1635)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SignalHandler.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -25,9 +25,10 @@
import org.jboss.bpm.client.ProcessEngine;
import org.jboss.bpm.client.SignalManager;
+import org.jboss.bpm.runtime.HandlerSupport;
/**
- * The {@link ProcessEngine} invokes the SignalHandler on an {@link Executable}
+ * The {@link ProcessEngine} invokes the SignalHandler on an {@link HandlerSupport}
* {@link FlowObject} to send {@link Signal}s to the {@link SignalManager}.
*
* @author thomas.diesler(a)jboss.com
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java 2008-07-15 10:23:31 UTC (rev 1635)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -21,6 +21,7 @@
*/
package org.jboss.bpm.model;
+
//$Id$
/**
@@ -29,6 +30,6 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface SubProcess extends Process, Executable, SingleInFlowSupport, SingleOutFlowSupport
+public interface SubProcess extends Process, SingleInFlowSupport, SingleOutFlowSupport
{
}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Task.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Task.java 2008-07-15 10:23:31 UTC (rev 1635)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Task.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -21,6 +21,7 @@
*/
package org.jboss.bpm.model;
+
//$Id$
/**
@@ -32,6 +33,6 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface Task extends Activity, Executable, SingleInFlowSupport, SingleOutFlowSupport
+public interface Task extends Activity, SingleInFlowSupport, SingleOutFlowSupport
{
}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/EventImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/EventImpl.java 2008-07-15 10:23:31 UTC (rev 1635)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/EventImpl.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -26,6 +26,7 @@
import org.jboss.bpm.model.FlowHandler;
import org.jboss.bpm.model.SignalHandler;
import org.jboss.bpm.model.internal.jaxb.JAXBEvent;
+import org.jboss.bpm.runtime.HandlerSetterSupport;
//$Id$
@@ -37,7 +38,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public abstract class EventImpl extends FlowObjectImpl implements Event
+public abstract class EventImpl extends FlowObjectImpl implements Event, HandlerSetterSupport
{
private ExecutionHandler executionHandler;
private FlowHandler flowHandler;
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/GatewayImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/GatewayImpl.java 2008-07-15 10:23:31 UTC (rev 1635)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/GatewayImpl.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -38,6 +38,7 @@
import org.jboss.bpm.model.SignalHandler;
import org.jboss.bpm.model.internal.jaxb.JAXBFlow;
import org.jboss.bpm.model.internal.jaxb.JAXBGateway;
+import org.jboss.bpm.runtime.HandlerSetterSupport;
import org.jboss.bpm.runtime.Token;
/**
@@ -47,7 +48,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public class GatewayImpl extends FlowObjectImpl implements Gateway
+public class GatewayImpl extends FlowObjectImpl implements Gateway, HandlerSetterSupport
{
// provide logging
private static final Log log = LogFactory.getLog(GatewayImpl.class);
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/HandlerImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/HandlerImpl.java 2008-07-15 10:23:31 UTC (rev 1635)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/HandlerImpl.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -25,6 +25,7 @@
import org.jboss.bpm.model.Handler;
import org.jboss.bpm.model.internal.jaxb.JAXBHandler;
+import org.jboss.bpm.NotImplementedException;
/**
* Implement to handle the outgoing Flows for an FlowObject
@@ -41,8 +42,30 @@
this.delegate = delegate;
}
+ @SuppressWarnings("unchecked")
protected <T> T newInstance(Class<T> clazz)
{
- return delegate.newInstance(clazz);
+ try
+ {
+ String className = delegate.getClassName();
+ String beanRef = delegate.getBeanRef();
+ if (className != null)
+ {
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ return (T)ctxLoader.loadClass(className).newInstance();
+ }
+ else if (beanRef != null)
+ {
+ throw new NotImplementedException();
+ }
+ else
+ {
+ throw new IllegalStateException("There is no 'class' nor 'bean' attribute set for this handler");
+ }
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Cannot instanciate the handler", ex);
+ }
}
}
\ No newline at end of file
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderImpl.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderImpl.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -0,0 +1,199 @@
+/*
+ * 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.jboss.bpm.model.internal;
+
+//$Id$
+
+import org.jboss.bpm.client.ProcessManager;
+import org.jboss.bpm.model.ExecutionHandler;
+import org.jboss.bpm.model.FlowHandler;
+import org.jboss.bpm.model.MultipleOutFlowSupport;
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.ProcessBuilder;
+import org.jboss.bpm.model.SignalHandler;
+import org.jboss.bpm.model.SingleOutFlowSupport;
+import org.jboss.bpm.runtime.HandlerSetterSupport;
+
+/**
+ * The ProcessBuilder can be used to dynamically build {@link Process}es.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class ProcessBuilderImpl implements ProcessBuilder
+{
+ private ProcessImpl proc;
+ private FlowObjectImpl flowObject;
+
+ public ProcessBuilderImpl(String procName)
+ {
+ proc = new ProcessImpl(procName);
+ }
+
+ public Process createProcess()
+ {
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ pm.registerProcess(proc);
+ return proc;
+ }
+
+ public ProcessBuilder addStartEvent()
+ {
+ flowObject = new StartEventImpl();
+ proc.addFlowObject(flowObject);
+ return this;
+ }
+
+ public ProcessBuilder addSequenceFlow(String name)
+ {
+ if (flowObject instanceof SingleOutFlowSupport)
+ {
+ SingleOutFlowSupport outFlow = (SingleOutFlowSupport)flowObject;
+ outFlow.setOutFlow(new SequenceFlowImpl(name));
+ }
+ else if (flowObject instanceof MultipleOutFlowSupport)
+ {
+ MultipleOutFlowSupport outFlow = (MultipleOutFlowSupport)flowObject;
+ outFlow.addOutFlow(new SequenceFlowImpl(name));
+ }
+ else
+ {
+ throw new IllegalStateException("Cannot add a sequence flow to: " + flowObject);
+ }
+ return this;
+ }
+
+ public ProcessBuilder addMessageFlow(String name)
+ {
+ if (flowObject instanceof SingleOutFlowSupport)
+ {
+ SingleOutFlowSupport outFlow = (SingleOutFlowSupport)flowObject;
+ outFlow.setOutFlow(new MessageFlowImpl(name));
+ }
+ else if (flowObject instanceof MultipleOutFlowSupport)
+ {
+ MultipleOutFlowSupport outFlow = (MultipleOutFlowSupport)flowObject;
+ outFlow.addOutFlow(new MessageFlowImpl(name));
+ }
+ else
+ {
+ throw new IllegalStateException("Cannot add a message flow to: " + flowObject);
+ }
+ return this;
+ }
+
+ public ProcessBuilder addTask(String name)
+ {
+ flowObject = new TaskImpl(name);
+ proc.addFlowObject(flowObject);
+ return this;
+ }
+
+ public ProcessBuilder addExclusiveGateway(String name)
+ {
+ flowObject = new ExclusiveGatewayImpl(name);
+ proc.addFlowObject(flowObject);
+ return this;
+ }
+
+ public ProcessBuilder addInclusiveGateway(String name)
+ {
+ flowObject = new InclusiveGatewayImpl(name);
+ proc.addFlowObject(flowObject);
+ return this;
+ }
+
+ public ProcessBuilder addComplexGateway(String name)
+ {
+ flowObject = new ComplexGatewayImpl(name);
+ proc.addFlowObject(flowObject);
+ return this;
+ }
+
+ public ProcessBuilder addParallelGateway(String name)
+ {
+ flowObject = new ParallelGatewayImpl(name);
+ proc.addFlowObject(flowObject);
+ return this;
+ }
+
+ public ProcessBuilder addSubProcess(String name)
+ {
+ flowObject = new SubProcessImpl(name);
+ proc.addFlowObject(flowObject);
+ return this;
+ }
+
+ public ProcessBuilder addItermediateEvent(String name)
+ {
+ flowObject = new IntermediateEventImpl(name);
+ proc.addFlowObject(flowObject);
+ return this;
+ }
+
+ public ProcessBuilder addEndEvent(String name)
+ {
+ flowObject = new EndEventImpl(name);
+ proc.addFlowObject(flowObject);
+ return this;
+ }
+
+ public ProcessBuilder addExecutionHandler(Class<?> clazz)
+ {
+ return addHandler(clazz);
+ }
+
+ public ProcessBuilder addFlowHandler(Class<?> clazz)
+ {
+ return addHandler(clazz);
+ }
+
+ public ProcessBuilder addSignalHandler(Class<?> clazz)
+ {
+ return addHandler(clazz);
+ }
+
+ private ProcessBuilder addHandler(Class<?> clazz)
+ {
+ if (flowObject instanceof HandlerSetterSupport == false)
+ throw new IllegalStateException("Current flow object does not support handlers: " + flowObject);
+
+ HandlerSetterSupport hs = (HandlerSetterSupport)flowObject;
+ try
+ {
+ Object handler = clazz.newInstance();
+ if (handler instanceof ExecutionHandler)
+ hs.setExecutionHandler((ExecutionHandler)handler);
+ else if (handler instanceof FlowHandler)
+ hs.setFlowHandler((FlowHandler)handler);
+ else if (handler instanceof SignalHandler)
+ hs.setSignalHandler((SignalHandler)handler);
+ else
+ throw new IllegalArgumentException("Given class is not a supported handler");
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalArgumentException("Cannot instanciate handler", ex);
+ }
+ return this;
+ }
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SubProcessImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SubProcessImpl.java 2008-07-15 10:23:31 UTC (rev 1635)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/SubProcessImpl.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -32,6 +32,7 @@
import org.jboss.bpm.model.SubProcess;
import org.jboss.bpm.model.internal.jaxb.JAXBFlow;
import org.jboss.bpm.model.internal.jaxb.JAXBSubProcess;
+import org.jboss.bpm.runtime.HandlerSetterSupport;
import org.jboss.bpm.runtime.Token;
/**
@@ -40,7 +41,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public class SubProcessImpl extends ProcessImpl implements SubProcess
+public class SubProcessImpl extends ProcessImpl implements SubProcess, HandlerSetterSupport
{
private Flow inFlow;
private Flow outFlow;
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/TaskImpl.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/TaskImpl.java 2008-07-15 10:23:31 UTC (rev 1635)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/TaskImpl.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -32,6 +32,7 @@
import org.jboss.bpm.model.Task;
import org.jboss.bpm.model.internal.jaxb.JAXBFlow;
import org.jboss.bpm.model.internal.jaxb.JAXBTask;
+import org.jboss.bpm.runtime.HandlerSetterSupport;
import org.jboss.bpm.runtime.Token;
//$Id$
@@ -45,7 +46,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public class TaskImpl extends ActivityImpl implements Task
+public class TaskImpl extends ActivityImpl implements Task, HandlerSetterSupport
{
// provide logging
private static final Log log = LogFactory.getLog(TaskImpl.class);
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/jaxb/JAXBHandler.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/jaxb/JAXBHandler.java 2008-07-15 10:23:31 UTC (rev 1635)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/jaxb/JAXBHandler.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -26,8 +26,6 @@
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
-import org.jboss.bpm.NotImplementedException;
-
/**
* Implement to handle the outgoing Flows for an FlowObject
*
@@ -61,29 +59,4 @@
{
this.beanRef = beanRef;
}
-
- @SuppressWarnings("unchecked")
- public <T> T newInstance(Class<T> clazz)
- {
- try
- {
- if (className != null)
- {
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- return (T)ctxLoader.loadClass(className).newInstance();
- }
- else if (beanRef != null)
- {
- throw new NotImplementedException();
- }
- else
- {
- throw new IllegalStateException("There is no 'class' nor 'bean' attribute set for this handler");
- }
- }
- catch (Exception ex)
- {
- throw new IllegalStateException("Cannot instanciate the handler", ex);
- }
- }
}
\ No newline at end of file
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/HandlerSetterSupport.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/HandlerSetterSupport.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/HandlerSetterSupport.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.runtime;
+
+import org.jboss.bpm.model.ExecutionHandler;
+import org.jboss.bpm.model.FlowHandler;
+import org.jboss.bpm.model.SignalHandler;
+
+//$Id$
+
+/**
+ * A combined interface for execution aspects
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface HandlerSetterSupport extends HandlerSupport
+{
+ /** Set the associated ExecutionHandler */
+ void setExecutionHandler(ExecutionHandler handler);
+
+ /** Set the associated SignalHandler */
+ void setSignalHandler(SignalHandler handler);
+
+ /** Set the associated FlowHandler */
+ void setFlowHandler(FlowHandler handler);
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/HandlerSetterSupport.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/HandlerSupport.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/HandlerSupport.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/HandlerSupport.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -0,0 +1,55 @@
+/*
+ * 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.jboss.bpm.runtime;
+
+import org.jboss.bpm.model.ExecutionHandler;
+import org.jboss.bpm.model.FlowHandler;
+import org.jboss.bpm.model.SignalHandler;
+
+//$Id$
+
+/**
+ * A combined interface for execution aspects
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface HandlerSupport
+{
+ /** Get the associated ExecutionHandler */
+ ExecutionHandler getExecutionHandler();
+
+ /** Get the default ExecutionHandler */
+ ExecutionHandler getDefaultExecutionHandler();
+
+ /** Get the associated SignalHandler */
+ SignalHandler getSignalHandler();
+
+ /** Get the default SignalHandler */
+ SignalHandler getDefaultSignalHandler();
+
+ /** Get the associated FlowHandler */
+ FlowHandler getFlowHandler();
+
+ /** Get the default FlowHandler */
+ FlowHandler getDefaultFlowHandler();
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/HandlerSupport.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/trunk/modules/api/src/test/java/org/jboss/bpm/model/ProcessMarshallerTest.java
===================================================================
--- api/trunk/modules/api/src/test/java/org/jboss/bpm/model/ProcessMarshallerTest.java 2008-07-15 10:23:31 UTC (rev 1635)
+++ api/trunk/modules/api/src/test/java/org/jboss/bpm/model/ProcessMarshallerTest.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -26,8 +26,8 @@
import java.io.StringReader;
import java.io.StringWriter;
-import junit.framework.TestCase;
-
+import org.jboss.bpm.MockEngineTestCase;
+import org.jboss.bpm.model.internal.ProcessBuilderImpl;
import org.jboss.bpm.util.ProcessMarshaller;
import org.jboss.bpm.util.ProcessUnmarshaller;
@@ -37,21 +37,21 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public class ProcessMarshallerTest extends TestCase
+public class ProcessMarshallerTest extends MockEngineTestCase
{
public void testProcess() throws Exception
{
- Process inProc = new ProcessBuilder("myproc").addStartEvent().addSequenceFlow("task").addTask("task").
+ Process inProc = new ProcessBuilderImpl("myproc").addStartEvent().addSequenceFlow("task").addTask("task").
addSequenceFlow("split").addParallelGateway("split").addSequenceFlow("subproc").addSequenceFlow("event").
addSubProcess("subproc").addSequenceFlow("join").addItermediateEvent("event").addSequenceFlow("join").
- addParallelGateway("join").addSequenceFlow("end").addEndEvent("end").getProcess();
+ addParallelGateway("join").addSequenceFlow("end").addEndEvent("end").createProcess();
StringWriter strwr = new StringWriter();
ProcessMarshaller marshaller = new ProcessMarshaller();
marshaller.marshallProcess(inProc, strwr);
String xml = strwr.toString();
- System.out.println(xml);
+ //System.out.println(xml);
ProcessUnmarshaller unmarshaller = new ProcessUnmarshaller();
Process outProc = unmarshaller.unmarshallProcess(new StringReader(xml));
Modified: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/TaskA.java
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/TaskA.java 2008-07-15 10:23:31 UTC (rev 1635)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/TaskA.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -23,7 +23,7 @@
// $Id$
-import org.jboss.bpm.model.internal.ExecutionHandlerImpl;
+import org.jboss.bpm.model.ExecutionHandler;
import org.jboss.bpm.runtime.ExecutionContext;
import org.jboss.bpm.runtime.Token;
@@ -33,9 +33,8 @@
* @author Thomas.Diesler(a)jboss.com
* @since 04-Jul-2008
*/
-public class TaskA extends ExecutionHandlerImpl
+public class TaskA implements ExecutionHandler
{
- @Override
public void execute(Token token)
{
ExecutionContext ctx = token.getExecutionContext();
Added: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/parallelsplit/ParallelSplitTest.java
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/parallelsplit/ParallelSplitTest.java (rev 0)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/parallelsplit/ParallelSplitTest.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -0,0 +1,98 @@
+/*
+ * 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.jboss.bpm.samples.parallelsplit;
+
+// $Id$
+
+import java.net.URL;
+import java.util.List;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+
+import org.jboss.bpm.client.ProcessManager;
+import org.jboss.bpm.client.SignalManager;
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.ProcessBuilder;
+import org.jboss.bpm.model.ProcessBuilderFactory;
+import org.jboss.bpm.model.Result;
+import org.jboss.bpm.model.Signal;
+import org.jboss.bpm.test.DefaultEngineTestCase;
+
+/**
+ * A point in the workflow process where a single thread of control splits
+ * into multiple threads of control which can be executed in parallel,
+ * thus allowing activities to be executed simultaneously or in any order.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 03-Jul-2008
+ */
+public class ParallelSplitTest extends DefaultEngineTestCase
+{
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ SignalManager em = SignalManager.locateSignalManager();
+ em.addListener(getName(), this);
+ }
+
+ /**
+ * The ParallelGateway uses non threaded SequenceFlows
+ */
+ public void testParallelSplit() throws Exception
+ {
+ URL jpdlURL = getResourceURL("samples/parallelsplit/parallel-split-" + getDialect() + ".xml");
+
+ // Create a Process through the ProcessManager
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ Process proc = pm.createProcess(jpdlURL);
+
+ runProcess(proc);
+ }
+
+ public void testParallelSplitDynamic() throws Exception
+ {
+ // Create a Process through the ProcessBuilder
+ ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance(getName());
+ Process proc = procBuilder.addStartEvent().addSequenceFlow("gateway").addParallelGateway("gateway").
+ addSequenceFlow("endA").addSequenceFlow("endB").addEndEvent("endA").addEndEvent("endB").createProcess();
+
+ runProcess(proc);
+ }
+
+ private void runProcess(Process proc) throws InterruptedException, ExecutionException
+ {
+ // Start the Process
+ Future<Result> end = proc.startProcess();
+ Result result = end.get();
+
+ // Validate received signals
+ List<Signal> signals = getSignals();
+ assertEquals(Signal.Type.ENTER_END_EVENT, signals.get(5).getType());
+ assertEquals("EndEvent[endA]", signals.get(5).getFlowObject());
+ assertEquals(Signal.Type.EXIT_END_EVENT, signals.get(6).getType());
+
+ assertEquals(Signal.Type.ENTER_END_EVENT, signals.get(7).getType());
+ assertEquals("EndEvent[endB]", signals.get(7).getFlowObject());
+ assertEquals(Signal.Type.EXIT_END_EVENT, signals.get(8).getType());
+ }
+}
Property changes on: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/parallelsplit/ParallelSplitTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java 2008-07-15 10:23:31 UTC (rev 1635)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -25,11 +25,14 @@
import java.net.URL;
import java.util.List;
+import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import org.jboss.bpm.client.ProcessManager;
import org.jboss.bpm.client.SignalManager;
import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.ProcessBuilder;
+import org.jboss.bpm.model.ProcessBuilderFactory;
import org.jboss.bpm.model.Result;
import org.jboss.bpm.model.Signal;
import org.jboss.bpm.test.DefaultEngineTestCase;
@@ -42,34 +45,51 @@
*/
public class BasicSequenceTest extends DefaultEngineTestCase
{
- private URL jpdlURL;
-
@Override
protected void setUp() throws Exception
{
super.setUp();
- jpdlURL = getResourceURL("samples/sequence/basic-sequence-" + getDialect() + ".xml");
SignalManager em = SignalManager.locateSignalManager();
- em.addListener("basic-sequence", this);
+ em.addListener(getName(), this);
}
/**
* Test a basic sequence
*/
- public void testBasicSequence() throws Exception
+ public void testBasicSequence() throws Exception
{
+ URL jpdlURL = getResourceURL("samples/sequence/basic-sequence-" + getDialect() + ".xml");
+
// Create a Process through the ProcessManager
ProcessManager pm = ProcessManager.locateProcessManager();
Process proc = pm.createProcess(jpdlURL);
-
+
+ runProcess(proc);
+ }
+
+ /**
+ * Test a basic sequence through the ProcessBuilder
+ */
+ public void testBasicSequenceDynamic() throws Exception
+ {
+ // Create a Process through the ProcessBuilder
+ ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance(getName());
+ Process proc = procBuilder.addStartEvent().addSequenceFlow("stateA").addTask("stateA").
+ addSequenceFlow("end").addEndEvent("end").createProcess();
+
+ runProcess(proc);
+ }
+
+ private void runProcess(Process proc) throws InterruptedException, ExecutionException
+ {
// Start the Process
Future<Result> end = proc.startProcess();
Result result = end.get();
-
+
// Validate the Result
assertNotNull("Result expected", result);
assertEquals("No attachments expected", 0, result.getAttachments().getAttachmentKeys().size());
-
+
// Validate received signals
List<Signal> signals = getSignals();
assertEquals(Signal.Type.ENTER_PROCESS, signals.get(0).getType());
Modified: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java 2008-07-15 10:23:31 UTC (rev 1635)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -25,11 +25,14 @@
import java.net.URL;
import java.util.List;
+import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import org.jboss.bpm.client.ProcessManager;
import org.jboss.bpm.client.SignalManager;
import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.ProcessBuilder;
+import org.jboss.bpm.model.ProcessBuilderFactory;
import org.jboss.bpm.model.Result;
import org.jboss.bpm.model.Signal;
import org.jboss.bpm.runtime.Attachments;
@@ -43,37 +46,53 @@
*/
public class BasicTaskTest extends DefaultEngineTestCase
{
- private URL jpdlURL;
-
@Override
protected void setUp() throws Exception
{
super.setUp();
- jpdlURL = getResourceURL("samples/task/basic-task-" + getDialect() + ".xml");
SignalManager em = SignalManager.locateSignalManager();
- em.addListener("basic-task", this);
+ em.addListener(getName(), this);
}
/**
- * Test that the execution context variables set by the Task
- * are visible to the client.
+ * Test that the execution context variables set by the Task are visible to the client.
*/
public void testBasicTask() throws Exception
{
+ URL jpdlURL = getResourceURL("samples/task/basic-task-" + getDialect() + ".xml");
+
// Create a Process through the ProcessManager
ProcessManager pm = ProcessManager.locateProcessManager();
Process proc = pm.createProcess(jpdlURL);
-
+
+ runProcess(proc);
+ }
+
+ /**
+ * Test a basic task through the ProcessBuilder
+ */
+ public void testBasicTaskDynamic() throws Exception
+ {
+ // Create a Process through the ProcessBuilder
+ ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance(getName());
+ Process proc = procBuilder.addStartEvent().addSequenceFlow("stateA").addTask("stateA").addExecutionHandler(TaskA.class).
+ addSequenceFlow("end").addEndEvent("end").createProcess();
+
+ runProcess(proc);
+ }
+
+ private void runProcess(Process proc) throws InterruptedException, ExecutionException
+ {
// Start the Process
Future<Result> end = proc.startProcess();
Result result = end.get();
-
+
// Validate the Result
assertNotNull("Result expected", result);
Attachments att = result.getAttachments();
assertEquals("Attachments expected", 1, att.getAttachmentKeys().size());
assertEquals("Task: TaskA", att.getAttachment(String.class));
-
+
// Validate received signals
List<Signal> signals = getSignals();
assertEquals(Signal.Type.ENTER_PROCESS, signals.get(0).getType());
Modified: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/TaskA.java
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/TaskA.java 2008-07-15 10:23:31 UTC (rev 1635)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/TaskA.java 2008-07-15 13:05:25 UTC (rev 1636)
@@ -23,7 +23,7 @@
// $Id$
-import org.jboss.bpm.model.internal.ExecutionHandlerImpl;
+import org.jboss.bpm.model.ExecutionHandler;
import org.jboss.bpm.runtime.ExecutionContext;
import org.jboss.bpm.runtime.Token;
@@ -33,9 +33,8 @@
* @author Thomas.Diesler(a)jboss.com
* @since 04-Jul-2008
*/
-public class TaskA extends ExecutionHandlerImpl
+public class TaskA implements ExecutionHandler
{
- @Override
public void execute(Token token)
{
ExecutionContext ctx = token.getExecutionContext();
Added: api/trunk/modules/testsuite/src/test/resources/samples/parallelsplit/parallel-split-api10.xml
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/parallelsplit/parallel-split-api10.xml (rev 0)
+++ api/trunk/modules/testsuite/src/test/resources/samples/parallelsplit/parallel-split-api10.xml 2008-07-15 13:05:25 UTC (rev 1636)
@@ -0,0 +1,11 @@
+<ns2:process name="testParallelSplit" xmlns:ns2="urn:api.bpm.jboss:jpdl-0.1">
+ <start>
+ <sequence to="gateway" />
+ </start>
+ <parallel-gateway name="gateway">
+ <sequence to="endA" />
+ <sequence to="endB" />
+ </parallel-gateway>
+ <end name="endA" />
+ <end name="endB" />
+</ns2:process>
\ No newline at end of file
Property changes on: api/trunk/modules/testsuite/src/test/resources/samples/parallelsplit/parallel-split-api10.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/testsuite/src/test/resources/samples/parallelsplit/parallel-split.bpmn
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/parallelsplit/parallel-split.bpmn (rev 0)
+++ api/trunk/modules/testsuite/src/test/resources/samples/parallelsplit/parallel-split.bpmn 2008-07-15 13:05:25 UTC (rev 1636)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:BpmnDiagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:bpmn="http://stp.eclipse.org/bpmn" xmi:id="__6YwkFJsEd2rTur0B442zw" iD="__6XicFJsEd2rTur0B442zw">
+ <pools xmi:type="bpmn:Pool" xmi:id="__7duoVJsEd2rTur0B442zw" iD="__7duoFJsEd2rTur0B442zw" name="Pool">
+ <vertices xmi:type="bpmn:Activity" xmi:id="_I-ywUVJtEd2rTur0B442zw" iD="_I-ywUFJtEd2rTur0B442zw" outgoingEdges="_P3mbMVJtEd2rTur0B442zw _Ry4cIVJtEd2rTur0B442zw" incomingEdges="_KocOsVJtEd2rTur0B442zw" activityType="GatewayParallel"/>
+ <vertices xmi:type="bpmn:Activity" xmi:id="_KM9MkVJtEd2rTur0B442zw" iD="_KM9MkFJtEd2rTur0B442zw" outgoingEdges="_KocOsVJtEd2rTur0B442zw" activityType="EventStartEmpty"/>
+ <vertices xmi:type="bpmn:Activity" xmi:id="_NKHhQVJtEd2rTur0B442zw" iD="_NKHhQFJtEd2rTur0B442zw" incomingEdges="_P3mbMVJtEd2rTur0B442zw" name="endA" activityType="EventEndEmpty"/>
+ <vertices xmi:type="bpmn:Activity" xmi:id="_RywgUFJtEd2rTur0B442zw" iD="_Ryv5QFJtEd2rTur0B442zw" incomingEdges="_Ry4cIVJtEd2rTur0B442zw" name="endB" activityType="EventEndEmpty"/>
+ <sequenceEdges xmi:type="bpmn:SequenceEdge" xmi:id="_KocOsVJtEd2rTur0B442zw" iD="_KocOsFJtEd2rTur0B442zw" source="_KM9MkVJtEd2rTur0B442zw" target="_I-ywUVJtEd2rTur0B442zw"/>
+ <sequenceEdges xmi:type="bpmn:SequenceEdge" xmi:id="_P3mbMVJtEd2rTur0B442zw" iD="_P3mbMFJtEd2rTur0B442zw" source="_I-ywUVJtEd2rTur0B442zw" target="_NKHhQVJtEd2rTur0B442zw"/>
+ <sequenceEdges xmi:type="bpmn:SequenceEdge" xmi:id="_Ry4cIVJtEd2rTur0B442zw" iD="_Ry4cIFJtEd2rTur0B442zw" source="_I-ywUVJtEd2rTur0B442zw" target="_RywgUFJtEd2rTur0B442zw"/>
+ </pools>
+</bpmn:BpmnDiagram>
Added: api/trunk/modules/testsuite/src/test/resources/samples/parallelsplit/parallel-split.bpmn_diagram
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/parallelsplit/parallel-split.bpmn_diagram (rev 0)
+++ api/trunk/modules/testsuite/src/test/resources/samples/parallelsplit/parallel-split.bpmn_diagram 2008-07-15 13:05:25 UTC (rev 1636)
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:bpmn="http://stp.eclipse.org/bpmn" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation" xmi:id="__63RsFJsEd2rTur0B442zw" type="Bpmn" name="parallel-split.bpmn_diagram" measurementUnit="Pixel">
+ <children xmi:type="notation:Node" xmi:id="__89jcFJsEd2rTur0B442zw" type="1001">
+ <children xmi:type="notation:Node" xmi:id="__9DDAFJsEd2rTur0B442zw" type="4008"/>
+ <children xmi:type="notation:Node" xmi:id="__9E4MFJsEd2rTur0B442zw" type="5001">
+ <children xmi:type="notation:Node" xmi:id="_I-6sIFJtEd2rTur0B442zw" type="2001">
+ <children xmi:type="notation:Node" xmi:id="_I-76QFJtEd2rTur0B442zw" type="4001"/>
+ <styles xmi:type="notation:FontStyle" xmi:id="_I-6sIVJtEd2rTur0B442zw" fontName="Arial"/>
+ <styles xmi:type="notation:DescriptionStyle" xmi:id="_I-6sIlJtEd2rTur0B442zw"/>
+ <styles xmi:type="notation:FillStyle" xmi:id="_I-6sI1JtEd2rTur0B442zw"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_I-6sJFJtEd2rTur0B442zw" lineColor="0"/>
+ <element xmi:type="bpmn:Activity" href="parallel-split.bpmn#_I-ywUVJtEd2rTur0B442zw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_I-7TMFJtEd2rTur0B442zw" x="96" y="72"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_KM-asFJtEd2rTur0B442zw" type="2001">
+ <children xmi:type="notation:Node" xmi:id="_KM_BwFJtEd2rTur0B442zw" type="4001"/>
+ <styles xmi:type="notation:FontStyle" xmi:id="_KM-asVJtEd2rTur0B442zw" fontName="Arial"/>
+ <styles xmi:type="notation:DescriptionStyle" xmi:id="_KM-aslJtEd2rTur0B442zw"/>
+ <styles xmi:type="notation:FillStyle" xmi:id="_KM-as1JtEd2rTur0B442zw"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_KM-atFJtEd2rTur0B442zw" lineColor="0"/>
+ <element xmi:type="bpmn:Activity" href="parallel-split.bpmn#_KM9MkVJtEd2rTur0B442zw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_KM-atVJtEd2rTur0B442zw" x="17" y="82"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_NKIvYFJtEd2rTur0B442zw" type="2001">
+ <children xmi:type="notation:Node" xmi:id="_NKJ9gFJtEd2rTur0B442zw" type="4001"/>
+ <styles xmi:type="notation:FontStyle" xmi:id="_NKJWcFJtEd2rTur0B442zw" fontName="Arial"/>
+ <styles xmi:type="notation:DescriptionStyle" xmi:id="_NKJWcVJtEd2rTur0B442zw"/>
+ <styles xmi:type="notation:FillStyle" xmi:id="_NKJWclJtEd2rTur0B442zw"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_NKJWc1JtEd2rTur0B442zw" lineColor="0"/>
+ <element xmi:type="bpmn:Activity" href="parallel-split.bpmn#_NKHhQVJtEd2rTur0B442zw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_NKJWdFJtEd2rTur0B442zw" x="180" y="24"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_RyyVgFJtEd2rTur0B442zw" type="2001">
+ <children xmi:type="notation:Node" xmi:id="_Ryy8kFJtEd2rTur0B442zw" type="4001"/>
+ <styles xmi:type="notation:FontStyle" xmi:id="_RyyVgVJtEd2rTur0B442zw" fontName="Arial"/>
+ <styles xmi:type="notation:DescriptionStyle" xmi:id="_RyyVglJtEd2rTur0B442zw"/>
+ <styles xmi:type="notation:FillStyle" xmi:id="_RyyVg1JtEd2rTur0B442zw"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_RyyVhFJtEd2rTur0B442zw" lineColor="0"/>
+ <element xmi:type="bpmn:Activity" href="parallel-split.bpmn#_RywgUFJtEd2rTur0B442zw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_RyyVhVJtEd2rTur0B442zw" x="180" y="132"/>
+ </children>
+ <styles xmi:type="notation:DrawerStyle" xmi:id="__9E4MVJsEd2rTur0B442zw"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="__9E4MlJsEd2rTur0B442zw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="__9E4M1JsEd2rTur0B442zw"/>
+ </children>
+ <styles xmi:type="notation:FontStyle" xmi:id="__89jcVJsEd2rTur0B442zw" fontName="Arial"/>
+ <styles xmi:type="notation:DescriptionStyle" xmi:id="__89jclJsEd2rTur0B442zw"/>
+ <styles xmi:type="notation:FillStyle" xmi:id="__89jc1JsEd2rTur0B442zw" fillColor="16771304"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="__89jdFJsEd2rTur0B442zw" lineColor="11119017"/>
+ <element xmi:type="bpmn:Pool" href="parallel-split.bpmn#__7duoVJsEd2rTur0B442zw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="__9GGUFJsEd2rTur0B442zw" x="16" y="16" width="333" height="202"/>
+ </children>
+ <styles xmi:type="notation:PageStyle" xmi:id="__63RsVJsEd2rTur0B442zw"/>
+ <styles xmi:type="notation:GuideStyle" xmi:id="__63RslJsEd2rTur0B442zw"/>
+ <styles xmi:type="notation:DescriptionStyle" xmi:id="__63Rs1JsEd2rTur0B442zw"/>
+ <element xmi:type="bpmn:BpmnDiagram" href="parallel-split.bpmn#__6YwkFJsEd2rTur0B442zw"/>
+ <edges xmi:type="notation:Edge" xmi:id="_Kof5EFJtEd2rTur0B442zw" type="3001" source="_KM-asFJtEd2rTur0B442zw" target="_I-6sIFJtEd2rTur0B442zw">
+ <children xmi:type="notation:Node" xmi:id="_Koi8YFJtEd2rTur0B442zw" type="4012">
+ <styles xmi:type="notation:FillStyle" xmi:id="_Koi8YVJtEd2rTur0B442zw" fillColor="16776959"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_Koi8YlJtEd2rTur0B442zw" lineColor="16776959"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_Koi8Y1JtEd2rTur0B442zw" y="-10"/>
+ </children>
+ <styles xmi:type="notation:RoutingStyle" xmi:id="_Kof5EVJtEd2rTur0B442zw" routing="Rectilinear" smoothness="Normal" closestDistance="true"/>
+ <styles xmi:type="notation:FontStyle" xmi:id="_Kof5ElJtEd2rTur0B442zw" fontName="Arial"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_Kof5E1JtEd2rTur0B442zw" lineColor="0"/>
+ <element xmi:type="bpmn:SequenceEdge" href="parallel-split.bpmn#_KocOsVJtEd2rTur0B442zw"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Kof5FFJtEd2rTur0B442zw" points="[15, 0, -213, -12]$[208, 6, -20, -6]"/>
+ </edges>
+ <edges xmi:type="notation:Edge" xmi:id="_P3o3cFJtEd2rTur0B442zw" type="3001" source="_I-6sIFJtEd2rTur0B442zw" target="_NKIvYFJtEd2rTur0B442zw">
+ <children xmi:type="notation:Node" xmi:id="_P3pegFJtEd2rTur0B442zw" type="4012">
+ <styles xmi:type="notation:FillStyle" xmi:id="_P3pegVJtEd2rTur0B442zw" fillColor="16776959"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_P3peglJtEd2rTur0B442zw" lineColor="16776959"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_P3peg1JtEd2rTur0B442zw" y="-10"/>
+ </children>
+ <styles xmi:type="notation:RoutingStyle" xmi:id="_P3o3cVJtEd2rTur0B442zw" routing="Rectilinear" smoothness="Normal" closestDistance="true"/>
+ <styles xmi:type="notation:FontStyle" xmi:id="_P3o3clJtEd2rTur0B442zw" fontName="Arial"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_P3o3c1JtEd2rTur0B442zw" lineColor="0"/>
+ <element xmi:type="bpmn:SequenceEdge" href="parallel-split.bpmn#_P3mbMVJtEd2rTur0B442zw"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_P3o3dFJtEd2rTur0B442zw" points="[-23, -2, -136, 55]$[98, -51, -15, 6]"/>
+ </edges>
+ <edges xmi:type="notation:Edge" xmi:id="_Ry5qQFJtEd2rTur0B442zw" type="3001" source="_I-6sIFJtEd2rTur0B442zw" target="_RyyVgFJtEd2rTur0B442zw">
+ <children xmi:type="notation:Node" xmi:id="_Ry64YFJtEd2rTur0B442zw" type="4012">
+ <styles xmi:type="notation:FillStyle" xmi:id="_Ry64YVJtEd2rTur0B442zw" fillColor="16776959"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_Ry64YlJtEd2rTur0B442zw" lineColor="16776959"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_Ry64Y1JtEd2rTur0B442zw" y="-10"/>
+ </children>
+ <styles xmi:type="notation:RoutingStyle" xmi:id="_Ry5qQVJtEd2rTur0B442zw" routing="Rectilinear" smoothness="Normal" closestDistance="true"/>
+ <styles xmi:type="notation:FontStyle" xmi:id="_Ry6RUFJtEd2rTur0B442zw" fontName="Arial"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_Ry6RUVJtEd2rTur0B442zw" lineColor="0"/>
+ <element xmi:type="bpmn:SequenceEdge" href="parallel-split.bpmn#_Ry4cIVJtEd2rTur0B442zw"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Ry6RUlJtEd2rTur0B442zw" points="[-14, -12, 109, 87]$[-121, -97, 2, 2]"/>
+ </edges>
+</notation:Diagram>
Added: api/trunk/modules/testsuite/src/test/resources/samples/parallelsplit/parallel-split.png
===================================================================
(Binary files differ)
Property changes on: api/trunk/modules/testsuite/src/test/resources/samples/parallelsplit/parallel-split.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence-api10.xml
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence-api10.xml 2008-07-15 10:23:31 UTC (rev 1635)
+++ api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence-api10.xml 2008-07-15 13:05:25 UTC (rev 1636)
@@ -1,4 +1,4 @@
-<ns2:process name="basic-sequence" xmlns:ns2="urn:api.bpm.jboss:jpdl-0.1">
+<ns2:process name="testBasicSequence" xmlns:ns2="urn:api.bpm.jboss:jpdl-0.1">
<start>
<sequence to="stateA" />
</start>
Modified: api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task-api10.xml
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task-api10.xml 2008-07-15 10:23:31 UTC (rev 1635)
+++ api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task-api10.xml 2008-07-15 13:05:25 UTC (rev 1636)
@@ -1,4 +1,4 @@
-<ns2:process name="basic-task" xmlns:ns2="urn:api.bpm.jboss:jpdl-0.1">
+<ns2:process name="testBasicTask" xmlns:ns2="urn:api.bpm.jboss:jpdl-0.1">
<start>
<sequence to="stateA" />
</start>
17 years, 9 months