JBoss JBPM SVN: r2510 - in projects/spec/trunk/modules: api/src/main/java/org/jbpm/api/service and 3 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-10-08 11:11:43 -0400 (Wed, 08 Oct 2008)
New Revision: 2510
Added:
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/NodePersistenceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/ProcesDefinitionPersistenceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/ProcessPersistenceTest.java
Removed:
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceServiceTest.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/PersistenceServiceImpl.java
Modified:
projects/spec/trunk/modules/api/pom.xml
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/PersistenceService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessDefinitionService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/HibernatePersistenceServiceImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/InMemoryPersistenceServiceImpl.java
projects/spec/trunk/modules/impl/src/main/resources/jbpm-cfg-beans.xml
Log:
Add Node persistence
Modified: projects/spec/trunk/modules/api/pom.xml
===================================================================
--- projects/spec/trunk/modules/api/pom.xml 2008-10-08 13:24:59 UTC (rev 2509)
+++ projects/spec/trunk/modules/api/pom.xml 2008-10-08 15:11:43 UTC (rev 2510)
@@ -27,6 +27,7 @@
<!-- Properties -->
<properties>
+ <hibernate.version>3.2.6.ga</hibernate.version>
<jboss.microcontainer.version>2.0.0.CR1</jboss.microcontainer.version>
</properties>
@@ -34,6 +35,11 @@
<dependencyManagement>
<dependencies>
<dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate</artifactId>
+ <version>${hibernate.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss.microcontainer</groupId>
<artifactId>jboss-kernel</artifactId>
<version>${jboss.microcontainer.version}</version>
@@ -48,6 +54,10 @@
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.jboss.microcontainer</groupId>
<artifactId>jboss-kernel</artifactId>
</dependency>
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/PersistenceService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/PersistenceService.java 2008-10-08 13:24:59 UTC (rev 2509)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/PersistenceService.java 2008-10-08 15:11:43 UTC (rev 2510)
@@ -25,12 +25,14 @@
import javax.management.ObjectName;
+import org.hibernate.Session;
import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Node;
import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.Process;
/**
- * The persistence service for a process.
+ * The persistence service.
*
* @author thomas.diesler(a)jboss.com
* @since 17-Sep-2008
@@ -45,8 +47,13 @@
ProcessEngine engine = ProcessEngine.getProcessEngine();
return engine.getService(PersistenceService.class);
}
-
+
/**
+ * Create a new persistence session
+ */
+ public abstract Session createSession();
+
+ /**
* Save the ProcessDefinition to persistent storage
*/
public abstract ObjectName saveProcessDefinition(ProcessDefinition procDef);
@@ -60,7 +67,7 @@
* Delete the ProcessDefinition from persistent storage
*/
public abstract void deleteProcessDefinition(ProcessDefinition procDef);
-
+
/**
* Save the Process to persistent storage
*/
@@ -75,4 +82,14 @@
* Delete the Process from persistent storage
*/
public abstract void deleteProcess(Process proc);
+
+ /**
+ * Save the Node to persistent storage
+ */
+ public abstract ObjectName saveNode(Session session, Node node);
+
+ /**
+ * Load the Node from persistent storage
+ */
+ public abstract Node loadNode(Session session, ObjectName nodeID);
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessDefinitionService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessDefinitionService.java 2008-10-08 13:24:59 UTC (rev 2509)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessDefinitionService.java 2008-10-08 15:11:43 UTC (rev 2510)
@@ -30,6 +30,7 @@
import javax.management.ObjectName;
+import org.hibernate.Session;
import org.jbpm.api.client.Deployment;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.ProcessDefinition;
@@ -92,11 +93,18 @@
log.debug("registerProcessDefinition: " + procDef);
// Save the ProcessDefinition through the PersistenceService
- PersistenceService dbService = getProcessEngine().getService(PersistenceService.class);
- ObjectName procDefID = dbService.saveProcessDefinition(procDef);
-
- procDefs.put(procDefID, procDef);
- return procDefID;
+ PersistenceService persService = getProcessEngine().getService(PersistenceService.class);
+ Session session = persService.createSession();
+ try
+ {
+ ObjectName procDefID = persService.saveProcessDefinition(procDef);
+ procDefs.put(procDefID, procDef);
+ return procDefID;
+ }
+ finally
+ {
+ session.close();
+ }
}
/**
@@ -118,11 +126,18 @@
procService.unregisterProcess(procID);
// Delete the ProcessDefinition through the PersistenceService
- PersistenceService dbService = engine.getService(PersistenceService.class);
- dbService.deleteProcessDefinition(procDef);
-
- procDefs.remove(procDefID);
- removed = true;
+ PersistenceService persService = engine.getService(PersistenceService.class);
+ Session session = persService.createSession();
+ try
+ {
+ persService.deleteProcessDefinition(procDef);
+ procDefs.remove(procDefID);
+ removed = true;
+ }
+ finally
+ {
+ session.close();
+ }
}
return removed;
}
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java 2008-10-08 13:24:59 UTC (rev 2509)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java 2008-10-08 15:11:43 UTC (rev 2510)
@@ -31,6 +31,7 @@
import javax.management.ObjectName;
+import org.hibernate.Session;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Process;
import org.jbpm.api.model.ProcessDefinition;
@@ -89,11 +90,18 @@
procDefService.registerProcessDefinition(procDef);
// Save the process through the PersistenceService
- PersistenceService dbService = getProcessEngine().getService(PersistenceService.class);
- ObjectName procID = dbService.saveProcess(proc);
-
- registeredProcs.put(procID, proc);
- return procID;
+ PersistenceService persService = getProcessEngine().getService(PersistenceService.class);
+ Session session = persService.createSession();
+ try
+ {
+ ObjectName procID = persService.saveProcess(proc);
+ registeredProcs.put(procID, proc);
+ return procID;
+ }
+ finally
+ {
+ session.close();
+ }
}
/**
@@ -108,11 +116,18 @@
log.debug("unregisterProcess: " + proc);
// Delete the process through the PersistenceService
- PersistenceService dbService = getProcessEngine().getService(PersistenceService.class);
- dbService.deleteProcess(proc);
-
- registeredProcs.remove(procID);
- removed = true;
+ PersistenceService persService = getProcessEngine().getService(PersistenceService.class);
+ Session session = persService.createSession();
+ try
+ {
+ persService.deleteProcess(proc);
+ registeredProcs.remove(procID);
+ removed = true;
+ }
+ finally
+ {
+ session.close();
+ }
}
return removed;
}
Added: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/NodePersistenceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/NodePersistenceTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/NodePersistenceTest.java 2008-10-08 15:11:43 UTC (rev 2510)
@@ -0,0 +1,73 @@
+/*
+ * 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.test.cts.service.persistence;
+
+// $Id$
+
+import javax.management.ObjectName;
+
+import org.hibernate.Session;
+import org.jbpm.api.model.Node;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.Task;
+import org.jbpm.api.service.PersistenceService;
+import org.jbpm.api.service.ProcessDefinitionService;
+import org.jbpm.api.service.ProcessService;
+import org.jbpm.api.test.CTSTestCase;
+import org.jbpm.test.cts.service.process.ProcessCatalog;
+
+/**
+ * Test the PersistenceService for Nodes
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class NodePersistenceTest extends CTSTestCase
+{
+ /**
+ * Test save, load of a Node
+ */
+ public void testNode() throws Exception
+ {
+ ProcessService procService = ProcessService.locateProcessService();
+ PersistenceService service = PersistenceService.locatePersistenceService();
+
+ // Register (save) the process, which is not done implicitly
+ ProcessDefinition procDef = unregisterOnTearDown(ProcessCatalog.getDefaultProcess());
+ Process proc = procDef.newInstance();
+ procService.registerProcess(proc);
+
+ ObjectName taskID = proc.getNode(Task.class, "Task").getKey();
+
+ Session session = service.createSession();
+ try
+ {
+ Node task = service.loadNode(session, taskID);
+ assertNotNull("Node not null", task);
+ }
+ finally
+ {
+ session.close();
+ }
+ }
+}
Property changes on: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/NodePersistenceTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceServiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceServiceTest.java 2008-10-08 13:24:59 UTC (rev 2509)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceServiceTest.java 2008-10-08 15:11:43 UTC (rev 2510)
@@ -1,124 +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.test.cts.service.persistence;
-
-// $Id: PersistenceServiceTest.java 2419 2008-09-29 07:22:59Z thomas.diesler(a)jboss.com $
-
-import javax.management.ObjectName;
-
-import org.jbpm.api.ProcessNotFoundException;
-import org.jbpm.api.model.EndEvent;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.StartEvent;
-import org.jbpm.api.model.Task;
-import org.jbpm.api.service.PersistenceService;
-import org.jbpm.api.service.ProcessDefinitionService;
-import org.jbpm.api.test.CTSTestCase;
-import org.jbpm.test.cts.service.process.ProcessCatalog;
-
-/**
- * Test the PersistenceService
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public class PersistenceServiceTest extends CTSTestCase
-{
- /**
- * Test save, load, delete of a trivial ProcessDefinition
- */
- public void testProcessDefinition() throws Exception
- {
- PersistenceService service = PersistenceService.locatePersistenceService();
-
- // Save the ProcessDefinition
- ProcessDefinition procDef = ProcessCatalog.getDefaultProcess();
- service.saveProcessDefinition(procDef);
-
- // Load the ProcessDefinition
- ObjectName procDefID = procDef.getKey();
- ProcessDefinition loadDef = service.loadProcessDefinition(procDefID);
- ProcessCatalog.validateDefaultProcess(loadDef);
-
- StartEvent start = loadDef.getNode(StartEvent.class, "Start");
- Task task = loadDef.getNode(Task.class, "Task");
- EndEvent end = loadDef.getNode(EndEvent.class, "End");
-
- assertSame(loadDef, start.getProcessDefinition());
- assertSame(loadDef, task.getProcessDefinition());
- assertSame(loadDef, end.getProcessDefinition());
-
- // Delete the ProcessDefinition
- service.deleteProcessDefinition(procDef);
- try
- {
- service.loadProcessDefinition(procDefID);
- fail("ProcessNotFoundException expected");
- }
- catch (ProcessNotFoundException ex)
- {
- // expected
- }
- }
-
- /**
- * Test save, load, delete of a trivial Process
- */
- public void testProcess() throws Exception
- {
- ProcessDefinitionService procDefService = ProcessDefinitionService.locateProcessDefinitionService();
- PersistenceService service = PersistenceService.locatePersistenceService();
-
- // Register (save) the process definition, which is not done implicitly by saveProcess
- ProcessDefinition procDef = unregisterOnTearDown(ProcessCatalog.getDefaultProcess());
- procDefService.registerProcessDefinition(procDef);
-
- // Create and save the Process
- Process proc = procDef.newInstance();
- service.saveProcess(proc);
-
- // Load the process
- ObjectName procID = proc.getKey();
- Process loadProc = service.loadProcess(procID);
-
- StartEvent start = loadProc.getNode(StartEvent.class, "Start");
- Task task = loadProc.getNode(Task.class, "Task");
- EndEvent end = loadProc.getNode(EndEvent.class, "End");
-
- assertSame(loadProc, start.getProcess());
- assertSame(loadProc, task.getProcess());
- assertSame(loadProc, end.getProcess());
-
- // Delete the process
- service.deleteProcess(proc);
- try
- {
- service.loadProcess(procID);
- fail("ProcessNotFoundException expected");
- }
- catch (ProcessNotFoundException ex)
- {
- // expected
- }
- }
-}
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/ProcesDefinitionPersistenceTest.java (from rev 2508, projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceServiceTest.java)
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/ProcesDefinitionPersistenceTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/ProcesDefinitionPersistenceTest.java 2008-10-08 15:11:43 UTC (rev 2510)
@@ -0,0 +1,81 @@
+/*
+ * 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.test.cts.service.persistence;
+
+// $Id: PersistenceServiceTest.java 2419 2008-09-29 07:22:59Z thomas.diesler(a)jboss.com $
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.ProcessNotFoundException;
+import org.jbpm.api.model.EndEvent;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.StartEvent;
+import org.jbpm.api.model.Task;
+import org.jbpm.api.service.PersistenceService;
+import org.jbpm.api.test.CTSTestCase;
+import org.jbpm.test.cts.service.process.ProcessCatalog;
+
+/**
+ * Test the PersistenceService
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class ProcesDefinitionPersistenceTest extends CTSTestCase
+{
+ /**
+ * Test save, load, delete of a trivial ProcessDefinition
+ */
+ public void testProcessDefinition() throws Exception
+ {
+ PersistenceService service = PersistenceService.locatePersistenceService();
+
+ // Save the ProcessDefinition
+ ProcessDefinition procDef = ProcessCatalog.getDefaultProcess();
+ service.saveProcessDefinition(procDef);
+
+ // Load the ProcessDefinition
+ ObjectName procDefID = procDef.getKey();
+ ProcessDefinition loadDef = service.loadProcessDefinition(procDefID);
+ ProcessCatalog.validateDefaultProcess(loadDef);
+
+ StartEvent start = loadDef.getNode(StartEvent.class, "Start");
+ Task task = loadDef.getNode(Task.class, "Task");
+ EndEvent end = loadDef.getNode(EndEvent.class, "End");
+
+ assertSame(loadDef, start.getProcessDefinition());
+ assertSame(loadDef, task.getProcessDefinition());
+ assertSame(loadDef, end.getProcessDefinition());
+
+ // Delete the ProcessDefinition
+ service.deleteProcessDefinition(procDef);
+ try
+ {
+ service.loadProcessDefinition(procDefID);
+ fail("ProcessNotFoundException expected");
+ }
+ catch (ProcessNotFoundException ex)
+ {
+ // expected
+ }
+ }
+}
Added: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/ProcessPersistenceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/ProcessPersistenceTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/ProcessPersistenceTest.java 2008-10-08 15:11:43 UTC (rev 2510)
@@ -0,0 +1,87 @@
+/*
+ * 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.test.cts.service.persistence;
+
+// $Id$
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.ProcessNotFoundException;
+import org.jbpm.api.model.EndEvent;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.StartEvent;
+import org.jbpm.api.model.Task;
+import org.jbpm.api.service.PersistenceService;
+import org.jbpm.api.service.ProcessDefinitionService;
+import org.jbpm.api.test.CTSTestCase;
+import org.jbpm.test.cts.service.process.ProcessCatalog;
+
+/**
+ * Test the PersistenceService
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class ProcessPersistenceTest extends CTSTestCase
+{
+ /**
+ * Test save, load, delete of a trivial Process
+ */
+ public void testProcess() throws Exception
+ {
+ ProcessDefinitionService procDefService = ProcessDefinitionService.locateProcessDefinitionService();
+ PersistenceService service = PersistenceService.locatePersistenceService();
+
+ // Register (save) the process definition, which is not done implicitly
+ ProcessDefinition procDef = unregisterOnTearDown(ProcessCatalog.getDefaultProcess());
+ procDefService.registerProcessDefinition(procDef);
+
+ // Create and save the Process
+ Process proc = procDef.newInstance();
+ service.saveProcess(proc);
+
+ // Load the process
+ ObjectName procID = proc.getKey();
+ Process loadProc = service.loadProcess(procID);
+
+ StartEvent start = loadProc.getNode(StartEvent.class, "Start");
+ Task task = loadProc.getNode(Task.class, "Task");
+ EndEvent end = loadProc.getNode(EndEvent.class, "End");
+
+ assertSame(loadProc, start.getProcess());
+ assertSame(loadProc, task.getProcess());
+ assertSame(loadProc, end.getProcess());
+
+ // Delete the process
+ service.deleteProcess(proc);
+ try
+ {
+ service.loadProcess(procID);
+ fail("ProcessNotFoundException expected");
+ }
+ catch (ProcessNotFoundException ex)
+ {
+ // expected
+ }
+ }
+}
Property changes on: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/ProcessPersistenceTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/HibernatePersistenceServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/HibernatePersistenceServiceImpl.java 2008-10-08 13:24:59 UTC (rev 2509)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/HibernatePersistenceServiceImpl.java 2008-10-08 15:11:43 UTC (rev 2510)
@@ -34,13 +34,15 @@
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.AnnotationConfiguration;
-import org.hibernate.classic.Session;
+import org.hibernate.Session;
import org.jbpm.api.ProcessNotFoundException;
import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Node;
import org.jbpm.api.model.Process;
import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.service.PersistenceService;
import org.jbpm.api.service.Service;
+import org.jbpm.ri.model.NodeImpl;
import org.jbpm.ri.model.ProcessDefinitionImpl;
import org.jbpm.ri.model.ProcessImpl;
import org.slf4j.Logger;
@@ -66,7 +68,7 @@
{
super.setProcessEngine(engine);
}
-
+
public void setHibernateConfig(String hibernateConfig)
{
this.hibernateConfig = hibernateConfig;
@@ -78,6 +80,12 @@
}
@Override
+ public Session createSession()
+ {
+ return getSessionFactory().openSession();
+ }
+
+ @Override
public ObjectName saveProcessDefinition(ProcessDefinition procDef)
{
log.debug("START saveProcessDefinition: " + procDef.getKey());
@@ -161,13 +169,13 @@
public Process loadProcess(ObjectName procID)
{
log.debug("START loadProcess: " + procID);
- ProcessImpl procImpl = null;
+ Process proc = null;
Session session = getSessionFactory().openSession();
try
{
Integer id = Integer.valueOf(procID.getKeyProperty("id"));
- procImpl = (ProcessImpl)session.load(ProcessImpl.class, id);
- Hibernate.initialize(procImpl);
+ proc = (Process)session.load(ProcessImpl.class, id);
+ Hibernate.initialize(proc);
}
catch (ObjectNotFoundException ex)
{
@@ -178,7 +186,7 @@
session.close();
}
log.debug("END loadProcess: " + procID);
- return (Process)procImpl;
+ return proc;
}
@Override
@@ -199,6 +207,36 @@
log.debug("END deleteProcess: " + proc);
}
+ @Override
+ public ObjectName saveNode(Session session, Node node)
+ {
+ log.debug("START saveNode: " + node.getKey());
+
+ session.saveOrUpdate(node);
+
+ log.debug("END saveNode: " + node.getKey());
+ return node.getKey();
+ }
+
+ @Override
+ public Node loadNode(Session session, ObjectName nodeID)
+ {
+ log.debug("START loadNode: " + nodeID);
+ Node node = null;
+ try
+ {
+ Integer id = Integer.valueOf(nodeID.getKeyProperty("id"));
+ node = (Node)session.load(NodeImpl.class, id);
+ Hibernate.initialize(node);
+ }
+ catch (ObjectNotFoundException ex)
+ {
+ throw new ProcessNotFoundException("Cannot find node: " + nodeID);
+ }
+ log.debug("END loadNode: " + nodeID);
+ return node;
+ }
+
@SuppressWarnings("unchecked")
private SessionFactory getSessionFactory()
{
@@ -214,7 +252,7 @@
if (sessionFactory == null)
{
AnnotationConfiguration anConfig = new AnnotationConfiguration();
-
+
String serviceName = null;
try
{
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/InMemoryPersistenceServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/InMemoryPersistenceServiceImpl.java 2008-10-08 13:24:59 UTC (rev 2509)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/InMemoryPersistenceServiceImpl.java 2008-10-08 15:11:43 UTC (rev 2510)
@@ -28,8 +28,10 @@
import javax.management.ObjectName;
+import org.hibernate.Session;
import org.jbpm.api.ProcessNotFoundException;
import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Node;
import org.jbpm.api.model.Process;
import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.service.PersistenceService;
@@ -49,6 +51,7 @@
private Map<ObjectName, ProcessDefinition> procDefs = new HashMap<ObjectName, ProcessDefinition>();
private Map<ObjectName, Process> procs = new HashMap<ObjectName, Process>();
+ private Map<ObjectName, Node> nodes = new HashMap<ObjectName, Node>();
@Override
public void setProcessEngine(ProcessEngine engine)
@@ -57,70 +60,77 @@
}
@Override
+ public Session createSession()
+ {
+ return null;
+ }
+
+ @Override
public ObjectName saveProcessDefinition(ProcessDefinition procDef)
{
- log.debug("START saveProcessDefinition: " + procDef.getKey());
-
procDefs.put(procDef.getKey(), procDef);
-
- log.debug("END saveProcessDefinition: " + procDef.getKey());
return procDef.getKey();
}
@Override
public ProcessDefinition loadProcessDefinition(ObjectName procDefID)
{
- log.debug("START loadProcessDefinition: " + procDefID);
-
ProcessDefinition procDef = procDefs.get(procDefID);
if (procDef == null)
throw new ProcessNotFoundException("Cannot find process: " + procDefID);
- log.debug("END loadProcessDefinition: " + procDefID);
return procDef;
}
@Override
public void deleteProcessDefinition(ProcessDefinition procDef)
{
- log.debug("START deleteProcessDefinition: " + procDef);
-
procDefs.remove(procDef.getKey());
-
- log.debug("END deleteProcessDefinition: " + procDef);
}
@Override
public ObjectName saveProcess(Process proc)
{
- log.debug("START saveProcess: " + proc.getKey());
-
procs.put(proc.getKey(), proc);
- log.debug("END saveProcess: " + proc.getKey());
+ for (Node node : proc.getNodes())
+ nodes.put(node.getKey(), node);
+
return proc.getKey();
}
@Override
public Process loadProcess(ObjectName procID)
{
- log.debug("START loadProcess: " + procID);
-
Process proc = procs.get(procID);
if (proc == null)
throw new ProcessNotFoundException("Cannot find process: " + procID);
- log.debug("END loadProcess: " + procID);
return proc;
}
@Override
public void deleteProcess(Process proc)
{
- log.debug("START deleteProcess: " + proc);
-
procs.remove(proc.getKey());
- log.debug("END deleteProcess: " + proc);
+ for (Node node : proc.getNodes())
+ nodes.remove(node.getKey());
}
+
+ @Override
+ public ObjectName saveNode(Session session, Node node)
+ {
+ return node.getKey();
+ }
+
+ @Override
+ public Node loadNode(Session session, ObjectName nodeID)
+ {
+ Node node = nodes.get(nodeID);
+ if (node == null)
+ throw new ProcessNotFoundException("Cannot find node: " + nodeID);
+
+ return node;
+ }
}
Deleted: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/PersistenceServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/PersistenceServiceImpl.java 2008-10-08 13:24:59 UTC (rev 2509)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/PersistenceServiceImpl.java 2008-10-08 15:11:43 UTC (rev 2510)
@@ -1,239 +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.ri.service;
-
-// $Id$
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import javax.management.ObjectName;
-
-import org.hibernate.Hibernate;
-import org.hibernate.ObjectNotFoundException;
-import org.hibernate.SessionFactory;
-import org.hibernate.Transaction;
-import org.hibernate.cfg.AnnotationConfiguration;
-import org.hibernate.classic.Session;
-import org.jbpm.api.ProcessNotFoundException;
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.service.PersistenceService;
-import org.jbpm.api.service.Service;
-import org.jbpm.ri.model.ProcessDefinitionImpl;
-import org.jbpm.ri.model.ProcessImpl;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A Hibernate based persistence service for a process.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 17-Sep-2008
- */
-public class PersistenceServiceImpl extends PersistenceService implements MutableService
-{
- // Provide logging
- final Logger log = LoggerFactory.getLogger(PersistenceServiceImpl.class);
-
- private String hibernateConfig;
- private SessionFactory sessionFactory;
- private Set<String> annotatedClasses = new HashSet<String>();
-
- @Override
- public void setProcessEngine(ProcessEngine engine)
- {
- super.setProcessEngine(engine);
- }
-
- public void setHibernateConfig(String hibernateConfig)
- {
- this.hibernateConfig = hibernateConfig;
- }
-
- public void setAnnotatedClasses(Set<String> annotatedClasses)
- {
- this.annotatedClasses = annotatedClasses;
- }
-
- @Override
- public ObjectName saveProcessDefinition(ProcessDefinition procDef)
- {
- log.debug("START saveProcessDefinition: " + procDef.getKey());
- Session session = getSessionFactory().openSession();
- Transaction tx = session.beginTransaction();
- try
- {
- session.saveOrUpdate(procDef);
- tx.commit();
- }
- finally
- {
- session.close();
- }
- log.debug("END saveProcessDefinition: " + procDef.getKey());
- return procDef.getKey();
- }
-
- @Override
- public ProcessDefinition loadProcessDefinition(ObjectName procDefID)
- {
- log.debug("START loadProcessDefinition: " + procDefID);
- ProcessDefinitionImpl procDefImpl = null;
- Session session = getSessionFactory().openSession();
- try
- {
- Integer id = Integer.valueOf(procDefID.getKeyProperty("id"));
- procDefImpl = (ProcessDefinitionImpl)session.load(ProcessDefinitionImpl.class, id);
- Hibernate.initialize(procDefImpl);
- }
- catch (ObjectNotFoundException ex)
- {
- throw new ProcessNotFoundException("Cannot find process: " + procDefID);
- }
- finally
- {
- session.close();
- }
- log.debug("END loadProcessDefinition: " + procDefID);
- return (ProcessDefinition)procDefImpl;
- }
-
- @Override
- public void deleteProcessDefinition(ProcessDefinition procDef)
- {
- log.debug("START deleteProcessDefinition: " + procDef);
- Session session = getSessionFactory().openSession();
- Transaction tx = session.beginTransaction();
- try
- {
- session.delete(procDef);
- tx.commit();
- }
- finally
- {
- session.close();
- }
- log.debug("END deleteProcessDefinition: " + procDef);
- }
-
- @Override
- public ObjectName saveProcess(Process proc)
- {
- log.debug("START saveProcess: " + proc.getKey());
- Session session = getSessionFactory().openSession();
- Transaction tx = session.beginTransaction();
- try
- {
- session.saveOrUpdate(proc);
- tx.commit();
- }
- finally
- {
- session.close();
- }
- log.debug("END saveProcess: " + proc.getKey());
- return proc.getKey();
- }
-
- @Override
- public Process loadProcess(ObjectName procID)
- {
- log.debug("START loadProcess: " + procID);
- ProcessImpl procImpl = null;
- Session session = getSessionFactory().openSession();
- try
- {
- Integer id = Integer.valueOf(procID.getKeyProperty("id"));
- procImpl = (ProcessImpl)session.load(ProcessImpl.class, id);
- Hibernate.initialize(procImpl);
- }
- catch (ObjectNotFoundException ex)
- {
- throw new ProcessNotFoundException("Cannot find process: " + procID);
- }
- finally
- {
- session.close();
- }
- log.debug("END loadProcess: " + procID);
- return (Process)procImpl;
- }
-
- @Override
- public void deleteProcess(Process proc)
- {
- log.debug("START deleteProcess: " + proc);
- Session session = getSessionFactory().openSession();
- Transaction tx = session.beginTransaction();
- try
- {
- session.delete(proc);
- tx.commit();
- }
- finally
- {
- session.close();
- }
- log.debug("END deleteProcess: " + proc);
- }
-
- @SuppressWarnings("unchecked")
- private SessionFactory getSessionFactory()
- {
- // If this property is not explicitly set in the beans config
- // fall back to the -Ddatabase property that also activates
- // the corresponding mvn profiles
- if (hibernateConfig == null)
- {
- String database = System.getProperty("database", "mysql");
- hibernateConfig = "hibernate.cfg." + database + ".xml";
- }
-
- if (sessionFactory == null)
- {
- AnnotationConfiguration anConfig = new AnnotationConfiguration();
-
- String serviceName = null;
- try
- {
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- Iterator<String> itAnn = annotatedClasses.iterator();
- while (itAnn.hasNext())
- {
- serviceName = itAnn.next();
- Class<Service> serviceClass = (Class<Service>)ctxLoader.loadClass(serviceName);
- anConfig.addAnnotatedClass(serviceClass);
- }
- }
- catch (Exception ex)
- {
- throw new IllegalStateException("Cannot load service: " + serviceName, ex);
- }
-
- sessionFactory = anConfig.configure(hibernateConfig).buildSessionFactory();
- }
- return sessionFactory;
- }
-}
Modified: projects/spec/trunk/modules/impl/src/main/resources/jbpm-cfg-beans.xml
===================================================================
--- projects/spec/trunk/modules/impl/src/main/resources/jbpm-cfg-beans.xml 2008-10-08 13:24:59 UTC (rev 2509)
+++ projects/spec/trunk/modules/impl/src/main/resources/jbpm-cfg-beans.xml 2008-10-08 15:11:43 UTC (rev 2510)
@@ -21,7 +21,7 @@
</bean>
<!-- The PersistenceService -->
- <bean name="jBPMPersistenceService" class="org.jbpm.ri.service.PersistenceServiceImpl">
+ <bean name="jBPMPersistenceService" class="org.jbpm.ri.service.HibernatePersistenceServiceImpl">
<property name="annotatedClasses">
<set elementClass="java.lang.String">
<value>org.jbpm.ri.model.AbstractElementImpl</value>
17 years, 6 months
JBoss JBPM SVN: r2509 - in jbpm3/trunk/modules/gwt-console: rpc/src/main/java/org/jboss/bpm/console/client/model and 6 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-10-08 09:24:59 -0400 (Wed, 08 Oct 2008)
New Revision: 2509
Added:
jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/RoleAssignment.java
jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/RoleAssignmentWrapper.java
jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java
jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/UserManagement.java
Removed:
jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/ProcessManagementService.java
jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/ProcessManagementServiceAsync.java
jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/ProcessManagementApplication.java
Modified:
jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/GWTJsonFilter.java
jbpm3/trunk/modules/gwt-console/server/src/main/webapp/WEB-INF/web.xml
jbpm3/trunk/modules/gwt-console/server/src/main/webapp/index.html
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/Config.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/ConsoleView.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/MainMenu.java
jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/Application.gwt.xml
jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/console.css
Log:
Login screen and authorization, first cut
Deleted: jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/ProcessManagementService.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/ProcessManagementService.java 2008-10-08 11:24:25 UTC (rev 2508)
+++ jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/ProcessManagementService.java 2008-10-08 13:24:59 UTC (rev 2509)
@@ -1,36 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.console.client;
-
-import com.google.gwt.user.client.rpc.RemoteService;
-
-import java.util.List;
-
-import org.jboss.bpm.console.client.model.ProcessDefinition;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public interface ProcessManagementService extends RemoteService
-{
- List<ProcessDefinition> getAllProcessDefinitions();
-}
Deleted: jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/ProcessManagementServiceAsync.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/ProcessManagementServiceAsync.java 2008-10-08 11:24:25 UTC (rev 2508)
+++ jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/ProcessManagementServiceAsync.java 2008-10-08 13:24:59 UTC (rev 2509)
@@ -1,32 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.console.client;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public interface ProcessManagementServiceAsync
-{
- void getAllProcessDefinitions(AsyncCallback async);
-}
Added: jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/RoleAssignment.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/RoleAssignment.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/RoleAssignment.java 2008-10-08 13:24:59 UTC (rev 2509)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.console.client.model;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+@XmlRootElement(name = "roleAssignment")
+public class RoleAssignment
+{
+ private String role;
+ private boolean isAssigned;
+
+
+ public RoleAssignment()
+ {
+ }
+
+ public RoleAssignment(String role, boolean assigned)
+ {
+ this.role = role;
+ isAssigned = assigned;
+ }
+
+ @XmlElement(name = "role")
+ public String getRole()
+ {
+ return role;
+ }
+
+ public void setRole(String role)
+ {
+ this.role = role;
+ }
+
+ @XmlElement(name = "assigned")
+ public boolean isAssigned()
+ {
+ return isAssigned;
+ }
+
+ public void setAssigned(boolean assigned)
+ {
+ isAssigned = assigned;
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/RoleAssignment.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/RoleAssignmentWrapper.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/RoleAssignmentWrapper.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/RoleAssignmentWrapper.java 2008-10-08 13:24:59 UTC (rev 2509)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.console.client.model;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+@XmlRootElement(name = "wrapper")
+public class RoleAssignmentWrapper
+{
+ List<RoleAssignment> roles;
+
+ public RoleAssignmentWrapper()
+ {
+ }
+
+ public RoleAssignmentWrapper(List<RoleAssignment> roles)
+ {
+ this.roles = roles;
+ }
+
+ public List<RoleAssignment> getRoles()
+ {
+ return roles;
+ }
+
+ public void setRoles(List<RoleAssignment> roles)
+ {
+ this.roles = roles;
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/RoleAssignmentWrapper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java (from rev 2494, jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/ProcessManagementApplication.java)
===================================================================
--- jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java 2008-10-08 13:24:59 UTC (rev 2509)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.console.server;
+
+import javax.ws.rs.core.Application;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class ConsoleServerApplication extends Application
+{
+ HashSet<Object> singletons = new HashSet<Object>();
+
+ public ConsoleServerApplication()
+ {
+ singletons.add(new ProcessManagement());
+ singletons.add(new UserManagement());
+ }
+
+ @Override
+ public Set<Class<?>> getClasses()
+ {
+ HashSet<Class<?>> set = new HashSet<Class<?>>();
+ return set;
+ }
+
+ @Override
+ public Set<Object> getSingletons()
+ {
+ return singletons;
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/GWTJsonFilter.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/GWTJsonFilter.java 2008-10-08 11:24:25 UTC (rev 2508)
+++ jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/GWTJsonFilter.java 2008-10-08 13:24:59 UTC (rev 2509)
@@ -45,11 +45,11 @@
throws IOException, ServletException
{
- boolean isGWTRequest = false;
+ boolean isSOPCallback = false;
// identify GWT json requests
if(request.getParameter("callback")!=null)
- isGWTRequest = true;
+ isSOPCallback = true;
// sneak in repsonse wrapper
OutputStream out = response.getOutputStream();
@@ -62,15 +62,27 @@
String contentType = response.getContentType() != null ? response.getContentType() : "application/octet-stream";
boolean isJSONEncoding = contentType.equals("application/json");
StringBuffer sb = null;
- if(isGWTRequest && isJSONEncoding)
+ if(isJSONEncoding)
{
String payload = new String(wrapper.getData());
String gwtextFriendly = trimPayload(payload);
- sb = new StringBuffer(request.getParameter("callback"));
- sb.append("(");
+ sb = new StringBuffer();
+
+ if(isSOPCallback)
+ {
+ sb.append(request.getParameter("callback"));
+ sb.append("(");
+ }
+
+ // Strip wrapper when JSONRequest
sb.append(gwtextFriendly);
- sb.append(");");
+
+ if(isSOPCallback)
+ {
+ sb.append(");");
+ }
+
}
// flush
Deleted: jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/ProcessManagementApplication.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/ProcessManagementApplication.java 2008-10-08 11:24:25 UTC (rev 2508)
+++ jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/ProcessManagementApplication.java 2008-10-08 13:24:59 UTC (rev 2509)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.console.server;
-
-import javax.ws.rs.core.Application;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class ProcessManagementApplication extends Application
-{
- HashSet<Object> singletons = new HashSet<Object>();
-
- public ProcessManagementApplication()
- {
- singletons.add(new ProcessManagement());
- }
-
- @Override
- public Set<Class<?>> getClasses()
- {
- HashSet<Class<?>> set = new HashSet<Class<?>>();
- return set;
- }
-
- @Override
- public Set<Object> getSingletons()
- {
- return singletons;
- }
-}
Added: jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/UserManagement.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/UserManagement.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/UserManagement.java 2008-10-08 13:24:59 UTC (rev 2509)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.console.server;
+
+import org.jboss.bpm.console.client.model.RoleAssignmentWrapper;
+import org.jboss.bpm.console.client.model.RoleAssignment;
+
+import javax.ws.rs.*;
+import javax.ws.rs.core.Context;
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.StringTokenizer;
+
+/**
+ * REST server module for accessing user related data.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+@Path("user")
+public class UserManagement
+{
+
+ @GET
+ @Path("roles")
+ @Produces("application/json")
+ public RoleAssignmentWrapper getAssignedRoles(
+ @Context
+ HttpServletRequest request,
+ @QueryParam("roleCheck")
+ String roleCheck
+ )
+ {
+ if(null==roleCheck)
+ throw new WebApplicationException( new IllegalArgumentException("Missing parameter 'roleCheck'") );
+
+ System.out.println("Role check user: " + request.getRemoteUser() + ", actualRoles requested: " + roleCheck);
+
+ List<RoleAssignment> actualRoles = new ArrayList<RoleAssignment>();
+
+ StringTokenizer tok = new StringTokenizer(roleCheck, ",");
+ while(tok.hasMoreTokens())
+ {
+ String possibleRole = tok.nextToken();
+ actualRoles.add( new RoleAssignment(possibleRole, request.isUserInRole(possibleRole)));
+ }
+ return new RoleAssignmentWrapper(actualRoles);
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/UserManagement.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm3/trunk/modules/gwt-console/server/src/main/webapp/WEB-INF/web.xml
===================================================================
--- jbpm3/trunk/modules/gwt-console/server/src/main/webapp/WEB-INF/web.xml 2008-10-08 11:24:25 UTC (rev 2508)
+++ jbpm3/trunk/modules/gwt-console/server/src/main/webapp/WEB-INF/web.xml 2008-10-08 13:24:59 UTC (rev 2509)
@@ -7,7 +7,7 @@
<context-param>
<param-name>javax.ws.rs.core.Application</param-name>
- <param-value>org.jboss.bpm.console.server.ProcessManagementApplication</param-value>
+ <param-value>org.jboss.bpm.console.server.ConsoleServerApplication</param-value>
</context-param>
<context-param>
Modified: jbpm3/trunk/modules/gwt-console/server/src/main/webapp/index.html
===================================================================
--- jbpm3/trunk/modules/gwt-console/server/src/main/webapp/index.html 2008-10-08 11:24:25 UTC (rev 2508)
+++ jbpm3/trunk/modules/gwt-console/server/src/main/webapp/index.html 2008-10-08 13:24:59 UTC (rev 2509)
@@ -31,6 +31,16 @@
<td>application/json, text/html</td>
</tr>
+ <tr>
+ <td colspan=4>User Management</td>
+ </tr>
+
+ <tr>
+ <td>GET</td>
+ <td><a href="/gwt-console-server/rs/user/roles?roleCheck=admin,user">/rs/user/roles?roleCheck=a,b,c</a></td>
+ <td>A list of assigned roles</td>
+ <td>application/json</td>
+ </tr>
</table>
<h2>Example usage</h2>
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/Config.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/Config.java 2008-10-08 11:24:25 UTC (rev 2508)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/Config.java 2008-10-08 13:24:59 UTC (rev 2509)
@@ -58,4 +58,16 @@
{
return consoleServerUrl + webContext + "/rs/process/definitions/"+processId+"/instances";
}
+
+ public String getUserInRoleURL(String[] possibleRoles)
+ {
+ StringBuffer sb = new StringBuffer();
+ for(int i=0; i<possibleRoles.length; i++)
+ {
+ sb.append(possibleRoles[i]);
+ if(i<possibleRoles.length-1)
+ sb.append(",");
+ }
+ return consoleServerUrl + webContext + "/rs/user/roles?roleCheck="+sb.toString();
+ }
}
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/ConsoleView.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/ConsoleView.java 2008-10-08 11:24:25 UTC (rev 2508)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/ConsoleView.java 2008-10-08 13:24:59 UTC (rev 2509)
@@ -21,53 +21,79 @@
*/
package org.jboss.bpm.console.client;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.http.client.*;
+import com.google.gwt.json.client.JSONArray;
+import com.google.gwt.json.client.JSONObject;
+import com.google.gwt.json.client.JSONParser;
+import com.google.gwt.json.client.JSONValue;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTML;
+import com.gwtext.client.core.EventObject;
import com.gwtext.client.core.Margins;
import com.gwtext.client.core.RegionPosition;
-import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.Viewport;
-import com.gwtext.client.widgets.MessageBox;
-import com.gwtext.client.widgets.MessageBoxConfig;
+import com.gwtext.client.widgets.*;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
import com.gwtext.client.widgets.layout.BorderLayout;
import com.gwtext.client.widgets.layout.BorderLayoutData;
import com.gwtext.client.widgets.layout.FitLayout;
+import com.gwtext.client.widgets.layout.VerticalLayout;
import org.jboss.bpm.console.client.metric.MetricOverviewEditor;
import org.jboss.bpm.console.client.process.ProcessDefinitionListEditor;
import org.jboss.bpm.console.client.widgets.EditorView;
import org.jboss.bpm.console.client.widgets.UIConstants;
-import org.jboss.bpm.console.client.model.ProcessDefinition;
+import java.util.ArrayList;
+import java.util.List;
+
/**
+ * The main composite that assembles the gwt console application.
+ *
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
public class ConsoleView extends Composite
{
- private Panel mainPanel = new Panel();
- private Panel borderPanel = new Panel();
-
- private HTML status = new HTML();
-
+ private HTML status = new HTML();
private HeaderPanel header;
private MainMenu mainMenu;
private EditorPanel editorPanel;
-
private Config config = new Config();
+ private String[] rolesAssigned = new String[] {};
+ private final static String[] POSSIBLE_ROLES = {"admin", "user"};
+
+ private static final int WIDTH = 1024;
+ private static final int HEIGHT = 768;
+
private Viewport viewport;
-
+
public ConsoleView()
{
+ Panel mainPanel = createMainPanel();
+ assembleMainApplication(mainPanel);
+ forceLogin(mainPanel);
+ viewport = new Viewport(mainPanel);
+ }
+
+ private Panel createMainPanel()
+ {
+ Panel mainPanel = new Panel();
mainPanel.setBorder(false);
mainPanel.setPaddings(5); // outer most padding
mainPanel.setLayout(new FitLayout());
- mainPanel.setWidth(1024);
- mainPanel.setHeight(768);
+ mainPanel.setWidth(WIDTH);
+ mainPanel.setHeight(HEIGHT);
+ mainPanel.hide();
initWidget( mainPanel );
-
- borderPanel.setLayout(new BorderLayout());
+ return mainPanel;
+ }
+ private void assembleMainApplication(Panel mainPanel)
+ {
+ Panel borderPanel = new Panel();
+ borderPanel.setLayout(new BorderLayout());
+
// ------------------------------------------
header = new HeaderPanel(this);
@@ -89,18 +115,116 @@
borderPanel.add(editorPanel, new BorderLayoutData(RegionPosition.CENTER));
// ------------------------------------------
-
+
editorPanel.addEditor( new ProcessDefinitionListEditor(this), false );
editorPanel.addEditor( new MetricOverviewEditor(this), false);
+
+ // ------------------------------------------
+
+ mainPanel.add(borderPanel);
+ }
+
+ private void forceLogin(final Panel mainPanel)
+ {
+ Panel panel = new Panel();
+ panel.setPaddings(20);
+ panel.setStyleName("login-panel-content");
+ panel.setLayout(new VerticalLayout(10));
+ panel.add( new HTML("Welcome, please login.") );
+ final Window window = new Window();
+ window.setTitle("GWT-Console");
+ window.setClosable(false);
+ window.setResizable(false);
+ window.setWidth(300);
+ window.setHeight(180);
+ window.setLayout(new BorderLayout());
+ window.setCloseAction(Window.CLOSE);
+
+ final Button submitBtn = new Button("Login",
+ new ButtonListenerAdapter()
+ {
+ public void onClick(Button button, EventObject e)
+ {
+
+ if(GWT.isScript())
+ {
+ String url = getConfig().getUserInRoleURL(POSSIBLE_ROLES);
+ RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, url);
+
+ try
+ {
+ rb.sendRequest(null,
+ new RequestCallback() {
+
+ public void onResponseReceived(Request request, Response response)
+ {
+ // parse roles
+ List<String> tmp = new ArrayList<String>();
+
+ JSONValue result = JSONParser.parse(response.getText());
+ JSONValue jsonValue = result.isObject().get("roles");
+ JSONArray array = jsonValue.isArray();
+ for (int i = 0; i < array.size(); ++i)
+ {
+ JSONObject item = array.get(i).isObject();
+ String assigned = item.get("assigned").toString();
+ String roleName = item.get("role").toString();
+
+
+ if(assigned.equals("true"))
+ {
+ tmp.add(roleName);
+ }
+
+ }
+
+ rolesAssigned = tmp.toArray(new String[] {});
+
+ window.close();
+ mainPanel.show();
+ mainPanel.doLayout();
+ }
+
+ public void onError(Request request, Throwable t)
+ {
+ // auth failed
+ setError("Authentication failed.");
+ t.printStackTrace(System.out);
+ }
+ });
+ }
+ catch (RequestException e1)
+ {
+ setError(e1.getMessage());
+ e1.printStackTrace();
+ }
+ }
+ else
+ {
+ // hosted mode roles grant any role
+ // will popup BASIC Auth windows when required
+ rolesAssigned = POSSIBLE_ROLES;
+
+ window.close();
+ mainPanel.show();
+ mainPanel.doLayout();
+ }
+ }
+ });
+
+ panel.add(submitBtn);
+
+ BorderLayoutData centerData = new BorderLayoutData(RegionPosition.CENTER);
+ centerData.setMargins(3, 0, 3, 3);
+
+ window.add(panel, centerData);
// ------------------------------------------
- mainPanel.add(borderPanel);
-
- // auto viewport and js init
- viewport = new Viewport(mainPanel);
+ window.show();
}
+
public void addEditorView(EditorView editorView)
{
editorPanel.addEditor(editorView, true);
@@ -118,17 +242,23 @@
public void showEditor(String id)
{
- editorPanel.showTab(id);
+ editorPanel.showTab(id);
}
public void setError(final String error)
{
- status.setText(error);
+ displayMessage(error, true);
+ }
+ public void displayMessage(final String message, final boolean isError)
+ {
+ status.setText(message);
+
MessageBox.show(new MessageBoxConfig() {
{
- setTitle("Unknown Error");
- setMsg(error);
+ String title = isError ? "Unknown error" : "System Message";
+ setTitle(title);
+ setMsg(message);
setButtons(MessageBox.OK);
setCallback(new MessageBox.PromptCallback()
{
@@ -139,4 +269,9 @@
}
});
}
+
+ public String[] getRolesAssigned()
+ {
+ return rolesAssigned;
+ }
}
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/MainMenu.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/MainMenu.java 2008-10-08 11:24:25 UTC (rev 2508)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/MainMenu.java 2008-10-08 13:24:59 UTC (rev 2509)
@@ -28,6 +28,7 @@
import com.gwtext.client.widgets.tree.TreeNode;
import com.gwtext.client.widgets.tree.TreePanel;
import com.gwtext.client.widgets.tree.event.TreeNodeListenerAdapter;
+import com.google.gwt.user.client.ui.HTML;
import org.jboss.bpm.console.client.metric.MetricOverviewEditor;
import org.jboss.bpm.console.client.process.ProcessDefinitionListEditor;
import org.jboss.bpm.console.client.widgets.MainMenuPanel;
@@ -51,10 +52,10 @@
this.setWidth(200);
this.setLayout(accordion);
- Panel navPanel = new MainMenuPanel("Process Management", "bpm-process-icon", new ProcessTree());
+ Panel navPanel = new MainMenuPanel("Process Management", "bpm-process-icon", new ProcessTree());
Panel taskPanel = new MainMenuPanel("Task Management", "bpm-task-icon", null);
Panel metricPanel = new MainMenuPanel("Metrics and Stats", "bpm-metric-icon", new MetricTree());
- Panel settingsPanel = new MainMenuPanel("Settings", "bpm-settings-icon", null);
+ Panel settingsPanel = new MainMenuPanel("Settings", "bpm-settings-icon", new SettingsTree());
this.add(navPanel);
this.add(taskPanel);
@@ -72,7 +73,7 @@
TreeNode definitions = new TreeNode("View definitions");
definitions.setExpanded(true);
definitions.addListener(
- new TreeNodeListenerAdapter()
+ new TreeNodeListenerAdapter()
{
public void onClick(Node node, EventObject eventObject)
{
@@ -94,7 +95,7 @@
root.appendChild(definitions);
root.appendChild(upload);
- setRootVisible(true);
+ setRootVisible(true);
setRootNode(root);
root.setExpanded(true);
}
@@ -132,11 +133,44 @@
root.appendChild(overview);
root.appendChild(export);
+
+ setRootVisible(true);
+ setRootNode(root);
+ root.setExpanded(true);
+ }
+ }
+
+ class SettingsTree extends TreePanel
+ {
+
+ public SettingsTree()
+ {
+ TreeNode root = new TreeNode("Debug");
+
+ TreeNode overview = new TreeNode("Assigned roles");
+ overview.setExpanded(true);
+ overview.addListener(
+ new TreeNodeListenerAdapter()
+ {
+ public void onClick(Node node, EventObject eventObject)
+ {
+ StringBuffer sb = new StringBuffer();
+ for(String roleName : view.getRolesAssigned())
+ {
+ sb.append(roleName).append("/");
+ }
+
+ view.displayMessage("Assigned roles: " + sb.toString(), false);
+ }
+ }
+ );
+
+ root.appendChild(overview);
setRootVisible(true);
setRootNode(root);
root.setExpanded(true);
+
}
}
-
}
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/Application.gwt.xml
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/Application.gwt.xml 2008-10-08 11:24:25 UTC (rev 2508)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/Application.gwt.xml 2008-10-08 13:24:59 UTC (rev 2509)
@@ -2,6 +2,7 @@
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
+ <inherits name='com.google.gwt.json.JSON'/>
<inherits name='com.gwtext.GwtExt' />
<inherits name='com.googlecode.gchart.GChart'/>
<inherits name='org.gwtwidgets.WidgetLibrary'/>
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/console.css
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/console.css 2008-10-08 11:24:25 UTC (rev 2508)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/console.css 2008-10-08 13:24:59 UTC (rev 2509)
@@ -95,3 +95,7 @@
.bpm-enalrge-icon {
background-image: url( images/icons/49.png)
}
+
+.login-panel-content {
+ text-align: center;
+}
\ No newline at end of file
17 years, 6 months
JBoss JBPM SVN: r2508 - in projects/spec/trunk/modules: api/src/main/java/org/jbpm/api/model and 8 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-10-08 07:24:25 -0400 (Wed, 08 Oct 2008)
New Revision: 2508
Added:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/UserTaskCallback.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Assignment.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Event.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Expression.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Gateway.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/AbstractElement.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/InputSet.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/OutputSet.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/Participant.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/ProcessStructure.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/PropertySupport.java
Removed:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/AbstractElement.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Assignment.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Event.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Expression.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Gateway.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/InputSet.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/OutputSet.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Participant.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessStructure.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/PropertySupport.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/UserTaskCallback.java
Modified:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/EndEvent.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Message.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Node.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Process.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessDefinition.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/SequenceFlow.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/StartEvent.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Task.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/UserTask.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/Token.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/MessageService.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceServiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessCatalog.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskCallbackTest.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/AbstractElementImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ComplexGatewayImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EndEventImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ExclusiveGatewayImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/GatewayImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/InclusiveGatewayImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/InputSetImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/MessageImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/OutputSetImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ParallelGatewayImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ParticipantImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessStructureImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/SendTaskImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StartEventImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StructureDelegateImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/TaskImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/UserTaskImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/MessageSender.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/MutableToken.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/TokenImpl.java
Log:
Restructure packages
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/UserTaskCallback.java (from rev 2506, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/UserTaskCallback.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/UserTaskCallback.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/UserTaskCallback.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -0,0 +1,132 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.client;
+
+//$Id$
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.model.Message;
+import org.jbpm.api.model.UserTask;
+import org.jbpm.api.model.builder.MessageBuilder;
+import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.runtime.Attachments;
+import org.jbpm.api.runtime.BasicAttachments;
+import org.jbpm.api.service.MessageBuilderService;
+import org.jbpm.api.service.MessageService;
+
+/**
+ * A callback that can be attached to a {@link UserTask} to facilitate message handling;
+ *
+ * The callback registers a {@link MessageListener}, extracts the data from the received message
+ * and calls the user provided 'callback' method. The response message is then constructed from
+ * the user provided data and automatically sent back to the {@link UserTask}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Oct-2008
+ */
+public abstract class UserTaskCallback
+{
+ private MessageListener messageListener;
+
+ /**
+ * Get the associated MessageListener
+ */
+ public MessageListener getMessageListener()
+ {
+ return messageListener;
+ }
+
+ /**
+ * Attached this callback to the user task
+ */
+ public void attach(UserTask userTask)
+ {
+ userTask.setUserTaskCallback(this);
+
+ messageListener = new CallbackMessageListener(userTask);
+
+ MessageService msgService = userTask.getProcessEngine().getService(MessageService.class);
+ msgService.addMessageListener(messageListener);
+ }
+
+ /**
+ * Detach this callback from the user task
+ */
+ public void detach(UserTask userTask)
+ {
+ MessageService msgService = userTask.getProcessEngine().getService(MessageService.class);
+ msgService.removeMessageListener(messageListener.getKey());
+ }
+
+ public abstract void callback(Attachments att);
+
+ class CallbackMessageListener implements MessageListener
+ {
+ private UserTask userTask;
+
+ public CallbackMessageListener(UserTask userTask)
+ {
+ this.userTask = userTask;
+ }
+
+ @Override
+ public void catchMessage(Message msg)
+ {
+ // Get the message data
+ Attachments att = new BasicAttachments();
+ for (String propName : msg.getPropertyNames())
+ {
+ String value = msg.getProperty(propName).getValue();
+ att.addAttachment(propName, value);
+ }
+
+ // Call the user callback
+ callback(att);
+
+ // Build the response message
+ Message msgRef = userTask.getInMessageRef();
+ MessageBuilder msgBuilder = MessageBuilderService.locateMessageBuilder();
+ msgBuilder.newMessage(msgRef.getName());
+ for (String propName : msgRef.getPropertyNames())
+ {
+ Object value = att.getAttachment(propName);
+ if (value == null)
+ throw new IllegalStateException("Cannot obtain required property: " + propName);
+ msgBuilder.addProperty(propName, value);
+ }
+ Message resMessage = msgBuilder.getMessage();
+
+ MessageService msgService = MessageService.locateMessageService();
+
+ ObjectName procID = userTask.getProcess().getKey();
+ msgService.sendMessage(procID, userTask.getName(), resMessage);
+ }
+
+ @Override
+ public ObjectName getKey()
+ {
+ String oname = userTask.getKey().getCanonicalName();
+ return ObjectNameFactory.create(oname + ",msgListener=UserTaskCallback");
+ }
+ }
+}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/AbstractElement.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/AbstractElement.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/AbstractElement.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-//$Id$
-
-import java.io.Serializable;
-
-import javax.management.ObjectName;
-
-import org.jbpm.api.client.ProcessEngine;
-
-/**
- * The parrent of all Elements
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface AbstractElement extends Serializable
-{
- /**
- * Get the ID of this element
- */
- ObjectName getKey();
-
- /**
- * Get the associated ProcessEngine
- */
- ProcessEngine getProcessEngine();
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Assignment.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Assignment.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Assignment.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-import java.io.Serializable;
-
-//$Id$
-
-/**
- * An Assignment, which is used in the definition of attributes for Process,
- * Activity, Event, Gateway, and Gate.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface Assignment extends Serializable
-{
- public enum AssignTime
- {
- Start, End
- }
-
- /**
- * The target for the Assignment MUST be a Property of the Process or the activity
- * itself.
- */
- Property getTo();
-
- /**
- * The Expression MUST be made up of a combination of Values, Properties, and
- * Attributes, which are separated by operators such as add or multiply. The expression
- * language is defined in the ExpressionLanguage attribute of the Business Process
- * Diagram
- */
- Expression getFrom();
-
- /**
- * An Assignment MAY have a AssignTime setting. If the Object is an activity (Task,
- * Sub-Process, or Process), then the Assignment MUST have an AssignTime.
- * A value of Start means that the assignment SHALL occur at the start of the activity.
- * This can be used to assign the higher-level (global) Properties of the Process to the
- * (local) Properties of the activity as an input to the activity.
- * A value of End means that the assignment SHALL occur at the end of the activity.
- * This can be used to assign the (local) Properties of the activity to the higher-level
- * (global) Properties of the Process as an output to the activity.
- */
- AssignTime getAssignTime();
-}
Added: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Assignment.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Assignment.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Assignment.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+import java.io.Serializable;
+
+
+//$Id$
+
+/**
+ * An Assignment, which is used in the definition of attributes for Process,
+ * Activity, Event, Gateway, and Gate.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface Assignment extends Serializable
+{
+ public enum AssignTime
+ {
+ Start, End
+ }
+
+ /**
+ * The target for the Assignment MUST be a Property of the Process or the activity
+ * itself.
+ */
+ Property getTo();
+
+ /**
+ * The Expression MUST be made up of a combination of Values, Properties, and
+ * Attributes, which are separated by operators such as add or multiply. The expression
+ * language is defined in the ExpressionLanguage attribute of the Business Process
+ * Diagram
+ */
+ Expression getFrom();
+
+ /**
+ * An Assignment MAY have a AssignTime setting. If the Object is an activity (Task,
+ * Sub-Process, or Process), then the Assignment MUST have an AssignTime.
+ * A value of Start means that the assignment SHALL occur at the start of the activity.
+ * This can be used to assign the higher-level (global) Properties of the Process to the
+ * (local) Properties of the activity as an input to the activity.
+ * A value of End means that the assignment SHALL occur at the end of the activity.
+ * This can be used to assign the (local) Properties of the activity to the higher-level
+ * (global) Properties of the Process as an output to the activity.
+ */
+ AssignTime getAssignTime();
+}
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/EndEvent.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/EndEvent.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/EndEvent.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -21,6 +21,7 @@
*/
package org.jbpm.api.model;
+
//$Id$
/**
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Event.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Event.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Event.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -1,71 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-//$Id$
-
-/**
- * An Event is something that “happens” during the course of a business process.
- * <p/>
- * These Events affect the flow of the Process and usually have a cause or an impact.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface Event extends Node
-{
- /**
- * Defines the type of an {@link Event}
- */
- enum EventType
- {
- Start, End, Intermediate
- };
-
- /**
- * Defines the type of event detail
- */
- enum EventDetailType
- {
- None, Message, Error, Compensation, Link, Multiple, Timer, Rule, Signal
- }
-
- /**
- * Get the type of this event
- */
- EventType getEventType();
-
- /**
- * Get the detail type fopr this event
- */
- EventDetailType getDetailType();
-
- /**
- * Get the associated signal ref
- */
- Signal getSignalRef();
-
- /**
- * Get the associated message ref
- */
- Message getMessageRef();
-}
\ No newline at end of file
Added: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Event.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Event.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Event.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -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.jbpm.api.model;
+
+
+//$Id$
+
+/**
+ * An Event is something that “happens” during the course of a business process.
+ * <p/>
+ * These Events affect the flow of the Process and usually have a cause or an impact.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface Event extends Node
+{
+ /**
+ * Defines the type of an {@link Event}
+ */
+ enum EventType
+ {
+ Start, End, Intermediate
+ };
+
+ /**
+ * Defines the type of event detail
+ */
+ enum EventDetailType
+ {
+ None, Message, Error, Compensation, Link, Multiple, Timer, Rule, Signal
+ }
+
+ /**
+ * Get the type of this event
+ */
+ EventType getEventType();
+
+ /**
+ * Get the detail type fopr this event
+ */
+ EventDetailType getDetailType();
+
+ /**
+ * Get the associated signal ref
+ */
+ Signal getSignalRef();
+
+ /**
+ * Get the associated message ref
+ */
+ Message getMessageRef();
+}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Expression.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Expression.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Expression.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-import java.io.Serializable;
-
-//$Id$
-
-/**
- * An Expression, which is used in the definition of attributes for StartEvent,
- * IntermediateEvent, Activity, ComplexGateway, and SequenceFlow
- *
- * @author thomas.diesler(a)jboss.com
- * @since 21-Jul-2008
- */
-public interface Expression extends Serializable
-{
- enum ExpressionLanguage
- {
- MVEL
- }
-
- /**
- * An ExpressionBody MUST be entered to provide the text of the expression, which
- * will be written in the language defined by the ExpressionLanguage attribute.
- */
- String getExpressionBody();
-
- /**
- * A Language MUST be provided to identify the language of the ExpressionBody.
- * The value of the ExpressionLanguage should follow the naming conventions for the
- * version of the specified language.
- */
- ExpressionLanguage getExpressionLanguage();
-
-}
Added: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Expression.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Expression.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Expression.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -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.jbpm.api.model;
+
+import java.io.Serializable;
+
+//$Id$
+
+/**
+ * An Expression, which is used in the definition of attributes for StartEvent,
+ * IntermediateEvent, Activity, ComplexGateway, and SequenceFlow
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 21-Jul-2008
+ */
+public interface Expression extends Serializable
+{
+ enum ExpressionLanguage
+ {
+ MVEL
+ }
+
+ /**
+ * An ExpressionBody MUST be entered to provide the text of the expression, which
+ * will be written in the language defined by the ExpressionLanguage attribute.
+ */
+ String getExpressionBody();
+
+ /**
+ * A Language MUST be provided to identify the language of the ExpressionBody.
+ * The value of the ExpressionLanguage should follow the naming conventions for the
+ * version of the specified language.
+ */
+ ExpressionLanguage getExpressionLanguage();
+
+}
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Gateway.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Gateway.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Gateway.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -1,82 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-//$Id$
-
-import java.util.List;
-
-/**
- * Gateways are modeling 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 controlled, then a Gateway is not needed. The term “Gateway” implies that
- * there is a gating mechanism that either allows or disallows passage through the Gateway--that is, as Tokens arrive at a
- * Gateway, they can be merged together on input and/or split apart on output as the Gateway mechanisms are invoked. To
- * be more descriptive, a Gateway is actually a collection of “Gates.”
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface Gateway extends Node
-{
- /**
- * The GatewayType
- *
- */
- public enum GatewayType
- {
- Exclusive, Inclusive, Complex, Parallel
- }
-
- /**
- * GatewayType is by default Exclusive. The GatewayType MAY be set to Inclusive, Complex, or Parallel. The GatewayType will determine the behavior of the Gateway,
- * both for incoming and outgoing Sequence Flow
- */
- GatewayType getGatewayType();
-
- /**
- * There MAY be zero or more Gates (except where noted below). Zero Gates are allowed if the Gateway is last object in a Process flow and there are no Start or End
- * Events for the Process. If there are zero or only one incoming Sequence Flow, then there MUST be at least two Gates.
- *
- * For Exclusive Data-Based Gateways.
- * When two Gates are required, one of them MAY be the DefaultGate.
- *
- * For Exclusive Event-Based Gateways.
- * There MUST be two or more Gates. (Note that this type of Gateway does not act only as a Merge--it is always a Decision, at
- * least.)
- *
- * For Inclusive Gateways.
- * When two Gates are required, one of them MAY be the DefaultGate.
- */
- List<SequenceFlow> getGates();
-
- /**
- * Get the optional default gate
- * @return null if there is none
- */
- SequenceFlow getDefaultGate();
-
- /**
- * Get the gate for the given target name
- * @return null if there is none
- */
- SequenceFlow getGateByName(String targetName);
-}
\ No newline at end of file
Added: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Gateway.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Gateway.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Gateway.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+import java.util.List;
+
+
+/**
+ * Gateways are modeling 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 controlled, then a Gateway is not needed. The term “Gateway” implies that
+ * there is a gating mechanism that either allows or disallows passage through the Gateway--that is, as Tokens arrive at a
+ * Gateway, they can be merged together on input and/or split apart on output as the Gateway mechanisms are invoked. To
+ * be more descriptive, a Gateway is actually a collection of “Gates.”
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface Gateway extends Node
+{
+ /**
+ * The GatewayType
+ *
+ */
+ public enum GatewayType
+ {
+ Exclusive, Inclusive, Complex, Parallel
+ }
+
+ /**
+ * GatewayType is by default Exclusive. The GatewayType MAY be set to Inclusive, Complex, or Parallel. The GatewayType will determine the behavior of the Gateway,
+ * both for incoming and outgoing Sequence Flow
+ */
+ GatewayType getGatewayType();
+
+ /**
+ * There MAY be zero or more Gates (except where noted below). Zero Gates are allowed if the Gateway is last object in a Process flow and there are no Start or End
+ * Events for the Process. If there are zero or only one incoming Sequence Flow, then there MUST be at least two Gates.
+ *
+ * For Exclusive Data-Based Gateways.
+ * When two Gates are required, one of them MAY be the DefaultGate.
+ *
+ * For Exclusive Event-Based Gateways.
+ * There MUST be two or more Gates. (Note that this type of Gateway does not act only as a Merge--it is always a Decision, at
+ * least.)
+ *
+ * For Inclusive Gateways.
+ * When two Gates are required, one of them MAY be the DefaultGate.
+ */
+ List<SequenceFlow> getGates();
+
+ /**
+ * Get the optional default gate
+ * @return null if there is none
+ */
+ SequenceFlow getDefaultGate();
+
+ /**
+ * Get the gate for the given target name
+ * @return null if there is none
+ */
+ SequenceFlow getGateByName(String targetName);
+}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/InputSet.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/InputSet.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/InputSet.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -1,34 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-//$Id$
-
-/**
- * An InputSet, which is used in the definition of common attributes for Activities and for attributes of a Process
- *
- * @author thomas.diesler(a)jboss.com
- * @since 21-Jul-2008
- */
-public interface InputSet extends PropertySupport
-{
-}
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Message.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Message.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Message.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -23,8 +23,11 @@
import java.io.Serializable;
+import org.jbpm.api.model.internal.Participant;
+import org.jbpm.api.model.internal.PropertySupport;
+
//$Id$
/**
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Node.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Node.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Node.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -25,6 +25,8 @@
import java.util.List;
+import org.jbpm.api.model.internal.AbstractElement;
+import org.jbpm.api.model.internal.PropertySupport;
import org.jbpm.api.runtime.ExecutionHandler;
import org.jbpm.api.runtime.FlowHandler;
import org.jbpm.api.runtime.SignalHandler;
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/OutputSet.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/OutputSet.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/OutputSet.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -1,34 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-//$Id$
-
-/**
- * An OuputSet, which is used in the definition of common attributes for Activities and for attributes of a Process
- *
- * @author thomas.diesler(a)jboss.com
- * @since 21-Jul-2008
- */
-public interface OutputSet extends PropertySupport
-{
-}
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Participant.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Participant.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Participant.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-//$Id$
-
-import java.io.Serializable;
-
-import javax.management.ObjectName;
-
-/**
- * A Participant, which is used in the definition of attributes for a Pool, {@link Message}, and WebService
- *
- * @author thomas.diesler(a)jboss.com
- * @since 21-Jul-2008
- */
-public interface Participant extends Serializable
-{
- /**
- * The name of this participant
- */
- ObjectName getName();
-}
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Process.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Process.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Process.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -25,6 +25,7 @@
import javax.management.ObjectName;
+import org.jbpm.api.model.internal.ProcessStructure;
import org.jbpm.api.runtime.Attachments;
/**
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessDefinition.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessDefinition.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessDefinition.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -21,6 +21,8 @@
*/
package org.jbpm.api.model;
+import org.jbpm.api.model.internal.ProcessStructure;
+
//$Id$
/**
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessStructure.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessStructure.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessStructure.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -1,83 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-//$Id$
-
-import java.util.List;
-import java.util.Set;
-
-/**
- * A ProcessStructure defines the structure of a Process
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface ProcessStructure extends AbstractElement, PropertySupport
-{
- /**
- * Get the unique name.
- */
- String getName();
-
- /**
- * Get the list of nodes
- */
- List<Node> getNodes();
-
- /**
- * Get a list of nodes of a given type.
- */
- <T extends Node> List<T> getNodes(Class<T> clazz);
-
- /**
- * Get a node of a given type and name
- */
- <T extends Node> T getNode(Class<T> clazz, String name);
-
- /**
- * Get a node by name.
- *
- * @return null if not found
- */
- Node getNode(String name);
-
- /**
- * One or more assignment expressions MAY be made for the object. The Assignment SHALL be performed as defined by the
- * AssignTime attribute.
- */
- List<Assignment> getAssignments();
-
- /**
- * Get the list of associated {@link Message} objects.
- *
- * @return An empty list if there are none
- */
- Set<Message> getMessages();
-
- /**
- * Get an associated {@link Message} by name.
- *
- * @return null if not found
- */
- Message getMessage(String msgName);
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/PropertySupport.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/PropertySupport.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/PropertySupport.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-//$Id$
-
-import java.io.Serializable;
-import java.util.Set;
-
-/**
- * Property support
- *
- * @author thomas.diesler(a)jboss.com
- * @since 21-Jul-2008
- */
-public interface PropertySupport extends Serializable
-{
- /**
- * Get a Property with a given name.
- */
- Property getProperty(String name);
-
- /**
- * Add a property
- */
- void addProperty(Property prop);
-
- /**
- * Remove a property
- */
- boolean removeProperty(String name);
-
- /**
- * Get the set of property names
- */
- Set<String> getPropertyNames();
-
-}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/SequenceFlow.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/SequenceFlow.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/SequenceFlow.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -24,6 +24,7 @@
import java.io.Serializable;
+
//$Id$
/**
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/StartEvent.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/StartEvent.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/StartEvent.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -21,6 +21,7 @@
*/
package org.jbpm.api.model;
+
// $Id$
/**
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Task.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Task.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Task.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -25,6 +25,9 @@
import java.util.List;
+import org.jbpm.api.model.internal.InputSet;
+import org.jbpm.api.model.internal.OutputSet;
+
/**
* A Task is an Atomic Activity that is included within a Process.
*
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/UserTask.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/UserTask.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/UserTask.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -21,24 +21,48 @@
*/
package org.jbpm.api.model;
+import org.jbpm.api.client.UserTaskCallback;
+
//$Id$
/**
- * A Task is an Atomic Activity that is included within a Process.
+ * A User Task is a typical “workflow” task where a human performer performs the Task with the assistance of a software
+ * application and is scheduled through a task list manager of some sort.
*
- * A Task is used when the work in the Process is not broken down to a finer level of Process Model detail. Generally, an end-user and/or an application are used to
- * perform the Task when it is executed.
- *
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
public interface UserTask extends Task
{
+ /**
+ * Get the associated callback
+ */
UserTaskCallback getUserTaskCallback();
+ /**
+ * Set the associated callback
+ */
void setUserTaskCallback(UserTaskCallback callback);
+ /**
+ * A Message for the OutMessageRef attribute MUST be entered. The sending
+ * of this message marks the completion of the Task, which may cause the
+ * production of an OutputSet. One or more corresponding outgoing Message
+ * Flow MAY be shown on the diagram. However, the display of the Message
+ * Flow is not required. The Message is applied to all outgoing Message Flow
+ * and the Message will be sent down all outgoing Message Flow at the
+ * completion of a single instance of the
+ */
Message getOutMessageRef();
+ /**
+ * A Message for the InMessageRef attribute MUST be entered. This indicates
+ * that the Message will be received at the start of the Task, after the
+ * availability of any defined InputSets. One or more corresponding incoming
+ * Message Flows MAY be shown on the diagram. However, the display of the
+ * Message Flow is not required. The Message is applied to all incoming
+ * Message Flow, but can arrive for only one of the incoming Message Flow
+ * for a single instance of the
+ */
Message getInMessageRef();
}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/UserTaskCallback.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/UserTaskCallback.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/UserTaskCallback.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -1,123 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-//$Id$
-
-import javax.management.ObjectName;
-
-import org.jbpm.api.client.MessageListener;
-import org.jbpm.api.model.builder.MessageBuilder;
-import org.jbpm.api.model.builder.ObjectNameFactory;
-import org.jbpm.api.runtime.Attachments;
-import org.jbpm.api.runtime.BasicAttachments;
-import org.jbpm.api.service.MessageBuilderService;
-import org.jbpm.api.service.MessageService;
-
-/**
- * A callback that can be attached to a {@link UserTask} to facilitate message handling;
- *
- * The callback registers a {@link MessageListener}, extracts the data from the received message
- * and calls the user provided 'callback' method. The response message is then constructed from
- * the user provided data and automatically sent back to the {@link UserTask}.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Oct-2008
- */
-public abstract class UserTaskCallback
-{
- private MessageListener messageListener;
-
- public MessageListener getMessageListener()
- {
- return messageListener;
- }
-
- public void attach(UserTask userTask)
- {
- if (userTask.getUserTaskCallback() != this)
- userTask.setUserTaskCallback(this);
-
- messageListener = new CallbackMessageListener(userTask);
-
- MessageService msgService = userTask.getProcessEngine().getService(MessageService.class);
- msgService.addMessageListener(messageListener);
- }
-
- public void detach(UserTask userTask)
- {
- MessageService msgService = userTask.getProcessEngine().getService(MessageService.class);
- msgService.removeMessageListener(messageListener.getKey());
- }
-
- public abstract void callback(Attachments att);
-
- class CallbackMessageListener implements MessageListener
- {
- private UserTask userTask;
-
- public CallbackMessageListener(UserTask userTask)
- {
- this.userTask = userTask;
- }
-
- @Override
- public void catchMessage(Message msg)
- {
- // Get the message data
- Attachments att = new BasicAttachments();
- for (String propName : msg.getPropertyNames())
- {
- String value = msg.getProperty(propName).getValue();
- att.addAttachment(propName, value);
- }
-
- // Call the user callback
- callback(att);
-
- // Build the response message
- Message msgRef = userTask.getInMessageRef();
- MessageBuilder msgBuilder = MessageBuilderService.locateMessageBuilder();
- msgBuilder.newMessage(msgRef.getName());
- for (String propName : msgRef.getPropertyNames())
- {
- Object value = att.getAttachment(propName);
- if (value == null)
- throw new IllegalStateException("Cannot obtain required property: " + propName);
- msgBuilder.addProperty(propName, value);
- }
- Message resMessage = msgBuilder.getMessage();
-
- MessageService msgService = MessageService.locateMessageService();
-
- ObjectName procID = userTask.getProcess().getKey();
- msgService.sendMessage(procID, userTask.getName(), resMessage);
- }
-
- @Override
- public ObjectName getKey()
- {
- String oname = userTask.getKey().getCanonicalName();
- return ObjectNameFactory.create(oname + ",msgListener=UserTaskCallback");
- }
- }
-}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/AbstractElement.java (from rev 2501, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/AbstractElement.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/AbstractElement.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/AbstractElement.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.internal;
+
+//$Id$
+
+import java.io.Serializable;
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.client.ProcessEngine;
+
+/**
+ * The parrent of all Elements
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface AbstractElement extends Serializable
+{
+ /**
+ * Get the ID of this element
+ */
+ ObjectName getKey();
+
+ /**
+ * Get the associated ProcessEngine
+ */
+ ProcessEngine getProcessEngine();
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/InputSet.java (from rev 2501, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/InputSet.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/InputSet.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/InputSet.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.internal;
+
+
+//$Id$
+
+/**
+ * An InputSet, which is used in the definition of common attributes for Activities and for attributes of a Process
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 21-Jul-2008
+ */
+public interface InputSet extends PropertySupport
+{
+}
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/OutputSet.java (from rev 2501, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/OutputSet.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/OutputSet.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/OutputSet.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.internal;
+
+
+//$Id$
+
+/**
+ * An OuputSet, which is used in the definition of common attributes for Activities and for attributes of a Process
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 21-Jul-2008
+ */
+public interface OutputSet extends PropertySupport
+{
+}
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/Participant.java (from rev 2501, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Participant.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/Participant.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/Participant.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -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.jbpm.api.model.internal;
+
+//$Id$
+
+import java.io.Serializable;
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.model.Message;
+
+/**
+ * A Participant, which is used in the definition of attributes for a Pool, {@link Message}, and WebService
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 21-Jul-2008
+ */
+public interface Participant extends Serializable
+{
+ /**
+ * The name of this participant
+ */
+ ObjectName getName();
+}
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/ProcessStructure.java (from rev 2501, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessStructure.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/ProcessStructure.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/ProcessStructure.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.internal;
+
+//$Id$
+
+import java.util.List;
+import java.util.Set;
+
+import org.jbpm.api.model.Assignment;
+import org.jbpm.api.model.Message;
+import org.jbpm.api.model.Node;
+
+/**
+ * A ProcessStructure defines the structure of a Process
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface ProcessStructure extends AbstractElement, PropertySupport
+{
+ /**
+ * Get the unique name.
+ */
+ String getName();
+
+ /**
+ * Get the list of nodes
+ */
+ List<Node> getNodes();
+
+ /**
+ * Get a list of nodes of a given type.
+ */
+ <T extends Node> List<T> getNodes(Class<T> clazz);
+
+ /**
+ * Get a node of a given type and name
+ */
+ <T extends Node> T getNode(Class<T> clazz, String name);
+
+ /**
+ * Get a node by name.
+ *
+ * @return null if not found
+ */
+ Node getNode(String name);
+
+ /**
+ * One or more assignment expressions MAY be made for the object. The Assignment SHALL be performed as defined by the
+ * AssignTime attribute.
+ */
+ List<Assignment> getAssignments();
+
+ /**
+ * Get the list of associated {@link Message} objects.
+ *
+ * @return An empty list if there are none
+ */
+ Set<Message> getMessages();
+
+ /**
+ * Get an associated {@link Message} by name.
+ *
+ * @return null if not found
+ */
+ Message getMessage(String msgName);
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/PropertySupport.java (from rev 2501, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/PropertySupport.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/PropertySupport.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/PropertySupport.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -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.api.model.internal;
+
+//$Id$
+
+import java.io.Serializable;
+import java.util.Set;
+
+import org.jbpm.api.model.Property;
+
+/**
+ * Property support
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 21-Jul-2008
+ */
+public interface PropertySupport extends Serializable
+{
+ /**
+ * Get a Property with a given name.
+ */
+ Property getProperty(String name);
+
+ /**
+ * Add a property
+ */
+ void addProperty(Property prop);
+
+ /**
+ * Remove a property
+ */
+ boolean removeProperty(String name);
+
+ /**
+ * Get the set of property names
+ */
+ Set<String> getPropertyNames();
+
+}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/Token.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/Token.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/Token.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -23,9 +23,9 @@
// $Id$
-import org.jbpm.api.model.InputSet;
-import org.jbpm.api.model.OutputSet;
import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.model.internal.InputSet;
+import org.jbpm.api.model.internal.OutputSet;
/**
* A Token is a descriptive construct used to describe how the flow of a Process will proceed at runtime.
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/MessageService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/MessageService.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/MessageService.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -36,9 +36,9 @@
import org.jbpm.api.model.Event;
import org.jbpm.api.model.Message;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Participant;
import org.jbpm.api.model.Process;
import org.jbpm.api.model.Task;
+import org.jbpm.api.model.internal.Participant;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceServiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceServiceTest.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceServiceTest.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -100,7 +100,6 @@
// Load the process
ObjectName procID = proc.getKey();
Process loadProc = service.loadProcess(procID);
- ProcessCatalog.validateDefaultProcess(loadProc);
StartEvent start = loadProc.getNode(StartEvent.class, "Start");
Task task = loadProc.getNode(Task.class, "Task");
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessCatalog.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessCatalog.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessCatalog.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -27,7 +27,6 @@
import org.jbpm.api.model.EndEvent;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.model.StartEvent;
import org.jbpm.api.model.Task;
@@ -52,7 +51,7 @@
return builder.getProcessDefinition();
}
- public static void validateDefaultProcess(ProcessStructure procStruct)
+ public static void validateDefaultProcess(ProcessDefinition procStruct)
{
TestCase.assertNotNull("Process not null", procStruct);
TestCase.assertEquals("Proc", procStruct.getName());
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskCallbackTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskCallbackTest.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskCallbackTest.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -26,11 +26,11 @@
import java.io.IOException;
import java.util.List;
+import org.jbpm.api.client.UserTaskCallback;
import org.jbpm.api.model.Message;
import org.jbpm.api.model.Process;
import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.UserTask;
-import org.jbpm.api.model.UserTaskCallback;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.Task.TaskType;
import org.jbpm.api.model.builder.ProcessBuilder;
@@ -40,7 +40,7 @@
import org.jbpm.api.test.CTSTestCase;
/**
- * Test User Task
+ * Test UserTask that uses the callback API
*
* @author thomas.diesler(a)jboss.com
* @since 07-Oct-2008
@@ -54,7 +54,7 @@
// Attach the callback to the UserTask
UserTask userTask = proc.getNode(UserTask.class, "UserTask");
- userTask.setUserTaskCallback(new TaskCallback());
+ userTask.setUserTaskCallback(new UserTaskCallbackImpl());
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "xxx");
@@ -79,7 +79,7 @@
return procBuilder.getProcessDefinition();
}
- public static class TaskCallback extends UserTaskCallback
+ public static class UserTaskCallbackImpl extends UserTaskCallback
{
@Override
public void callback(Attachments att)
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/AbstractElementImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/AbstractElementImpl.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/AbstractElementImpl.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -32,9 +32,9 @@
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.AbstractElement;
import org.jbpm.api.model.Process;
import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.internal.AbstractElement;
/**
* The parrent of all Elements
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ComplexGatewayImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ComplexGatewayImpl.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ComplexGatewayImpl.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -27,7 +27,7 @@
import org.jbpm.api.NotImplementedException;
import org.jbpm.api.model.Expression;
-import org.jbpm.api.model.ProcessStructure;
+import org.jbpm.api.model.internal.ProcessStructure;
/**
* A Complex Gateway handles situations that are not easily handled through the other types of Gateways. Complex
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EndEventImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EndEventImpl.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EndEventImpl.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -32,10 +32,10 @@
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.EndEvent;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.model.Signal;
import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.model.internal.ProcessStructure;
import org.jbpm.api.runtime.ExecutionContext;
import org.jbpm.api.runtime.FlowHandler;
import org.jbpm.api.runtime.SignalHandler;
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -37,9 +37,9 @@
import org.jbpm.api.model.Node;
import org.jbpm.api.model.Process;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.Signal;
import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.model.internal.ProcessStructure;
import org.jbpm.api.runtime.ExecutionHandler;
import org.jbpm.api.runtime.SignalHandler;
import org.jbpm.api.runtime.Token;
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ExclusiveGatewayImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ExclusiveGatewayImpl.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ExclusiveGatewayImpl.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -31,9 +31,9 @@
import org.jbpm.api.model.Expression;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.model.SequenceFlow.ConditionType;
+import org.jbpm.api.model.internal.ProcessStructure;
import org.jbpm.api.runtime.ExecutionHandler;
import org.jbpm.api.runtime.FlowHandler;
import org.jbpm.api.runtime.Token;
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/GatewayImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/GatewayImpl.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/GatewayImpl.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -37,11 +37,11 @@
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Gateway;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.model.Signal;
import org.jbpm.api.model.SequenceFlow.ConditionType;
import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.model.internal.ProcessStructure;
import org.jbpm.api.runtime.ExecutionHandler;
import org.jbpm.api.runtime.SignalHandler;
import org.jbpm.api.runtime.Token;
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/InclusiveGatewayImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/InclusiveGatewayImpl.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/InclusiveGatewayImpl.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -31,11 +31,11 @@
import javax.persistence.Entity;
import org.jbpm.api.model.Expression;
-import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.SequenceFlow.ConditionType;
+import org.jbpm.api.model.internal.ProcessStructure;
import org.jbpm.api.runtime.ExecutionContext;
import org.jbpm.api.runtime.FlowHandler;
import org.jbpm.api.runtime.Token;
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/InputSetImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/InputSetImpl.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/InputSetImpl.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -28,8 +28,8 @@
import javax.persistence.Transient;
-import org.jbpm.api.model.InputSet;
import org.jbpm.api.model.Property;
+import org.jbpm.api.model.internal.InputSet;
/**
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/MessageImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/MessageImpl.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/MessageImpl.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -36,8 +36,8 @@
import javax.persistence.OneToMany;
import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Participant;
import org.jbpm.api.model.Property;
+import org.jbpm.api.model.internal.Participant;
/**
* A Message, which is used in the definition of attributes for a @{link StartEvent},
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -47,10 +47,10 @@
import org.jbpm.api.model.Node;
import org.jbpm.api.model.Process;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.Property;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.model.StartEvent;
+import org.jbpm.api.model.internal.ProcessStructure;
import org.jbpm.api.runtime.ExecutionHandler;
import org.jbpm.api.runtime.FlowHandler;
import org.jbpm.api.runtime.NodeHandler;
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/OutputSetImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/OutputSetImpl.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/OutputSetImpl.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -28,8 +28,8 @@
import javax.persistence.Transient;
-import org.jbpm.api.model.OutputSet;
import org.jbpm.api.model.Property;
+import org.jbpm.api.model.internal.OutputSet;
/**
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ParallelGatewayImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ParallelGatewayImpl.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ParallelGatewayImpl.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -32,8 +32,8 @@
import javax.persistence.Transient;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.model.internal.ProcessStructure;
import org.jbpm.api.runtime.ExecutionHandler;
import org.jbpm.api.runtime.FlowHandler;
import org.jbpm.api.runtime.Token;
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ParticipantImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ParticipantImpl.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ParticipantImpl.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -29,8 +29,8 @@
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
-import org.jbpm.api.model.Participant;
import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.model.internal.Participant;
/**
* A Participant, which is used in the definition of attributes for a @{link Pool}, @{link Message}, and @{link
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessStructureImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessStructureImpl.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessStructureImpl.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -47,10 +47,10 @@
import org.jbpm.api.model.Node;
import org.jbpm.api.model.Process;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.Property;
import org.jbpm.api.model.StartEvent;
import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.model.internal.ProcessStructure;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -35,7 +35,7 @@
import org.jbpm.api.model.Message;
import org.jbpm.api.model.Process;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.ProcessStructure;
+import org.jbpm.api.model.internal.ProcessStructure;
import org.jbpm.api.runtime.ExecutionContext;
import org.jbpm.api.runtime.Token;
import org.jbpm.api.runtime.TokenExecutor;
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/SendTaskImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/SendTaskImpl.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/SendTaskImpl.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -31,7 +31,7 @@
import org.jbpm.api.model.Node;
import org.jbpm.api.model.Process;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.ProcessStructure;
+import org.jbpm.api.model.internal.ProcessStructure;
import org.jbpm.api.runtime.ExecutionHandler;
import org.jbpm.api.runtime.Token;
import org.jbpm.ri.runtime.MessageSender;
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StartEventImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StartEventImpl.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StartEventImpl.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -34,12 +34,12 @@
import org.jbpm.api.model.Node;
import org.jbpm.api.model.Process;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.model.Signal;
import org.jbpm.api.model.StartEvent;
import org.jbpm.api.model.Signal.SignalType;
import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.model.internal.ProcessStructure;
import org.jbpm.api.runtime.SignalHandler;
import org.jbpm.api.runtime.Token;
import org.jbpm.api.service.ExecutionService;
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StructureDelegateImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StructureDelegateImpl.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StructureDelegateImpl.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -35,8 +35,8 @@
import org.jbpm.api.model.Assignment;
import org.jbpm.api.model.Message;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.Property;
+import org.jbpm.api.model.internal.ProcessStructure;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/TaskImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/TaskImpl.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/TaskImpl.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -38,15 +38,15 @@
import org.jbpm.api.NotImplementedException;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Expression;
-import org.jbpm.api.model.InputSet;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.OutputSet;
-import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.Property;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.model.Signal;
import org.jbpm.api.model.Task;
import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.model.internal.InputSet;
+import org.jbpm.api.model.internal.OutputSet;
+import org.jbpm.api.model.internal.ProcessStructure;
import org.jbpm.api.runtime.ExecutionContext;
import org.jbpm.api.runtime.ExecutionHandler;
import org.jbpm.api.runtime.SignalHandler;
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/UserTaskImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/UserTaskImpl.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/UserTaskImpl.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -32,12 +32,12 @@
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.client.MessageListener;
+import org.jbpm.api.client.UserTaskCallback;
import org.jbpm.api.model.Message;
import org.jbpm.api.model.Process;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.UserTask;
-import org.jbpm.api.model.UserTaskCallback;
+import org.jbpm.api.model.internal.ProcessStructure;
import org.jbpm.api.runtime.ExecutionContext;
import org.jbpm.api.runtime.Token;
import org.jbpm.api.runtime.TokenExecutor;
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -23,10 +23,10 @@
//$Id$
-import org.jbpm.api.model.InputSet;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.OutputSet;
import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.model.internal.InputSet;
+import org.jbpm.api.model.internal.OutputSet;
import org.jbpm.api.runtime.ExecutionContext;
import org.jbpm.api.runtime.Token;
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/MessageSender.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/MessageSender.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/MessageSender.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -28,8 +28,8 @@
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Message;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Participant;
import org.jbpm.api.model.builder.MessageBuilder;
+import org.jbpm.api.model.internal.Participant;
import org.jbpm.api.runtime.ExecutionContext;
import org.jbpm.api.runtime.Token;
import org.jbpm.api.service.MessageService;
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/MutableToken.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/MutableToken.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/MutableToken.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -23,9 +23,9 @@
//$Id$
-import org.jbpm.api.model.InputSet;
-import org.jbpm.api.model.OutputSet;
import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.model.internal.InputSet;
+import org.jbpm.api.model.internal.OutputSet;
import org.jbpm.api.runtime.Token;
/**
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/TokenImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/TokenImpl.java 2008-10-08 11:09:58 UTC (rev 2507)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/TokenImpl.java 2008-10-08 11:24:25 UTC (rev 2508)
@@ -24,9 +24,9 @@
//$Id$
import org.jboss.util.id.UID;
-import org.jbpm.api.model.InputSet;
-import org.jbpm.api.model.OutputSet;
import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.model.internal.InputSet;
+import org.jbpm.api.model.internal.OutputSet;
import org.jbpm.api.runtime.Attachments;
import org.jbpm.api.runtime.BasicExecutionContext;
import org.jbpm.api.runtime.ExecutionContext;
17 years, 6 months
JBoss JBPM SVN: r2507 - jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par.
by do-not-reply@jboss.org
Author: camunda
Date: 2008-10-08 07:09:58 -0400 (Wed, 08 Oct 2008)
New Revision: 2507
Added:
jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/NotInParAction.java
Modified:
jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessArchiveDeploymentDbTest.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessLoadedActionHandler.java
Log:
JBPM-1404
added testcase for uncorrect ProcessClassLoader (in the area of https://jira.jboss.org/jira/browse/JBPM-1404)
Added: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/NotInParAction.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/NotInParAction.java (rev 0)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/NotInParAction.java 2008-10-08 11:09:58 UTC (rev 2507)
@@ -0,0 +1,20 @@
+package org.jbpm.jpdl.par;
+
+import org.jbpm.graph.def.ActionHandler;
+import org.jbpm.graph.exe.ExecutionContext;
+
+public class NotInParAction implements ActionHandler {
+
+ public void execute(ExecutionContext executionContext) throws Exception {
+ // create new action without specifying classloader
+ // should use the ProcessClassLoader specified as ContextClassLoader
+ // this can be verified later on
+ ProcessArchiveDeploymentDbTest.resourceActionInstance =
+ Thread.currentThread().getContextClassLoader().loadClass("org.jbpm.jpdl.par.ResourceAction").newInstance();
+
+ // TODO: why doesn't the following work? I thought it is delegated to
+ // the context class loader? But it seems not that easy?
+ // ProcessArchiveDeploymentDbTest.resourceActionInstance = new ResourceAction();
+ }
+
+}
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessArchiveDeploymentDbTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessArchiveDeploymentDbTest.java 2008-10-08 11:06:20 UTC (rev 2506)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessArchiveDeploymentDbTest.java 2008-10-08 11:09:58 UTC (rev 2507)
@@ -23,6 +23,7 @@
import java.io.File;
import java.io.FileInputStream;
+import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -35,6 +36,7 @@
import org.jbpm.db.AbstractDbTestCase;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
+import org.jbpm.instantiation.ProcessClassLoader;
import org.jbpm.taskmgmt.def.Task;
import org.jbpm.taskmgmt.def.TaskMgmtDefinition;
import org.jbpm.util.ClassLoaderUtil;
@@ -245,6 +247,59 @@
resourceActionInstance = null;
}
+ /**
+ * start process with action, which itselfs loads an action via "new ResourceAction()".
+ * This action is checked if it gets loaded by the ProcessClassLoader
+ * correctly (which should be set as ContextClassLoader)
+ *
+ * TODO: doesn't yet test the right thing, looks like the Action
+ * first tries its own classloader (which is a ProcessClassLoader)
+ * and thus it works even without the ContextClassLoader set.
+ */
+ public void testProcessClassLoaderAsContextClassLoader() throws Exception {
+ // create a process archive file and save it to disk
+ String fileName = getTestClassesDir() + "/resource.process";
+ FileOutputStream fileOutputStream = new FileOutputStream(fileName);
+ ZipOutputStream zipOutputStream = new ZipOutputStream(fileOutputStream);
+ addEntry(zipOutputStream, "processdefinition.xml", "org/jbpm/jpdl/par/classloadingprocess.xml");
+ addEntry(zipOutputStream, "classes/org/jbpm/jpdl/par/ResourceAction.class", "org/jbpm/jpdl/par/ResourceAction.class");
+ addEntry(zipOutputStream, "classes/org/jbpm/jpdl/par/ProcessLoadedActionHandler.class", "org/jbpm/jpdl/par/ProcessLoadedActionHandler.class");
+ zipOutputStream.close();
+
+ // deploy the saved process file
+ ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(fileName));
+ ProcessDefinition processDefinition = ProcessDefinition.parseParZipInputStream(zipInputStream);
+
+ // rename the resources to force usage of the process classloader by preventing that they will be found in the test classpath
+ String classOriginalName1 = getTestClassesDir() + "org/jbpm/jpdl/par/ResourceAction.class";
+ String classTmpName1 = classOriginalName1 + ".hiddenFromTestClasspath";
+ String classOriginalName2 = getTestClassesDir() + "org/jbpm/jpdl/par/ProcessLoadedActionHandler.class";
+ String classTmpName2 = classOriginalName2 + ".hiddenFromTestClasspath";
+
+ // move the files
+ assertTrue(new File(classOriginalName1).renameTo(new File(classTmpName1)));
+ assertTrue(new File(classOriginalName2).renameTo(new File(classTmpName2)));
+
+ try {
+ jbpmContext.deployProcessDefinition(processDefinition);
+ try {
+ newTransaction();
+
+ ProcessInstance processInstance = jbpmContext.newProcessInstance("the deployable process");
+ processInstance.signal();
+ } finally {
+ jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
+ }
+ } finally {
+ // put the files back into original position
+ new File(classTmpName1).renameTo(new File(classOriginalName1));
+ new File(classTmpName2).renameTo(new File(classOriginalName2));
+ }
+
+ assertEquals(ProcessClassLoader.class, resourceActionInstance.getClass().getClassLoader().getClass());
+ resourceActionInstance = null;
+ }
+
private static void addEntry(ZipOutputStream zipOutputStream, String entryName, String resource) throws IOException
{
InputStream inputStream = ClassLoaderUtil.getStream(resource);
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessLoadedActionHandler.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessLoadedActionHandler.java 2008-10-08 11:06:20 UTC (rev 2506)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessLoadedActionHandler.java 2008-10-08 11:09:58 UTC (rev 2507)
@@ -32,5 +32,10 @@
// notify the ProcessArchiveClassLoadingTest that this
// class has been executed
ProcessArchiveClassLoadingDbTest.isLoadedActionHandlerExecuted = true;
+
+ // create new action without specifying classloader
+ // should use the ProcessClassLoader specified as ContextClassLoader
+ // this can be verified later on
+ new NotInParAction().execute(executionContext);
}
}
17 years, 6 months
JBoss JBPM SVN: r2506 - in projects/spec/trunk/modules: cts/src/test/java/org/jbpm/test/cts/task and 2 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-10-08 07:06:20 -0400 (Wed, 08 Oct 2008)
New Revision: 2506
Added:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/UserTask.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/UserTaskCallback.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskCallbackTest.java
Modified:
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/ReceiveTaskTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskTest.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/UserTaskImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/MessageSender.java
Log:
Add UserTaskCallback API
Added: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/UserTask.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/UserTask.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/UserTask.java 2008-10-08 11:06:20 UTC (rev 2506)
@@ -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.jbpm.api.model;
+
+//$Id$
+
+/**
+ * A Task is an Atomic Activity that is included within a Process.
+ *
+ * A Task is used when the work in the Process is not broken down to a finer level of Process Model detail. Generally, an end-user and/or an application are used to
+ * perform the Task when it is executed.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface UserTask extends Task
+{
+ UserTaskCallback getUserTaskCallback();
+
+ void setUserTaskCallback(UserTaskCallback callback);
+
+ Message getOutMessageRef();
+
+ Message getInMessageRef();
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/UserTask.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/UserTaskCallback.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/UserTaskCallback.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/UserTaskCallback.java 2008-10-08 11:06:20 UTC (rev 2506)
@@ -0,0 +1,123 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.client.MessageListener;
+import org.jbpm.api.model.builder.MessageBuilder;
+import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.runtime.Attachments;
+import org.jbpm.api.runtime.BasicAttachments;
+import org.jbpm.api.service.MessageBuilderService;
+import org.jbpm.api.service.MessageService;
+
+/**
+ * A callback that can be attached to a {@link UserTask} to facilitate message handling;
+ *
+ * The callback registers a {@link MessageListener}, extracts the data from the received message
+ * and calls the user provided 'callback' method. The response message is then constructed from
+ * the user provided data and automatically sent back to the {@link UserTask}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Oct-2008
+ */
+public abstract class UserTaskCallback
+{
+ private MessageListener messageListener;
+
+ public MessageListener getMessageListener()
+ {
+ return messageListener;
+ }
+
+ public void attach(UserTask userTask)
+ {
+ if (userTask.getUserTaskCallback() != this)
+ userTask.setUserTaskCallback(this);
+
+ messageListener = new CallbackMessageListener(userTask);
+
+ MessageService msgService = userTask.getProcessEngine().getService(MessageService.class);
+ msgService.addMessageListener(messageListener);
+ }
+
+ public void detach(UserTask userTask)
+ {
+ MessageService msgService = userTask.getProcessEngine().getService(MessageService.class);
+ msgService.removeMessageListener(messageListener.getKey());
+ }
+
+ public abstract void callback(Attachments att);
+
+ class CallbackMessageListener implements MessageListener
+ {
+ private UserTask userTask;
+
+ public CallbackMessageListener(UserTask userTask)
+ {
+ this.userTask = userTask;
+ }
+
+ @Override
+ public void catchMessage(Message msg)
+ {
+ // Get the message data
+ Attachments att = new BasicAttachments();
+ for (String propName : msg.getPropertyNames())
+ {
+ String value = msg.getProperty(propName).getValue();
+ att.addAttachment(propName, value);
+ }
+
+ // Call the user callback
+ callback(att);
+
+ // Build the response message
+ Message msgRef = userTask.getInMessageRef();
+ MessageBuilder msgBuilder = MessageBuilderService.locateMessageBuilder();
+ msgBuilder.newMessage(msgRef.getName());
+ for (String propName : msgRef.getPropertyNames())
+ {
+ Object value = att.getAttachment(propName);
+ if (value == null)
+ throw new IllegalStateException("Cannot obtain required property: " + propName);
+ msgBuilder.addProperty(propName, value);
+ }
+ Message resMessage = msgBuilder.getMessage();
+
+ MessageService msgService = MessageService.locateMessageService();
+
+ ObjectName procID = userTask.getProcess().getKey();
+ msgService.sendMessage(procID, userTask.getName(), resMessage);
+ }
+
+ @Override
+ public ObjectName getKey()
+ {
+ String oname = userTask.getKey().getCanonicalName();
+ return ObjectNameFactory.create(oname + ",msgListener=UserTaskCallback");
+ }
+ }
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/UserTaskCallback.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/ReceiveTaskTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/ReceiveTaskTest.java 2008-10-08 10:08:08 UTC (rev 2505)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/ReceiveTaskTest.java 2008-10-08 11:06:20 UTC (rev 2506)
@@ -55,7 +55,7 @@
*/
public class ReceiveTaskTest extends CTSTestCase
{
- public void _testReceiveTaskWithNoMessage() throws Exception
+ public void testReceiveTaskWithNoMessage() throws Exception
{
ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
procBuilder.addProcess("ReceiveTaskTest").addStartEvent("Start").addSequenceFlow("TaskA");
@@ -71,7 +71,7 @@
}
}
- public void _testUnregisteredProcess() throws Exception
+ public void testUnregisteredProcess() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
Process proc = procDef.newInstance();
@@ -88,7 +88,7 @@
}
}
- public void _testSuspendedMessage() throws Exception
+ public void testSuspendedMessage() throws Exception
{
ProcessDefinitionService procDefService = ProcessDefinitionService.locateProcessDefinitionService();
ProcessService procService = ProcessService.locateProcessService();
@@ -146,7 +146,7 @@
try
{
proc.startProcess();
- proc.waitForEnd();
+ proc.waitForEnd(1000);
}
finally
{
Added: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskCallbackTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskCallbackTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskCallbackTest.java 2008-10-08 11:06:20 UTC (rev 2506)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.cts.task;
+
+// $Id$
+
+import java.io.IOException;
+import java.util.List;
+
+import org.jbpm.api.model.Message;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.UserTask;
+import org.jbpm.api.model.UserTaskCallback;
+import org.jbpm.api.model.Event.EventDetailType;
+import org.jbpm.api.model.Task.TaskType;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.runtime.Attachments;
+import org.jbpm.api.runtime.BasicAttachments;
+import org.jbpm.api.service.ProcessBuilderService;
+import org.jbpm.api.test.CTSTestCase;
+
+/**
+ * Test User Task
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 07-Oct-2008
+ */
+public class UserTaskCallbackTest extends CTSTestCase
+{
+ public void testUserTask() throws Exception
+ {
+ ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
+ Process proc = procDef.newInstance();
+
+ // Attach the callback to the UserTask
+ UserTask userTask = proc.getNode(UserTask.class, "UserTask");
+ userTask.setUserTaskCallback(new TaskCallback());
+
+ BasicAttachments att = new BasicAttachments();
+ att.addAttachment("foo", "xxx");
+ proc.startProcess(att);
+ proc.waitForEnd();
+
+ List<Message> messages = getMessages();
+ assertEquals(1, messages.size());
+ assertEquals("xxx", messages.get(0).getProperty("bar").getValue());
+ }
+
+ protected ProcessDefinition getProcessDefinition() throws IOException
+ {
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
+ procBuilder.addProcess("UserTaskTest");
+ procBuilder.addProcessMessage("OutMessage").addProperty("foo", null, true);
+ procBuilder.addProcessMessage("InMessage").addProperty("bar", null, true);
+ procBuilder.addProcessMessage("EndMessage").addToRef(getTestID()).addProperty("bar", null, true);
+ procBuilder.addStartEvent("Start").addSequenceFlow("UserTask");
+ procBuilder.addTask("UserTask", TaskType.User).addOutMessageRef("OutMessage").addInMessageRef("InMessage");
+ procBuilder.addSequenceFlow("End").addEndEvent("End", EventDetailType.Message).addMessageRef("EndMessage");
+ return procBuilder.getProcessDefinition();
+ }
+
+ public static class TaskCallback extends UserTaskCallback
+ {
+ @Override
+ public void callback(Attachments att)
+ {
+ Object value = att.removeAttachment("foo");
+ att.addAttachment("bar", value);
+ }
+ }
+}
Property changes on: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskCallbackTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskTest.java 2008-10-08 10:08:08 UTC (rev 2505)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskTest.java 2008-10-08 11:06:20 UTC (rev 2506)
@@ -55,16 +55,16 @@
{
static final ObjectName MSG_LISTENER_ID = ObjectNameFactory.create(Constants.ID_DOMAIN, "msgListener", "UserTaskTest");
- public void testSendTask() throws Exception
+ public void testUserTask() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
Process proc = procDef.newInstance();
- // Register the process - this assignes the procID
+ // Register the process - this assigns the procID
ProcessService procService = ProcessService.locateProcessService();
procService.registerProcess(proc);
- // Add the message user message listener
+ // Add the user message listener
MessageService msgService = MessageService.locateMessageService();
msgService.addMessageListener(new UserMessageListener(proc.getKey()));
@@ -73,7 +73,7 @@
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "xxx");
proc.startProcess(att);
- proc.waitForEnd();
+ proc.waitForEnd(1000);
List<Message> messages = getMessages();
assertEquals(1, messages.size());
@@ -92,8 +92,8 @@
procBuilder.addProcessMessage("OutMessage").addToRef(MSG_LISTENER_ID).addProperty("foo", null, true);
procBuilder.addProcessMessage("InMessage").addProperty("bar", null, true);
procBuilder.addProcessMessage("EndMessage").addToRef(getTestID()).addProperty("bar", null, true);
- procBuilder.addStartEvent("Start").addSequenceFlow("TaskA");
- procBuilder.addTask("TaskA", TaskType.User).addOutMessageRef("OutMessage").addInMessageRef("InMessage");
+ procBuilder.addStartEvent("Start").addSequenceFlow("UserTask");
+ procBuilder.addTask("UserTask", TaskType.User).addOutMessageRef("OutMessage").addInMessageRef("InMessage");
procBuilder.addSequenceFlow("End").addEndEvent("End", EventDetailType.Message).addMessageRef("EndMessage");
return procBuilder.getProcessDefinition();
}
@@ -115,7 +115,7 @@
Message resMessage = msgBuilder.newMessage("InMessage").addProperty("bar", propValue, true).getMessage();
MessageService msgService = MessageService.locateMessageService();
- msgService.sendMessage(procID, "TaskA", resMessage);
+ msgService.sendMessage(procID, "UserTask", resMessage);
}
@Override
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/UserTaskImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/UserTaskImpl.java 2008-10-08 10:08:08 UTC (rev 2505)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/UserTaskImpl.java 2008-10-08 11:06:20 UTC (rev 2506)
@@ -26,6 +26,7 @@
import java.util.ArrayList;
import java.util.List;
+import javax.management.ObjectName;
import javax.persistence.Entity;
import javax.persistence.Transient;
@@ -35,6 +36,8 @@
import org.jbpm.api.model.Process;
import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.ProcessStructure;
+import org.jbpm.api.model.UserTask;
+import org.jbpm.api.model.UserTaskCallback;
import org.jbpm.api.runtime.ExecutionContext;
import org.jbpm.api.runtime.Token;
import org.jbpm.api.runtime.TokenExecutor;
@@ -50,7 +53,7 @@
* @since 08-Jul-2008
*/
@Entity(name = "UserTask")
-public class UserTaskImpl extends TaskImpl implements MessageListener
+public class UserTaskImpl extends TaskImpl implements UserTask, MessageListener
{
private static final long serialVersionUID = 1L;
@@ -72,6 +75,9 @@
@Transient
private transient TokenExecutor tokenExecutor;
+ @Transient
+ private transient UserTaskCallback userCallback;
+
public UserTaskImpl(ProcessStructure procStruct, String name)
{
super(procStruct, name, TaskType.User);
@@ -82,6 +88,19 @@
{
}
+ @Override
+ public UserTaskCallback getUserTaskCallback()
+ {
+ return userCallback;
+ }
+
+ @Override
+ public void setUserTaskCallback(UserTaskCallback callback)
+ {
+ this.userCallback = callback;
+ }
+
+ @Override
public Message getOutMessageRef()
{
return outMessageRef;
@@ -92,6 +111,7 @@
this.outMessageRef = message;
}
+ @Override
public Message getInMessageRef()
{
return inMessageRef;
@@ -188,4 +208,28 @@
procDefImpl.initializeMessageRef(outMessageRef);
procDefImpl.initializeMessageRef(inMessageRef);
}
+
+ @Override
+ protected void register(Process proc)
+ {
+ super.register(proc);
+
+ if (userCallback != null)
+ {
+ userCallback.attach(this);
+
+ // Redirect the outgoing message to the callback message listener
+ ObjectName listenerID = userCallback.getMessageListener().getKey();
+ outMessageRef.setToRef(new ParticipantImpl(listenerID));
+ }
+ }
+
+ @Override
+ protected void unregister(Process proc)
+ {
+ super.unregister(proc);
+
+ if (userCallback != null)
+ userCallback.detach(this);
+ }
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/MessageSender.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/MessageSender.java 2008-10-08 10:08:08 UTC (rev 2505)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/MessageSender.java 2008-10-08 11:06:20 UTC (rev 2506)
@@ -54,7 +54,7 @@
{
this.fromNode = fromNode;
this.messageRef = messageRef;
- this.fromRef = new ParticipantImpl(fromNode.getProcessDefinition().getKey());
+ this.fromRef = new ParticipantImpl(fromNode.getKey());
if (messageRef == null)
throw new IllegalArgumentException("MessageRef cannot be null");
17 years, 6 months
JBoss JBPM SVN: r2505 - in jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph: node and 1 other directory.
by do-not-reply@jboss.org
Author: camunda
Date: 2008-10-08 06:08:08 -0400 (Wed, 08 Oct 2008)
New Revision: 2505
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/Action.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/Decision.java
Log:
fixed problem of not setting ProcessDefinition correctly in ProcessClassLoader
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/Action.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/Action.java 2008-10-08 09:43:20 UTC (rev 2504)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/Action.java 2008-10-08 10:08:08 UTC (rev 2505)
@@ -116,7 +116,7 @@
ClassLoader surroundingClassLoader = Thread.currentThread().getContextClassLoader();
try {
// set context class loader correctly for delegation class (https://jira.jboss.org/jira/browse/JBPM-1448)
- Thread.currentThread().setContextClassLoader(JbpmConfiguration.getProcessClassLoader(processDefinition));
+ Thread.currentThread().setContextClassLoader(JbpmConfiguration.getProcessClassLoader(executionContext.getProcessDefinition()));
if (referencedAction != null) {
referencedAction.execute(executionContext);
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/Decision.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/Decision.java 2008-10-08 09:43:20 UTC (rev 2504)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/Decision.java 2008-10-08 10:08:08 UTC (rev 2505)
@@ -77,7 +77,7 @@
ClassLoader surroundingClassLoader = Thread.currentThread().getContextClassLoader();
try {
// set context class loader correctly for delegation class (https://jira.jboss.org/jira/browse/JBPM-1448)
- Thread.currentThread().setContextClassLoader(JbpmConfiguration.getProcessClassLoader(processDefinition));
+ Thread.currentThread().setContextClassLoader(JbpmConfiguration.getProcessClassLoader(executionContext.getProcessDefinition()));
try {
if (decisionDelegation != null) {
17 years, 6 months
JBoss JBPM SVN: r2504 - in projects/spec/trunk/modules/impl/src/main: java/org/jbpm/ri/service and 1 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-10-08 05:43:20 -0400 (Wed, 08 Oct 2008)
New Revision: 2504
Modified:
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/RunnableToken.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java
projects/spec/trunk/modules/impl/src/main/resources/jbpm-cfg-beans.xml
Log:
Externalize node interceptors
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/RunnableToken.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/RunnableToken.java 2008-10-08 09:23:47 UTC (rev 2503)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/RunnableToken.java 2008-10-08 09:43:20 UTC (rev 2504)
@@ -28,7 +28,9 @@
import org.jbpm.api.runtime.Token;
import org.jbpm.api.runtime.TokenExecutor;
import org.jbpm.api.runtime.Token.TokenStatus;
+import org.jbpm.api.service.ProcessService;
import org.jbpm.ri.model.ProcessImpl;
+import org.jbpm.ri.service.ProcessServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -85,11 +87,12 @@
// Create a Token that includes node properties
DelegatingToken tokCopy = new DelegatingToken(token);
RuntimeContext rtContext = new RuntimeContext(tokenExecutor, tokCopy);
- rtContext.addInterceptor(new SignalHandlerInterceptor());
- rtContext.addInterceptor(new FlowHandlerInterceptor());
- rtContext.addInterceptor(new AssignmentInterceptor());
- rtContext.addInterceptor(new NodeExecuteInterceptor());
-
+
+ // Add the interceptors that are defined on the ProcessService
+ ProcessServiceImpl procService = (ProcessServiceImpl)node.getProcessEngine().getService(ProcessService.class);
+ for (NodeInterceptor itor : procService.getNodeInterceptors())
+ rtContext.addInterceptor(itor);
+
// Call the interceptor chain
rtContext.next();
}
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java 2008-10-08 09:23:47 UTC (rev 2503)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java 2008-10-08 09:43:20 UTC (rev 2504)
@@ -23,6 +23,10 @@
// $Id$
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
import javax.management.ObjectName;
import org.jbpm.api.client.ProcessEngine;
@@ -30,6 +34,9 @@
import org.jbpm.api.model.Process.ProcessStatus;
import org.jbpm.api.service.ProcessService;
import org.jbpm.ri.model.ProcessImpl;
+import org.jbpm.ri.runtime.NodeInterceptor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* The ProcessService is the entry point to create, find and otherwise manage processes.
@@ -39,12 +46,31 @@
*/
public class ProcessServiceImpl extends ProcessService implements MutableService
{
+ // Provide logging
+ final static Logger log = LoggerFactory.getLogger(ProcessServiceImpl.class);
+
+ private List<NodeInterceptor> nodeInterceptors = new ArrayList<NodeInterceptor>();
+
@Override
public void setProcessEngine(ProcessEngine engine)
{
super.setProcessEngine(engine);
}
+ public void setInterceptors(List<String> itorClassNames)
+ {
+ for (String itorClass : itorClassNames)
+ {
+ NodeInterceptor itor = loadNodeInterceptor(itorClass);
+ nodeInterceptors.add(itor);
+ }
+ }
+
+ public List<NodeInterceptor> getNodeInterceptors()
+ {
+ return Collections.unmodifiableList(nodeInterceptors);
+ }
+
@Override
public ObjectName registerProcess(Process proc)
{
@@ -66,4 +92,22 @@
return super.unregisterProcess(procID);
}
+
+ private NodeInterceptor loadNodeInterceptor(String className)
+ {
+ NodeInterceptor itor = null;
+ if (className != null)
+ {
+ try
+ {
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ itor = (NodeInterceptor)ctxLoader.loadClass(className).newInstance();
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot load interceptor: " + className, ex);
+ }
+ }
+ return itor;
+ }
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/impl/src/main/resources/jbpm-cfg-beans.xml
===================================================================
--- projects/spec/trunk/modules/impl/src/main/resources/jbpm-cfg-beans.xml 2008-10-08 09:23:47 UTC (rev 2503)
+++ projects/spec/trunk/modules/impl/src/main/resources/jbpm-cfg-beans.xml 2008-10-08 09:43:20 UTC (rev 2504)
@@ -21,8 +21,6 @@
</bean>
<!-- The PersistenceService -->
- <bean name="jBPMPersistenceService" class="org.jbpm.ri.service.InMemoryPersistenceServiceImpl"/>
- <!--
<bean name="jBPMPersistenceService" class="org.jbpm.ri.service.PersistenceServiceImpl">
<property name="annotatedClasses">
<set elementClass="java.lang.String">
@@ -50,15 +48,26 @@
</set>
</property>
</bean>
- -->
+ <!--bean name="jBPMPersistenceService" class="org.jbpm.ri.service.InMemoryPersistenceServiceImpl"/-->
+ <!-- The ProcessService -->
+ <bean name="jBPMProcessService" class="org.jbpm.ri.service.ProcessServiceImpl" >
+ <property name="interceptors">
+ <list elementClass="java.lang.String">
+ <value>org.jbpm.ri.runtime.SignalHandlerInterceptor</value>
+ <value>org.jbpm.ri.runtime.FlowHandlerInterceptor</value>
+ <value>org.jbpm.ri.runtime.AssignmentInterceptor</value>
+ <value>org.jbpm.ri.runtime.NodeExecuteInterceptor</value>
+ </list>
+ </property>
+ </bean>
+
<!-- Other Services -->
<bean name="jBPMExecutionService" class="org.jbpm.ri.service.ExecutionServiceImpl" />
<bean name="jBPMMessageService" class="org.jbpm.ri.service.MessageServiceImpl" />
<bean name="jBPMMessageBuilderService" class="org.jbpm.ri.service.MessageBuilderServiceImpl" />
<bean name="jBPMProcessBuilderService" class="org.jbpm.ri.service.ProcessBuilderServiceImpl" />
<bean name="jBPMProcessDefinitionService" class="org.jbpm.ri.service.ProcessDefinitionServiceImpl" />
- <bean name="jBPMProcessService" class="org.jbpm.ri.service.ProcessServiceImpl" />
<bean name="jBPMSignalService" class="org.jbpm.ri.service.SignalServiceImpl" />
</deployment>
17 years, 6 months
JBoss JBPM SVN: r2503 - jbpm3/trunk/modules/core/src/main/java/org/jbpm/context/exe.
by do-not-reply@jboss.org
Author: camunda
Date: 2008-10-08 05:23:47 -0400 (Wed, 08 Oct 2008)
New Revision: 2503
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/context/exe/VariableContainer.java
Log:
added serialVersion to VariableContainer (http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4180981)
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/context/exe/VariableContainer.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/context/exe/VariableContainer.java 2008-10-08 09:18:41 UTC (rev 2502)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/context/exe/VariableContainer.java 2008-10-08 09:23:47 UTC (rev 2503)
@@ -16,6 +16,7 @@
public abstract class VariableContainer implements Serializable {
+ private static final long serialVersionUID = 520258491083406913L;
protected Map variableInstances = null;
protected abstract VariableContainer getParentVariableContainer();
17 years, 6 months
JBoss JBPM SVN: r2502 - in projects/spec/trunk/modules: api/src/main/java/org/jbpm/api/model/builder and 24 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-10-08 05:18:41 -0400 (Wed, 08 Oct 2008)
New Revision: 2502
Added:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/MessageBuilderService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessBuilderService.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskTest.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/UserTaskImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/AssignmentInterceptor.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/ExitSignalInterceptor.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/FlowHandlerInterceptor.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/NodeExecuteInterceptor.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/NodeInterceptor.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/RunnableToken.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/RuntimeContext.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/SignalHandlerInterceptor.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/HibernatePersistenceServiceImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/InMemoryPersistenceServiceImpl.java
Removed:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/MessageBuilderService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilderService.java
Modified:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Node.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/TaskBuilder.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/endevent/EndEventMessageTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/InclusiveGatewayMergeTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/InclusiveGatewaySplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/ParallelGatewayMergeTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/ParallelGatewaySplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/node/NodeInputSetTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/node/NodeOutputSetTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/node/NodePropertyTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/process/ProcessPropertyTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessBuilderTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessCatalog.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessServiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/startevent/StartEventSignalTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/ReceiveTaskTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/SendTaskTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/TaskExecutionHandlerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/exclusivechoice/ExclusiveChoiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/multichoice/MultiChoiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/parallelsplit/ParallelSplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/simplemerge/SimpleMergeTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/synchronization/SynchronizationTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/casedata/CaseDataTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/taskdata/TaskDataTest.java
projects/spec/trunk/modules/cts/src/test/resources/log4j.xml
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/GatewayImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/SendTaskImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/TaskBuilderImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/MessageBuilderServiceImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessBuilderServiceImpl.java
projects/spec/trunk/modules/impl/src/main/resources/jbpm-cfg-beans.xml
Log:
Add UserTask
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Node.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Node.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Node.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -61,16 +61,16 @@
/**
* Get the associated ExecutionHandler
*/
- ExecutionHandler getExecutionHandler(boolean defaultHandler);
+ ExecutionHandler getExecutionHandler();
/**
* Get the associated SignalHandler
*/
- SignalHandler getSignalHandler(boolean defaultHandler);
+ SignalHandler getSignalHandler();
/**
* Get the associated FlowHandler
*/
- FlowHandler getFlowHandler(boolean defaultHandler);
+ FlowHandler getFlowHandler();
}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/MessageBuilderService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/MessageBuilderService.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/MessageBuilderService.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model.builder;
-
-//$Id$
-
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.service.AbstractService;
-
-/**
- * The MessageBuilder can be used to build a {@link Message} dynamically.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public abstract class MessageBuilderService extends AbstractService
-{
- /**
- * Locate the default MessageBuilder
- */
- public static MessageBuilder locateMessageBuilder()
- {
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- MessageBuilderService builderService = engine.getService(MessageBuilderService.class);
- return builderService.getMessageBuilder();
- }
-
- /**
- * Get the MessageBuilder
- */
- public abstract MessageBuilder getMessageBuilder();
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilderService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilderService.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilderService.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model.builder;
-
-//$Id$
-
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.service.AbstractService;
-
-/**
- * The ProcessBuilder can be used to build a {@link Process} dynamically.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public abstract class ProcessBuilderService extends AbstractService
-{
- /**
- * Locate the default ProcessBuilder
- */
- public static ProcessBuilder locateProcessBuilder()
- {
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- ProcessBuilderService builderService = engine.getService(ProcessBuilderService.class);
- return builderService.getProcessBuilder();
- }
-
- /**
- * Get the ProcessBuilder
- */
- public abstract ProcessBuilder getProcessBuilder();
-}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/TaskBuilder.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/TaskBuilder.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/TaskBuilder.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -35,13 +35,20 @@
public interface TaskBuilder extends ProcessBuilder
{
/**
- * Add a {@link Message} reference.
+ * Add an outgoing {@link Message} reference.
* <p/>
* The {@link Message} must be defined at {@link Process} level
*/
- TaskBuilder addMessageRef(String msgName);
+ TaskBuilder addOutMessageRef(String msgName);
/**
+ * Add an incomming {@link Message} reference.
+ * <p/>
+ * The {@link Message} must be defined at {@link Process} level
+ */
+ TaskBuilder addInMessageRef(String msgName);
+
+ /**
* Add an InputSet
*/
TaskBuilder addInputSet();
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/MessageBuilderService.java (from rev 2488, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/MessageBuilderService.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/MessageBuilderService.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/MessageBuilderService.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.service;
+
+//$Id$
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Message;
+import org.jbpm.api.model.builder.MessageBuilder;
+
+/**
+ * The MessageBuilder can be used to build a {@link Message} dynamically.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public abstract class MessageBuilderService extends AbstractService
+{
+ /**
+ * Locate the default MessageBuilder
+ */
+ public static MessageBuilder locateMessageBuilder()
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ MessageBuilderService builderService = engine.getService(MessageBuilderService.class);
+ return builderService.getMessageBuilder();
+ }
+
+ /**
+ * Get the MessageBuilder
+ */
+ public abstract MessageBuilder getMessageBuilder();
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessBuilderService.java (from rev 2488, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilderService.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessBuilderService.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessBuilderService.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.service;
+
+//$Id$
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.builder.ProcessBuilder;
+
+/**
+ * The ProcessBuilder can be used to build a {@link Process} dynamically.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public abstract class ProcessBuilderService extends AbstractService
+{
+ /**
+ * Locate the default ProcessBuilder
+ */
+ public static ProcessBuilder locateProcessBuilder()
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ ProcessBuilderService builderService = engine.getService(ProcessBuilderService.class);
+ return builderService.getProcessBuilder();
+ }
+
+ /**
+ * Get the ProcessBuilder
+ */
+ public abstract ProcessBuilder getProcessBuilder();
+}
\ No newline at end of file
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/endevent/EndEventMessageTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/endevent/EndEventMessageTest.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/endevent/EndEventMessageTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -31,8 +31,8 @@
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.builder.MessageBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
import org.jbpm.api.runtime.BasicAttachments;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
/**
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -31,7 +31,7 @@
import org.jbpm.api.model.Signal;
import org.jbpm.api.model.Gateway.GatewayType;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
/**
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -33,8 +33,8 @@
import org.jbpm.api.model.Gateway.GatewayType;
import org.jbpm.api.model.builder.GatewayBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
import org.jbpm.api.runtime.BasicAttachments;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
/**
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/InclusiveGatewayMergeTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/InclusiveGatewayMergeTest.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/InclusiveGatewayMergeTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -31,7 +31,7 @@
import org.jbpm.api.model.Signal;
import org.jbpm.api.model.Gateway.GatewayType;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
/**
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/InclusiveGatewaySplitTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/InclusiveGatewaySplitTest.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/InclusiveGatewaySplitTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -33,8 +33,8 @@
import org.jbpm.api.model.Gateway.GatewayType;
import org.jbpm.api.model.builder.GatewayBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
import org.jbpm.api.runtime.BasicAttachments;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
/**
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/ParallelGatewayMergeTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/ParallelGatewayMergeTest.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/ParallelGatewayMergeTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -34,7 +34,7 @@
import org.jbpm.api.model.Gateway.GatewayType;
import org.jbpm.api.model.builder.MessageBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
/**
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/ParallelGatewaySplitTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/ParallelGatewaySplitTest.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/ParallelGatewaySplitTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -34,7 +34,7 @@
import org.jbpm.api.model.Gateway.GatewayType;
import org.jbpm.api.model.Signal.SignalType;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
/**
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/node/NodeInputSetTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/node/NodeInputSetTest.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/node/NodeInputSetTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -31,9 +31,9 @@
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.builder.MessageBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
import org.jbpm.api.model.builder.TaskBuilder;
import org.jbpm.api.runtime.BasicAttachments;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
/**
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/node/NodeOutputSetTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/node/NodeOutputSetTest.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/node/NodeOutputSetTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -31,8 +31,8 @@
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.builder.MessageBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
import org.jbpm.api.model.builder.TaskBuilder;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
/**
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/node/NodePropertyTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/node/NodePropertyTest.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/node/NodePropertyTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -33,8 +33,8 @@
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.builder.MessageBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
import org.jbpm.api.model.builder.TaskBuilder;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
/**
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/process/ProcessPropertyTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/process/ProcessPropertyTest.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/process/ProcessPropertyTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -33,7 +33,7 @@
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.builder.MessageBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
/**
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessBuilderTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessBuilderTest.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessBuilderTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -26,7 +26,7 @@
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
/**
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessCatalog.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessCatalog.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessCatalog.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -32,7 +32,7 @@
import org.jbpm.api.model.StartEvent;
import org.jbpm.api.model.Task;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.service.ProcessBuilderService;
/**
* A catalog of CTS test processes
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessServiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessServiceTest.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessServiceTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -31,7 +31,7 @@
import org.jbpm.api.model.Signal;
import org.jbpm.api.model.Signal.SignalType;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.service.ProcessDefinitionService;
import org.jbpm.api.service.ProcessService;
import org.jbpm.api.service.SignalService;
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/startevent/StartEventSignalTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/startevent/StartEventSignalTest.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/startevent/StartEventSignalTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -40,8 +40,8 @@
import org.jbpm.api.model.builder.EventBuilder;
import org.jbpm.api.model.builder.MessageBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
import org.jbpm.api.model.builder.TaskBuilder;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.service.ProcessDefinitionService;
import org.jbpm.api.service.ProcessService;
import org.jbpm.api.service.SignalService;
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/ReceiveTaskTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/ReceiveTaskTest.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/ReceiveTaskTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -38,10 +38,10 @@
import org.jbpm.api.model.Task.TaskType;
import org.jbpm.api.model.builder.EventBuilder;
import org.jbpm.api.model.builder.MessageBuilder;
-import org.jbpm.api.model.builder.MessageBuilderService;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.service.MessageBuilderService;
import org.jbpm.api.service.MessageService;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.service.ProcessDefinitionService;
import org.jbpm.api.service.ProcessService;
import org.jbpm.api.service.SignalService;
@@ -55,7 +55,7 @@
*/
public class ReceiveTaskTest extends CTSTestCase
{
- public void testReceiveTaskWithNoMessage() throws Exception
+ public void _testReceiveTaskWithNoMessage() throws Exception
{
ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
procBuilder.addProcess("ReceiveTaskTest").addStartEvent("Start").addSequenceFlow("TaskA");
@@ -71,15 +71,15 @@
}
}
- public void testUnregisteredProcess() throws Exception
+ public void _testUnregisteredProcess() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
Process proc = procDef.newInstance();
- MessageService msgManager = MessageService.locateMessageService();
+ MessageService msgService = MessageService.locateMessageService();
try
{
- msgManager.sendMessage(proc.getKey(), "TaskA", getMessage());
+ msgService.sendMessage(proc.getKey(), "TaskA", getMessage());
fail("Send to an unregistered process is expected to fail");
}
catch (RuntimeException ex)
@@ -88,7 +88,7 @@
}
}
- public void testSuspendedMessage() throws Exception
+ public void _testSuspendedMessage() throws Exception
{
ProcessDefinitionService procDefService = ProcessDefinitionService.locateProcessDefinitionService();
ProcessService procService = ProcessService.locateProcessService();
@@ -100,8 +100,8 @@
try
{
// Send the message before the process is started
- MessageService msgManager = MessageService.locateMessageService();
- msgManager.sendMessage(procID, "TaskA", getMessage());
+ MessageService msgService = MessageService.locateMessageService();
+ msgService.sendMessage(procID, "TaskA", getMessage());
proc.startProcess();
proc.waitForEnd(1000);
@@ -135,8 +135,8 @@
if (sendMessage == true)
{
sendMessage = false;
- MessageService msgManager = MessageService.locateMessageService();
- msgManager.sendMessage(proc.getKey(), "TaskA", getMessage());
+ MessageService msgService = MessageService.locateMessageService();
+ msgService.sendMessage(proc.getKey(), "TaskA", getMessage());
}
}
};
@@ -146,7 +146,7 @@
try
{
proc.startProcess();
- proc.waitForEnd(1000);
+ proc.waitForEnd();
}
finally
{
@@ -160,8 +160,8 @@
private Message getMessage()
{
- MessageBuilder procBuilder = MessageBuilderService.locateMessageBuilder();
- Message msg = procBuilder.newMessage("ReceiveTaskMessage").addProperty("foo", "bar", true).getMessage();
+ MessageBuilder msgBuilder = MessageBuilderService.locateMessageBuilder();
+ Message msg = msgBuilder.newMessage("ReceiveTaskMessage").addProperty("foo", "bar", true).getMessage();
return msg;
}
@@ -172,7 +172,7 @@
procBuilder.addProcessMessage("ReceiveTaskMessage").addProperty("foo", null, true);
procBuilder.addProcessMessage("EndEventMessage").addToRef(getTestID()).addProperty("foo", null, true);
procBuilder.addStartEvent("Start").addSequenceFlow("TaskA");
- procBuilder.addTask("TaskA", TaskType.Receive).addMessageRef("ReceiveTaskMessage");
+ procBuilder.addTask("TaskA", TaskType.Receive).addInMessageRef("ReceiveTaskMessage");
EventBuilder eventBuilder = procBuilder.addSequenceFlow("End").addEndEvent("End", EventDetailType.Message);
eventBuilder.addMessageRef("EndEventMessage");
return procBuilder.getProcessDefinition();
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/SendTaskTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/SendTaskTest.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/SendTaskTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -33,8 +33,8 @@
import org.jbpm.api.model.Task.TaskType;
import org.jbpm.api.model.builder.MessageBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
import org.jbpm.api.runtime.BasicAttachments;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
/**
@@ -82,7 +82,7 @@
MessageBuilder msgBuilder = procBuilder.addProcess("SendTaskTest").addProcessMessage("SendTaskMessage");
msgBuilder.addToRef(getTestID()).addProperty("foo", null, true);
procBuilder.addStartEvent("Start").addSequenceFlow("TaskA");
- procBuilder.addTask("TaskA", TaskType.Send).addMessageRef("SendTaskMessage");
+ procBuilder.addTask("TaskA", TaskType.Send).addOutMessageRef("SendTaskMessage");
procBuilder.addSequenceFlow("End").addEndEvent("End");
return procBuilder.getProcessDefinition();
}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/TaskExecutionHandlerTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/TaskExecutionHandlerTest.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/TaskExecutionHandlerTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -30,12 +30,12 @@
import org.jbpm.api.model.Assignment.AssignTime;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
import org.jbpm.api.model.builder.TaskBuilder;
import org.jbpm.api.runtime.BasicNodeHandler;
import org.jbpm.api.runtime.ExecutionContext;
import org.jbpm.api.runtime.ExecutionHandler;
import org.jbpm.api.runtime.Token;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
/**
Added: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -0,0 +1,128 @@
+/*
+ * 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.test.cts.task;
+
+// $Id$
+
+import java.io.IOException;
+import java.util.List;
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.Constants;
+import org.jbpm.api.client.MessageListener;
+import org.jbpm.api.model.Message;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.Event.EventDetailType;
+import org.jbpm.api.model.Task.TaskType;
+import org.jbpm.api.model.builder.MessageBuilder;
+import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.runtime.BasicAttachments;
+import org.jbpm.api.service.MessageBuilderService;
+import org.jbpm.api.service.MessageService;
+import org.jbpm.api.service.ProcessBuilderService;
+import org.jbpm.api.service.ProcessService;
+import org.jbpm.api.test.CTSTestCase;
+
+/**
+ * Test User Task
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 07-Oct-2008
+ */
+public class UserTaskTest extends CTSTestCase
+{
+ static final ObjectName MSG_LISTENER_ID = ObjectNameFactory.create(Constants.ID_DOMAIN, "msgListener", "UserTaskTest");
+
+ public void testSendTask() throws Exception
+ {
+ ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
+ Process proc = procDef.newInstance();
+
+ // Register the process - this assignes the procID
+ ProcessService procService = ProcessService.locateProcessService();
+ procService.registerProcess(proc);
+
+ // Add the message user message listener
+ MessageService msgService = MessageService.locateMessageService();
+ msgService.addMessageListener(new UserMessageListener(proc.getKey()));
+
+ try
+ {
+ BasicAttachments att = new BasicAttachments();
+ att.addAttachment("foo", "xxx");
+ proc.startProcess(att);
+ proc.waitForEnd();
+
+ List<Message> messages = getMessages();
+ assertEquals(1, messages.size());
+ assertEquals("xxx", messages.get(0).getProperty("bar").getValue());
+ }
+ finally
+ {
+ msgService.removeMessageListener(MSG_LISTENER_ID);
+ }
+ }
+
+ protected ProcessDefinition getProcessDefinition() throws IOException
+ {
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
+ procBuilder.addProcess("UserTaskTest");
+ procBuilder.addProcessMessage("OutMessage").addToRef(MSG_LISTENER_ID).addProperty("foo", null, true);
+ procBuilder.addProcessMessage("InMessage").addProperty("bar", null, true);
+ procBuilder.addProcessMessage("EndMessage").addToRef(getTestID()).addProperty("bar", null, true);
+ procBuilder.addStartEvent("Start").addSequenceFlow("TaskA");
+ procBuilder.addTask("TaskA", TaskType.User).addOutMessageRef("OutMessage").addInMessageRef("InMessage");
+ procBuilder.addSequenceFlow("End").addEndEvent("End", EventDetailType.Message).addMessageRef("EndMessage");
+ return procBuilder.getProcessDefinition();
+ }
+
+ public static class UserMessageListener implements MessageListener
+ {
+ ObjectName procID;
+
+ public UserMessageListener(ObjectName procID)
+ {
+ this.procID = procID;
+ }
+
+ @Override
+ public void catchMessage(Message message)
+ {
+ String propValue = message.getProperty("foo").getValue();
+ MessageBuilder msgBuilder = MessageBuilderService.locateMessageBuilder();
+ Message resMessage = msgBuilder.newMessage("InMessage").addProperty("bar", propValue, true).getMessage();
+
+ MessageService msgService = MessageService.locateMessageService();
+ msgService.sendMessage(procID, "TaskA", resMessage);
+ }
+
+ @Override
+ public ObjectName getKey()
+ {
+ return MSG_LISTENER_ID;
+ }
+
+ }
+}
Property changes on: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/exclusivechoice/ExclusiveChoiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/exclusivechoice/ExclusiveChoiceTest.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/exclusivechoice/ExclusiveChoiceTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -33,8 +33,8 @@
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.builder.GatewayBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
import org.jbpm.api.runtime.BasicAttachments;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
/**
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/multichoice/MultiChoiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/multichoice/MultiChoiceTest.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/multichoice/MultiChoiceTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -33,8 +33,8 @@
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.builder.GatewayBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
import org.jbpm.api.runtime.BasicAttachments;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
/**
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/parallelsplit/ParallelSplitTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/parallelsplit/ParallelSplitTest.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/parallelsplit/ParallelSplitTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -34,7 +34,7 @@
import org.jbpm.api.model.Signal;
import org.jbpm.api.model.Signal.SignalType;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
/**
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -31,7 +31,7 @@
import org.jbpm.api.model.Signal;
import org.jbpm.api.model.Signal.SignalType;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
/**
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/simplemerge/SimpleMergeTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/simplemerge/SimpleMergeTest.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/simplemerge/SimpleMergeTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -31,7 +31,7 @@
import org.jbpm.api.model.Signal;
import org.jbpm.api.model.Gateway.GatewayType;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
/**
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/synchronization/SynchronizationTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/synchronization/SynchronizationTest.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/synchronization/SynchronizationTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -34,7 +34,7 @@
import org.jbpm.api.model.Gateway.GatewayType;
import org.jbpm.api.model.builder.MessageBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
/**
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/casedata/CaseDataTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/casedata/CaseDataTest.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/casedata/CaseDataTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -33,7 +33,7 @@
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.builder.MessageBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
/**
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/taskdata/TaskDataTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/taskdata/TaskDataTest.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/taskdata/TaskDataTest.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -33,8 +33,8 @@
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.builder.MessageBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
import org.jbpm.api.model.builder.TaskBuilder;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
/**
Modified: projects/spec/trunk/modules/cts/src/test/resources/log4j.xml
===================================================================
--- projects/spec/trunk/modules/cts/src/test/resources/log4j.xml 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/cts/src/test/resources/log4j.xml 2008-10-08 09:18:41 UTC (rev 2502)
@@ -32,12 +32,11 @@
<!-- Limit categories -->
<!-- ================ -->
- <!-- Apache HTTP Client -->
- <category name="org.apache.commons.httpclient">
+ <category name="org.hibernate">
<priority value="INFO" />
</category>
- <category name="httpclient.wire">
- <priority value="INFO" />
+ <category name="org.hibernate.persister">
+ <priority value="DEBUG" />
</category>
<!-- ======================= -->
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/GatewayImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/GatewayImpl.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/GatewayImpl.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -167,11 +167,6 @@
if (expectedFlows.contains(flow) == false)
throw new IllegalStateException("Unexpected token from: " + flow);
- // Call custom execution handler
- ExecutionHandler exHandler = getExecutionHandler(false);
- if (exHandler != null)
- exHandler.execute(token);
-
// Remove the flow from the expected list
expectedFlows.remove(flow);
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -57,10 +57,12 @@
import org.jbpm.api.runtime.SignalHandler;
import org.jbpm.api.runtime.Token;
import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.runtime.Token.TokenStatus;
import org.jbpm.ri.model.builder.MultipleInFlowSupport;
import org.jbpm.ri.model.builder.MultipleOutFlowSupport;
import org.jbpm.ri.model.builder.SingleInFlowSupport;
import org.jbpm.ri.model.builder.SingleOutFlowSupport;
+import org.jbpm.ri.runtime.RuntimeContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -220,6 +222,15 @@
return outFlows;
}
+ public void execute(RuntimeContext rtContext)
+ {
+ Token token = rtContext.getToken();
+
+ // The default implementation calls the ExecutionHandler
+ ExecutionHandler execHandler = getExecutionHandler();
+ execHandler.execute(token);
+ }
+
public <T extends ExecutionHandler> void setExecutionHandler(Class<T> clazz)
{
this.execHandler = clazz.getName();
@@ -236,7 +247,7 @@
}
@Override
- public ExecutionHandler getExecutionHandler(boolean defaultHandler)
+ public ExecutionHandler getExecutionHandler()
{
if (customExecHandler == null && execHandler != null)
customExecHandler = loadHandlerInstance(ExecutionHandler.class, execHandler);
@@ -244,7 +255,7 @@
if (defaultExecHandler == null)
defaultExecHandler = getDefaultExecutionHandler();
- return defaultHandler ? defaultExecHandler : customExecHandler;
+ return customExecHandler != null ? customExecHandler : defaultExecHandler;
}
protected ExecutionHandler getDefaultExecutionHandler()
@@ -273,7 +284,7 @@
}
@Override
- public SignalHandler getSignalHandler(boolean defaultHandler)
+ public SignalHandler getSignalHandler()
{
if (customSignalHandler == null && sigHandler != null)
customSignalHandler = loadHandlerInstance(SignalHandler.class, sigHandler);
@@ -281,13 +292,13 @@
if (defaultSignalHandler == null)
defaultSignalHandler = getDefaultSignalHandler();
- return defaultHandler ? defaultSignalHandler : customSignalHandler;
+ return customSignalHandler != null ? customSignalHandler : defaultSignalHandler;
}
protected abstract SignalHandler getDefaultSignalHandler();
@Override
- public FlowHandler getFlowHandler(boolean defaultHandler)
+ public FlowHandler getFlowHandler()
{
if (customFlowHandler == null && flowHandler != null)
customFlowHandler = loadHandlerInstance(FlowHandler.class, flowHandler);
@@ -295,7 +306,7 @@
if (defaultFlowHandler == null)
defaultFlowHandler = getDefaultFlowHandler();
- return defaultHandler ? defaultFlowHandler : customFlowHandler;
+ return customFlowHandler != null ? customFlowHandler : defaultFlowHandler;
}
protected FlowHandler getDefaultFlowHandler()
@@ -310,7 +321,8 @@
if (getOutFlows().size() == 1)
{
SequenceFlow outFlow = getOutFlows().get(0);
- tokenExecutor.move(token, outFlow);
+ if (token.getTokenStatus() == TokenStatus.Started)
+ tokenExecutor.move(token, outFlow);
}
else
{
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -33,20 +33,18 @@
import org.jbpm.api.NotImplementedException;
import org.jbpm.api.client.MessageListener;
import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Node;
import org.jbpm.api.model.Process;
import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.FlowHandler;
import org.jbpm.api.runtime.Token;
import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.ri.runtime.RuntimeContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * Task that corresponds to the TaskType.None
+ * Task that corresponds to the TaskType.Receive
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
@@ -66,8 +64,11 @@
private List<Message> receivedMessages = new ArrayList<Message>();
@Transient
- private List<Token> suspendedTokens = new ArrayList<Token>();
+ private transient Token suspendedToken;
+ @Transient
+ private transient TokenExecutor tokenExecutor;
+
public ReceiveTaskImpl(ProcessStructure procStruct, String name)
{
super(procStruct, name, TaskType.Receive);
@@ -94,30 +95,55 @@
this.messageRef = message;
}
+
+ @Override
+ public void execute(RuntimeContext rtContext)
+ {
+ Token token = rtContext.getToken();
+ tokenExecutor = rtContext.getTokenExecutor();
+
+ if (receivedMessages.size() > 0)
+ {
+ // Copy the expected properties from the received message
+ Message msg = receivedMessages.get(0);
+ ExecutionContext exContext = token.getExecutionContext();
+ for (String key : messageRef.getPropertyNames())
+ {
+ Object value = msg.getProperty(key).getValue();
+ exContext.addAttachment(key, value);
+ }
+ }
+ else
+ {
+ tokenExecutor.suspend(token);
+ suspendedToken = token;
+ }
+ }
+
+ @Override
public synchronized void catchMessage(Message message)
{
String msgName = message.getName();
if (messageRef.getName().equals(msgName))
{
log.debug("catchMessage in " + this + " => " + message);
+
+ // Verify expected properties
for (String propName : messageRef.getPropertyNames())
{
if (message.getProperty(propName) == null)
throw new IllegalArgumentException("Received message does not contain expected property: " + propName);
}
+
+ // Store the received message
receivedMessages.add(message);
- if (suspendedTokens.size() == 0)
+ // Activate the suspended token
+ if (suspendedToken != null)
{
- log.debug("Suspend message: " + message);
+ tokenExecutor.activate(suspendedToken.getTokenID());
+ suspendedToken = null;
}
- else
- {
- Token token = suspendedTokens.remove(0);
- ExecutionContext exContext = token.getExecutionContext();
- TokenExecutor tokenExecutor = exContext.removeAttachment(TokenExecutor.class);
- tokenExecutor.activate(token.getTokenID());
- }
}
else
{
@@ -126,80 +152,6 @@
}
@Override
- protected ExecutionHandler getDefaultExecutionHandler()
- {
- final Node thisNode = this;
- return new ExecutionHandler()
- {
- private static final long serialVersionUID = 1L;
-
- public void execute(Token token)
- {
- if (receivedMessages.size() > 0)
- {
- // Copy the expected properties from the
- // received message to the execution context
- Message msg = receivedMessages.get(0);
- ExecutionContext exContext = token.getExecutionContext();
- for (String key : messageRef.getPropertyNames())
- {
- Object value = msg.getProperty(key).getValue();
- exContext.addAttachment(key, value);
- }
- }
- }
-
- @Override
- public Node getNode()
- {
- return thisNode;
- }
-
- @Override
- public void setNode(Node node)
- {
- }
- };
- }
-
- @Override
- protected FlowHandler getDefaultFlowHandler()
- {
- final Node thisNode = this;
- return new FlowHandler()
- {
- private static final long serialVersionUID = 1L;
-
- public void execute(TokenExecutor tokenExecutor, Token token)
- {
- if (receivedMessages.size() > 0)
- {
- receivedMessages.remove(0);
- tokenExecutor.move(token, getOutFlow());
- }
- else
- {
- tokenExecutor.suspend(token);
- ExecutionContext exContext = token.getExecutionContext();
- exContext.addAttachment(TokenExecutor.class, tokenExecutor);
- suspendedTokens.add(token);
- }
- }
-
- @Override
- public Node getNode()
- {
- return thisNode;
- }
-
- @Override
- public void setNode(Node node)
- {
- }
- };
- }
-
- @Override
protected void create(ProcessDefinition procDef)
{
super.create(procDef);
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/SendTaskImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/SendTaskImpl.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/SendTaskImpl.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -39,7 +39,7 @@
import org.slf4j.LoggerFactory;
/**
- * Task that corresponds to the TaskType.None
+ * Task that corresponds to the TaskType.Send
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/UserTaskImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/UserTaskImpl.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/UserTaskImpl.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -0,0 +1,191 @@
+/*
+ * 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.ri.model;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.Entity;
+import javax.persistence.Transient;
+
+import org.jbpm.api.InvalidProcessException;
+import org.jbpm.api.client.MessageListener;
+import org.jbpm.api.model.Message;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.ProcessStructure;
+import org.jbpm.api.runtime.ExecutionContext;
+import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.ri.runtime.MessageSender;
+import org.jbpm.ri.runtime.RuntimeContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Task that corresponds to the TaskType.User
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+@Entity(name = "UserTask")
+public class UserTaskImpl extends TaskImpl implements MessageListener
+{
+ private static final long serialVersionUID = 1L;
+
+ // provide logging
+ final static Logger log = LoggerFactory.getLogger(UserTaskImpl.class);
+
+ @Transient
+ protected MessageImpl outMessageRef;
+
+ @Transient
+ protected MessageImpl inMessageRef;
+
+ @Transient
+ private List<Message> receivedMessages = new ArrayList<Message>();
+
+ @Transient
+ private transient Token suspendedToken;
+
+ @Transient
+ private transient TokenExecutor tokenExecutor;
+
+ public UserTaskImpl(ProcessStructure procStruct, String name)
+ {
+ super(procStruct, name, TaskType.User);
+ }
+
+ // Persistence ctor
+ protected UserTaskImpl()
+ {
+ }
+
+ public Message getOutMessageRef()
+ {
+ return outMessageRef;
+ }
+
+ public void setOutMessageRef(MessageImpl message)
+ {
+ this.outMessageRef = message;
+ }
+
+ public Message getInMessageRef()
+ {
+ return inMessageRef;
+ }
+
+ public void setInMessageRef(MessageImpl message)
+ {
+ this.inMessageRef = message;
+ }
+
+
+ @Override
+ public void execute(RuntimeContext rtContext)
+ {
+ Token token = rtContext.getToken();
+ tokenExecutor = rtContext.getTokenExecutor();
+
+ if (receivedMessages.size() == 0)
+ {
+ MessageSender messageSender = new MessageSender(this, outMessageRef);
+ messageSender.sendMessage(token);
+ }
+
+ if (receivedMessages.size() > 0)
+ {
+ // Copy the expected properties from the received message
+ Message msg = receivedMessages.remove(0);
+ ExecutionContext exContext = token.getExecutionContext();
+ for (String key : inMessageRef.getPropertyNames())
+ {
+ Object value = msg.getProperty(key).getValue();
+ exContext.addAttachment(key, value);
+ }
+ }
+ else
+ {
+ tokenExecutor.suspend(token);
+ suspendedToken = token;
+ }
+ }
+
+ @Override
+ public synchronized void catchMessage(Message message)
+ {
+ String msgName = message.getName();
+ if (inMessageRef.getName().equals(msgName))
+ {
+ log.debug("catchMessage in " + this + " => " + message);
+
+ // Verify expected properties
+ for (String propName : inMessageRef.getPropertyNames())
+ {
+ if (message.getProperty(propName) == null)
+ throw new IllegalArgumentException("Received message does not contain expected property: " + propName);
+ }
+
+ // Store the received message
+ receivedMessages.add(message);
+
+ // Activate the suspended token
+ if (suspendedToken != null)
+ {
+ tokenExecutor.activate(suspendedToken.getTokenID());
+ suspendedToken = null;
+ }
+ }
+ else
+ {
+ log.debug("Ignore unexpected message: " + message);
+ }
+ }
+
+ @Override
+ protected void create(ProcessDefinition procDef)
+ {
+ super.create(procDef);
+
+ if (outMessageRef == null)
+ throw new InvalidProcessException("An outgoing message ref attribute MUST be entered");
+ if (inMessageRef == null)
+ throw new InvalidProcessException("An incomming message ref attribute MUST be entered");
+
+ ProcessDefinitionImpl procDefImpl = (ProcessDefinitionImpl)procDef;
+ procDefImpl.initializeMessageRef(outMessageRef);
+ procDefImpl.initializeMessageRef(inMessageRef);
+ }
+
+ @Override
+ protected void create(Process proc)
+ {
+ super.create(proc);
+
+ ProcessDefinitionImpl procDefImpl = (ProcessDefinitionImpl)proc.getProcessDefinition();
+ procDefImpl.initializeMessageRef(outMessageRef);
+ procDefImpl.initializeMessageRef(inMessageRef);
+ }
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/UserTaskImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -57,6 +57,7 @@
import org.jbpm.ri.model.SequenceFlowImpl;
import org.jbpm.ri.model.StartEventImpl;
import org.jbpm.ri.model.TaskImpl;
+import org.jbpm.ri.model.UserTaskImpl;
/**
* The ProcessBuilder can be used to dynamically build a {@link Process}.
@@ -173,7 +174,7 @@
}
else if (type == TaskType.User)
{
- throw new NotImplementedException("JBPM-1653", "Task Type User");
+ node = new UserTaskImpl(procStruct, name);
}
else if (type == TaskType.Script)
{
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/TaskBuilderImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/TaskBuilderImpl.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/TaskBuilderImpl.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -35,6 +35,7 @@
import org.jbpm.ri.model.ReceiveTaskImpl;
import org.jbpm.ri.model.SendTaskImpl;
import org.jbpm.ri.model.TaskImpl;
+import org.jbpm.ri.model.UserTaskImpl;
/**
* The TaskBuilder can be used to dynamically build {@link Task}.
@@ -53,22 +54,43 @@
}
@Override
- public TaskBuilder addMessageRef(String msgName)
+ public TaskBuilder addOutMessageRef(String msgName)
{
TaskImpl taskImpl = getTask();
+ if (taskImpl instanceof SendTaskImpl)
+ {
+ SendTaskImpl sendTaskImpl = (SendTaskImpl)taskImpl;
+ sendTaskImpl.setMessageRef(new MessageImpl(msgName));
+ }
+ else if (taskImpl instanceof UserTaskImpl)
+ {
+ UserTaskImpl userTaskImpl = (UserTaskImpl)taskImpl;
+ userTaskImpl.setOutMessageRef(new MessageImpl(msgName));
+ }
+ else
+ {
+ throw new IllegalStateException("Cannot set outgoing message ref on task: " + taskImpl);
+ }
+ return this;
+ }
+
+ @Override
+ public TaskBuilder addInMessageRef(String msgName)
+ {
+ TaskImpl taskImpl = getTask();
if (taskImpl instanceof ReceiveTaskImpl)
{
ReceiveTaskImpl receiveTaskImpl = (ReceiveTaskImpl)taskImpl;
receiveTaskImpl.setMessageRef(new MessageImpl(msgName));
}
- else if (taskImpl instanceof SendTaskImpl)
+ else if (taskImpl instanceof UserTaskImpl)
{
- SendTaskImpl sendTaskImpl = (SendTaskImpl)taskImpl;
- sendTaskImpl.setMessageRef(new MessageImpl(msgName));
+ UserTaskImpl userTaskImpl = (UserTaskImpl)taskImpl;
+ userTaskImpl.setInMessageRef(new MessageImpl(msgName));
}
else
{
- throw new IllegalStateException("Cannot set a message ref on task: " + taskImpl);
+ throw new IllegalStateException("Cannot set incomming message ref on task: " + taskImpl);
}
return this;
}
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/AssignmentInterceptor.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/AssignmentInterceptor.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/AssignmentInterceptor.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -0,0 +1,74 @@
+/*
+ * 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.ri.runtime;
+
+//$Id$
+
+import org.jbpm.api.model.Assignment;
+import org.jbpm.api.model.Expression;
+import org.jbpm.api.model.Node;
+import org.jbpm.api.model.Assignment.AssignTime;
+import org.jbpm.api.runtime.ExecutionContext;
+import org.jbpm.api.runtime.Token;
+
+/**
+ * An interceptor that invokes the ExecutionHandler.execute
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 07-Oct-2008
+ */
+public class AssignmentInterceptor implements NodeInterceptor
+{
+ @Override
+ public void execute(RuntimeContext rtContext)
+ {
+ Node node = rtContext.getNode();
+ Token token = rtContext.getToken();
+
+ // Do start time assignments
+ for (Assignment ass : node.getAssignments())
+ {
+ if (ass.getAssignTime() == AssignTime.Start)
+ anyTimeAssignment(ass, token);
+ }
+
+ // Call the next Interceptor
+ rtContext.next();
+
+ // Do end time assignments
+ for (Assignment ass : node.getAssignments())
+ {
+ if (ass.getAssignTime() == AssignTime.End)
+ anyTimeAssignment(ass, token);
+ }
+ }
+
+ protected void anyTimeAssignment(Assignment ass, Token token)
+ {
+ Expression expr = ass.getFrom();
+ ExpressionEvaluator exprEvaluator = new ExpressionEvaluator(expr);
+ Object result = exprEvaluator.evaluateExpression(token);
+ String propName = ass.getTo().getName();
+ ExecutionContext exContext = token.getExecutionContext();
+ exContext.addAttachment(propName, result);
+ }
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/AssignmentInterceptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/ExitSignalInterceptor.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/ExitSignalInterceptor.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/ExitSignalInterceptor.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.ri.runtime;
+
+//$Id$
+
+import org.jbpm.api.model.Node;
+import org.jbpm.api.runtime.SignalHandler;
+import org.jbpm.api.runtime.Token;
+
+/**
+ * An interceptor that invokes the SignalHandler.throwExitSignal
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 07-Oct-2008
+ */
+public class ExitSignalInterceptor implements NodeInterceptor
+{
+ @Override
+ public void execute(RuntimeContext rtContext)
+ {
+ Node node = rtContext.getNode();
+ Token token = rtContext.getToken();
+
+ SignalHandler sigHandler = node.getSignalHandler();
+ sigHandler.throwExitSignal(token);
+ }
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/ExitSignalInterceptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/FlowHandlerInterceptor.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/FlowHandlerInterceptor.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/FlowHandlerInterceptor.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -0,0 +1,53 @@
+/*
+ * 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.ri.runtime;
+
+//$Id$
+
+import org.jbpm.api.model.Node;
+import org.jbpm.api.runtime.FlowHandler;
+import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.TokenExecutor;
+
+/**
+ * An interceptor that invokes the FlowHandler.execute
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 07-Oct-2008
+ */
+public class FlowHandlerInterceptor implements NodeInterceptor
+{
+ @Override
+ public void execute(RuntimeContext rtContext)
+ {
+ TokenExecutor tokenExecutor = rtContext.getTokenExecutor();
+ Node node = rtContext.getNode();
+ Token token = rtContext.getToken();
+
+ // Call the next Interceptor
+ rtContext.next();
+
+ // Call the FlowHandler
+ FlowHandler flowHandler = node.getFlowHandler();
+ flowHandler.execute(tokenExecutor, token);
+ }
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/FlowHandlerInterceptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/NodeExecuteInterceptor.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/NodeExecuteInterceptor.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/NodeExecuteInterceptor.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.ri.runtime;
+
+//$Id$
+
+import org.jbpm.ri.model.NodeImpl;
+
+/**
+ * An interceptor that invokes the Node.execute
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 07-Oct-2008
+ */
+public class NodeExecuteInterceptor implements NodeInterceptor
+{
+ @Override
+ public void execute(RuntimeContext rtContext)
+ {
+ NodeImpl nodeImpl = (NodeImpl)rtContext.getNode();
+ nodeImpl.execute(rtContext);
+ }
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/NodeExecuteInterceptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/NodeInterceptor.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/NodeInterceptor.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/NodeInterceptor.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.ri.runtime;
+
+//$Id$
+
+/**
+ * A node interceptor
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 07-Oct-2008
+ */
+public interface NodeInterceptor
+{
+ void execute (RuntimeContext rtContext);
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/NodeInterceptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/RunnableToken.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/RunnableToken.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/RunnableToken.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -0,0 +1,140 @@
+/*
+ * 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.ri.runtime;
+
+import org.jbpm.api.model.Node;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.model.Process.ProcessStatus;
+import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.runtime.Token.TokenStatus;
+import org.jbpm.ri.model.ProcessImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The runnable Token
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+class RunnableToken implements Runnable
+{
+ // provide logging
+ final static Logger log = LoggerFactory.getLogger(RunnableToken.class);
+
+ private RuntimeProcess rtProc;
+ private TokenExecutor tokenExecutor;
+ private MutableToken token;
+ private boolean releaseThread;
+
+ public RunnableToken(TokenExecutorImpl tokenExecutorImpl, RuntimeProcess rtProc, MutableToken token)
+ {
+ this.tokenExecutor = rtProc.getTokenExecutor();
+ this.rtProc = rtProc;
+ this.token = token;
+ }
+
+ public Token getToken()
+ {
+ return token;
+ }
+
+ void releaseThread()
+ {
+ releaseThread = true;
+ }
+
+ public void run()
+ {
+ Process proc = rtProc.getProcess();
+ try
+ {
+ SequenceFlow flow = token.getFlow();
+ if (flow == null)
+ throw new IllegalStateException("Cannot obtain initial flow");
+
+ while (continueTokenThread())
+ {
+ // Get the target node
+ Node node = token.getFlow().getTargetRef();
+
+ // Synchronize on the target Node
+ synchronized (node)
+ {
+ // Create a Token that includes node properties
+ DelegatingToken tokCopy = new DelegatingToken(token);
+ RuntimeContext rtContext = new RuntimeContext(tokenExecutor, tokCopy);
+ rtContext.addInterceptor(new SignalHandlerInterceptor());
+ rtContext.addInterceptor(new FlowHandlerInterceptor());
+ rtContext.addInterceptor(new AssignmentInterceptor());
+ rtContext.addInterceptor(new NodeExecuteInterceptor());
+
+ // Call the interceptor chain
+ rtContext.next();
+ }
+ }
+ }
+ catch (RuntimeException rte)
+ {
+ log.error("Process aborted: " + proc, rte);
+ ((ProcessImpl)proc).setRuntimeException(rte);
+
+ log.debug("Terminate all suspended tokens");
+ for (Token auxToken : tokenExecutor.getRunnableTokens())
+ {
+ if (auxToken.getTokenStatus() == TokenStatus.Suspended)
+ tokenExecutor.destroy(auxToken);
+ }
+
+ // Destroy this token
+ tokenExecutor.destroy(token);
+ }
+ finally
+ {
+ // Notify Process on token termination
+ notifyRuntimeProcess();
+ }
+ }
+
+ private boolean continueTokenThread()
+ {
+ TokenStatus tokStatus = token.getTokenStatus();
+ ProcessStatus procStatus = rtProc.getProcess().getProcessStatus();
+ return releaseThread == false && procStatus == ProcessStatus.Active && tokStatus == TokenStatus.Started;
+ }
+
+ private void notifyRuntimeProcess()
+ {
+ synchronized (rtProc)
+ {
+ rtProc.notifyAll();
+ }
+ }
+
+ @Override
+ public String toString()
+ {
+ return token.toString();
+ }
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/RunnableToken.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/RuntimeContext.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/RuntimeContext.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/RuntimeContext.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -0,0 +1,81 @@
+/*
+ * 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.ri.runtime;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jbpm.api.model.Node;
+import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.TokenExecutor;
+
+/**
+ * A runtime context that passes through a chain of interceptors.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 07-Oct-2008
+ */
+public class RuntimeContext
+{
+ List<NodeInterceptor> interceptors = new ArrayList<NodeInterceptor>();
+ int itorIndex;
+
+ TokenExecutor tokenExecutor;
+ MutableToken token;
+
+ public RuntimeContext(TokenExecutor tokenExecutor, MutableToken token)
+ {
+ this.tokenExecutor = tokenExecutor;
+ this.token = token;
+ }
+
+ public TokenExecutor getTokenExecutor()
+ {
+ return tokenExecutor;
+ }
+
+ public Node getNode()
+ {
+ return token.getFlow().getTargetRef();
+ }
+
+ public Token getToken()
+ {
+ return token;
+ }
+
+ void addInterceptor(NodeInterceptor itor)
+ {
+ interceptors.add(itor);
+ }
+
+ protected void next()
+ {
+ if (itorIndex < interceptors.size())
+ {
+ NodeInterceptor itor = interceptors.get(itorIndex++);
+ itor.execute(this);
+ }
+ }
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/RuntimeContext.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/SignalHandlerInterceptor.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/SignalHandlerInterceptor.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/SignalHandlerInterceptor.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -0,0 +1,58 @@
+/*
+ * 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.ri.runtime;
+
+//$Id$
+
+import org.jbpm.api.model.Node;
+import org.jbpm.api.runtime.SignalHandler;
+import org.jbpm.api.runtime.Token;
+
+/**
+ * An interceptor that invokes the SignalHandler.throwEnterSignal
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 07-Oct-2008
+ */
+public class SignalHandlerInterceptor implements NodeInterceptor
+{
+ @Override
+ public void execute(RuntimeContext rtContext)
+ {
+ Node node = rtContext.getNode();
+ Token token = rtContext.getToken();
+
+ try
+ {
+ SignalHandler sigHandler = node.getSignalHandler();
+ sigHandler.throwEnterSignal(token);
+
+ // Call the next Interceptor
+ rtContext.next();
+ }
+ finally
+ {
+ SignalHandler sigHandler = node.getSignalHandler();
+ sigHandler.throwExitSignal(token);
+ }
+ }
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/SignalHandlerInterceptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -31,21 +31,12 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
-import org.jbpm.api.model.Assignment;
-import org.jbpm.api.model.Expression;
-import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.model.Assignment.AssignTime;
import org.jbpm.api.model.Process.ProcessStatus;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.ExecutionHandler;
import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.SignalHandler;
import org.jbpm.api.runtime.Token;
import org.jbpm.api.runtime.TokenExecutor;
import org.jbpm.api.runtime.Token.TokenStatus;
-import org.jbpm.ri.model.ProcessImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -63,7 +54,7 @@
private RuntimeProcess rtProc;
private ExecutorService executor = Executors.newCachedThreadPool();
- private Map<String, RunnableToken> runnableTokens = new HashMap<String, RunnableToken>();
+ Map<String, RunnableToken> runnableTokens = new HashMap<String, RunnableToken>();
public TokenExecutorImpl(RuntimeProcess rtProc)
{
@@ -100,7 +91,7 @@
log.debug("Create Token: " + token);
- RunnableToken rtToken = new RunnableToken(rtProc, mutableToken);
+ RunnableToken rtToken = new RunnableToken(this, rtProc, mutableToken);
runnableTokens.put(token.getTokenID(), rtToken);
}
}
@@ -113,7 +104,7 @@
if (procStatus != ProcessStatus.Ready && procStatus != ProcessStatus.Active)
throw new IllegalStateException("Cannot start token to process in state: " + procStatus);
- log.debug("Sart Token: " + token);
+ log.debug("Start Token: " + token);
MutableToken mutableToken = (MutableToken)token;
mutableToken.setTokenStatus(TokenStatus.Started);
@@ -129,6 +120,9 @@
if (flow == null)
throw new IllegalArgumentException("Flow cannot be null");
+ if (token.getTokenStatus() != TokenStatus.Started)
+ throw new IllegalStateException("Cannot move token in state: " + token.getTokenStatus());
+
MutableToken mutableToken = (MutableToken)token;
mutableToken.setFlow(flow);
}
@@ -159,9 +153,17 @@
{
synchronized (runnableTokens)
{
+ RunnableToken rtToken = runnableTokens.get(token.getTokenID());
+ if (rtToken == null)
+ throw new IllegalStateException("Not a runnable token: " + token);
+
log.debug("Suspend Token: " + token);
MutableToken mutableToken = (MutableToken)token;
mutableToken.setTokenStatus(TokenStatus.Suspended);
+
+ // Release the thread for a suspended token
+ rtToken.releaseThread();
+
return token.getTokenID();
}
}
@@ -182,170 +184,11 @@
MutableToken mutableToken = (MutableToken)token;
mutableToken.setTokenStatus(TokenStatus.Started);
+ rtToken = new RunnableToken(this, rtProc, mutableToken);
+ runnableTokens.put(token.getTokenID(), rtToken);
executor.submit(rtToken);
+
return token;
}
}
-
- /****************************************************
- * The runnable Token
- */
- class RunnableToken implements Runnable
- {
- private RuntimeProcess rtProc;
- private TokenExecutor tokenExecutor;
- private MutableToken token;
-
- public RunnableToken(RuntimeProcess rtProc, MutableToken token)
- {
- this.tokenExecutor = rtProc.getTokenExecutor();
- this.rtProc = rtProc;
- this.token = token;
- }
-
- public Token getToken()
- {
- return token;
- }
-
- public void run()
- {
- Process proc = rtProc.getProcess();
- try
- {
- SequenceFlow flow = token.getFlow();
- if (flow == null)
- throw new IllegalStateException("Cannot obtain initial flow");
-
- TokenStatus tokStatus = token.getTokenStatus();
- ProcessStatus procStatus = proc.getProcessStatus();
- while (procStatus == ProcessStatus.Active && tokStatus == TokenStatus.Started)
- {
- // Get the target and its handlers
- Node node = token.getFlow().getTargetRef();
- SignalHandler sigHandler = getSignalHandler(node);
- ExecutionHandler execHandler = getExecutionHandler(node);
- FlowHandler flowHandler = getFlowHandler(node);
-
- // Synchronize execution on the target Node
- synchronized (node)
- {
- // Create a Token that includes properties from the current Activity
- DelegatingToken tokCopy = new DelegatingToken(token);
-
- // Throw the Enter Signal
- sigHandler.throwEnterSignal(tokCopy);
-
- // Process the start time assignments
- startTimeAssignments(node, tokCopy);
-
- // Execute the target Node
- execHandler.execute(tokCopy);
-
- // Process the end time assignments
- endTimeAssignments(node, tokCopy);
-
- // Transfer the token to the FlowHandler
- flowHandler.execute(tokenExecutor, tokCopy);
-
- // Throw the Exit Signal
- sigHandler.throwExitSignal(tokCopy);
-
- tokStatus = token.getTokenStatus();
- procStatus = proc.getProcessStatus();
- }
- }
-
- // Notify Process on token termination
- terminateToken(proc);
- }
- catch (RuntimeException rte)
- {
- log.error("Process aborted: " + proc, rte);
- ((ProcessImpl)proc).setRuntimeException(rte);
-
- log.debug("Terminate all suspended tokens");
- Set<String> keySet = new HashSet<String>(runnableTokens.keySet());
- for (String tokID : keySet)
- {
- RunnableToken rtTok = runnableTokens.get(tokID);
- Token auxToken = rtTok.getToken();
- if (auxToken.getTokenStatus() == TokenStatus.Suspended)
- tokenExecutor.destroy(auxToken);
- }
-
- // Notify Process on token termination
- terminateToken(proc);
- }
- }
-
- private void terminateToken(Process proc)
- {
- // Destroy the token if not already done
- synchronized (runnableTokens)
- {
- TokenStatus status = token.getTokenStatus();
- if (status != TokenStatus.Suspended && status != TokenStatus.Destroyed)
- tokenExecutor.destroy(token);
- }
-
- // Notify the runtime process
- synchronized (rtProc)
- {
- rtProc.notifyAll();
- }
- }
-
- private void startTimeAssignments(Node node, Token token)
- {
- for (Assignment ass : node.getAssignments())
- {
- if (ass.getAssignTime() == AssignTime.Start)
- anyTimeAssignment(ass, token);
- }
- }
-
- private void endTimeAssignments(Node node, Token token)
- {
- for (Assignment ass : node.getAssignments())
- {
- if (ass.getAssignTime() == AssignTime.End)
- anyTimeAssignment(ass, token);
- }
- }
-
- private void anyTimeAssignment(Assignment ass, Token token)
- {
- Expression expr = ass.getFrom();
- ExpressionEvaluator exprEvaluator = new ExpressionEvaluator(expr);
- Object result = exprEvaluator.evaluateExpression(token);
- String propName = ass.getTo().getName();
- ExecutionContext exContext = token.getExecutionContext();
- exContext.addAttachment(propName, result);
- }
-
- private SignalHandler getSignalHandler(Node target)
- {
- SignalHandler customHandler = target.getSignalHandler(false);
- return customHandler != null ? customHandler : target.getSignalHandler(true);
- }
-
- private ExecutionHandler getExecutionHandler(Node target)
- {
- ExecutionHandler customHandler = target.getExecutionHandler(false);
- return customHandler != null ? customHandler : target.getExecutionHandler(true);
- }
-
- private FlowHandler getFlowHandler(Node target)
- {
- FlowHandler customHandler = target.getFlowHandler(false);
- return customHandler != null ? customHandler : target.getFlowHandler(true);
- }
-
- @Override
- public String toString()
- {
- return token.toString();
- }
- }
}
\ No newline at end of file
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/HibernatePersistenceServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/HibernatePersistenceServiceImpl.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/HibernatePersistenceServiceImpl.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -0,0 +1,239 @@
+/*
+ * 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.ri.service;
+
+// $Id$
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.management.ObjectName;
+
+import org.hibernate.Hibernate;
+import org.hibernate.ObjectNotFoundException;
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.hibernate.cfg.AnnotationConfiguration;
+import org.hibernate.classic.Session;
+import org.jbpm.api.ProcessNotFoundException;
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.service.PersistenceService;
+import org.jbpm.api.service.Service;
+import org.jbpm.ri.model.ProcessDefinitionImpl;
+import org.jbpm.ri.model.ProcessImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A Hibernate based persistence service.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 17-Sep-2008
+ */
+public class HibernatePersistenceServiceImpl extends PersistenceService implements MutableService
+{
+ // Provide logging
+ final Logger log = LoggerFactory.getLogger(HibernatePersistenceServiceImpl.class);
+
+ private String hibernateConfig;
+ private SessionFactory sessionFactory;
+ private Set<String> annotatedClasses = new HashSet<String>();
+
+ @Override
+ public void setProcessEngine(ProcessEngine engine)
+ {
+ super.setProcessEngine(engine);
+ }
+
+ public void setHibernateConfig(String hibernateConfig)
+ {
+ this.hibernateConfig = hibernateConfig;
+ }
+
+ public void setAnnotatedClasses(Set<String> annotatedClasses)
+ {
+ this.annotatedClasses = annotatedClasses;
+ }
+
+ @Override
+ public ObjectName saveProcessDefinition(ProcessDefinition procDef)
+ {
+ log.debug("START saveProcessDefinition: " + procDef.getKey());
+ Session session = getSessionFactory().openSession();
+ Transaction tx = session.beginTransaction();
+ try
+ {
+ session.saveOrUpdate(procDef);
+ tx.commit();
+ }
+ finally
+ {
+ session.close();
+ }
+ log.debug("END saveProcessDefinition: " + procDef.getKey());
+ return procDef.getKey();
+ }
+
+ @Override
+ public ProcessDefinition loadProcessDefinition(ObjectName procDefID)
+ {
+ log.debug("START loadProcessDefinition: " + procDefID);
+ ProcessDefinitionImpl procDefImpl = null;
+ Session session = getSessionFactory().openSession();
+ try
+ {
+ Integer id = Integer.valueOf(procDefID.getKeyProperty("id"));
+ procDefImpl = (ProcessDefinitionImpl)session.load(ProcessDefinitionImpl.class, id);
+ Hibernate.initialize(procDefImpl);
+ }
+ catch (ObjectNotFoundException ex)
+ {
+ throw new ProcessNotFoundException("Cannot find process: " + procDefID);
+ }
+ finally
+ {
+ session.close();
+ }
+ log.debug("END loadProcessDefinition: " + procDefID);
+ return (ProcessDefinition)procDefImpl;
+ }
+
+ @Override
+ public void deleteProcessDefinition(ProcessDefinition procDef)
+ {
+ log.debug("START deleteProcessDefinition: " + procDef);
+ Session session = getSessionFactory().openSession();
+ Transaction tx = session.beginTransaction();
+ try
+ {
+ session.delete(procDef);
+ tx.commit();
+ }
+ finally
+ {
+ session.close();
+ }
+ log.debug("END deleteProcessDefinition: " + procDef);
+ }
+
+ @Override
+ public ObjectName saveProcess(Process proc)
+ {
+ log.debug("START saveProcess: " + proc.getKey());
+ Session session = getSessionFactory().openSession();
+ Transaction tx = session.beginTransaction();
+ try
+ {
+ session.saveOrUpdate(proc);
+ tx.commit();
+ }
+ finally
+ {
+ session.close();
+ }
+ log.debug("END saveProcess: " + proc.getKey());
+ return proc.getKey();
+ }
+
+ @Override
+ public Process loadProcess(ObjectName procID)
+ {
+ log.debug("START loadProcess: " + procID);
+ ProcessImpl procImpl = null;
+ Session session = getSessionFactory().openSession();
+ try
+ {
+ Integer id = Integer.valueOf(procID.getKeyProperty("id"));
+ procImpl = (ProcessImpl)session.load(ProcessImpl.class, id);
+ Hibernate.initialize(procImpl);
+ }
+ catch (ObjectNotFoundException ex)
+ {
+ throw new ProcessNotFoundException("Cannot find process: " + procID);
+ }
+ finally
+ {
+ session.close();
+ }
+ log.debug("END loadProcess: " + procID);
+ return (Process)procImpl;
+ }
+
+ @Override
+ public void deleteProcess(Process proc)
+ {
+ log.debug("START deleteProcess: " + proc);
+ Session session = getSessionFactory().openSession();
+ Transaction tx = session.beginTransaction();
+ try
+ {
+ session.delete(proc);
+ tx.commit();
+ }
+ finally
+ {
+ session.close();
+ }
+ log.debug("END deleteProcess: " + proc);
+ }
+
+ @SuppressWarnings("unchecked")
+ private SessionFactory getSessionFactory()
+ {
+ // If this property is not explicitly set in the beans config
+ // fall back to the -Ddatabase property that also activates
+ // the corresponding mvn profiles
+ if (hibernateConfig == null)
+ {
+ String database = System.getProperty("database", "mysql");
+ hibernateConfig = "hibernate.cfg." + database + ".xml";
+ }
+
+ if (sessionFactory == null)
+ {
+ AnnotationConfiguration anConfig = new AnnotationConfiguration();
+
+ String serviceName = null;
+ try
+ {
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ Iterator<String> itAnn = annotatedClasses.iterator();
+ while (itAnn.hasNext())
+ {
+ serviceName = itAnn.next();
+ Class<Service> serviceClass = (Class<Service>)ctxLoader.loadClass(serviceName);
+ anConfig.addAnnotatedClass(serviceClass);
+ }
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Cannot load service: " + serviceName, ex);
+ }
+
+ sessionFactory = anConfig.configure(hibernateConfig).buildSessionFactory();
+ }
+ return sessionFactory;
+ }
+}
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/HibernatePersistenceServiceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/InMemoryPersistenceServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/InMemoryPersistenceServiceImpl.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/InMemoryPersistenceServiceImpl.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -0,0 +1,126 @@
+/*
+ * 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.ri.service;
+
+// $Id$
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.ProcessNotFoundException;
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.service.PersistenceService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * An in-memory persistence service.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 17-Sep-2008
+ */
+public class InMemoryPersistenceServiceImpl extends PersistenceService implements MutableService
+{
+ // Provide logging
+ final Logger log = LoggerFactory.getLogger(InMemoryPersistenceServiceImpl.class);
+
+ private Map<ObjectName, ProcessDefinition> procDefs = new HashMap<ObjectName, ProcessDefinition>();
+ private Map<ObjectName, Process> procs = new HashMap<ObjectName, Process>();
+
+ @Override
+ public void setProcessEngine(ProcessEngine engine)
+ {
+ super.setProcessEngine(engine);
+ }
+
+ @Override
+ public ObjectName saveProcessDefinition(ProcessDefinition procDef)
+ {
+ log.debug("START saveProcessDefinition: " + procDef.getKey());
+
+ procDefs.put(procDef.getKey(), procDef);
+
+ log.debug("END saveProcessDefinition: " + procDef.getKey());
+ return procDef.getKey();
+ }
+
+ @Override
+ public ProcessDefinition loadProcessDefinition(ObjectName procDefID)
+ {
+ log.debug("START loadProcessDefinition: " + procDefID);
+
+ ProcessDefinition procDef = procDefs.get(procDefID);
+ if (procDef == null)
+ throw new ProcessNotFoundException("Cannot find process: " + procDefID);
+
+ log.debug("END loadProcessDefinition: " + procDefID);
+ return procDef;
+ }
+
+ @Override
+ public void deleteProcessDefinition(ProcessDefinition procDef)
+ {
+ log.debug("START deleteProcessDefinition: " + procDef);
+
+ procDefs.remove(procDef.getKey());
+
+ log.debug("END deleteProcessDefinition: " + procDef);
+ }
+
+ @Override
+ public ObjectName saveProcess(Process proc)
+ {
+ log.debug("START saveProcess: " + proc.getKey());
+
+ procs.put(proc.getKey(), proc);
+
+ log.debug("END saveProcess: " + proc.getKey());
+ return proc.getKey();
+ }
+
+ @Override
+ public Process loadProcess(ObjectName procID)
+ {
+ log.debug("START loadProcess: " + procID);
+
+ Process proc = procs.get(procID);
+ if (proc == null)
+ throw new ProcessNotFoundException("Cannot find process: " + procID);
+
+ log.debug("END loadProcess: " + procID);
+ return proc;
+ }
+
+ @Override
+ public void deleteProcess(Process proc)
+ {
+ log.debug("START deleteProcess: " + proc);
+
+ procs.remove(proc.getKey());
+
+ log.debug("END deleteProcess: " + proc);
+ }
+}
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/InMemoryPersistenceServiceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/MessageBuilderServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/MessageBuilderServiceImpl.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/MessageBuilderServiceImpl.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -26,7 +26,7 @@
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Message;
import org.jbpm.api.model.builder.MessageBuilder;
-import org.jbpm.api.model.builder.MessageBuilderService;
+import org.jbpm.api.service.MessageBuilderService;
import org.jbpm.ri.model.builder.MessageBuilderImpl;
/**
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessBuilderServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessBuilderServiceImpl.java 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessBuilderServiceImpl.java 2008-10-08 09:18:41 UTC (rev 2502)
@@ -26,7 +26,7 @@
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Process;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.ri.model.builder.ProcessBuilderImpl;
/**
Modified: projects/spec/trunk/modules/impl/src/main/resources/jbpm-cfg-beans.xml
===================================================================
--- projects/spec/trunk/modules/impl/src/main/resources/jbpm-cfg-beans.xml 2008-10-07 15:00:18 UTC (rev 2501)
+++ projects/spec/trunk/modules/impl/src/main/resources/jbpm-cfg-beans.xml 2008-10-08 09:18:41 UTC (rev 2502)
@@ -21,6 +21,8 @@
</bean>
<!-- The PersistenceService -->
+ <bean name="jBPMPersistenceService" class="org.jbpm.ri.service.InMemoryPersistenceServiceImpl"/>
+ <!--
<bean name="jBPMPersistenceService" class="org.jbpm.ri.service.PersistenceServiceImpl">
<property name="annotatedClasses">
<set elementClass="java.lang.String">
@@ -44,9 +46,11 @@
<value>org.jbpm.ri.model.StartEventImpl</value>
<value>org.jbpm.ri.model.StructureDelegateImpl</value>
<value>org.jbpm.ri.model.TaskImpl</value>
+ <value>org.jbpm.ri.model.UserTaskImpl</value>
</set>
</property>
</bean>
+ -->
<!-- Other Services -->
<bean name="jBPMExecutionService" class="org.jbpm.ri.service.ExecutionServiceImpl" />
17 years, 6 months
JBoss JBPM SVN: r2501 - in jbpm3/trunk/modules/core/src: test/java/org/jbpm/jpdl/par and 1 other directory.
by do-not-reply@jboss.org
Author: camunda
Date: 2008-10-07 11:00:18 -0400 (Tue, 07 Oct 2008)
New Revision: 2501
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/instantiation/ProcessClassLoader.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessArchiveDeploymentDbTest.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ResourceAction.java
Log:
JBPM-1404
added verification of package information in classes from par to test case
(see https://jira.jboss.org/jira/browse/JBPM-1404)
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/instantiation/ProcessClassLoader.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/instantiation/ProcessClassLoader.java 2008-10-07 14:20:14 UTC (rev 2500)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/instantiation/ProcessClassLoader.java 2008-10-07 15:00:18 UTC (rev 2501)
@@ -112,6 +112,18 @@
} catch (JbpmException e) {
clazz = null;
}
+
+ // Add the package information
+ // see https://jira.jboss.org/jira/browse/JBPM-1404
+ // not necessary! Test passes without it?
+// final int packageIndex = name.lastIndexOf('.');
+// if (packageIndex != -1) {
+// final String packageName = name.substring(0, packageIndex);
+// final Package classPackage = getPackage(packageName);
+// if (classPackage == null) {
+// definePackage(packageName, null, null, null, null, null, null, null);
+// }
+// }
}
if (clazz==null) {
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessArchiveDeploymentDbTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessArchiveDeploymentDbTest.java 2008-10-07 14:20:14 UTC (rev 2500)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessArchiveDeploymentDbTest.java 2008-10-07 15:00:18 UTC (rev 2501)
@@ -158,6 +158,8 @@
public static InputStream unexistingArchiveResourceStream = null;
public static InputStream unexistingArchiveLoaderResourceStream = null;
+ public static Object resourceActionInstance = null;
+
public void testExecuteResourceUsingProcess() throws Exception
{
// create a process archive file and save it to disk
@@ -205,6 +207,8 @@
unexistingClassLoaderResourceStream = null;
unexistingArchiveResourceStream = null;
unexistingArchiveLoaderResourceStream = null;
+
+ resourceActionInstance = null;
processInstance.signal();
}
@@ -234,6 +238,11 @@
assertNull(unexistingClassLoaderResourceStream);
assertNull(unexistingArchiveResourceStream);
assertNull(unexistingArchiveLoaderResourceStream);
+
+ // test if package information are set correctly
+ // see https://jira.jboss.org/jira/browse/JBPM-1404
+ assertEquals("org.jbpm.jpdl.par", resourceActionInstance.getClass().getPackage().getName());
+ resourceActionInstance = null;
}
private static void addEntry(ZipOutputStream zipOutputStream, String entryName, String resource) throws IOException
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ResourceAction.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ResourceAction.java 2008-10-07 14:20:14 UTC (rev 2500)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ResourceAction.java 2008-10-07 15:00:18 UTC (rev 2501)
@@ -15,6 +15,9 @@
public void execute(ExecutionContext executionContext) throws Exception
{
+ // remember action class instance
+ ProcessArchiveDeploymentDbTest.resourceActionInstance = this;
+
// class resources
URL resource = getClass().getResource("classresource.txt");
17 years, 6 months