JBoss JBPM SVN: r3334 - jbpm3/trunk/modules/core/src/main/java/org/jbpm/util.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-12-11 06:38:23 -0500 (Thu, 11 Dec 2008)
New Revision: 3334
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/ClassLoaderUtil.java
Log:
[JBPM-1765] Unclosed InputStream in org.jbpm.util.ClassLoaderUtil.getProperties
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/ClassLoaderUtil.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/ClassLoaderUtil.java 2008-12-11 11:32:22 UTC (rev 3333)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/ClassLoaderUtil.java 2008-12-11 11:38:23 UTC (rev 3334)
@@ -34,107 +34,126 @@
/**
* provides centralized classloader lookup.
*/
-public class ClassLoaderUtil {
+public class ClassLoaderUtil
+{
- private ClassLoaderUtil() {
+ private ClassLoaderUtil()
+ {
// hide default constructor to prevent instantiation
}
- public static Class loadClass(String className) {
- try {
+ public static Class loadClass(String className)
+ {
+ try
+ {
return getClassLoader().loadClass(className);
- } catch (ClassNotFoundException e) {
- throw new JbpmException("class not found '"+className+"'", e);
}
+ catch (ClassNotFoundException e)
+ {
+ throw new JbpmException("class not found '" + className + "'", e);
+ }
}
-
- /**
- * returns the {@link ClassLoader} which is used in jbpm.
- * Can be configured in jbpm.cfg.xml by the property
- * <b>'jbpm.classloader'</b>
- *
- * <td>
- * <li>'jbpm': (default value) uses the {@link ClassLoaderUtil}.class.getClassLoader()
- * {@link ClassLoader}. This was the only behavior available before <a href="https://jira.jboss.org/jira/browse/JBPM-1148">JBPM-1148</a>.</li>
- *
- * <li>'context': uses the Thread.currentThread().getContextClassLoader().</li>
- *
- * <li>'custom': means that a ClassLoader class has to be provided in the property
- * <b>'jbpm.classloader.classname'</b></li>
- * </td>
+
+ /*
+ * returns the {@link ClassLoader} which is used in jbpm. Can be configured in jbpm.cfg.xml by the property <b>'jbpm.classloader'</b> <td> <li>'jbpm': (default value)
+ * uses the {@link ClassLoaderUtil}.class.getClassLoader() {@link ClassLoader}. This was the only behavior available before <a
+ * href="https://jira.jboss.org/jira/browse/JBPM-1148">JBPM-1148</a>.</li> <li>'context': uses the Thread.currentThread().getContextClassLoader().</li> <li>'custom':
+ * means that a ClassLoader class has to be provided in the property <b>'jbpm.classloader.classname'</b></li> </td>
*/
- public static ClassLoader getClassLoader() {
- if (JbpmConfiguration.Configs.hasObject("jbpm.classLoader")) {
+ public static ClassLoader getClassLoader()
+ {
+ if (JbpmConfiguration.Configs.hasObject("jbpm.classLoader"))
+ {
String jbpmClassloader = JbpmConfiguration.Configs.getString("jbpm.classLoader");
- if (jbpmClassloader.equals("jbpm")) {
+ if (jbpmClassloader.equals("jbpm"))
+ {
return ClassLoaderUtil.class.getClassLoader();
- } else if (jbpmClassloader.equals("context")) {
+ }
+ else if (jbpmClassloader.equals("context"))
+ {
return Thread.currentThread().getContextClassLoader();
- } else if (jbpmClassloader.equals("custom")) {
+ }
+ else if (jbpmClassloader.equals("custom"))
+ {
String jbpmClassloaderClassname = null;
- try {
- if (!JbpmConfiguration.Configs.hasObject("jbpm.customClassLoader.className")) {
+ try
+ {
+ if (!JbpmConfiguration.Configs.hasObject("jbpm.customClassLoader.className"))
+ {
throw new JbpmException("'jbpm.classloader' property set to 'custom' but 'jbpm.customClassLoader.className' is empty!");
}
jbpmClassloaderClassname = JbpmConfiguration.Configs.getString("jbpm.customClassLoader.className");
- if (jbpmClassloaderClassname == null) {
+ if (jbpmClassloaderClassname == null)
+ {
throw new JbpmException("'jbpm.classloader' property set to 'custom' but 'jbpm.customClassLoader.className' is empty!");
}
-
+
Class clazz = ClassLoaderUtil.class.getClassLoader().loadClass(jbpmClassloaderClassname);
- if (clazz==null)
+ if (clazz == null)
clazz = Thread.currentThread().getContextClassLoader().loadClass(jbpmClassloaderClassname);
-
- return (ClassLoader) clazz.newInstance();
- } catch (InstantiationException e) {
+
+ return (ClassLoader)clazz.newInstance();
+ }
+ catch (InstantiationException e)
+ {
throw new JbpmException("Error instantiating custom classloader " + jbpmClassloaderClassname, e);
- } catch (IllegalAccessException e) {
+ }
+ catch (IllegalAccessException e)
+ {
throw new JbpmException("Error accessing custom classloader " + jbpmClassloaderClassname, e);
- } catch (ClassNotFoundException e) {
+ }
+ catch (ClassNotFoundException e)
+ {
throw new JbpmException("Custom classloader " + jbpmClassloaderClassname + " not found ", e);
}
- } else {
+ }
+ else
+ {
throw new JbpmException("'jbpm.classloader' property set to '" + jbpmClassloader + "' but only the values 'jbpm'/'context'/'custom' are supported!");
}
- } else {
- // default behavior like before https://jira.jboss.org/jira/browse/JBPM-1148
+ }
+ else
+ {
+ // default behavior like before https://jira.jboss.org/jira/browse/JBPM-1148
return ClassLoaderUtil.class.getClassLoader();
}
}
-
- public static InputStream getStream(String resource) {
- return getClassLoader().getResourceAsStream(resource);
+
+ public static InputStream getStream(String resource)
+ {
+ return getClassLoader().getResourceAsStream(resource);
}
-
- /**
- * Load jbpm configuration related resources as stream (normally jbpm.cfg.xml).
- *
- * This method first tries to load the resource from the {@link ClassLoaderUtil}
- * class loader, if not found it tries the context class loader.
- *
- * If this doesn't return any ressource the call is delegated to the class
- * loader configured by calling getClassLoader().
- *
- * This is a special method because the class loader which has to be used
- * for loading the jbpm.cfg.xml cannot be configured in the jbpm.cfg.xml
- * itself.
+
+ /*
+ * Load jbpm configuration related resources as stream (normally jbpm.cfg.xml). This method first tries to load the resource from the {@link ClassLoaderUtil} class
+ * loader, if not found it tries the context class loader. If this doesn't return any ressource the call is delegated to the class loader configured by calling
+ * getClassLoader(). This is a special method because the class loader which has to be used for loading the jbpm.cfg.xml cannot be configured in the jbpm.cfg.xml
+ * itself.
*/
- public static InputStream getJbpmConfigurationStream(String resource) {
+ public static InputStream getJbpmConfigurationStream(String resource)
+ {
InputStream jbpmCfgStream = ClassLoaderUtil.class.getClassLoader().getResourceAsStream(resource);
- if (jbpmCfgStream==null) {
+ if (jbpmCfgStream == null)
+ {
jbpmCfgStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
}
return jbpmCfgStream;
}
-
- public static Properties getProperties(String resource) {
+
+ public static Properties getProperties(String resource)
+ {
Properties properties = new Properties();
- try {
- properties.load(getStream(resource));
- } catch (IOException e) {
- throw new JbpmException("couldn't load properties file '"+resource+"'", e);
+ try
+ {
+ InputStream inStream = getStream(resource);
+ properties.load(inStream);
+ inStream.close();
}
+ catch (IOException e)
+ {
+ throw new JbpmException("couldn't load properties file '" + resource + "'", e);
+ }
return properties;
}
}
17 years, 4 months
JBoss JBPM SVN: r3333 - in projects/gwt-console/trunk: 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-12-11 06:32:22 -0500 (Thu, 11 Dec 2008)
New Revision: 3333
Added:
projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/TaskManagementTest.java
Modified:
projects/gwt-console/trunk/gwt-parent.iml
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TaskRef.java
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/jbpm3/TokenReference.java
projects/gwt-console/trunk/server/gwt-server.iml
projects/gwt-console/trunk/server/src/main/resources/SampleProcess.par
projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/BaseTC.java
projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/ProcessManagementTest.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/URLBuilder.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java
Log:
Improve test coverage
Modified: projects/gwt-console/trunk/gwt-parent.iml
===================================================================
--- projects/gwt-console/trunk/gwt-parent.iml 2008-12-11 11:30:20 UTC (rev 3332)
+++ projects/gwt-console/trunk/gwt-parent.iml 2008-12-11 11:32:22 UTC (rev 3333)
@@ -649,7 +649,7 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: net.sf.ezmorph:ezmorph:jar:1.0.6:test">
+ <library name="M2 Dep: net.sf.ezmorph:ezmorph:jar:1.0.6:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/net/sf/ezmorph/ezmorph/1.0.6/ezmorph-1.0.6.jar!/" />
</CLASSES>
@@ -658,7 +658,7 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: net.sf.json-lib:json-lib:jar:2.2.3:test">
+ <library name="M2 Dep: net.sf.json-lib:json-lib:jar:2.2.3:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/net/sf/json-lib/json-lib/2.2.3/json-lib-2.2.3.jar!/" />
</CLASSES>
@@ -667,7 +667,7 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-beanutils:commons-beanutils:jar:1.7.0:test">
+ <library name="M2 Dep: commons-beanutils:commons-beanutils:jar:1.7.0:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar!/" />
</CLASSES>
@@ -676,7 +676,7 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-lang:commons-lang:jar:2.4:test">
+ <library name="M2 Dep: commons-lang:commons-lang:jar:2.4:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar!/" />
</CLASSES>
@@ -685,7 +685,7 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: commons-collections:commons-collections:jar:3.2:test">
+ <library name="M2 Dep: commons-collections:commons-collections:jar:3.2:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/commons-collections/commons-collections/3.2/commons-collections-3.2.jar!/" />
</CLASSES>
Modified: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TaskRef.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TaskRef.java 2008-12-11 11:30:20 UTC (rev 3332)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/TaskRef.java 2008-12-11 11:32:22 UTC (rev 3333)
@@ -151,6 +151,21 @@
return transitionNames;
}
+ public void setProcessId(long processId)
+ {
+ this.processId = processId;
+ }
+
+ public void setTransitionNames(List<String> transitionNames)
+ {
+ this.transitionNames = transitionNames;
+ }
+
+ public void setPooledActors(List<String> pooledActors)
+ {
+ this.pooledActors = pooledActors;
+ }
+
public void addPooledActor(String actorId)
{
pooledActors.add(actorId);
Modified: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/jbpm3/TokenReference.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/jbpm3/TokenReference.java 2008-12-11 11:30:20 UTC (rev 3332)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/jbpm3/TokenReference.java 2008-12-11 11:32:22 UTC (rev 3333)
@@ -38,7 +38,7 @@
private String currentNodeName;
- private Set<TokenReference> children = new HashSet<TokenReference>();
+ private List<TokenReference> children = new ArrayList<TokenReference>();
private List<String> availableSignals = new ArrayList<String>();
private boolean canBeSignaled = true;
@@ -54,6 +54,31 @@
this.currentNodeName = nodeName;
}
+ public void setId(long id)
+ {
+ this.id = id;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public void setCurrentNodeName(String currentNodeName)
+ {
+ this.currentNodeName = currentNodeName;
+ }
+
+ public void setChildren(List<TokenReference> children)
+ {
+ this.children = children;
+ }
+
+ public void setAvailableSignals(List<String> availableSignals)
+ {
+ this.availableSignals = availableSignals;
+ }
+
public long getId()
{
return id;
@@ -64,7 +89,7 @@
return name;
}
- public Set<TokenReference> getChildren()
+ public List<TokenReference> getChildren()
{
return children;
}
Modified: projects/gwt-console/trunk/server/gwt-server.iml
===================================================================
--- projects/gwt-console/trunk/server/gwt-server.iml 2008-12-11 11:30:20 UTC (rev 3332)
+++ projects/gwt-console/trunk/server/gwt-server.iml 2008-12-11 11:32:22 UTC (rev 3333)
@@ -618,7 +618,7 @@
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: net.sf.ezmorph:ezmorph:jar:1.0.6:test">
+ <library name="M2 Dep: net.sf.ezmorph:ezmorph:jar:1.0.6:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/net/sf/ezmorph/ezmorph/1.0.6/ezmorph-1.0.6.jar!/" />
</CLASSES>
@@ -627,7 +627,7 @@
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: net.sf.json-lib:json-lib:jar:2.2.3:test">
+ <library name="M2 Dep: net.sf.json-lib:json-lib:jar:2.2.3:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/net/sf/json-lib/json-lib/2.2.3/json-lib-2.2.3.jar!/" />
</CLASSES>
@@ -636,7 +636,7 @@
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: commons-beanutils:commons-beanutils:jar:1.7.0:test">
+ <library name="M2 Dep: commons-beanutils:commons-beanutils:jar:1.7.0:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar!/" />
</CLASSES>
@@ -645,7 +645,7 @@
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: commons-lang:commons-lang:jar:2.4:test">
+ <library name="M2 Dep: commons-lang:commons-lang:jar:2.4:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar!/" />
</CLASSES>
@@ -654,7 +654,7 @@
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: commons-collections:commons-collections:jar:3.2:test">
+ <library name="M2 Dep: commons-collections:commons-collections:jar:3.2:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-collections/commons-collections/3.2/commons-collections-3.2.jar!/" />
</CLASSES>
Modified: projects/gwt-console/trunk/server/src/main/resources/SampleProcess.par
===================================================================
(Binary files differ)
Modified: projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/BaseTC.java
===================================================================
--- projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/BaseTC.java 2008-12-11 11:30:20 UTC (rev 3332)
+++ projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/BaseTC.java 2008-12-11 11:32:22 UTC (rev 3333)
@@ -31,6 +31,9 @@
import org.jboss.bpm.console.client.model.jbpm3.*;
import java.io.ByteArrayInputStream;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Iterator;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -46,9 +49,17 @@
protected void setUp() throws Exception
{
super.setUp();
- setupMorphRegistry();
+ setupMorphRegistry();
+ deployTestHarness();
}
+
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+ undeployTestHarness();
+ }
+
protected void deployTestHarness()
throws Exception
{
@@ -87,6 +98,109 @@
Morpher token = new BeanMorpher( TokenReference.class, morpherRegistry);
morpherRegistry.registerMorpher( token );
+ Morpher task = new BeanMorpher( TaskRef.class, morpherRegistry);
+ morpherRegistry.registerMorpher( task );
+
return morpherRegistry;
}
+
+ protected ProcessDefinitionRefWrapper unmarshallProcessDefinitionList(String response)
+ {
+ JSONObject jsonObject = JSONObject.fromObject( response );
+ ProcessDefinitionRefWrapper dto = (ProcessDefinitionRefWrapper)
+ JSONObject.toBean( jsonObject, ProcessDefinitionRefWrapper.class );
+
+ // --
+ List defs = new ArrayList();
+ for( Iterator i = dto.getDefinitions().iterator(); i.hasNext(); ){
+ defs.add(
+ morpherRegistry.morph( ProcessDefinitionRef.class, i.next() )
+ );
+ }
+ dto.setDefinitions(defs);
+ return dto;
+ }
+
+ protected ProcessInstanceRefWrapper unmarshallProcessInstanceList(String response)
+ {
+ JSONObject jsonObject = JSONObject.fromObject( response );
+ ProcessInstanceRefWrapper dto = (ProcessInstanceRefWrapper)
+ JSONObject.toBean( jsonObject, ProcessInstanceRefWrapper.class );
+
+ // --
+ List instances = new ArrayList();
+ for( Iterator i = dto.getInstances().iterator(); i.hasNext(); ){
+ instances.add(
+ morpherRegistry.morph( ProcessInstanceRef.class, i.next() )
+ );
+ }
+ dto.setInstances(instances);
+
+ return dto;
+ }
+
+ protected ProcessInstanceRef unmarshallProcessInstance(String response)
+ {
+ JSONObject jsonObject = JSONObject.fromObject( response );
+ ProcessInstanceRef dto = (ProcessInstanceRef)
+ JSONObject.toBean( jsonObject, ProcessInstanceRef.class );
+ return dto;
+ }
+
+ protected ProcessInstanceRef createNewProcessInstance()
+ throws Exception
+ {
+ String resource = "/process/definitions/"+testDeploymentRef.getProcessId()+"/instances/new";
+ String response = HTTP.post(SERVER_URL + resource, EMPTY, DEFAULT_CREDENTIALS);
+
+ // ------- New instance
+
+ ProcessInstanceRef newInstanceRef = unmarshallProcessInstance(response);
+ assertTrue(newInstanceRef.getState()==ProcessInstanceRef.STATE.RUNNING);
+ return newInstanceRef;
+ }
+
+ protected ProcessInstanceRefWrapper getInstanceList(ProcessDefinitionRef def)
+ {
+ String listResponse = HTTP.get(
+ SERVER_URL + "/process/definitions/"+def.getProcessId()+"/instances",
+ DEFAULT_CREDENTIALS
+ );
+
+ ProcessInstanceRefWrapper instanceList = unmarshallProcessInstanceList(listResponse);
+ return instanceList;
+ }
+
+ protected ProcessInstanceRef getInstance(ProcessDefinitionRef definitionRef, long instanceId)
+ {
+ ProcessInstanceRef match = null;
+ ProcessInstanceRefWrapper list = getInstanceList(definitionRef);
+
+ for(ProcessInstanceRef i : list.getInstances())
+ {
+ if(i.getInstanceId() == instanceId)
+ {
+ match = i;
+ break;
+ }
+ }
+ return match;
+ }
+
+ protected TaskRefWrapper unmarshallTaskList(String taskListResponse)
+ {
+ JSONObject jsonObject = JSONObject.fromObject( taskListResponse );
+ TaskRefWrapper dto = (TaskRefWrapper)
+ JSONObject.toBean( jsonObject, TaskRefWrapper.class );
+
+ List tasks = new ArrayList();
+ for( Iterator i = dto.getTasks().iterator(); i.hasNext(); ){
+ tasks.add(
+ morpherRegistry.morph( TaskRef.class, i.next() )
+ );
+ }
+ dto.setTasks(tasks);
+
+ return dto;
+ }
}
Modified: projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/ProcessManagementTest.java
===================================================================
--- projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/ProcessManagementTest.java 2008-12-11 11:30:20 UTC (rev 3332)
+++ projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/ProcessManagementTest.java 2008-12-11 11:32:22 UTC (rev 3333)
@@ -29,29 +29,22 @@
import java.util.List;
/**
- * Executes process managemnt tests.
+ * Tests process management functionality.
*
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
public class ProcessManagementTest extends BaseTC
{
- protected void setUp() throws Exception
- {
- super.setUp();
- deployTestHarness();
- }
-
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- undeployTestHarness();
- }
-
/**
- * Check the process defintion list after deployment of a new process.
- * (done in {@link #setUp()})
+ * Checks the following reqiorements:<br>
+ *
+ * <ul>
+ * <li> Process deployment
+ * <li> Create instance
+ * <li> Suspend instance
+ * <li> End an instance
+ * </ul>
*
* @throws Exception
*/
@@ -75,22 +68,14 @@
}
/**
- * Test instance creation, suspend, resume and deletetion.
+ * Test instance creation, suspend, resume and deletion.
*
* @throws Exception
*/
public void testInstanceOperations() throws Exception
{
- String resource = "/process/definitions/"+testDeploymentRef.getProcessId()+"/instances/new";
- String response = HTTP.post(SERVER_URL + resource, EMPTY, DEFAULT_CREDENTIALS);
+ ProcessInstanceRef newInstanceRef = createNewProcessInstance();
- System.out.println("!!"+response);
-
- // ------- New instance
-
- ProcessInstanceRef newInstanceRef = unmarshallProcessInstance(response);
- assertTrue(newInstanceRef.getState()==ProcessInstanceRef.STATE.RUNNING);
-
// ------- Suspend it
newInstanceRef.setState(ProcessInstanceRef.STATE.SUSPENDED);
@@ -101,13 +86,9 @@
// ------- Verify
- String listResponse = HTTP.get(
- SERVER_URL + "/process/definitions/"+testDeploymentRef.getProcessId()+"/instances",
- DEFAULT_CREDENTIALS
- );
-
- ProcessInstanceRefWrapper instanceList = unmarshallProcessInstanceList(listResponse);
+ ProcessInstanceRefWrapper instanceList = getInstanceList(testDeploymentRef);
assertFalse(instanceList.getInstances().isEmpty());
+ assertTrue(instanceList.getTotalCount()==1);
ProcessInstanceRef match = null;
for(ProcessInstanceRef ref : instanceList.getInstances())
@@ -121,51 +102,20 @@
assertNotNull(match);
assertEquals(ProcessInstanceRef.STATE.SUSPENDED, match.getState());
- }
- // ---------------- marshalling --------------
+ // end and verify
+ newInstanceRef.setState(ProcessInstanceRef.STATE.ENDED);
+ HTTP.post(
+ SERVER_URL + "/process/instances/"+newInstanceRef.getInstanceId()+"/state/"+newInstanceRef.getState(),
+ EMPTY, DEFAULT_CREDENTIALS
+ );
- private ProcessDefinitionRefWrapper unmarshallProcessDefinitionList(String response)
- {
- JSONObject jsonObject = JSONObject.fromObject( response );
- ProcessDefinitionRefWrapper dto = (ProcessDefinitionRefWrapper)
- JSONObject.toBean( jsonObject, ProcessDefinitionRefWrapper.class );
+ // refresh instance list
+ instanceList = getInstanceList(testDeploymentRef);
+ assertTrue(instanceList.getInstances().isEmpty());
- // --
- List defs = new ArrayList();
- for( Iterator i = dto.getDefinitions().iterator(); i.hasNext(); ){
- defs.add(
- morpherRegistry.morph( ProcessDefinitionRef.class, i.next() )
- );
- }
- dto.setDefinitions(defs);
- return dto;
- }
- private ProcessInstanceRefWrapper unmarshallProcessInstanceList(String response)
- {
- JSONObject jsonObject = JSONObject.fromObject( response );
- ProcessInstanceRefWrapper dto = (ProcessInstanceRefWrapper)
- JSONObject.toBean( jsonObject, ProcessInstanceRefWrapper.class );
- // --
- List instances = new ArrayList();
- for( Iterator i = dto.getInstances().iterator(); i.hasNext(); ){
- instances.add(
- morpherRegistry.morph( ProcessInstanceRef.class, i.next() )
- );
- }
- dto.setInstances(instances);
-
- return dto;
}
- private ProcessInstanceRef unmarshallProcessInstance(String response)
- {
- JSONObject jsonObject = JSONObject.fromObject( response );
- ProcessInstanceRef dto = (ProcessInstanceRef)
- JSONObject.toBean( jsonObject, ProcessInstanceRef.class );
- return dto;
- }
-
}
Added: projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/TaskManagementTest.java
===================================================================
--- projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/TaskManagementTest.java (rev 0)
+++ projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/TaskManagementTest.java 2008-12-11 11:32:22 UTC (rev 3333)
@@ -0,0 +1,115 @@
+/*
+ * 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.ProcessInstanceRef;
+import org.jboss.bpm.console.client.model.TaskRef;
+import org.jboss.bpm.console.client.model.TaskRefWrapper;
+
+import java.util.List;
+
+/**
+ * Test task related functionality.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class TaskManagementTest extends BaseTC
+{
+ /**
+ * Following reqiorements are covered:<br>
+ *
+ * <ul>
+ * <li> Signal token
+ * <li> View task list
+ * <li> Complete task
+ * </ul>
+ *
+ * @throws Exception
+ */
+ public void testTaskOperations() throws Exception
+ {
+ ProcessInstanceRef newInstanceRef = createNewProcessInstance();
+ long newInstanceId = newInstanceRef.getInstanceId();
+ String previousNodeName = newInstanceRef.getRootToken().getCurrentNodeName();
+ long previousTokenId = newInstanceRef.getRootToken().getId();
+
+ assertEquals(newInstanceRef.getState(), ProcessInstanceRef.STATE.RUNNING);
+
+ // signal it to move to task node
+ String url = "/jbpm3/tokens/"+newInstanceRef.getRootToken().getId()+"/transition/default";
+ HTTP.post(
+ SERVER_URL + url, EMPTY, DEFAULT_CREDENTIALS
+ );
+
+ // refresh instance ref
+ newInstanceRef = getInstance(testDeploymentRef, newInstanceId);
+ assertNotNull(newInstanceRef);
+
+ // same token?
+ assertTrue(previousTokenId == newInstanceRef.getRootToken().getId());
+
+ // did it really move?
+ assertFalse( previousNodeName.equals( newInstanceRef.getRootToken().getCurrentNodeName()));
+
+ // has a task been created?
+ String taskListResponse = HTTP.get(
+ SERVER_URL + "/tasks/actor/admin", DEFAULT_CREDENTIALS // 'user' is the actual actorname
+ );
+
+ TaskRefWrapper taskList = unmarshallTaskList(taskListResponse);
+ assertFalse(taskList.getTasks().isEmpty());
+ assertTrue(taskList.getTotalCount() == 1); // TODO: shared database may cause problems
+
+ TaskRef match = null;
+ for(TaskRef task : taskList.getTasks())
+ {
+ if(task.getName().equals("example task"))
+ {
+ match = task;
+ break;
+ }
+ }
+
+ assertNotNull(match);
+ List<String> transitions = match.getTransitionNames();
+ assertFalse(transitions.isEmpty());
+ assertTrue(transitions.size()==1);
+ assertEquals("to_end", transitions.get(0));
+
+ // complete the task and make sure the list is empty again
+ String completionUrl = "/tasks/"+match.getId()+"/close/transition/default";
+ HTTP.post(
+ SERVER_URL + completionUrl, EMPTY, DEFAULT_CREDENTIALS
+ );
+
+ // refresh task list
+ taskListResponse = HTTP.get(
+ SERVER_URL + "/tasks/actor/admin", DEFAULT_CREDENTIALS // 'user' is the actual actorname
+ );
+ taskList = unmarshallTaskList(taskListResponse);
+
+ // make sure it's empty
+ assertTrue(taskList.getTasks().isEmpty());
+
+ }
+
+}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/URLBuilder.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/URLBuilder.java 2008-12-11 11:30:20 UTC (rev 3332)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/URLBuilder.java 2008-12-11 11:32:22 UTC (rev 3333)
@@ -48,7 +48,7 @@
return getConsoleServerUrl() + "/rs/process/definitions";
}
- public String getProcessInstanceURL(long processId)
+ public String getProcessInstancesURL(long processId)
{
return getConsoleServerUrl() + "/rs/process/definitions/"+processId+"/instances";
}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java 2008-12-11 11:30:20 UTC (rev 3332)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java 2008-12-11 11:32:22 UTC (rev 3333)
@@ -251,6 +251,6 @@
private static String getResourceUrl(MainView view, long parentId)
{
- return view.getUrlBuilder().getProcessInstanceURL(parentId);
+ return view.getUrlBuilder().getProcessInstancesURL(parentId);
}
}
17 years, 4 months
JBoss JBPM SVN: r3332 - in jbpm3/trunk/modules: distribution/scripts and 4 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-12-11 06:30:20 -0500 (Thu, 11 Dec 2008)
New Revision: 3332
Added:
jbpm3/trunk/modules/integration/src/test/resources/jndi.properties
Modified:
jbpm3/trunk/modules/distribution/pom.xml
jbpm3/trunk/modules/distribution/scripts/assembly-deploy-artifacts.xml
jbpm3/trunk/modules/distribution/src/main/resources/installer/install-definition.xml
jbpm3/trunk/modules/integration/.project
jbpm3/trunk/modules/integration/pom.xml
jbpm3/trunk/modules/integration/src/test/java/org/jbpm/test/integration/spec/deployment/DeploymentPARTest.java
Log:
Add remote deployer tests
Modified: jbpm3/trunk/modules/distribution/pom.xml
===================================================================
--- jbpm3/trunk/modules/distribution/pom.xml 2008-12-11 10:56:36 UTC (rev 3331)
+++ jbpm3/trunk/modules/distribution/pom.xml 2008-12-11 11:30:20 UTC (rev 3332)
@@ -41,12 +41,12 @@
</dependency>
<dependency>
<groupId>org.jbpm.jbpm3</groupId>
- <artifactId>bpm-spec-integration-jbpm3</artifactId>
+ <artifactId>jbpm-integration-spec</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.jbpm.jbpm3</groupId>
- <artifactId>bpm-spec-integration-jbpm3</artifactId>
+ <artifactId>jbpm-integration-spec</artifactId>
<classifier>config</classifier>
<version>${version}</version>
</dependency>
Modified: jbpm3/trunk/modules/distribution/scripts/assembly-deploy-artifacts.xml
===================================================================
--- jbpm3/trunk/modules/distribution/scripts/assembly-deploy-artifacts.xml 2008-12-11 10:56:36 UTC (rev 3331)
+++ jbpm3/trunk/modules/distribution/scripts/assembly-deploy-artifacts.xml 2008-12-11 11:30:20 UTC (rev 3332)
@@ -54,7 +54,7 @@
<outputDirectory>resources/jbpm-integration-config</outputDirectory>
<useStrictFiltering>true</useStrictFiltering>
<includes>
- <include>*:bpm-spec-integration-jbpm3:jar:config</include>
+ <include>*:jbpm-integration-spec:jar:config</include>
<include>*:bpm-spec-integration-jboss42:jar:config</include>
</includes>
<unpack>true</unpack>
Modified: jbpm3/trunk/modules/distribution/src/main/resources/installer/install-definition.xml
===================================================================
--- jbpm3/trunk/modules/distribution/src/main/resources/installer/install-definition.xml 2008-12-11 10:56:36 UTC (rev 3331)
+++ jbpm3/trunk/modules/distribution/src/main/resources/installer/install-definition.xml 2008-12-11 11:30:20 UTC (rev 3332)
@@ -148,7 +148,6 @@
<include name="activation.jar" />
<include name="antlr.jar" />
<include name="asm.jar" />
- <include name="bpm-spec-integration-jbpm3" />
<include name="bpm-spec-integration-jboss42.jar" />
<include name="bsh.jar" />
<include name="cglib.jar" />
@@ -158,6 +157,7 @@
<include name="hibernate.jar" />
<include name="hsqldb.jar" />
<include name="jbpm-enterprise-bundle.ear" />
+ <include name="jbpm-integration-spec.jar"/>
<include name="jbpm-jpdl.jar" />
<include name="jbpm-identity.jar" />
<include name="junit.jar" />
@@ -199,7 +199,7 @@
<!-- jbpm/jbpm-integration.beans -->
<fileset dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-integration.beans" override="true">
<include name="bpm-spec-dialect-api10.jar" />
- <include name="bpm-spec-integration-jbpm3.jar" />
+ <include name="jbpm-integration-spec.jar" />
</fileset>
<fileset dir="@{deploy.artifacts.dir}/resources/jbpm-integration-config" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-integration.beans/META-INF" override="true">
<include name="jboss-beans.xml" />
Modified: jbpm3/trunk/modules/integration/.project
===================================================================
--- jbpm3/trunk/modules/integration/.project 2008-12-11 10:56:36 UTC (rev 3331)
+++ jbpm3/trunk/modules/integration/.project 2008-12-11 11:30:20 UTC (rev 3332)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>bpm-spec-integration-jbpm3</name>
+ <name>jbpm-integration-spec</name>
<comment></comment>
<projects>
</projects>
Modified: jbpm3/trunk/modules/integration/pom.xml
===================================================================
--- jbpm3/trunk/modules/integration/pom.xml 2008-12-11 10:56:36 UTC (rev 3331)
+++ jbpm3/trunk/modules/integration/pom.xml 2008-12-11 11:30:20 UTC (rev 3332)
@@ -15,9 +15,9 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <name>JBoss jBPM3 - Integration</name>
+ <name>JBoss jBPM3 - Spec Integration</name>
<groupId>org.jbpm.jbpm3</groupId>
- <artifactId>bpm-spec-integration-jbpm3</artifactId>
+ <artifactId>jbpm-integration-spec</artifactId>
<packaging>jar</packaging>
<!-- Parent -->
@@ -30,6 +30,7 @@
<!-- Properties -->
<properties>
+ <jboss.version>4.2.2.GA</jboss.version>
<mvel.version>1.3.7-java1.5</mvel.version>
</properties>
@@ -68,6 +69,12 @@
</dependency>
<dependency>
+ <groupId>org.jboss.client</groupId>
+ <artifactId>jbossall-client</artifactId>
+ <version>${jboss.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<scope>test</scope>
@@ -89,6 +96,7 @@
<testResources>
<testResource>
<directory>src/test/resources</directory>
+ <filtering>true</filtering>
</testResource>
<testResource>
<directory>src/cts/resources</directory>
@@ -202,4 +210,31 @@
</plugins>
</build>
+ <!-- Profiles -->
+ <profiles>
+
+ <!--
+ Name: no-jboss-bind-address
+ Descr: Skip tests if no jboss.bind address is given
+ -->
+ <profile>
+ <id>no-jboss-bind-address</id>
+ <activation>
+ <property>
+ <name>!jboss.bind.address</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ </profiles>
</project>
Modified: jbpm3/trunk/modules/integration/src/test/java/org/jbpm/test/integration/spec/deployment/DeploymentPARTest.java
===================================================================
--- jbpm3/trunk/modules/integration/src/test/java/org/jbpm/test/integration/spec/deployment/DeploymentPARTest.java 2008-12-11 10:56:36 UTC (rev 3331)
+++ jbpm3/trunk/modules/integration/src/test/java/org/jbpm/test/integration/spec/deployment/DeploymentPARTest.java 2008-12-11 11:30:20 UTC (rev 3332)
@@ -29,11 +29,11 @@
import java.util.Map;
import org.jboss.bpm.api.deployment.Deployment;
+import org.jboss.bpm.api.model.ProcessDefinition;
import org.jboss.bpm.api.model.ProcessInstance;
-import org.jboss.bpm.api.model.ProcessDefinition;
import org.jboss.bpm.api.runtime.Token;
import org.jboss.bpm.api.service.DeploymentService;
-import org.jboss.bpm.api.test.APITestCase;
+import org.jboss.bpm.api.test.IntegrationTestCase;
import org.jboss.bpm.incubator.service.TaskInstanceService;
/**
@@ -42,8 +42,9 @@
* @author thomas.diesler(a)jboss.com
* @since 24-Nov-2008
*/
-public class DeploymentPARTest extends APITestCase
+public class DeploymentPARTest extends IntegrationTestCase
{
+
public void testSimplePARDeploy() throws Exception
{
URL parURL = getTestArchiveURL("fork-join-example.par");
@@ -75,6 +76,16 @@
assertTrue("Undeploy successful", depService.undeploy(dep));
}
+ public void testRemoteDeploy() throws Exception
+ {
+ deploy("fork-join-example.par");
+ }
+
+ public void testRemoteUndeploy() throws Exception
+ {
+ undeploy("fork-join-example.par");
+ }
+
private Token getChildToken(Token token, String nodeName)
{
Map<String, Token> childToks = new HashMap<String, Token>();
Added: jbpm3/trunk/modules/integration/src/test/resources/jndi.properties
===================================================================
--- jbpm3/trunk/modules/integration/src/test/resources/jndi.properties (rev 0)
+++ jbpm3/trunk/modules/integration/src/test/resources/jndi.properties 2008-12-11 11:30:20 UTC (rev 3332)
@@ -0,0 +1,3 @@
+java.naming.provider.url=jnp://@jboss.bind.address@:1099
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.factory.url.pkgs=org.jboss.naming.client
17 years, 4 months
JBoss JBPM SVN: r3331 - projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/jbpm3.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-12-11 05:56:36 -0500 (Thu, 11 Dec 2008)
New Revision: 3331
Modified:
projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/jbpm3/GetGroupMembershipCommand.java
Log:
Exception when user not found
Modified: projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/jbpm3/GetGroupMembershipCommand.java
===================================================================
--- projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/jbpm3/GetGroupMembershipCommand.java 2008-12-11 10:43:05 UTC (rev 3330)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/jbpm3/GetGroupMembershipCommand.java 2008-12-11 10:56:36 UTC (rev 3331)
@@ -60,6 +60,9 @@
);
User user = session.getUserByName(actorName);
+ if(null==user)
+ throw new IllegalArgumentException("No such user:"+actorName);
+
Set<Group> groups = (Set<Group>)user.getGroupsForGroupType("organisation");
for(Group g : groups)
17 years, 4 months
JBoss JBPM SVN: r3330 - jbpm3/branches.
by do-not-reply@jboss.org
Author: tkirby
Date: 2008-12-11 05:43:05 -0500 (Thu, 11 Dec 2008)
New Revision: 3330
Added:
jbpm3/branches/jpdl-3.2.2-SOA-4.2/
Log:
replacing soa 3.2.2 branch
Copied: jbpm3/branches/jpdl-3.2.2-SOA-4.2 (from rev 3329, jbpm3/tags/jpdl-3.2.2-SOA-4.2.0.CP03)
17 years, 4 months
JBoss JBPM SVN: r3329 - in jbpm3/trunk/hudson/hudson-home/jobs: jBPM3-JDK1.6 and 2 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-12-11 05:42:04 -0500 (Thu, 11 Dec 2008)
New Revision: 3329
Modified:
jbpm3/trunk/hudson/hudson-home/jobs/jBPM3-JDK1.5/config.xml
jbpm3/trunk/hudson/hudson-home/jobs/jBPM3-JDK1.6/config.xml
jbpm3/trunk/hudson/hudson-home/jobs/jBPM3-Matrix/config.xml
jbpm3/trunk/hudson/hudson-home/jobs/jBPM3-ShortMatrix/config.xml
Log:
keep builds for 60 days
Modified: jbpm3/trunk/hudson/hudson-home/jobs/jBPM3-JDK1.5/config.xml
===================================================================
--- jbpm3/trunk/hudson/hudson-home/jobs/jBPM3-JDK1.5/config.xml 2008-12-11 10:32:08 UTC (rev 3328)
+++ jbpm3/trunk/hudson/hudson-home/jobs/jBPM3-JDK1.5/config.xml 2008-12-11 10:42:04 UTC (rev 3329)
@@ -3,7 +3,7 @@
<actions class="vector" />
<description>Build and test @version.id@ on JDK1.5</description>
<logRotator>
- <daysToKeep>28</daysToKeep>
+ <daysToKeep>60</daysToKeep>
<numToKeep>-1</numToKeep>
</logRotator>
<keepDependencies>false</keepDependencies>
Modified: jbpm3/trunk/hudson/hudson-home/jobs/jBPM3-JDK1.6/config.xml
===================================================================
--- jbpm3/trunk/hudson/hudson-home/jobs/jBPM3-JDK1.6/config.xml 2008-12-11 10:32:08 UTC (rev 3328)
+++ jbpm3/trunk/hudson/hudson-home/jobs/jBPM3-JDK1.6/config.xml 2008-12-11 10:42:04 UTC (rev 3329)
@@ -3,7 +3,7 @@
<actions class="vector" />
<description>Build and test @version.id@ on JDK1.6</description>
<logRotator>
- <daysToKeep>28</daysToKeep>
+ <daysToKeep>60</daysToKeep>
<numToKeep>-1</numToKeep>
</logRotator>
<keepDependencies>false</keepDependencies>
Modified: jbpm3/trunk/hudson/hudson-home/jobs/jBPM3-Matrix/config.xml
===================================================================
--- jbpm3/trunk/hudson/hudson-home/jobs/jBPM3-Matrix/config.xml 2008-12-11 10:32:08 UTC (rev 3328)
+++ jbpm3/trunk/hudson/hudson-home/jobs/jBPM3-Matrix/config.xml 2008-12-11 10:42:04 UTC (rev 3329)
@@ -3,7 +3,7 @@
<actions class="java.util.concurrent.CopyOnWriteArrayList"/>
<description>Build and test the @version.id@ Matrix</description>
<logRotator>
- <daysToKeep>28</daysToKeep>
+ <daysToKeep>60</daysToKeep>
<numToKeep>-1</numToKeep>
</logRotator>
<keepDependencies>false</keepDependencies>
Modified: jbpm3/trunk/hudson/hudson-home/jobs/jBPM3-ShortMatrix/config.xml
===================================================================
--- jbpm3/trunk/hudson/hudson-home/jobs/jBPM3-ShortMatrix/config.xml 2008-12-11 10:32:08 UTC (rev 3328)
+++ jbpm3/trunk/hudson/hudson-home/jobs/jBPM3-ShortMatrix/config.xml 2008-12-11 10:42:04 UTC (rev 3329)
@@ -3,7 +3,7 @@
<actions class="java.util.concurrent.CopyOnWriteArrayList"/>
<description>Build and test the @version.id@ Matrix</description>
<logRotator>
- <daysToKeep>28</daysToKeep>
+ <daysToKeep>60</daysToKeep>
<numToKeep>-1</numToKeep>
</logRotator>
<keepDependencies>false</keepDependencies>
17 years, 4 months
JBoss JBPM SVN: r3328 - in jbpm3/trunk/modules: core/src/main/resources and 1 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-12-11 05:32:08 -0500 (Thu, 11 Dec 2008)
New Revision: 3328
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/persistence/jta/JtaDbPersistenceServiceFactory.java
jbpm3/trunk/modules/core/src/main/resources/hibernate.common.xml
jbpm3/trunk/modules/enterprise/src/main/java/org/jbpm/ejb/impl/CommandListenerBean.java
Log:
Fix JNDI comp references to JbpmDS and UserTransaction
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/persistence/jta/JtaDbPersistenceServiceFactory.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/persistence/jta/JtaDbPersistenceServiceFactory.java 2008-12-11 08:52:50 UTC (rev 3327)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/persistence/jta/JtaDbPersistenceServiceFactory.java 2008-12-11 10:32:08 UTC (rev 3328)
@@ -48,41 +48,47 @@
*
* @author Tom Baeyens
*/
-public class JtaDbPersistenceServiceFactory extends DbPersistenceServiceFactory {
+public class JtaDbPersistenceServiceFactory extends DbPersistenceServiceFactory
+{
private static final long serialVersionUID = 1L;
private UserTransaction userTransaction;
- public JtaDbPersistenceServiceFactory() {
+ public JtaDbPersistenceServiceFactory()
+ {
setCurrentSessionEnabled(true);
setTransactionEnabled(false);
}
-
- public Service openService() {
+
+ public Service openService()
+ {
return new JtaDbPersistenceService(this);
}
- public UserTransaction getUserTransaction() {
- if (userTransaction == null) {
+ public UserTransaction getUserTransaction()
+ {
+ if (userTransaction == null)
+ {
String jndiName = getConfiguration().getProperty("jta.UserTransaction");
- if (jndiName == null) {
+ if (jndiName == null)
+ {
/*
- * EJB 2.1 section 20.9 The container must make the UserTransaction interface available to the
- * enterprise beans that are allowed to use this interface (only session and message-
- * driven beans with bean-managed transaction demarcation are allowed to use this
- * interface) in JNDI under the name java:comp/UserTransaction.
- * J2EE 1.4 section 4.2.1.1 The J2EE platform must provide an object implementing the
- * UserTransaction interface to all web components. The platform must publish the
- * UserTransaction object in JNDI under the name java:comp/UserTransaction.
+ * EJB 2.1 section 20.9 The container must make the UserTransaction interface available to the enterprise beans that are allowed to use this interface (only
+ * session and message- driven beans with bean-managed transaction demarcation are allowed to use this interface) in JNDI under the name
+ * java:comp/UserTransaction. J2EE 1.4 section 4.2.1.1 The J2EE platform must provide an object implementing the UserTransaction interface to all web
+ * components. The platform must publish the UserTransaction object in JNDI under the name java:comp/UserTransaction.
*/
jndiName = "java:comp/UserTransaction";
}
- try {
- userTransaction = (UserTransaction) new InitialContext().lookup(jndiName);
- } catch (NamingException e) {
- throw new JbpmException("could not retrieve user transaction with name "+jndiName, e);
+ try
+ {
+ userTransaction = (UserTransaction)new InitialContext().lookup(jndiName);
}
+ catch (NamingException e)
+ {
+ throw new JbpmException("could not retrieve user transaction with name " + jndiName, e);
+ }
}
return userTransaction;
}
Modified: jbpm3/trunk/modules/core/src/main/resources/hibernate.common.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/hibernate.common.xml 2008-12-11 08:52:50 UTC (rev 3327)
+++ jbpm3/trunk/modules/core/src/main/resources/hibernate.common.xml 2008-12-11 10:32:08 UTC (rev 3328)
@@ -1,11 +1,12 @@
<!-- DataSource properties (begin) ===
- <property name="hibernate.connection.datasource">java:comp/env/jdbc/JbpmDataSource</property>
+ <property name="hibernate.connection.datasource">java:JbpmDS</property>
==== DataSource properties (end) -->
<!-- JTA transaction properties (begin) ===
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
+ <property name="jta.UserTransaction">UserTransaction</property>
==== JTA transaction properties (end) -->
<!-- CMT transaction properties (begin) ===
Modified: jbpm3/trunk/modules/enterprise/src/main/java/org/jbpm/ejb/impl/CommandListenerBean.java
===================================================================
--- jbpm3/trunk/modules/enterprise/src/main/java/org/jbpm/ejb/impl/CommandListenerBean.java 2008-12-11 08:52:50 UTC (rev 3327)
+++ jbpm3/trunk/modules/enterprise/src/main/java/org/jbpm/ejb/impl/CommandListenerBean.java 2008-12-11 10:32:08 UTC (rev 3328)
@@ -94,20 +94,24 @@
* @author Tom Baeyens
* @author Alejandro Guizar
*/
-public class CommandListenerBean implements MessageDrivenBean, MessageListener {
+public class CommandListenerBean implements MessageDrivenBean, MessageListener
+{
private static final long serialVersionUID = 1L;
-
+
MessageDrivenContext messageDrivenContext = null;
LocalCommandService commandService;
Connection jmsConnection;
Destination deadLetterQueue;
- public void onMessage(Message message) {
- try {
+ public void onMessage(Message message)
+ {
+ try
+ {
// extract command from message
Command command = extractCommand(message);
- if (command == null) {
+ if (command == null)
+ {
discard(message);
return;
}
@@ -115,40 +119,54 @@
Object result = commandService.execute(command);
// send a response back if a "reply to" destination is set
Destination replyTo = message.getJMSReplyTo();
- if (replyTo != null && (result instanceof Serializable || result == null)) {
- sendResult((Serializable) result, replyTo, message.getJMSMessageID());
+ if (replyTo != null && (result instanceof Serializable || result == null))
+ {
+ sendResult((Serializable)result, replyTo, message.getJMSMessageID());
}
}
- catch (JMSException e) {
+ catch (JMSException e)
+ {
messageDrivenContext.setRollbackOnly();
log.error("could not process message " + message, e);
}
}
- protected Command extractCommand(Message message) throws JMSException {
+ protected Command extractCommand(Message message) throws JMSException
+ {
Command command = null;
- if (message instanceof ObjectMessage) {
+ if (message instanceof ObjectMessage)
+ {
log.debug("deserializing command from jms message...");
ObjectMessage objectMessage = (ObjectMessage)message;
Serializable object = objectMessage.getObject();
- if (object instanceof Command) {
- command = (Command) object;
- } else {
- log.warn("ignoring object message cause it isn't a command '"+object+"'"+(object!=null ? " ("+object.getClass().getName()+")" : ""));
+ if (object instanceof Command)
+ {
+ command = (Command)object;
}
- } else {
- log.warn("ignoring message '"+message+"' cause it isn't an ObjectMessage ("+message.getClass().getName()+")");
+ else
+ {
+ log.warn("ignoring object message cause it isn't a command '" + object + "'" + (object != null ? " (" + object.getClass().getName() + ")" : ""));
+ }
}
+ else
+ {
+ log.warn("ignoring message '" + message + "' cause it isn't an ObjectMessage (" + message.getClass().getName() + ")");
+ }
return command;
}
- private void discard(Message message) throws JMSException {
- if (deadLetterQueue == null) {
+ private void discard(Message message) throws JMSException
+ {
+ if (deadLetterQueue == null)
+ {
// lookup dead letter queue
- try {
+ try
+ {
Context initial = new InitialContext();
- deadLetterQueue = (Destination) initial.lookup("java:comp/env/jms/DeadLetterQueue");
- } catch (NamingException e) {
+ deadLetterQueue = (Destination)initial.lookup("java:comp/env/jms/DeadLetterQueue");
+ }
+ catch (NamingException e)
+ {
log.debug("failed to retrieve dead letter queue, rejecting message: " + message);
messageDrivenContext.setRollbackOnly();
return;
@@ -156,54 +174,70 @@
}
// send message to dead letter queue
Session jmsSession = createSession();
- try {
+ try
+ {
jmsSession.createProducer(deadLetterQueue).send(message);
- } finally {
+ }
+ finally
+ {
jmsSession.close();
}
}
- private void sendResult(Serializable result, Destination destination, String correlationId) throws JMSException {
+ private void sendResult(Serializable result, Destination destination, String correlationId) throws JMSException
+ {
log.debug("sending result " + result + " to " + destination);
Session jmsSession = createSession();
- try {
+ try
+ {
Message resultMessage = jmsSession.createObjectMessage(result);
resultMessage.setJMSCorrelationID(correlationId);
jmsSession.createProducer(destination).send(resultMessage);
- } finally {
+ }
+ finally
+ {
jmsSession.close();
}
}
- private Session createSession() throws JMSException {
- if (jmsConnection == null) {
+ private Session createSession() throws JMSException
+ {
+ if (jmsConnection == null)
+ {
// lookup factory and create jms connection
- try {
+ try
+ {
Context initial = new InitialContext();
- ConnectionFactory jmsConnectionFactory = (ConnectionFactory) initial.lookup("java:comp/env/jms/JbpmConnectionFactory");
+ ConnectionFactory jmsConnectionFactory = (ConnectionFactory)initial.lookup("java:comp/env/jms/JbpmConnectionFactory");
jmsConnection = jmsConnectionFactory.createConnection();
}
- catch (NamingException e) {
+ catch (NamingException e)
+ {
throw new EJBException("error retrieving jms connection factory", e);
}
}
/*
- * if the connection supports xa, the session will be transacted, else the
- * session will auto acknowledge; in either case no explicit transaction
- * control must be performed - see ejb 2.1 - 17.3.5
+ * if the connection supports xa, the session will be transacted, else the session will auto acknowledge; in either case no explicit transaction control must be
+ * performed - see ejb 2.1 - 17.3.5
*/
return jmsConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
}
- public void setMessageDrivenContext(MessageDrivenContext messageDrivenContext) {
+ public void setMessageDrivenContext(MessageDrivenContext messageDrivenContext)
+ {
this.messageDrivenContext = messageDrivenContext;
}
- public void ejbRemove() {
- if (jmsConnection != null) {
- try {
+ public void ejbRemove()
+ {
+ if (jmsConnection != null)
+ {
+ try
+ {
jmsConnection.close();
- } catch (JMSException e) {
+ }
+ catch (JMSException e)
+ {
log.debug("failed to close jms connection", e);
}
jmsConnection = null;
@@ -213,14 +247,20 @@
messageDrivenContext = null;
}
- public void ejbCreate() {
- try {
+ public void ejbCreate()
+ {
+ try
+ {
Context initial = new InitialContext();
- LocalCommandServiceHome commandServiceHome = (LocalCommandServiceHome) initial.lookup("java:comp/env/ejb/LocalCommandServiceBean");
+ LocalCommandServiceHome commandServiceHome = (LocalCommandServiceHome)initial.lookup("java:comp/env/ejb/LocalCommandServiceBean");
commandService = commandServiceHome.create();
- } catch (NamingException e) {
+ }
+ catch (NamingException e)
+ {
throw new EJBException("error retrieving command service home", e);
- } catch (CreateException e) {
+ }
+ catch (CreateException e)
+ {
throw new EJBException("error creating command service", e);
}
}
17 years, 4 months
JBoss JBPM SVN: r3327 - jbpm3/trunk/modules/core/src/test/java/org/jbpm/graph/exe.
by do-not-reply@jboss.org
Author: camunda
Date: 2008-12-11 03:52:50 -0500 (Thu, 11 Dec 2008)
New Revision: 3327
Modified:
jbpm3/trunk/modules/core/src/test/java/org/jbpm/graph/exe/SubProcessCancellationTest.java
Log:
reincluded test case (see http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4195599)
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/graph/exe/SubProcessCancellationTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/graph/exe/SubProcessCancellationTest.java 2008-12-11 01:10:40 UTC (rev 3326)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/graph/exe/SubProcessCancellationTest.java 2008-12-11 08:52:50 UTC (rev 3327)
@@ -8,10 +8,7 @@
public class SubProcessCancellationTest extends AbstractDbTestCase
{
- public void testWithSubProcess()
- {}
-
- public void _testWithSubProcess()
+ public void testWithSubProcess()
{
ProcessDefinition subProcess = ProcessDefinition.parseXmlString(
"<process-definition name='sub'>" +
17 years, 4 months
JBoss JBPM SVN: r3326 - jbpm4/trunk/modules/userguide/src/main/docbook/en/modules.
by do-not-reply@jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-12-10 20:10:40 -0500 (Wed, 10 Dec 2008)
New Revision: 3326
Modified:
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch01-Introduction.xml
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml
Log:
Add gpd specifics to chapter 1 and 2 of the docs
Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch01-Introduction.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch01-Introduction.xml 2008-12-10 20:44:50 UTC (rev 3325)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch01-Introduction.xml 2008-12-11 01:10:40 UTC (rev 3326)
@@ -52,6 +52,10 @@
The developers guide explains more advanced customization options that
are not supported.
</para>
+ <para>TODO ?Explain what is meant by supported? Shouldn't it be clear to user's that it is more
+ geared towards extenders? That they can use it but that there is no guarantee of infinite stability?
+ END TODO
+ </para>
</section>
<section id="processdefinitionprocessinstanceandexecutions">
Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml 2008-12-10 20:44:50 UTC (rev 3325)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml 2008-12-11 01:10:40 UTC (rev 3326)
@@ -56,29 +56,115 @@
</section>
<section id="eclipse">
- <title>Eclipse</title>
- <para>TODO</para>
+ <title>Graphical Process Designer (GPD)</title>
+ <para>Eclipse is used as the platform to host the jPDL graphical process
+ designer. This section will describe how to obtain Eclipse and install
+ the GPD.</para>
<section>
- <title>Graphical Process Designer (GPD)</title>
- <para>TODO</para>
+ <title>Obtaining Eclipse</title>
+ <para>If you have already an Eclipse installation and you want to
+ install the GPD in that one, please first make sure that your installation
+ includes an XML editor. An XML editor comes in handy if you want to add
+ technical details to the process files that are produced by the GPD.
+ If you have one of those you can safely skip the rest of this section and
+ directly proceed with the GPD installation. If you don't have one
+ yet, there are two ways of getting it.</para>
+ <section>
+ <title>Use the jBPM Installer</title>
+ <para>TODO</para>
+ </section>
+ <section>
+ <title>Download Eclipse</title>
+ <para>You can download Eclipse from http://www.eclipse.org/downloads/.
+ We recommend to download either the Eclipse IDE for Java EE Developers
+ or the Eclipse IDE for Java Developers over the Eclipse Classic as the
+ former two contain an XML editor while the latter doesn't.</para>
</section>
<section>
- <title>In an existing eclipse</title>
- <para>TODO</para>
+ <title>GPD Installation</title>
+ <para>The installation of the GPD uses the Eclipse Software Update
+ mechanism and is pretty straightforward. An archived update site
+ containing the different Eclipse plugins that you need is shipped
+ with the jBPM download. You will find it in the gpd subfolder of the
+ distribution. The site is called jbpm-gpd-site.zip.</para>
+ <para>To do the installation, fire up Eclipse and choose
+ 'Help->Software Updates'. On the following dialog, select the
+ 'Available Software' tab and push the 'Add Site...' button. In the
+ 'Add Site' dialog, push the 'Archive...' button. Then, navigate to the
+ jbpm-gpd-site.zip file mentioned above and select it. Push 'OK' to
+ come back to the 'Software Updates and Add-ons' dialog. Select the
+ 'jPDL 4 GPD Update Site' that has appeared and push the 'Install...'
+ button. Eclipse will calculate the needed dependencies and open the
+ 'Install' dialog. Make sure both the 'Flow Common Feature' and the
+ 'jPDL 4 Feature' are selected and push the 'Next' button. On the
+ next screen, select the 'Accept...' radio button and push 'Finish'
+ to complete the installation. Restart your Eclipse and you are all set.
</section>
<section>
- <title>Let the installer download eclipse</title>
- <para>TODO</para>
- </section>
- <section>
<title>Workspace</title>
- <para>TODO: Koen, can we make an existing workspace
- part of the distro and then put some examples in there ?
- Then users just have to point their eclipse to the
- workspace in our distro and they have the examples with
- the projects and classpaths ready to go.
- We would have to put some workspace in our svn...
- </para>
+ <para>In this section we will show you a possible setup of your
+ workspace. This includes the definition of a user library containing
+ the dependencies that you might need while developing jPDL applications
+ and importing the examples from the distribution in a newly created
+ project.</para>
+ <section>
+ <title>Define the jBPM User Library</title>
+ <para>This section shows how to define a library for your workspace
+ that contains the jBPM classes as well as its dependencies. If you
+ create a new Java project, it will be sufficient to add this user
+ library to the build path of your project for things to compile
+ smoothly.</para>
+ <para>Open the Eclipse preferences dialog and navigate to the
+ 'Java->Build Path->User Libraries' page. Push the 'New...' button
+ and choose a name e.g. 'jBPM Libraries'. Push the 'Add JARs...'
+ button and navigate to the 'lib' folder within your jBPM installation.
+ Select all the jar files in this folder and push the 'Open' button
+ to include them.</para>
+ <para>So far we have added all the jBPM dependencies.
+ Now let's add the jBPM classes themselves and attach the sources so
+ we can easily navigate to them when we are debugging. Select the
+ 'jBPM Libraries' entry and push the 'Add JARs...' button again.
+ This time select the jbpm.jar file in the root of your jBPM installation
+ and push the 'Open' button again. Next, select the 'Source attachment'
+ entry under the jbpm.jar file that we just added and push the 'Edit...'
+ button. The 'Source Attachment Configuration' dialog opens. Select the
+ 'External Folder...' button and navigate to the 'src' folder in your
+ jBPM installation. Select 'Choose' and twice 'OK' to close all the open
+ dialogs.</para>
+ <para>Now that we have done all these steps we are ready to create
+ projects and add this newly created user library to the build path of
+ these projects. Let's start doing this in the next section while
+ importing the examples.</para>
+ </section>
+ <section>
+ <title>Importing the Examples</title>
+ <para>In this section we will create a Java project in our Eclipse
+ workspace and import the jBPM examples that came with the distribution.</para>
+ <para>Bring up the 'New Java Project' wizard by selecting
+ 'File->New->Java Project'. Choose a name for your project,
+ e.g. jbpm-examples and push the 'Finish' button. Next bring up the
+ properties dialog for the newly created project by selecting it and
+ choosing 'File->Properties...'. In this properties dialog, select the
+ 'Java Build Path' page, then the tab 'Libraries' and push the
+ 'Add Library...' button. The 'Add Library' wizard opens. Select
+ 'User Library' and push the 'Next >' button. On the following page
+ select the 'jBPM Libraries' entry and push finish. Push the 'OK' button
+ to close the properties dialog. We have successfully added the jBPM classes
+ and their dependencies to our newly created Java project. Next, let's
+ import the examples.
+ <para>Select the 'src' folder in the jbpm-examples project and then the
+ 'File->Import...' menu. The 'Import' wizard opens. Select
+ 'General->File System' and push the 'Next >' button.
+ On the following page, push the 'Browse...' button next to
+ the 'From directory' text field and navigate to the 'examples/src' folder
+ of your jBPM installation. Push the 'Choose' button to select it. Check
+ the checkbox next to the 'src' entry that appears. Also, make sure that the
+ 'Into folder' text field refers to the 'src' folder of the jbpm-examples
+ project. Push the 'Finish' button to complete the import.
+ </para>
+ <para>That's it. Now you are ready to look at the examples and take it
+ from there.</para>
+ </section>
</section>
</section>
17 years, 4 months
JBoss JBPM SVN: r3325 - in projects/gwt-console/trunk: 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-12-10 15:44:50 -0500 (Wed, 10 Dec 2008)
New Revision: 3325
Added:
projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/ProcessManagementTest.java
Modified:
projects/gwt-console/trunk/gwt-parent.iml
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRefWrapper.java
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceRef.java
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceRefWrapper.java
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/jbpm3/TokenReference.java
projects/gwt-console/trunk/server/gwt-server.iml
projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/TestFacade.java
projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/AuthorizationTest.java
projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/BaseTC.java
projects/gwt-console/trunk/war/gwt-war.iml
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceDetailForm.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java
Log:
Test process instance creation and suspension
Modified: projects/gwt-console/trunk/gwt-parent.iml
===================================================================
--- projects/gwt-console/trunk/gwt-parent.iml 2008-12-10 20:44:16 UTC (rev 3324)
+++ projects/gwt-console/trunk/gwt-parent.iml 2008-12-10 20:44:50 UTC (rev 3325)
@@ -15,7 +15,9 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="jbpm3-toplevel" exported="" />
+ <orderEntry type="module" module-name="jbpm3-enterprise" exported="" />
+ <orderEntry type="module" module-name="jbpm3-identity" exported="" />
+ <orderEntry type="module" module-name="jbpm3-core" exported="" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: org.slf4j:slf4j-simple:jar:1.5.2:compile">
<CLASSES>
Modified: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java 2008-12-10 20:44:16 UTC (rev 3324)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java 2008-12-10 20:44:50 UTC (rev 3325)
@@ -81,6 +81,29 @@
public String toString()
{
- return "ProcessDefinitionRef{id="+this.processId +", name="+this.name+"}";
+ return "ProcessDefinitionRef{id="+this.processId +", name="+this.name+", version="+this.version+"}";
}
+
+ public boolean equals(Object o)
+ {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ ProcessDefinitionRef that = (ProcessDefinitionRef) o;
+
+ if (processId != that.processId) return false;
+ if (name != null ? !name.equals(that.name) : that.name != null) return false;
+ if (version != null ? !version.equals(that.version) : that.version != null) return false;
+
+ return true;
+ }
+
+ public int hashCode()
+ {
+ int result;
+ result = (int) (processId ^ (processId >>> 32));
+ result = 31 * result + (name != null ? name.hashCode() : 0);
+ result = 31 * result + (version != null ? version.hashCode() : 0);
+ return result;
+ }
}
Modified: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRefWrapper.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRefWrapper.java 2008-12-10 20:44:16 UTC (rev 3324)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRefWrapper.java 2008-12-10 20:44:50 UTC (rev 3325)
@@ -54,4 +54,9 @@
{
return definitions.size();
}
+
+ public void setDefinitions(List<ProcessDefinitionRef> definitions)
+ {
+ this.definitions = definitions;
+ }
}
Modified: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceRef.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceRef.java 2008-12-10 20:44:16 UTC (rev 3324)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceRef.java 2008-12-10 20:44:50 UTC (rev 3325)
@@ -45,8 +45,6 @@
private boolean suspended;
- private STATE state; // gson is field based, hence why...
-
private transient Lifecycle lifecycle;
private TokenReference rootToken;
@@ -84,8 +82,6 @@
this.lifecycle = new Lifecycle(this, STATE.SUSPENDED);
else
this.lifecycle = new Lifecycle(this, STATE.RUNNING);
-
- this.state = lifecycle.getState();
}
@XmlElement(name = "instanceId")
@@ -124,7 +120,7 @@
@XmlElement(name = "status")
public STATE getState()
{
- return this.state;
+ return this.lifecycle.getState();
}
public void setState(String nextState)
@@ -135,7 +131,6 @@
public void setState(STATE nextState)
{
this.lifecycle = this.lifecycle.transitionTo(nextState);
- this.state = this.lifecycle.getState();
}
@XmlElement(name = "start")
@@ -238,6 +233,26 @@
{
return current;
}
+
+
+ public boolean equals(Object o)
+ {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ Lifecycle lifecycle = (Lifecycle) o;
+
+ if (current != lifecycle.current) return false;
+
+ return true;
+ }
+
+ public int hashCode()
+ {
+ int result;
+ result = (current != null ? current.hashCode() : 0);
+ return result;
+ }
}
private class IllegalTransitionException extends IllegalArgumentException
@@ -258,4 +273,44 @@
{
this.rootToken = rootToken;
}
+
+ // it's actually just used for unmarshalling, TODO: fix it
+ public void setSuspended(boolean suspended)
+ {
+ this.suspended = suspended;
+ initLifecycle();
+ }
+
+ public boolean equals(Object o)
+ {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ ProcessInstanceRef that = (ProcessInstanceRef) o;
+
+ if (instanceId != that.instanceId) return false;
+ if (parentId != that.parentId) return false;
+ if (suspended != that.suspended) return false;
+ if (endDate != null ? !endDate.equals(that.endDate) : that.endDate != null) return false;
+ if (key != null ? !key.equals(that.key) : that.key != null) return false;
+ if (lifecycle != null ? !lifecycle.equals(that.lifecycle) : that.lifecycle != null) return false;
+ if (rootToken != null ? !rootToken.equals(that.rootToken) : that.rootToken != null) return false;
+ if (startDate != null ? !startDate.toString().equals(that.startDate.toString()) : that.startDate != null) return false;
+
+ return true;
+ }
+
+ public int hashCode()
+ {
+ int result;
+ result = (int) (instanceId ^ (instanceId >>> 32));
+ result = 31 * result + (int) (parentId ^ (parentId >>> 32));
+ result = 31 * result + (key != null ? key.hashCode() : 0);
+ result = 31 * result + (startDate != null ? startDate.hashCode() : 0);
+ result = 31 * result + (endDate != null ? endDate.hashCode() : 0);
+ result = 31 * result + (suspended ? 1 : 0);
+ result = 31 * result + (lifecycle != null ? lifecycle.hashCode() : 0);
+ result = 31 * result + (rootToken != null ? rootToken.hashCode() : 0);
+ return result;
+ }
}
Modified: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceRefWrapper.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceRefWrapper.java 2008-12-10 20:44:16 UTC (rev 3324)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceRefWrapper.java 2008-12-10 20:44:50 UTC (rev 3325)
@@ -49,6 +49,11 @@
return instances;
}
+ public void setInstances(List<ProcessInstanceRef> instances)
+ {
+ this.instances = instances;
+ }
+
@XmlElement(name = "totalCount")
public int getTotalCount()
{
Modified: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/jbpm3/TokenReference.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/jbpm3/TokenReference.java 2008-12-10 20:44:16 UTC (rev 3324)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/jbpm3/TokenReference.java 2008-12-10 20:44:50 UTC (rev 3325)
@@ -43,6 +43,10 @@
private boolean canBeSignaled = true;
+ public TokenReference()
+ {
+ }
+
public TokenReference(long id, String name, String nodeName)
{
this.id = id;
@@ -84,4 +88,36 @@
{
this.canBeSignaled = canBeSignaled;
}
+
+
+ public boolean equals(Object o)
+ {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ TokenReference that = (TokenReference) o;
+
+ if (canBeSignaled != that.canBeSignaled) return false;
+ if (id != that.id) return false;
+ if (availableSignals != null ? !availableSignals.equals(that.availableSignals) : that.availableSignals != null)
+ return false;
+ if (children != null ? !children.equals(that.children) : that.children != null) return false;
+ if (currentNodeName != null ? !currentNodeName.equals(that.currentNodeName) : that.currentNodeName != null)
+ return false;
+ if (name != null ? !name.equals(that.name) : that.name != null) return false;
+
+ return true;
+ }
+
+ public int hashCode()
+ {
+ int result;
+ result = (int) (id ^ (id >>> 32));
+ result = 31 * result + (name != null ? name.hashCode() : 0);
+ result = 31 * result + (currentNodeName != null ? currentNodeName.hashCode() : 0);
+ result = 31 * result + (children != null ? children.hashCode() : 0);
+ result = 31 * result + (availableSignals != null ? availableSignals.hashCode() : 0);
+ result = 31 * result + (canBeSignaled ? 1 : 0);
+ return result;
+ }
}
Modified: projects/gwt-console/trunk/server/gwt-server.iml
===================================================================
--- projects/gwt-console/trunk/server/gwt-server.iml 2008-12-10 20:44:16 UTC (rev 3324)
+++ projects/gwt-console/trunk/server/gwt-server.iml 2008-12-10 20:44:50 UTC (rev 3325)
@@ -11,7 +11,9 @@
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="gwt-parent" />
- <orderEntry type="module" module-name="jbpm3-toplevel" />
+ <orderEntry type="module" module-name="jbpm3-enterprise" />
+ <orderEntry type="module" module-name="jbpm3-identity" />
+ <orderEntry type="module" module-name="jbpm3-core" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: org.slf4j:slf4j-simple:jar:1.5.2:compile">
<CLASSES>
Modified: projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/TestFacade.java
===================================================================
--- projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/TestFacade.java 2008-12-10 20:44:16 UTC (rev 3324)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/TestFacade.java 2008-12-10 20:44:50 UTC (rev 3325)
@@ -27,6 +27,7 @@
import org.jboss.bpm.console.server.integration.ExtensionManagement;
import org.jboss.bpm.console.server.integration.ManagementFactory;
import org.jboss.bpm.console.server.integration.ProcessManagement;
+import org.jboss.bpm.console.server.gson.GsonFactory;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
@@ -37,6 +38,8 @@
import java.io.InputStream;
import java.util.List;
+import com.google.gson.Gson;
+
/**
* Test utility to simplify GWT tests.
*
@@ -95,7 +98,7 @@
ProcessDefinitionRef def = getManagementExtension().deployNewDefinition(data);
log.info("Deployed test process definition " + def);
- return Response.ok().build();
+ return createJsonResponse(def);
}
catch (IOException e)
{
@@ -120,4 +123,11 @@
}
return Response.ok().build();
}
+
+ private Response createJsonResponse(Object wrapper)
+ {
+ Gson gson = GsonFactory.createInstance();
+ String json = gson.toJson(wrapper);
+ return Response.ok(json).type("application/json").build();
+ }
}
Modified: projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/AuthorizationTest.java
===================================================================
--- projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/AuthorizationTest.java 2008-12-10 20:44:16 UTC (rev 3324)
+++ projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/AuthorizationTest.java 2008-12-10 20:44:50 UTC (rev 3325)
@@ -22,16 +22,12 @@
package org.jboss.bpm.console.server;
import net.sf.json.JSONObject;
-import net.sf.json.util.JSONUtils;
-import net.sf.ezmorph.Morpher;
-import net.sf.ezmorph.MorpherRegistry;
-import net.sf.ezmorph.bean.BeanMorpher;
-import org.jboss.bpm.console.client.model.*;
-import org.apache.commons.beanutils.PropertyUtils;
+import org.jboss.bpm.console.client.model.RoleAssignmentRef;
+import org.jboss.bpm.console.client.model.RoleAssignmentRefWrapper;
-import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;
+import java.util.List;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -52,9 +48,6 @@
// --
// Postprocessing required:
// See http://json-lib.sourceforge.net/usage.html
- MorpherRegistry morpherRegistry = JSONUtils.getMorpherRegistry();
- Morpher dynaMorpher = new BeanMorpher( RoleAssignmentRef.class, morpherRegistry);
- morpherRegistry.registerMorpher( dynaMorpher );
List roles = new ArrayList();
for( Iterator i = dto.getRoles().iterator(); i.hasNext(); ){
roles.add( morpherRegistry.morph( RoleAssignmentRef.class, i.next() ) );
Modified: projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/BaseTC.java
===================================================================
--- projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/BaseTC.java 2008-12-10 20:44:16 UTC (rev 3324)
+++ projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/BaseTC.java 2008-12-10 20:44:50 UTC (rev 3325)
@@ -22,7 +22,16 @@
package org.jboss.bpm.console.server;
import junit.framework.TestCase;
+import net.sf.ezmorph.Morpher;
+import net.sf.ezmorph.MorpherRegistry;
+import net.sf.ezmorph.bean.BeanMorpher;
+import net.sf.json.JSONObject;
+import net.sf.json.util.JSONUtils;
+import org.jboss.bpm.console.client.model.*;
+import org.jboss.bpm.console.client.model.jbpm3.*;
+import java.io.ByteArrayInputStream;
+
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
@@ -30,4 +39,54 @@
{
protected final static String[] DEFAULT_CREDENTIALS = new String[] {"admin", "admin"};
protected String SERVER_URL = "http://localhost:8080/gwt-console-server/rs";
+ protected final ByteArrayInputStream EMPTY = new ByteArrayInputStream("".getBytes());
+ protected ProcessDefinitionRef testDeploymentRef;
+ protected MorpherRegistry morpherRegistry = null;
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ setupMorphRegistry();
+ }
+
+ protected void deployTestHarness()
+ throws Exception
+ {
+ String response = HTTP.post(
+ SERVER_URL + "/test/deploy/harness", EMPTY, DEFAULT_CREDENTIALS
+ );
+
+ JSONObject jsonObject = JSONObject.fromObject( response );
+ testDeploymentRef = (ProcessDefinitionRef)
+ JSONObject.toBean( jsonObject, ProcessDefinitionRef.class );
+ System.out.println("deployed " + testDeploymentRef);
+ }
+
+ protected void undeployTestHarness()
+ throws Exception
+ {
+ String response = HTTP.post(
+ SERVER_URL + "/test/undeploy/harness", EMPTY, DEFAULT_CREDENTIALS
+ );
+
+ System.out.println("undeployed " + testDeploymentRef);
+ }
+
+ protected MorpherRegistry setupMorphRegistry()
+ {
+ this.morpherRegistry = JSONUtils.getMorpherRegistry();
+ Morpher procDef = new BeanMorpher( ProcessDefinitionRef.class, morpherRegistry);
+ morpherRegistry.registerMorpher( procDef );
+
+ Morpher roles = new BeanMorpher( RoleAssignmentRef.class, morpherRegistry);
+ morpherRegistry.registerMorpher( roles );
+
+ Morpher instance = new BeanMorpher( ProcessInstanceRef.class, morpherRegistry);
+ morpherRegistry.registerMorpher( instance );
+
+ Morpher token = new BeanMorpher( TokenReference.class, morpherRegistry);
+ morpherRegistry.registerMorpher( token );
+
+ return morpherRegistry;
+ }
}
Added: projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/ProcessManagementTest.java
===================================================================
--- projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/ProcessManagementTest.java (rev 0)
+++ projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/ProcessManagementTest.java 2008-12-10 20:44:50 UTC (rev 3325)
@@ -0,0 +1,171 @@
+/*
+ * 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 net.sf.json.JSONObject;
+import org.jboss.bpm.console.client.model.*;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * Executes process managemnt tests.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class ProcessManagementTest extends BaseTC
+{
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ deployTestHarness();
+ }
+
+
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+ undeployTestHarness();
+ }
+
+ /**
+ * Check the process defintion list after deployment of a new process.
+ * (done in {@link #setUp()})
+ *
+ * @throws Exception
+ */
+ public void testProcessDefinitionList() throws Exception
+ {
+ String response = HTTP.get(
+ SERVER_URL + "/process/definitions", DEFAULT_CREDENTIALS
+ );
+
+ ProcessDefinitionRefWrapper dto = unmarshallProcessDefinitionList(response);
+
+ ProcessDefinitionRef match = null;
+ for(ProcessDefinitionRef def : dto.getDefinitions())
+ {
+ if(def.equals(testDeploymentRef))
+ match = def;
+ }
+
+ assertNotNull(match);
+
+ }
+
+ /**
+ * Test instance creation, suspend, resume and deletetion.
+ *
+ * @throws Exception
+ */
+ public void testInstanceOperations() throws Exception
+ {
+ String resource = "/process/definitions/"+testDeploymentRef.getProcessId()+"/instances/new";
+ String response = HTTP.post(SERVER_URL + resource, EMPTY, DEFAULT_CREDENTIALS);
+
+ System.out.println("!!"+response);
+
+ // ------- New instance
+
+ ProcessInstanceRef newInstanceRef = unmarshallProcessInstance(response);
+ assertTrue(newInstanceRef.getState()==ProcessInstanceRef.STATE.RUNNING);
+
+ // ------- Suspend it
+
+ newInstanceRef.setState(ProcessInstanceRef.STATE.SUSPENDED);
+ HTTP.post(
+ SERVER_URL + "/process/instances/"+newInstanceRef.getInstanceId()+"/state/"+newInstanceRef.getState(),
+ EMPTY, DEFAULT_CREDENTIALS
+ );
+
+ // ------- Verify
+
+ String listResponse = HTTP.get(
+ SERVER_URL + "/process/definitions/"+testDeploymentRef.getProcessId()+"/instances",
+ DEFAULT_CREDENTIALS
+ );
+
+ ProcessInstanceRefWrapper instanceList = unmarshallProcessInstanceList(listResponse);
+ assertFalse(instanceList.getInstances().isEmpty());
+
+ ProcessInstanceRef match = null;
+ for(ProcessInstanceRef ref : instanceList.getInstances())
+ {
+ if(ref.equals(newInstanceRef))
+ {
+ match = ref;
+ break;
+ }
+ }
+
+ assertNotNull(match);
+ assertEquals(ProcessInstanceRef.STATE.SUSPENDED, match.getState());
+ }
+
+ // ---------------- marshalling --------------
+
+ private ProcessDefinitionRefWrapper unmarshallProcessDefinitionList(String response)
+ {
+ JSONObject jsonObject = JSONObject.fromObject( response );
+ ProcessDefinitionRefWrapper dto = (ProcessDefinitionRefWrapper)
+ JSONObject.toBean( jsonObject, ProcessDefinitionRefWrapper.class );
+
+ // --
+ List defs = new ArrayList();
+ for( Iterator i = dto.getDefinitions().iterator(); i.hasNext(); ){
+ defs.add(
+ morpherRegistry.morph( ProcessDefinitionRef.class, i.next() )
+ );
+ }
+ dto.setDefinitions(defs);
+ return dto;
+ }
+
+ private ProcessInstanceRefWrapper unmarshallProcessInstanceList(String response)
+ {
+ JSONObject jsonObject = JSONObject.fromObject( response );
+ ProcessInstanceRefWrapper dto = (ProcessInstanceRefWrapper)
+ JSONObject.toBean( jsonObject, ProcessInstanceRefWrapper.class );
+
+ // --
+ List instances = new ArrayList();
+ for( Iterator i = dto.getInstances().iterator(); i.hasNext(); ){
+ instances.add(
+ morpherRegistry.morph( ProcessInstanceRef.class, i.next() )
+ );
+ }
+ dto.setInstances(instances);
+
+ return dto;
+ }
+
+ private ProcessInstanceRef unmarshallProcessInstance(String response)
+ {
+ JSONObject jsonObject = JSONObject.fromObject( response );
+ ProcessInstanceRef dto = (ProcessInstanceRef)
+ JSONObject.toBean( jsonObject, ProcessInstanceRef.class );
+ return dto;
+ }
+
+}
Modified: projects/gwt-console/trunk/war/gwt-war.iml
===================================================================
--- projects/gwt-console/trunk/war/gwt-war.iml 2008-12-10 20:44:16 UTC (rev 3324)
+++ projects/gwt-console/trunk/war/gwt-war.iml 2008-12-10 20:44:50 UTC (rev 3325)
@@ -11,7 +11,7 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="gwt-parent" />
+ <orderEntry type="module" module-name="gwt-parent" exported="" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: junit:junit:jar:3.8.1:test">
<CLASSES>
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceDetailForm.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceDetailForm.java 2008-12-10 20:44:16 UTC (rev 3324)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceDetailForm.java 2008-12-10 20:44:50 UTC (rev 3325)
@@ -172,6 +172,12 @@
}
detailsForm.getForm().loadRecord(record);
+
+ // state not part of the payload
+ detailsForm.getForm().findField("state").setRawValue(
+ selectedInstance.getState().toString()
+ );
+
detailsForm.doLayout();
}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java 2008-12-10 20:44:16 UTC (rev 3324)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java 2008-12-10 20:44:50 UTC (rev 3325)
@@ -29,6 +29,8 @@
import com.gwtext.client.widgets.MessageBoxConfig;
import com.gwtext.client.widgets.grid.ColumnConfig;
import com.gwtext.client.widgets.grid.ColumnModel;
+import com.gwtext.client.widgets.grid.Renderer;
+import com.gwtext.client.widgets.grid.CellMetadata;
import org.jboss.bpm.console.client.util.ConsoleLog;
import org.jboss.bpm.console.client.MainView;
import org.jboss.bpm.console.client.UIConstants;
@@ -207,7 +209,16 @@
new ColumnConfig("Instance ID", "instanceId", 75, true),
//new ColumnConfig("Process ID", "parentId", 25, true),
//new ColumnConfig("Key", "key", 50, true),
- new ColumnConfig("State", "state", 100, true, null, "expand"),
+ new ColumnConfig("State", "state", 100, true,
+ new Renderer()
+ {
+ public String render(Object object, CellMetadata cellMetadata, Record record, int i, int i1, Store store)
+ {
+ ProcessInstanceRef tmp = transform(record);
+ return tmp.getState().toString();
+ }
+ }
+ , "expand"),
new ColumnConfig("Start Date", "startDate", 125, true, new DateRenderer("startDate")),
//new ColumnConfig("End Date", "endDate", 125, true, new DateRenderer("endDate"))
}
17 years, 4 months