JBoss JBPM SVN: r3035 - in jbpm4/trunk/modules: devguide and 1 other directory.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-11-21 10:46:39 -0500 (Fri, 21 Nov 2008)
New Revision: 3035
Added:
jbpm4/trunk/modules/devguide/
jbpm4/trunk/modules/devguide/pom.xml
Log:
adding devguide
Added: jbpm4/trunk/modules/devguide/pom.xml
===================================================================
--- jbpm4/trunk/modules/devguide/pom.xml (rev 0)
+++ jbpm4/trunk/modules/devguide/pom.xml 2008-11-21 15:46:39 UTC (rev 3035)
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+ <!-- ====================================================================== -->
+ <!-- -->
+ <!-- JBoss, the OpenSource J2EE webOS -->
+ <!-- -->
+ <!-- Distributable under LGPL license. -->
+ <!-- See terms of license at http://www.gnu.org. -->
+ <!-- -->
+ <!-- ====================================================================== -->
+
+ <!-- $Id: pom.xml 2693 2008-10-31 09:12:32Z tom.baeyens(a)jboss.com $ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ 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>jBPM 4 - Developers Guide</name>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-devguide</artifactId>
+ <packaging>pom</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <dependencies>
+ <!--
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-pvm</artifactId>
+ <version>${version}</version>
+ </dependency>
+ -->
+ </dependencies>
+
+ <build>
+ <!-- ### PLUGINS ###################################################### -->
+ <plugins>
+
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.1.2</version>
+ <extensions>true</extensions>
+
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>resources</goal>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-docbook-xslt</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>docbook-style</artifactId>
+ <version>1.0.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ </dependencies>
+
+ <configuration>
+ <sourceDocumentName>master.xml</sourceDocumentName>
+ <masterTranslation>en</masterTranslation>
+ <imageResource>
+ <directory>${basedir}/src/main/docbook/en</directory>
+ <includes>
+ <include>images/*.png</include>
+ </includes>
+ </imageResource>
+ <formats>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ </configuration>
+
+ </plugin>
+
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
17 years, 5 months
JBoss JBPM SVN: r3034 - in jbpm3: trunk/modules/enterprise/jar/src/test/java/org/jbpm/enterprise and 1 other directory.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-21 10:41:01 -0500 (Fri, 21 Nov 2008)
New Revision: 3034
Removed:
jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/enterprise/deploy/
Modified:
jbpm3/branches/tdiesler/modules/enterprise/jar/pom.xml
Log:
Fix enterprise excludes
Modified: jbpm3/branches/tdiesler/modules/enterprise/jar/pom.xml
===================================================================
--- jbpm3/branches/tdiesler/modules/enterprise/jar/pom.xml 2008-11-21 14:40:27 UTC (rev 3033)
+++ jbpm3/branches/tdiesler/modules/enterprise/jar/pom.xml 2008-11-21 15:41:01 UTC (rev 3034)
@@ -259,9 +259,9 @@
<configuration>
<excludes>
<!-- [JBPM-1708] Enterprise EjbSchedulerTest fails -->
- <exclude>org/jbpm/scheduler/ejbtimer/EjbSchedulerTest.java</exclude>
+ <exclude>org/jbpm/enterprise/ejbtimer/EjbSchedulerTest.java</exclude>
<!-- [JBPM-1811] JmsMessageTest fails intermitently on HSQLDB -->
- <exclude>org/jbpm/msg/jms/JmsMessageTest.java</exclude>
+ <exclude>org/jbpm/enterprise/jms/JmsMessageTest.java</exclude>
</excludes>
</configuration>
</plugin>
@@ -288,9 +288,9 @@
<configuration>
<excludes>
<!-- [JBPM-1708] Enterprise EjbSchedulerTest fails -->
- <exclude>org/jbpm/scheduler/ejbtimer/EjbSchedulerTest.java</exclude>
+ <exclude>org/jbpm/enterprise/ejbtimer/EjbSchedulerTest.java</exclude>
<!-- [JBPM-1811] JmsMessageTest fails intermitently on HSQLDB -->
- <exclude>org/jbpm/msg/jms/JmsMessageTest.java</exclude>
+ <exclude>org/jbpm/enterprise/jms/JmsMessageTest.java</exclude>
</excludes>
</configuration>
</plugin>
@@ -359,11 +359,11 @@
<configuration>
<excludes>
<!-- [JBPM-1818] Use Sybase instance that supports XA Transaction -->
- <exclude>org/jbpm/scheduler/ejbtimer/EjbSchedulerTest.java</exclude>
- <exclude>org/jbpm/persistence/jta/JtaDbPersistenceTest.java</exclude>
- <exclude>org/jbpm/msg/jms/JmsMessageTest.java</exclude>
+ <exclude>org/jbpm/enterprise/ejbtimer/EjbSchedulerTest.java</exclude>
+ <exclude>org/jbpm/enterprise/jta/JtaDbPersistenceTest.java</exclude>
+ <exclude>org/jbpm/enterprise/jms/JmsMessageTest.java</exclude>
<!-- [JBPM-1830] Fix AppServerConfigurationsTest for sybase on jboss500 -->
- <exclude>org/jbpm/enterprise/AppServerConfigurationsTest.java</exclude>
+ <exclude>org/jbpm/enterprise/config/AppServerConfigurationsTest.java</exclude>
</excludes>
</configuration>
</plugin>
17 years, 5 months
JBoss JBPM SVN: r3033 - in jbpm3/trunk/modules/integration/jboss42: src and 6 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-21 09:40:27 -0500 (Fri, 21 Nov 2008)
New Revision: 3033
Added:
jbpm3/trunk/modules/integration/jboss42/deploy.sh
jbpm3/trunk/modules/integration/jboss42/src/main/etc/
jbpm3/trunk/modules/integration/jboss42/src/main/etc/par-deployer.xml
jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/PARSubDeployer.java
jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/PARSubDeployerMBean.java
jbpm3/trunk/modules/integration/jboss42/src/test/
jbpm3/trunk/modules/integration/jboss42/src/test/resources/
jbpm3/trunk/modules/integration/jboss42/src/test/resources/simple/
jbpm3/trunk/modules/integration/jboss42/src/test/resources/simple/simple-process.xml
Removed:
jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/DeployerInterceptor.java
Log:
Add PAR deployer
Added: jbpm3/trunk/modules/integration/jboss42/deploy.sh
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/deploy.sh (rev 0)
+++ jbpm3/trunk/modules/integration/jboss42/deploy.sh 2008-11-21 14:40:27 UTC (rev 3033)
@@ -0,0 +1,4 @@
+#! /bin/bash
+
+cp target/jbpm-integration-jboss42-3.3.1-SNAPSHOT.jar $JBOSS422/server/default/deploy/jbpm/jbpm-service.sar
+cp src/main/etc/par-deployer.xml $JBOSS422/server/default/deploy/jbpm/jbpm-service.sar
Property changes on: jbpm3/trunk/modules/integration/jboss42/deploy.sh
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/integration/jboss42/src/main/etc/par-deployer.xml
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/src/main/etc/par-deployer.xml (rev 0)
+++ jbpm3/trunk/modules/integration/jboss42/src/main/etc/par-deployer.xml 2008-11-21 14:40:27 UTC (rev 3033)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- The JBoss service configuration file for the PAR deployer service.
+ $Id$
+-->
+<server>
+ <mbean code="org.jbpm.integration.jboss42.PARSubDeployer"
+ name="jboss.deployer:service=PARDeployer">
+ </mbean>
+</server>
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/integration/jboss42/src/main/etc/par-deployer.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/DeployerInterceptor.java
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/DeployerInterceptor.java 2008-11-21 14:25:17 UTC (rev 3032)
+++ jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/DeployerInterceptor.java 2008-11-21 14:40:27 UTC (rev 3033)
@@ -1,115 +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.integration.jboss42;
-
-//$Id$
-
-import java.util.LinkedList;
-import java.util.List;
-
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.deployment.MainDeployerMBean;
-import org.jboss.deployment.SubDeployerInterceptorSupport;
-import org.jboss.mx.server.Invocation;
-import org.jboss.mx.util.MBeanProxy;
-
-/**
- * A deployer service that manages WS4EE compliant Web Services
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 03-May-2007
- */
-public abstract class DeployerInterceptor extends SubDeployerInterceptorSupport
-{
- // The main deployer
- private MainDeployerMBean mainDeployer;
-
- @Override
- protected final Object create(Invocation invocation, DeploymentInfo unit) throws Throwable
- {
- Object retn = invokeNext(invocation);
-
-
- return retn;
- }
-
- @Override
- protected final Object start(Invocation invocation, DeploymentInfo unit) throws Throwable
- {
- Object retn = invokeNext(invocation);
-
- return retn;
- }
-
- @Override
- protected final Object stop(Invocation invocation, DeploymentInfo unit) throws Throwable
- {
- Object retn = invokeNext(invocation);
-
- return retn;
- }
-
- @Override
- protected final Object destroy(Invocation invocation, DeploymentInfo unit) throws Throwable
- {
- Object retn = invokeNext(invocation);
-
- return retn;
- }
-
- /** Create the deployer service
- */
- protected void createService() throws Exception
- {
- mainDeployer = (MainDeployerMBean)MBeanProxy.get(MainDeployerMBean.class, MainDeployerMBean.OBJECT_NAME, server);
- super.attach();
- }
-
- /** Destroy the deployer service
- */
- protected void destroyService()
- {
- super.detach();
- }
-
- /**
- * Handle all webservice deployment exceptions.
- * You can either simply log the problem and keep the EJB/WAR module
- * alive or undeploy properly.
- */
- protected void handleStartupException(DeploymentInfo di, Throwable th)
- {
- log.error("Cannot startup webservice for: " + di.shortName, th);
- mainDeployer.undeploy(di);
- }
-
- /**
- * Handle all webservice deployment exceptions.
- *
- * You can either simply logs the problem and keep the EJB/WAR module
- * alive or undeploy properly.
- */
- protected void handleShutdownException(String moduleName, Throwable th)
- {
- log.error("Cannot shutdown webservice for: " + moduleName, th);
- }
-}
\ No newline at end of file
Added: jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/PARSubDeployer.java
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/PARSubDeployer.java (rev 0)
+++ jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/PARSubDeployer.java 2008-11-21 14:40:27 UTC (rev 3033)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.jboss42;
+
+//$Id$
+
+import org.jboss.deployment.DeploymentException;
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.deployment.SubDeployerSupport;
+
+/**
+ * A deployer service that manages jBPM Process Archive Deployments
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 03-May-2007
+ */
+public class PARSubDeployer extends SubDeployerSupport implements PARSubDeployerMBean
+{
+ /** The suffixes we accept, along with their relative order */
+ private static final String[] DEFAULT_ENHANCED_SUFFIXES = new String[] {
+ "900:-process.xml"
+ };
+
+ public PARSubDeployer()
+ {
+ setEnhancedSuffixes(DEFAULT_ENHANCED_SUFFIXES);
+ }
+
+ @Override
+ public boolean accepts(DeploymentInfo di)
+ {
+ boolean accepts = super.accepts(di);
+ if (accepts == true)
+ {
+ log.info("Accept: " + di);
+ }
+ return accepts;
+ }
+
+ @Override
+ public void create(DeploymentInfo di) throws DeploymentException
+ {
+ super.create(di);
+ }
+
+ @Override
+ public void destroy(DeploymentInfo di) throws DeploymentException
+ {
+ super.destroy(di);
+ }
+
+ @Override
+ public void init(DeploymentInfo di) throws DeploymentException
+ {
+ super.init(di);
+ }
+
+ @Override
+ public void start(DeploymentInfo di) throws DeploymentException
+ {
+ super.start(di);
+ }
+
+ @Override
+ public void stop(DeploymentInfo di) throws DeploymentException
+ {
+ super.stop(di);
+ }
+}
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/PARSubDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/PARSubDeployerMBean.java
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/PARSubDeployerMBean.java (rev 0)
+++ jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/PARSubDeployerMBean.java 2008-11-21 14:40:27 UTC (rev 3033)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.jboss42;
+
+//$Id$
+
+import org.jboss.deployment.SubDeployerExtMBean;
+
+/**
+ * A deployer service that manages jBPM Process Archive Deployments
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 03-May-2007
+ */
+public interface PARSubDeployerMBean extends SubDeployerExtMBean
+{
+}
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/PARSubDeployerMBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/integration/jboss42/src/test/resources/simple/simple-process.xml
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/src/test/resources/simple/simple-process.xml (rev 0)
+++ jbpm3/trunk/modules/integration/jboss42/src/test/resources/simple/simple-process.xml 2008-11-21 14:40:27 UTC (rev 3033)
@@ -0,0 +1,16 @@
+<process-definition name="timerProcess" xmlns="urn:jbpm.org:jpdl-3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jbpm.org:jpdl-3.2 http://jbpm.org/xsd/jpdl-3.2.xsd">
+ <start-state name='start'>
+ <transition to='a' />
+ </start-state>
+ <state name='a'>
+ <transition to='b' />
+ </state>
+ <state name='b'>
+ <transition to='c' />
+ </state>
+ <state name='c'>
+ <transition to='end' />
+ </state>
+ <end-state name='end' />
+</process-definition>
Property changes on: jbpm3/trunk/modules/integration/jboss42/src/test/resources/simple/simple-process.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 5 months
JBoss JBPM SVN: r3032 - in projects/gwt-console/trunk: war/src/main/java/org/jboss/bpm/console/client/model and 3 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-11-21 09:25:17 -0500 (Fri, 21 Nov 2008)
New Revision: 3032
Added:
projects/gwt-console/trunk/war/src/test/java/PreparationTest.java
projects/gwt-console/trunk/war/src/test/resources/SampleProcess.par
Removed:
projects/gwt-console/trunk/war/src/test/java/BlankTest.java
projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/DeferredExecution.java
projects/gwt-console/trunk/war/src/test/resources/org/
Modified:
projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/JBPM3MgmtFacade.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestApplication.java
Log:
Implement process deployment from within test case
Modified: projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/JBPM3MgmtFacade.java
===================================================================
--- projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/JBPM3MgmtFacade.java 2008-11-21 13:27:50 UTC (rev 3031)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/JBPM3MgmtFacade.java 2008-11-21 14:25:17 UTC (rev 3032)
@@ -29,9 +29,11 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.console.client.model.jbpm3.ActiveNodeInfo;
import org.jboss.bpm.console.client.model.jbpm3.DiagramInfo;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
import org.jboss.bpm.console.server.integration.JBPM3Extension;
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.servlet.http.HttpServletRequest;
import javax.ws.rs.*;
@@ -40,6 +42,8 @@
import java.util.Iterator;
import java.util.List;
+import com.google.gson.Gson;
+
/**
* REST server module for accessing proprietary jbpm data.
*
@@ -87,6 +91,8 @@
HttpServletRequest request
)
{
+ ProcessDefinitionRef processRef = null;
+
try
{
FileItemFactory factory = new DiskFileItemFactory();
@@ -114,7 +120,7 @@
// Process a file upload in memory
byte[] data = item.get();
- getManagementExtension().deployNewDefinition(data);
+ processRef = getManagementExtension().deployNewDefinition(data);
// Process stream
//InputStream uploadedStream = item.getInputStream();
@@ -129,7 +135,7 @@
throw new WebApplicationException(e);
}
- return Response.ok().build();
+ return createJsonResponse(processRef);
}
@@ -199,4 +205,11 @@
return Response.ok().type("application/json").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/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2008-11-21 13:27:50 UTC (rev 3031)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2008-11-21 14:25:17 UTC (rev 3032)
@@ -39,6 +39,15 @@
*/
public class DTOParser
{
+ public static ProcessDefinitionRef parseProcessDefinition(String json)
+ {
+ JSONValue root = JSONParser.parse(json);
+ long id = JSONWalk.on(root).next("processId").asLong();
+ String version = JSONWalk.on(root).next("version").asString();
+ String name = JSONWalk.on(root).next("name").asString();
+
+ return new ProcessDefinitionRef(id, name, version);
+ }
public static List<String> parseRolesAssigned(String json)
{
// parse roles
Deleted: projects/gwt-console/trunk/war/src/test/java/BlankTest.java
===================================================================
--- projects/gwt-console/trunk/war/src/test/java/BlankTest.java 2008-11-21 13:27:50 UTC (rev 3031)
+++ projects/gwt-console/trunk/war/src/test/java/BlankTest.java 2008-11-21 14:25:17 UTC (rev 3032)
@@ -1,35 +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.
- */
-
-import junit.framework.TestCase;
-import junit.framework.Assert;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class BlankTest extends TestCase
-{
- public void testSuccess()
- {
- Assert.assertTrue(true);
- }
-}
Copied: projects/gwt-console/trunk/war/src/test/java/PreparationTest.java (from rev 3021, projects/gwt-console/trunk/war/src/test/java/BlankTest.java)
===================================================================
--- projects/gwt-console/trunk/war/src/test/java/PreparationTest.java (rev 0)
+++ projects/gwt-console/trunk/war/src/test/java/PreparationTest.java 2008-11-21 14:25:17 UTC (rev 3032)
@@ -0,0 +1,210 @@
+/*
+ * 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.
+ */
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.jboss.bpm.console.client.URLBuilder;
+import org.jboss.bpm.console.client.GwtTestApplication;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class PreparationTest extends TestCase
+{
+
+ private static String JSON = null;
+
+ protected void setUp() throws Exception
+ {
+ File workDir = new File(".");
+
+ System.out.println("===================" );
+ System.out.println("Test execution in " + workDir.getAbsolutePath() );
+ System.out.println("===================" );
+
+ // deploy a sample process
+ String pathname = workDir.getAbsolutePath() + "/src/test/resources/SampleProcess.par";
+ File samplePar = new File(pathname);
+ if(!samplePar.exists())
+ throw new RuntimeException("Failed to load sample process: " +pathname);
+
+ URLBuilder urlBuilder = new URLBuilder("http://localhost:8080", "gwt-console-server");
+ String response = doHttpPost(
+ urlBuilder.getUploadDefinitionURL(),
+ samplePar
+ );
+
+ System.out.println("HTTP response: " + response);
+
+ }
+
+ public void testSuccess()
+ {
+ Assert.assertTrue(true);
+ }
+
+ private String doHttpPost(String urlString, File data)
+ throws Exception
+ {
+
+ String userPassword = "admin:admin";
+ String encoding = new sun.misc.BASE64Encoder().encode (userPassword.getBytes());
+
+ HttpURLConnection conn = null;
+ BufferedReader br = null;
+ DataOutputStream dos = null;
+ DataInputStream inStream = null;
+
+ InputStream is = null;
+ OutputStream os = null;
+ boolean ret = false;
+ String StrMessage = "";
+
+
+ String lineEnd = "\r\n";
+ String twoHyphens = "--";
+ String boundary = "*****";
+
+
+ int bytesRead, bytesAvailable, bufferSize;
+
+ byte[] buffer;
+
+ int maxBufferSize = 1*1024*1024;
+
+ String responseFromServer = "";
+
+ try
+ {
+ //------------------ CLIENT REQUEST
+
+ FileInputStream fileInputStream = new FileInputStream( data );
+
+ // open a URL connection to the Servlet
+
+ URL url = new URL(urlString);
+
+
+ // Open a HTTP connection to the URL
+
+ conn = (HttpURLConnection) url.openConnection();
+ conn.setRequestProperty ("Authorization", "Basic " + encoding);
+
+ // Allow Inputs
+ conn.setDoInput(true);
+
+ // Allow Outputs
+ conn.setDoOutput(true);
+
+ // Don't use a cached copy.
+ conn.setUseCaches(false);
+
+ // Use a post method.
+ conn.setRequestMethod("POST");
+
+ conn.setRequestProperty("Connection", "Keep-Alive");
+
+ conn.setRequestProperty("Content-Type", "multipart/form-data;boundary="+boundary);
+
+ dos = new DataOutputStream( conn.getOutputStream() );
+
+ dos.writeBytes(twoHyphens + boundary + lineEnd);
+ dos.writeBytes("Content-Disposition: form-data; name=\"upload\";"
+ + " filename=\"" + data.getName() +"\"" + lineEnd);
+ dos.writeBytes(lineEnd);
+
+ // create a buffer of maximum size
+ bytesAvailable = fileInputStream.available();
+ bufferSize = Math.min(bytesAvailable, maxBufferSize);
+ buffer = new byte[bufferSize];
+
+ // read file and write it into form...
+ bytesRead = fileInputStream.read(buffer, 0, bufferSize);
+
+ while (bytesRead > 0)
+ {
+ dos.write(buffer, 0, bufferSize);
+ bytesAvailable = fileInputStream.available();
+ bufferSize = Math.min(bytesAvailable, maxBufferSize);
+ bytesRead = fileInputStream.read(buffer, 0, bufferSize);
+ }
+
+ // send multipart form data necesssary after file data...
+
+ dos.writeBytes(lineEnd);
+ dos.writeBytes(twoHyphens + boundary + twoHyphens + lineEnd);
+
+ // close streams
+
+ fileInputStream.close();
+ dos.flush();
+ dos.close();
+
+ }
+ catch (MalformedURLException ex)
+ {
+ throw ex;
+ }
+
+ catch (IOException ioe)
+ {
+ throw ioe;
+ }
+
+
+ //------------------ read the SERVER RESPONSE
+
+ StringBuffer sb = new StringBuffer();
+
+ try
+ {
+ inStream = new DataInputStream ( conn.getInputStream() );
+ String str;
+ while (( str = inStream.readLine()) != null)
+ {
+ sb.append(str).append("");
+ }
+ inStream.close();
+
+ }
+ catch (IOException ioex)
+ {
+ System.out.println("From (ServerResponse): "+ioex);
+
+ }
+
+
+ return sb.toString();
+
+ }
+
+ public static String getJSON()
+ {
+ return JSON;
+ }
+}
Property changes on: projects/gwt-console/trunk/war/src/test/java/PreparationTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/DeferredExecution.java
===================================================================
--- projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/DeferredExecution.java 2008-11-21 13:27:50 UTC (rev 3031)
+++ projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/DeferredExecution.java 2008-11-21 14:25:17 UTC (rev 3032)
@@ -1,26 +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;
-
-public interface DeferredExecution {
- void execute();
-}
Modified: projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestApplication.java
===================================================================
--- projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestApplication.java 2008-11-21 13:27:50 UTC (rev 3031)
+++ projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestApplication.java 2008-11-21 14:25:17 UTC (rev 3032)
@@ -25,16 +25,12 @@
import com.google.gwt.http.client.Response;
import com.google.gwt.junit.client.GWTTestCase;
import com.google.gwt.user.client.Timer;
-import com.gwtext.client.widgets.ComponentMgr;
-import org.jboss.bpm.console.client.process.ProcessDefinitionList;
-import org.jboss.bpm.console.client.process.ProcessDefinitionListEditor;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
public class GwtTestApplication extends GWTTestCase
{
-
private static Application application = null;
public String getModuleName()
@@ -46,6 +42,7 @@
protected void gwtSetUp() throws Exception
{
super.gwtSetUp();
+
if(null==application)
{
application = new Application();
Copied: projects/gwt-console/trunk/war/src/test/resources/SampleProcess.par (from rev 3021, projects/gwt-console/trunk/war/src/test/resources/org/jboss/bpm/console/client/SampleProcess.par)
===================================================================
(Binary files differ)
Property changes on: projects/gwt-console/trunk/war/src/test/resources/SampleProcess.par
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 5 months
JBoss JBPM SVN: r3031 - in jbpm3/trunk/modules/integration: api and 7 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-21 08:27:50 -0500 (Fri, 21 Nov 2008)
New Revision: 3031
Added:
jbpm3/trunk/modules/integration/api/.classpath
jbpm3/trunk/modules/integration/api/.project
jbpm3/trunk/modules/integration/jboss42/.classpath
jbpm3/trunk/modules/integration/jboss42/.project
jbpm3/trunk/modules/integration/jboss42/pom.xml
jbpm3/trunk/modules/integration/jboss42/src/main/java/org/
jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/
jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/
jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/
jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/DeployerInterceptor.java
jbpm3/trunk/modules/integration/jboss50/.classpath
jbpm3/trunk/modules/integration/jboss50/.project
jbpm3/trunk/modules/integration/jboss50/pom.xml
jbpm3/trunk/modules/integration/pom.xml
Modified:
jbpm3/trunk/modules/integration/api/
jbpm3/trunk/modules/integration/jboss42/
jbpm3/trunk/modules/integration/jboss50/
Log:
Add AS42 DeployerInterceptor
Property changes on: jbpm3/trunk/modules/integration/api
___________________________________________________________________
Name: svn:ignore
+ .settings
target
Added: jbpm3/trunk/modules/integration/api/.classpath
===================================================================
--- jbpm3/trunk/modules/integration/api/.classpath (rev 0)
+++ jbpm3/trunk/modules/integration/api/.classpath 2008-11-21 13:27:50 UTC (rev 3031)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: jbpm3/trunk/modules/integration/api/.project
===================================================================
--- jbpm3/trunk/modules/integration/api/.project (rev 0)
+++ jbpm3/trunk/modules/integration/api/.project 2008-11-21 13:27:50 UTC (rev 3031)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jbpm-integration-api</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Property changes on: jbpm3/trunk/modules/integration/jboss42
___________________________________________________________________
Name: svn:ignore
+ .settings
target
Added: jbpm3/trunk/modules/integration/jboss42/.classpath
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/.classpath (rev 0)
+++ jbpm3/trunk/modules/integration/jboss42/.classpath 2008-11-21 13:27:50 UTC (rev 3031)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: jbpm3/trunk/modules/integration/jboss42/.project
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/.project (rev 0)
+++ jbpm3/trunk/modules/integration/jboss42/.project 2008-11-21 13:27:50 UTC (rev 3031)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jbpm-integration-jboss42</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Added: jbpm3/trunk/modules/integration/jboss42/pom.xml
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/pom.xml (rev 0)
+++ jbpm3/trunk/modules/integration/jboss42/pom.xml 2008-11-21 13:27:50 UTC (rev 3031)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ====================================================================== -->
+<!-- -->
+<!-- JBoss, the OpenSource J2EE webOS -->
+<!-- -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- -->
+<!-- ====================================================================== -->
+
+<!-- $Id$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ 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 JBoss42</name>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>jbpm-integration-jboss42</artifactId>
+ <packaging>jar</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>jbpm-integration</artifactId>
+ <version>3.3.1-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <!-- Properties -->
+ <properties>
+ <jboss.version>4.2.2.GA</jboss.version>
+ <jboss.common.version>1.2.1.GA</jboss.common.version>
+ </properties>
+
+ <!-- Dependencies -->
+ <dependencies>
+ <!-- jboss thirdparty dependencies -->
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-system</artifactId>
+ <version>${jboss.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss</artifactId>
+ <version>${jboss.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-jmx</artifactId>
+ <version>${jboss.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jbosssx</artifactId>
+ <version>${jboss.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>jboss.common</groupId>
+ <artifactId>jboss-common</artifactId>
+ <version>${jboss.common.version}</version>
+ </dependency>
+ </dependencies>
+ </project>
Property changes on: jbpm3/trunk/modules/integration/jboss42/pom.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/DeployerInterceptor.java
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/DeployerInterceptor.java (rev 0)
+++ jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/DeployerInterceptor.java 2008-11-21 13:27:50 UTC (rev 3031)
@@ -0,0 +1,115 @@
+/*
+ * 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.integration.jboss42;
+
+//$Id$
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.deployment.MainDeployerMBean;
+import org.jboss.deployment.SubDeployerInterceptorSupport;
+import org.jboss.mx.server.Invocation;
+import org.jboss.mx.util.MBeanProxy;
+
+/**
+ * A deployer service that manages WS4EE compliant Web Services
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 03-May-2007
+ */
+public abstract class DeployerInterceptor extends SubDeployerInterceptorSupport
+{
+ // The main deployer
+ private MainDeployerMBean mainDeployer;
+
+ @Override
+ protected final Object create(Invocation invocation, DeploymentInfo unit) throws Throwable
+ {
+ Object retn = invokeNext(invocation);
+
+
+ return retn;
+ }
+
+ @Override
+ protected final Object start(Invocation invocation, DeploymentInfo unit) throws Throwable
+ {
+ Object retn = invokeNext(invocation);
+
+ return retn;
+ }
+
+ @Override
+ protected final Object stop(Invocation invocation, DeploymentInfo unit) throws Throwable
+ {
+ Object retn = invokeNext(invocation);
+
+ return retn;
+ }
+
+ @Override
+ protected final Object destroy(Invocation invocation, DeploymentInfo unit) throws Throwable
+ {
+ Object retn = invokeNext(invocation);
+
+ return retn;
+ }
+
+ /** Create the deployer service
+ */
+ protected void createService() throws Exception
+ {
+ mainDeployer = (MainDeployerMBean)MBeanProxy.get(MainDeployerMBean.class, MainDeployerMBean.OBJECT_NAME, server);
+ super.attach();
+ }
+
+ /** Destroy the deployer service
+ */
+ protected void destroyService()
+ {
+ super.detach();
+ }
+
+ /**
+ * Handle all webservice deployment exceptions.
+ * You can either simply log the problem and keep the EJB/WAR module
+ * alive or undeploy properly.
+ */
+ protected void handleStartupException(DeploymentInfo di, Throwable th)
+ {
+ log.error("Cannot startup webservice for: " + di.shortName, th);
+ mainDeployer.undeploy(di);
+ }
+
+ /**
+ * Handle all webservice deployment exceptions.
+ *
+ * You can either simply logs the problem and keep the EJB/WAR module
+ * alive or undeploy properly.
+ */
+ protected void handleShutdownException(String moduleName, Throwable th)
+ {
+ log.error("Cannot shutdown webservice for: " + moduleName, th);
+ }
+}
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/DeployerInterceptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Property changes on: jbpm3/trunk/modules/integration/jboss50
___________________________________________________________________
Name: svn:ignore
+ .settings
target
Added: jbpm3/trunk/modules/integration/jboss50/.classpath
===================================================================
--- jbpm3/trunk/modules/integration/jboss50/.classpath (rev 0)
+++ jbpm3/trunk/modules/integration/jboss50/.classpath 2008-11-21 13:27:50 UTC (rev 3031)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: jbpm3/trunk/modules/integration/jboss50/.project
===================================================================
--- jbpm3/trunk/modules/integration/jboss50/.project (rev 0)
+++ jbpm3/trunk/modules/integration/jboss50/.project 2008-11-21 13:27:50 UTC (rev 3031)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jbpm-integration-jboss50</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Added: jbpm3/trunk/modules/integration/jboss50/pom.xml
===================================================================
--- jbpm3/trunk/modules/integration/jboss50/pom.xml (rev 0)
+++ jbpm3/trunk/modules/integration/jboss50/pom.xml 2008-11-21 13:27:50 UTC (rev 3031)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ====================================================================== -->
+<!-- -->
+<!-- JBoss, the OpenSource J2EE webOS -->
+<!-- -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- -->
+<!-- ====================================================================== -->
+
+<!-- $Id$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ 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 JBoss50</name>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>jbpm-integration-jboss50</artifactId>
+ <packaging>jar</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>jbpm-integration</artifactId>
+ <version>3.3.1-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+</project>
Property changes on: jbpm3/trunk/modules/integration/jboss50/pom.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/integration/pom.xml
===================================================================
--- jbpm3/trunk/modules/integration/pom.xml (rev 0)
+++ jbpm3/trunk/modules/integration/pom.xml 2008-11-21 13:27:50 UTC (rev 3031)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ====================================================================== -->
+<!-- -->
+<!-- JBoss, the OpenSource J2EE webOS -->
+<!-- -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- -->
+<!-- ====================================================================== -->
+
+<!-- $Id$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ 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>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>jbpm-integration</artifactId>
+ <packaging>pom</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>jbpm</artifactId>
+ <version>3.3.1-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <!-- Modules -->
+ <modules>
+ <module>api</module>
+ <module>jboss42</module>
+ <module>jboss50</module>
+ </modules>
+
+</project>
Property changes on: jbpm3/trunk/modules/integration/pom.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 5 months
JBoss JBPM SVN: r3030 - jbpm3/trunk/modules/integration.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-21 08:11:23 -0500 (Fri, 21 Nov 2008)
New Revision: 3030
Added:
jbpm3/trunk/modules/integration/jboss50/
Log:
Add Integration for JBoss50
Copied: jbpm3/trunk/modules/integration/jboss50 (from rev 3029, jbpm3/trunk/modules/integration/jboss42)
17 years, 5 months
JBoss JBPM SVN: r3029 - in jbpm3/trunk/modules: core/src/main/java/org/jbpm/command/impl and 7 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-21 08:10:25 -0500 (Fri, 21 Nov 2008)
New Revision: 3029
Added:
jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/enterprise/deploy/
jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/enterprise/deploy/DeployerTest.java
jbpm3/trunk/modules/integration/api/
jbpm3/trunk/modules/integration/api/pom.xml
jbpm3/trunk/modules/integration/api/src/
jbpm3/trunk/modules/integration/jboss42/
jbpm3/trunk/modules/integration/jboss42/src/
jbpm3/trunk/modules/integration/jboss42/src/main/
jbpm3/trunk/modules/integration/jboss42/src/main/java/
jbpm3/trunk/modules/integration/jboss42/src/main/resources/
Removed:
jbpm3/trunk/modules/integration/pom.xml
jbpm3/trunk/modules/integration/src/
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/AbstractCancelCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/AbstractGetObjectBaseCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/AsynchronousCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/BatchSignalCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/CancelProcessInstanceCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/CancelTokenCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/CancelWorkOnTaskCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/ChangeProcessInstanceVersionCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/Command.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/CommandService.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/CompositeCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/DeleteProcessdefinitionCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/DeployProcessCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/ExecuteJobsCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetProcessDefinitionCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetProcessDefinitionsCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetProcessInstanceCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetProcessInstanceLogCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetProcessInstancesCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetTaskInstanceCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetTaskListCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/NewProcessInstanceCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/SignalCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/StartProcessInstanceCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/StartWorkOnTaskCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/TaskInstanceEndCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/VariablesCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/impl/CommandServiceImpl.java
Log:
Add Integration for JBoss42
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/AbstractCancelCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/AbstractCancelCommand.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/AbstractCancelCommand.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -12,7 +12,8 @@
import org.jbpm.graph.exe.Token;
import org.jbpm.taskmgmt.exe.TaskInstance;
-public class AbstractCancelCommand implements Serializable {
+public class AbstractCancelCommand implements Serializable
+{
private static final long serialVersionUID = 1L;
@@ -20,16 +21,20 @@
protected static final Log log = LogFactory.getLog(AbstractCancelCommand.class);
- protected void cancelTokens(Collection tokens) {
- if (tokens != null && tokens.size() > 0) {
+ protected void cancelTokens(Collection tokens)
+ {
+ if (tokens != null && tokens.size() > 0)
+ {
log.info("cancel " + tokens.size() + " tokens");
- for (Iterator itr = tokens.iterator(); itr.hasNext();) {
- cancelToken((Token) itr.next());
+ for (Iterator itr = tokens.iterator(); itr.hasNext();)
+ {
+ cancelToken((Token)itr.next());
}
}
}
- protected void cancelToken(Token token) {
+ protected void cancelToken(Token token)
+ {
token.end(false); // end the token but dont verify
// ParentTermination
// if set to token.end() == token.end(true) the parent token is
@@ -42,17 +47,21 @@
log.info("token " + token.getId() + " canceled");
}
- protected List getTasksForToken(Token token) {
+ protected List getTasksForToken(Token token)
+ {
Query hqlQuery = jbpmContext.getSession().getNamedQuery("TaskMgmtSession.findTaskInstancesByTokenId");
hqlQuery.setLong("tokenId", token.getId());
return hqlQuery.list();
}
- protected void cancelTasks(List tasks) {
- if (tasks != null && tasks.size() > 0) {
+ protected void cancelTasks(List tasks)
+ {
+ if (tasks != null && tasks.size() > 0)
+ {
log.info("cancel " + tasks.size() + " tasks");
- for (Iterator it = tasks.iterator(); it.hasNext();) {
- TaskInstance ti = (TaskInstance) it.next();
+ for (Iterator it = tasks.iterator(); it.hasNext();)
+ {
+ TaskInstance ti = (TaskInstance)it.next();
// if the process def doesn't set signal="never", we have to
// manually turn off signaling for all tasks;
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/AbstractGetObjectBaseCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/AbstractGetObjectBaseCommand.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/AbstractGetObjectBaseCommand.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -13,165 +13,195 @@
import org.jbpm.taskmgmt.exe.TaskInstance;
/**
- * abstract base class for "get" commands which also implements
- * default pre-fetching.
+ * abstract base class for "get" commands which also implements default pre-fetching.
*
- * Note: prefetching logs is not possible here, so you have to load
- * Loags explicit with GetProcessInstanceLogCommand
+ * Note: prefetching logs is not possible here, so you have to load Loags explicit with GetProcessInstanceLogCommand
*
* @author Bernd Ruecker (bernd.ruecker(a)camunda.com)
*/
-public abstract class AbstractGetObjectBaseCommand implements Command {
+public abstract class AbstractGetObjectBaseCommand implements Command
+{
- static final Log log = LogFactory.getLog(AbstractGetObjectBaseCommand.class);
+ static final Log log = LogFactory.getLog(AbstractGetObjectBaseCommand.class);
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
- /**
- * if true, all process variables in the context (process instance / task)
- * are prefetched too
- */
- private boolean includeAllVariables = false;
+ /**
+ * if true, all process variables in the context (process instance / task) are prefetched too
+ */
+ private boolean includeAllVariables = false;
- /**
- * specify the names of the variables to prefetch
- */
- private String[] variablesToInclude = new String[0];
-
- private transient JbpmContext jbpmContext;
+ /**
+ * specify the names of the variables to prefetch
+ */
+ private String[] variablesToInclude = new String[0];
- public AbstractGetObjectBaseCommand() {
- }
+ private transient JbpmContext jbpmContext;
- public AbstractGetObjectBaseCommand(boolean includeAllVariables, boolean includeLogs) {
- this.includeAllVariables = includeAllVariables;
- }
+ public AbstractGetObjectBaseCommand()
+ {
+ }
- public AbstractGetObjectBaseCommand(String[] variablesToInclude) {
- this.variablesToInclude = variablesToInclude;
- }
+ public AbstractGetObjectBaseCommand(boolean includeAllVariables, boolean includeLogs)
+ {
+ this.includeAllVariables = includeAllVariables;
+ }
- public void retrieveTaskInstanceDetails(TaskInstance ti) {
- try {
- ti.getToken().getProcessInstance().getProcessDefinition().getName();
+ public AbstractGetObjectBaseCommand(String[] variablesToInclude)
+ {
+ this.variablesToInclude = variablesToInclude;
+ }
- // in TaskInstances created with jbpm 3.1, this association was
- // not present!
- ti.setProcessInstance(ti.getToken().getProcessInstance());
- ti.getToken().getNode().getName();
- ti.getTask().getName();
+ public void retrieveTaskInstanceDetails(TaskInstance ti)
+ {
+ try
+ {
+ ti.getToken().getProcessInstance().getProcessDefinition().getName();
- ti.getAvailableTransitions();
+ // in TaskInstances created with jbpm 3.1, this association was
+ // not present!
+ ti.setProcessInstance(ti.getToken().getProcessInstance());
+ ti.getToken().getNode().getName();
+ ti.getTask().getName();
- retrieveVariables(ti);
- }
- catch (Exception ex) {
- log.warn("exception while retrieving task instance data for task instance " + ti.getId(), ex);
- }
- }
+ ti.getAvailableTransitions();
- public ProcessInstance retrieveProcessInstance(ProcessInstance pi) {
- try {
- pi.getProcessDefinition().getName();
- retrieveToken(pi.getRootToken());
-
- // load at least the super process id and token id
- if (pi.getSuperProcessToken()!=null) {
- pi.getSuperProcessToken().getId();
- pi.getSuperProcessToken().getProcessInstance().getId();
- }
-
- retrieveVariables(pi);
- }
- catch (Exception ex) {
- log.warn("exception while retrieving process instance data for process instance " + pi.getId(), ex);
- }
- return pi;
+ retrieveVariables(ti);
}
-
- public ProcessDefinition retrieveProcessDefinition(ProcessDefinition pd) {
- try {
- pd.getName();
- // often needed to start a process:
- Iterator iter = pd.getStartState().getLeavingTransitions().iterator();
- while (iter.hasNext()) {
- Transition t = (Transition) iter.next();
- t.getName();
- }
- }
- catch (Exception ex) {
- log.warn("exception while retrieving process instance data for process definiton " + pd.getName(), ex);
- }
- return pd;
+ catch (Exception ex)
+ {
+ log.warn("exception while retrieving task instance data for task instance " + ti.getId(), ex);
}
+ }
- protected void retrieveToken(Token t) {
- retrieveNode(t.getNode());
- t.getAvailableTransitions();
-
-// if (includeLogs)
-// t.getProcessInstance().getLoggingInstance().
+ public ProcessInstance retrieveProcessInstance(ProcessInstance pi)
+ {
+ try
+ {
+ pi.getProcessDefinition().getName();
+ retrieveToken(pi.getRootToken());
- Iterator iter = t.getChildren().values().iterator();
- while (iter.hasNext()) {
- retrieveToken((Token) iter.next());
- }
- }
+ // load at least the super process id and token id
+ if (pi.getSuperProcessToken() != null)
+ {
+ pi.getSuperProcessToken().getId();
+ pi.getSuperProcessToken().getProcessInstance().getId();
+ }
- protected void retrieveNode(Node n) {
- n.getName();
- n.getLeavingTransitions();
- if (n.getSuperState()!=null)
- retrieveNode(n.getSuperState());
+ retrieveVariables(pi);
}
-
- public void retrieveVariables(ProcessInstance pi) {
- if (includeAllVariables) {
- pi.getContextInstance().getVariables();
- }
- else {
- for (int i = 0; i < variablesToInclude.length; i++) {
- pi.getContextInstance().getVariable(variablesToInclude[i]);
- }
- }
+ catch (Exception ex)
+ {
+ log.warn("exception while retrieving process instance data for process instance " + pi.getId(), ex);
}
+ return pi;
+ }
- public void retrieveVariables(TaskInstance ti) {
- if (includeAllVariables) {
- ti.getVariables();
- }
- else {
- for (int i = 0; i < variablesToInclude.length; i++) {
- ti.getVariable(variablesToInclude[i]);
- }
- }
+ public ProcessDefinition retrieveProcessDefinition(ProcessDefinition pd)
+ {
+ try
+ {
+ pd.getName();
+ // often needed to start a process:
+ Iterator iter = pd.getStartState().getLeavingTransitions().iterator();
+ while (iter.hasNext())
+ {
+ Transition t = (Transition)iter.next();
+ t.getName();
+ }
}
-
- public boolean isIncludeAllVariables() {
- return includeAllVariables;
+ catch (Exception ex)
+ {
+ log.warn("exception while retrieving process instance data for process definiton " + pd.getName(), ex);
}
+ return pd;
+ }
- public void setIncludeAllVariables(boolean includeAllVariables) {
- this.includeAllVariables = includeAllVariables;
- }
+ protected void retrieveToken(Token t)
+ {
+ retrieveNode(t.getNode());
+ t.getAvailableTransitions();
- public String[] getVariablesToInclude() {
- return variablesToInclude;
+ // if (includeLogs)
+ // t.getProcessInstance().getLoggingInstance().
+
+ Iterator iter = t.getChildren().values().iterator();
+ while (iter.hasNext())
+ {
+ retrieveToken((Token)iter.next());
}
+ }
- public void setVariablesToInclude(String[] variablesToInclude) {
- this.variablesToInclude = variablesToInclude;
+ protected void retrieveNode(Node n)
+ {
+ n.getName();
+ n.getLeavingTransitions();
+ if (n.getSuperState() != null)
+ retrieveNode(n.getSuperState());
+ }
+
+ public void retrieveVariables(ProcessInstance pi)
+ {
+ if (includeAllVariables)
+ {
+ pi.getContextInstance().getVariables();
}
+ else
+ {
+ for (int i = 0; i < variablesToInclude.length; i++)
+ {
+ pi.getContextInstance().getVariable(variablesToInclude[i]);
+ }
+ }
+ }
- public void setVariablesToInclude(String variableToInclude) {
- this.variablesToInclude = new String[] { variableToInclude };
+ public void retrieveVariables(TaskInstance ti)
+ {
+ if (includeAllVariables)
+ {
+ ti.getVariables();
}
-
- protected JbpmContext getJbpmContext() {
- return jbpmContext;
+ else
+ {
+ for (int i = 0; i < variablesToInclude.length; i++)
+ {
+ ti.getVariable(variablesToInclude[i]);
+ }
}
+ }
- protected void setJbpmContext(JbpmContext jbpmContext) {
- this.jbpmContext = jbpmContext;
- }
+ public boolean isIncludeAllVariables()
+ {
+ return includeAllVariables;
+ }
+
+ public void setIncludeAllVariables(boolean includeAllVariables)
+ {
+ this.includeAllVariables = includeAllVariables;
+ }
+
+ public String[] getVariablesToInclude()
+ {
+ return variablesToInclude;
+ }
+
+ public void setVariablesToInclude(String[] variablesToInclude)
+ {
+ this.variablesToInclude = variablesToInclude;
+ }
+
+ public void setVariablesToInclude(String variableToInclude)
+ {
+ this.variablesToInclude = new String[] { variableToInclude };
+ }
+
+ protected JbpmContext getJbpmContext()
+ {
+ return jbpmContext;
+ }
+
+ protected void setJbpmContext(JbpmContext jbpmContext)
+ {
+ this.jbpmContext = jbpmContext;
+ }
}
\ No newline at end of file
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/AsynchronousCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/AsynchronousCommand.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/AsynchronousCommand.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -3,23 +3,26 @@
import org.jbpm.JbpmContext;
/**
- * provides extra configuration options for the execution of asynchronous commands.
- * Plain commands can also be executed asynchronously.
+ * provides extra configuration options for the execution of asynchronous commands. Plain commands can also be executed
+ * asynchronously.
*/
-public class AsynchronousCommand implements Command {
+public class AsynchronousCommand implements Command
+{
private static final long serialVersionUID = 1L;
int retryCount = 1;
Command command;
-
- public AsynchronousCommand(Command command) {
+
+ public AsynchronousCommand(Command command)
+ {
this.command = command;
}
-
- public Object execute(JbpmContext jbpmContext) throws Exception {
+
+ public Object execute(JbpmContext jbpmContext) throws Exception
+ {
throw new UnsupportedOperationException("sending any command over the message service is not yet supported");
}
-
+
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/BatchSignalCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/BatchSignalCommand.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/BatchSignalCommand.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -10,132 +10,145 @@
import org.jbpm.graph.exe.Token;
/**
- * a bunch of processes is signalled with this command. you can specify the
- * tokens either
- * <li> by a array of token ids
- * <li> or by processName, processVersion (optional, without all versions),
- * stateName
+ * a bunch of processes is signalled with this command. you can specify the tokens either <li>by a array of token ids
+ * <li>or by processName, processVersion (optional, without all versions), stateName
*
- * transitionName speicifies the transition to take (if null, the default
- * transition is taken).
+ * transitionName speicifies the transition to take (if null, the default transition is taken).
*
- * This command can be for example useful, if you have a lot of processes to
- * check some information a not jBPM task has altered before (maybe in batch
- * too).
+ * This command can be for example useful, if you have a lot of processes to check some information a not jBPM task has
+ * altered before (maybe in batch too).
*
- * CURRENTLY EXPERIMENTAL!
+ * CURRENTLY EXPERIMENTAL!
*
* @author Bernd Rucker (bernd.ruecker(a)camunda.com)
*/
-public class BatchSignalCommand implements Command {
+public class BatchSignalCommand implements Command
+{
- private static final long serialVersionUID = -4330623193546102772L;
+ private static final long serialVersionUID = -4330623193546102772L;
- private static Log log = LogFactory.getLog(BatchSignalCommand.class);
+ private static Log log = LogFactory.getLog(BatchSignalCommand.class);
- private long[] tokenIds = null;
+ private long[] tokenIds = null;
- private String processName = null;
+ private String processName = null;
- private String stateName = null;
-
- /**
- * if set, only tokens which are started after this date are signaled
- * (interessting to implement some timeout for example)
- */
- private Date inStateAtLeastSince = null;
+ private String stateName = null;
- private long processVersion = 0;
+ /**
+ * if set, only tokens which are started after this date are signaled (interessting to implement some timeout for
+ * example)
+ */
+ private Date inStateAtLeastSince = null;
- private String transitionName = null;
+ private long processVersion = 0;
- public Object execute(JbpmContext jbpmContext) throws Exception {
- log.debug("executing " + this);
+ private String transitionName = null;
- // batch tokens
- if (tokenIds != null && tokenIds.length > 0) {
- for (int i = 0; i < tokenIds.length; i++) {
- Token token = jbpmContext.loadTokenForUpdate(tokenIds[i]);
- signalToken(token);
- }
- }
+ public Object execute(JbpmContext jbpmContext) throws Exception
+ {
+ log.debug("executing " + this);
- // search for tokens in process/state
- if (processName != null && stateName != null) {
- Query query = jbpmContext
- .getSession()
- .getNamedQuery(
- "GraphSession.findTokensForProcessInNode");
- query.setString("processDefinitionName", processName);
- query.setString("nodeName", stateName);
+ // batch tokens
+ if (tokenIds != null && tokenIds.length > 0)
+ {
+ for (int i = 0; i < tokenIds.length; i++)
+ {
+ Token token = jbpmContext.loadTokenForUpdate(tokenIds[i]);
+ signalToken(token);
+ }
+ }
- Iterator iter = query.list().iterator();
- while (iter.hasNext()) {
- Token t = (Token) iter.next();
- if (inStateAtLeastSince== null || t.getNodeEnter().before(inStateAtLeastSince))
- signalToken(t);
- }
- }
+ // search for tokens in process/state
+ if (processName != null && stateName != null)
+ {
+ Query query = jbpmContext.getSession().getNamedQuery("GraphSession.findTokensForProcessInNode");
+ query.setString("processDefinitionName", processName);
+ query.setString("nodeName", stateName);
- return null;
+ Iterator iter = query.list().iterator();
+ while (iter.hasNext())
+ {
+ Token t = (Token)iter.next();
+ if (inStateAtLeastSince == null || t.getNodeEnter().before(inStateAtLeastSince))
+ signalToken(t);
+ }
}
- private void signalToken(Token token) {
- log.debug("signal token " + token);
- if (transitionName == null) {
- token.signal();
- }
- else {
- token.signal(transitionName);
- }
- }
+ return null;
+ }
- public String getProcessName() {
- return processName;
+ private void signalToken(Token token)
+ {
+ log.debug("signal token " + token);
+ if (transitionName == null)
+ {
+ token.signal();
}
-
- public void setProcessName(String processName) {
- this.processName = processName;
+ else
+ {
+ token.signal(transitionName);
}
+ }
- public long getProcessVersion() {
- return processVersion;
- }
+ public String getProcessName()
+ {
+ return processName;
+ }
- public void setProcessVersion(long processVersion) {
- this.processVersion = processVersion;
- }
+ public void setProcessName(String processName)
+ {
+ this.processName = processName;
+ }
- public String getStateName() {
- return stateName;
- }
+ public long getProcessVersion()
+ {
+ return processVersion;
+ }
- public void setStateName(String stateName) {
- this.stateName = stateName;
- }
+ public void setProcessVersion(long processVersion)
+ {
+ this.processVersion = processVersion;
+ }
- public long[] getTokenIds() {
- return tokenIds;
- }
+ public String getStateName()
+ {
+ return stateName;
+ }
- public void setTokenIds(long[] tokenIds) {
- this.tokenIds = tokenIds;
- }
+ public void setStateName(String stateName)
+ {
+ this.stateName = stateName;
+ }
- public String getTransitionName() {
- return transitionName;
- }
+ public long[] getTokenIds()
+ {
+ return tokenIds;
+ }
- public void setTransitionName(String transitionName) {
- this.transitionName = transitionName;
- }
+ public void setTokenIds(long[] tokenIds)
+ {
+ this.tokenIds = tokenIds;
+ }
- public Date getInStateAtLeastSince() {
- return inStateAtLeastSince;
- }
+ public String getTransitionName()
+ {
+ return transitionName;
+ }
- public void setInStateAtLeastSince(Date inStateAtLeastSince) {
- this.inStateAtLeastSince = inStateAtLeastSince;
- }
+ public void setTransitionName(String transitionName)
+ {
+ this.transitionName = transitionName;
+ }
+ public Date getInStateAtLeastSince()
+ {
+ return inStateAtLeastSince;
+ }
+
+ public void setInStateAtLeastSince(Date inStateAtLeastSince)
+ {
+ this.inStateAtLeastSince = inStateAtLeastSince;
+ }
+
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/CancelProcessInstanceCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/CancelProcessInstanceCommand.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/CancelProcessInstanceCommand.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -1,9 +1,7 @@
package org.jbpm.command;
import java.util.Date;
-import java.util.Iterator;
-import org.hibernate.Query;
import org.jbpm.JbpmContext;
import org.jbpm.graph.exe.ProcessInstance;
@@ -12,59 +10,68 @@
* @author Bernd Ruecker (bernd.ruecker(a)camunda.com)
*
*/
-public class CancelProcessInstanceCommand extends AbstractCancelCommand implements Command {
+public class CancelProcessInstanceCommand extends AbstractCancelCommand implements Command
+{
- private static final long serialVersionUID = 7145293049356621597L;
+ private static final long serialVersionUID = 7145293049356621597L;
- private long processId;
+ private long processId;
- public CancelProcessInstanceCommand() {
- }
+ public CancelProcessInstanceCommand()
+ {
+ }
- public CancelProcessInstanceCommand(long processId) {
- this.processId = processId;
- }
+ public CancelProcessInstanceCommand(long processId)
+ {
+ this.processId = processId;
+ }
- public Object execute(JbpmContext jbpmContext) throws Exception {
- this.jbpmContext = jbpmContext;
- cancelProcess(processId);
- this.jbpmContext = null;
- return null;
- }
-
- protected void cancelProcess(long processIdToCancel) {
- ProcessInstance pi = jbpmContext.getGraphSession().loadProcessInstance(
- processIdToCancel);
-
- log.info("cancel process instance " + pi.getId());
-
- // Record a standardized variable that we can use to determine that this
- // process has been 'cancelled' and not just ended.
- pi.getContextInstance().createVariable("cancelled", new Date());
-
- try {
- // End the process instance and any open tokens
- // TODO: better implementation (also cancel sub processes etc.)
- // see http://intranet.computation.de/bugs/view_bug.php?bug_id=295
-
- cancelToken(pi.getRootToken());
- cancelTokens(pi.getRootToken().getChildren().values());
-
- pi.end();
+ public Object execute(JbpmContext jbpmContext) throws Exception
+ {
+ this.jbpmContext = jbpmContext;
+ cancelProcess(processId);
+ this.jbpmContext = null;
+ return null;
+ }
- log.info("finished process cancellation");
- } catch (RuntimeException ex) {
- log.error("problems while cancel process", ex);
- throw ex;
- }
- }
-
- public long getProcessId() {
- return processId;
- }
+ protected void cancelProcess(long processIdToCancel)
+ {
+ ProcessInstance pi = jbpmContext.getGraphSession().loadProcessInstance(processIdToCancel);
- public void setProcessId(long processId) {
- this.processId = processId;
- }
+ log.info("cancel process instance " + pi.getId());
+ // Record a standardized variable that we can use to determine that this
+ // process has been 'cancelled' and not just ended.
+ pi.getContextInstance().createVariable("cancelled", new Date());
+
+ try
+ {
+ // End the process instance and any open tokens
+ // TODO: better implementation (also cancel sub processes etc.)
+ // see http://intranet.computation.de/bugs/view_bug.php?bug_id=295
+
+ cancelToken(pi.getRootToken());
+ cancelTokens(pi.getRootToken().getChildren().values());
+
+ pi.end();
+
+ log.info("finished process cancellation");
+ }
+ catch (RuntimeException ex)
+ {
+ log.error("problems while cancel process", ex);
+ throw ex;
+ }
+ }
+
+ public long getProcessId()
+ {
+ return processId;
+ }
+
+ public void setProcessId(long processId)
+ {
+ this.processId = processId;
+ }
+
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/CancelTokenCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/CancelTokenCommand.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/CancelTokenCommand.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -7,32 +7,38 @@
* @author Bernd Ruecker (bernd.ruecker(a)camunda.com)
*
*/
-public class CancelTokenCommand extends AbstractCancelCommand implements Command {
+public class CancelTokenCommand extends AbstractCancelCommand implements Command
+{
- private static final long serialVersionUID = 7145293049356621597L;
+ private static final long serialVersionUID = 7145293049356621597L;
- private long tokenId;
+ private long tokenId;
- public CancelTokenCommand() {
- }
+ public CancelTokenCommand()
+ {
+ }
- public CancelTokenCommand(long tokenId) {
- this.tokenId = tokenId;
- }
+ public CancelTokenCommand(long tokenId)
+ {
+ this.tokenId = tokenId;
+ }
- public Object execute(JbpmContext jbpmContext) throws Exception {
- this.jbpmContext = jbpmContext;
- cancelToken(jbpmContext.getGraphSession().loadToken(tokenId));
- this.jbpmContext = null;
- return null;
- }
+ public Object execute(JbpmContext jbpmContext) throws Exception
+ {
+ this.jbpmContext = jbpmContext;
+ cancelToken(jbpmContext.getGraphSession().loadToken(tokenId));
+ this.jbpmContext = null;
+ return null;
+ }
- public long getTokenId() {
- return tokenId;
- }
+ public long getTokenId()
+ {
+ return tokenId;
+ }
- public void setTokenId(long tokenId) {
- this.tokenId = tokenId;
- }
+ public void setTokenId(long tokenId)
+ {
+ this.tokenId = tokenId;
+ }
}
\ No newline at end of file
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/CancelWorkOnTaskCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/CancelWorkOnTaskCommand.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/CancelWorkOnTaskCommand.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -4,40 +4,45 @@
import org.jbpm.taskmgmt.exe.TaskInstance;
/**
- * The current authorizes actor starts to work on the TaskInstance
- * so the actor is set to the given actor
+ * The current authorizes actor starts to work on the TaskInstance so the actor is set to the given actor
*
- * see some more information why we need that in the
- * <a href="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018785">jbpm forum</a>
+ * see some more information why we need that in the <a
+ * href="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018785">jbpm forum</a>
*
* @author Bernd Ruecker
*/
-public class CancelWorkOnTaskCommand implements Command {
+public class CancelWorkOnTaskCommand implements Command
+{
- private static final long serialVersionUID = -172457633891242288L;
+ private static final long serialVersionUID = -172457633891242288L;
- private long taskInstanceId;
+ private long taskInstanceId;
- public CancelWorkOnTaskCommand(long taskInstanceId) {
- this.taskInstanceId = taskInstanceId;
- }
+ public CancelWorkOnTaskCommand(long taskInstanceId)
+ {
+ this.taskInstanceId = taskInstanceId;
+ }
- public CancelWorkOnTaskCommand() {
- }
-
- public Object execute(JbpmContext jbpmContext) throws Exception {
- TaskInstance ti = jbpmContext.getTaskInstance(taskInstanceId);
- ti.setActorId(null);
- ti.setStart(null);
- return null;
- }
+ public CancelWorkOnTaskCommand()
+ {
+ }
- public long getTaskInstanceId() {
- return taskInstanceId;
- }
+ public Object execute(JbpmContext jbpmContext) throws Exception
+ {
+ TaskInstance ti = jbpmContext.getTaskInstance(taskInstanceId);
+ ti.setActorId(null);
+ ti.setStart(null);
+ return null;
+ }
- public void setTaskInstanceId(long taskInstanceId) {
- this.taskInstanceId = taskInstanceId;
- }
+ public long getTaskInstanceId()
+ {
+ return taskInstanceId;
+ }
+ public void setTaskInstanceId(long taskInstanceId)
+ {
+ this.taskInstanceId = taskInstanceId;
+ }
+
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/ChangeProcessInstanceVersionCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/ChangeProcessInstanceVersionCommand.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/ChangeProcessInstanceVersionCommand.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -21,226 +21,246 @@
/**
* <b>THIS COMMAND IS NOT YET STABLE, BUT FEEL FREE TO TEST :-)</b>
*
- * change the version of a running process instance. This works only, if the
- * current node is also available in the new version of the process definition
- * (identified by name, so the name has to be exactly the same). One problem
- * with this approach ist also, that if a task with the same name is moved to
- * another node (but this is a rare case)
+ * change the version of a running process instance. This works only, if the current node is also available in the new
+ * version of the process definition (identified by name, so the name has to be exactly the same). One problem with this
+ * approach ist also, that if a task with the same name is moved to another node (but this is a rare case)
*
*
- * make trouble, if there are 2 tokens in the process, because only one actual
- * node is used...
+ * make trouble, if there are 2 tokens in the process, because only one actual node is used...
*
* Possible workaround: use process id instead of node id.
*
- * TODO: new hibernate query for that? Proposal Fluffi "select distinct task " +
- * "from " + Task.class.getName() + " task " + "where task.name = :taskName " + "
- * and task.processDefinition.id = :processDefinitionId ";
+ * TODO: new hibernate query for that? Proposal Fluffi "select distinct task " + "from " + Task.class.getName() +
+ * " task " + "where task.name = :taskName " + " and task.processDefinition.id = :processDefinitionId ";
*
* @author Bernd Ruecker (bernd.ruecker(a)camunda.com)
*/
-public class ChangeProcessInstanceVersionCommand implements Command {
+public class ChangeProcessInstanceVersionCommand implements Command
+{
- private static final long serialVersionUID = 2277080393930008224L;
+ private static final long serialVersionUID = 2277080393930008224L;
- /**
- * process id of process to update. If set, this special process is updated
- */
- private long processId = -1;
-
- /**
- * if set, all running processes of the process with this name are updated
- */
- private String processName;
+ /**
+ * process id of process to update. If set, this special process is updated
+ */
+ private long processId = -1;
- /**
- * new version of process, if <=0, the latest process definition is used
- */
- private int newVersion = -1;
+ /**
+ * if set, all running processes of the process with this name are updated
+ */
+ private String processName;
- private static final Log log = LogFactory.getLog(JbpmSchema.class);
+ /**
+ * new version of process, if <=0, the latest process definition is used
+ */
+ private int newVersion = -1;
- private transient JbpmContext jbpmContext = null;
+ private static final Log log = LogFactory.getLog(JbpmSchema.class);
- /**
- * the map configures for every node-name in the old process definition (as
- * key) which node-name to use in the new process definition.
- *
- * if a node is not mentioned in this Map, old node name = new node name is
- * applied
- */
- private Map nameMapping = new HashMap();
-
- private transient ProcessDefinition newDef;
+ private transient JbpmContext jbpmContext = null;
- public ChangeProcessInstanceVersionCommand() {
+ /**
+ * the map configures for every node-name in the old process definition (as key) which node-name to use in the new
+ * process definition.
+ *
+ * if a node is not mentioned in this Map, old node name = new node name is applied
+ */
+ private Map nameMapping = new HashMap();
+
+ private transient ProcessDefinition newDef;
+
+ public ChangeProcessInstanceVersionCommand()
+ {
+ }
+
+ public ChangeProcessInstanceVersionCommand(long processId, int newVersion)
+ {
+ this.processId = processId;
+ this.newVersion = newVersion;
+ }
+
+ private ProcessDefinition getNewDef(String processName)
+ {
+ if (newDef == null)
+ {
+ if (newVersion <= 0)
+ newDef = jbpmContext.getGraphSession().findLatestProcessDefinition(processName);
+ else
+ newDef = jbpmContext.getGraphSession().findProcessDefinition(processName, newVersion);
}
+ return newDef;
+ }
- public ChangeProcessInstanceVersionCommand(long processId, int newVersion) {
- this.processId = processId;
- this.newVersion = newVersion;
+ /**
+ * @return always null
+ * @see org.jbpm.command.Command#execute(org.jbpm.JbpmContext)
+ */
+ public Object execute(JbpmContext jbpmContext) throws Exception
+ {
+ this.jbpmContext = jbpmContext;
+ if (processId > -1)
+ {
+ ProcessInstance pi = jbpmContext.getGraphSession().loadProcessInstance(processId);
+ changeProcessVersion(pi);
}
-
- private ProcessDefinition getNewDef(String processName) {
- if(newDef==null) {
- if (newVersion<=0)
- newDef = jbpmContext.getGraphSession().findLatestProcessDefinition(processName);
- else
- newDef = jbpmContext.getGraphSession().findProcessDefinition(processName, newVersion);
- }
- return newDef;
+ if (processName != null && processName.length() > 0)
+ {
+ changeAllProcessInstances(processName);
}
+ return null;
+ }
- /**
- * @return always null
- * @see org.jbpm.command.Command#execute(org.jbpm.JbpmContext)
- */
- public Object execute(JbpmContext jbpmContext) throws Exception {
- this.jbpmContext = jbpmContext;
- if (processId>-1) {
- ProcessInstance pi = jbpmContext.getGraphSession().loadProcessInstance(processId);
- changeProcessVersion(pi);
- }
- if (processName!=null && processName.length()>0) {
- changeAllProcessInstances(processName);
- }
- return null;
- }
+ private void changeProcessVersion(ProcessInstance pi)
+ {
+ changeTokenVersion(jbpmContext, pi.getRootToken());
- private void changeProcessVersion(ProcessInstance pi) {
- changeTokenVersion(jbpmContext, pi.getRootToken());
+ ProcessDefinition oldDef = pi.getProcessDefinition();
+ ProcessDefinition newDef = getNewDef(oldDef.getName());
- ProcessDefinition oldDef = pi.getProcessDefinition();
- ProcessDefinition newDef = getNewDef(oldDef.getName());
+ log.debug("changes process id " + pi.getId() + " from version " + pi.getProcessDefinition().getVersion() + " to new version " + newDef.getVersion());
- log.debug("changes process id " + pi.getId() + " from version " + pi.getProcessDefinition().getVersion() + " to new version " + newDef.getVersion());
+ pi.setProcessDefinition(newDef);
- pi.setProcessDefinition(newDef);
+ log.debug("process id " + pi.getId() + " changed to version " + pi.getProcessDefinition().getVersion());
+ }
- log.debug("process id " + pi.getId() + " changed to version " + pi.getProcessDefinition().getVersion());
- }
-
- private void changeAllProcessInstances(String processName) throws Exception {
- log.debug("changing version all processes '" + processName + "'");
+ private void changeAllProcessInstances(String processName) throws Exception
+ {
+ log.debug("changing version all processes '" + processName + "'");
- GetProcessInstancesCommand cmd = new GetProcessInstancesCommand();
- cmd.setProcessName(processName);
- cmd.setOnlyRunning(true);
-
- List instances = (List)cmd.execute(jbpmContext);
- for (Iterator iter = instances.iterator(); iter.hasNext();) {
- ProcessInstance pi = (ProcessInstance) iter.next();
- changeProcessVersion(pi);
- }
+ GetProcessInstancesCommand cmd = new GetProcessInstancesCommand();
+ cmd.setProcessName(processName);
+ cmd.setOnlyRunning(true);
+
+ List instances = (List)cmd.execute(jbpmContext);
+ for (Iterator iter = instances.iterator(); iter.hasNext();)
+ {
+ ProcessInstance pi = (ProcessInstance)iter.next();
+ changeProcessVersion(pi);
}
+ }
- private void changeTokenVersion(JbpmContext jbpmContext, Token token) {
- Node oldNode = token.getNode();
+ private void changeTokenVersion(JbpmContext jbpmContext, Token token)
+ {
+ Node oldNode = token.getNode();
- ProcessDefinition oldDef = token.getProcessInstance().getProcessDefinition();
- ProcessDefinition newDef = getNewDef(oldDef.getName());
-
- Node newNode = newDef.findNode(getNewNodeName(oldNode));
+ ProcessDefinition oldDef = token.getProcessInstance().getProcessDefinition();
+ ProcessDefinition newDef = getNewDef(oldDef.getName());
- if (newNode == null) {
- throw new JbpmException("node with name '" + getNewNodeName(oldNode) + "' not found in new process definition");
- }
+ Node newNode = newDef.findNode(getNewNodeName(oldNode));
- log.debug("change token id " + token.getId() + " from version " + oldDef.getVersion() + " to new version " + newDef.getVersion());
+ if (newNode == null)
+ {
+ throw new JbpmException("node with name '" + getNewNodeName(oldNode) + "' not found in new process definition");
+ }
- token.setNode(newNode);
+ log.debug("change token id " + token.getId() + " from version " + oldDef.getVersion() + " to new version " + newDef.getVersion());
- // TODO: Change timers too!
+ token.setNode(newNode);
- // change tasks
- Iterator iter = getTasksForToken(token).iterator();
- while (iter.hasNext()) {
- TaskInstance ti = (TaskInstance) iter.next();
+ // TODO: Change timers too!
- Task oldTask = ti.getTask();
- // find new task
- Query q = jbpmContext.getSession().getNamedQuery("TaskMgmtSession.findTaskForNode");
- q.setString("taskName", oldTask.getName());
- q.setLong("taskNodeId", newNode.getId());
- // TODO: q.setLong("processDefinitionId", newDef.getId());
+ // change tasks
+ Iterator iter = getTasksForToken(token).iterator();
+ while (iter.hasNext())
+ {
+ TaskInstance ti = (TaskInstance)iter.next();
- Task newTask = (Task) q.uniqueResult();
+ Task oldTask = ti.getTask();
+ // find new task
+ Query q = jbpmContext.getSession().getNamedQuery("TaskMgmtSession.findTaskForNode");
+ q.setString("taskName", oldTask.getName());
+ q.setLong("taskNodeId", newNode.getId());
+ // TODO: q.setLong("processDefinitionId", newDef.getId());
- if (newTask == null) {
- throw new JbpmException("node '" + newNode.getName() + "' has no Task configured! Check the new process definition");
- }
+ Task newTask = (Task)q.uniqueResult();
- ti.setTask(newTask);
- log.debug("change dependent task-instance with id " + oldTask.getId());
- }
+ if (newTask == null)
+ {
+ throw new JbpmException("node '" + newNode.getName() + "' has no Task configured! Check the new process definition");
+ }
- // change childs recursive
- Iterator childIter = token.getChildren().values().iterator();
- while (childIter.hasNext()) {
- changeTokenVersion(jbpmContext, (Token) childIter.next());
- }
+ ti.setTask(newTask);
+ log.debug("change dependent task-instance with id " + oldTask.getId());
}
- /**
- * @param oldNode
- * @return the name of the new node (given in the map or return default
- * value, which is the old node name)
- */
- private String getNewNodeName(Node oldNode) {
- String oldName = oldNode.getFullyQualifiedName();
- if (nameMapping.containsKey(oldName)) {
- return (String) nameMapping.get(oldName);
- }
- // return new node name = old node name as default
- return oldName;
+ // change childs recursive
+ Iterator childIter = token.getChildren().values().iterator();
+ while (childIter.hasNext())
+ {
+ changeTokenVersion(jbpmContext, (Token)childIter.next());
}
+ }
- /**
- * We may still have open tasks, even though their parent tokens have been
- * ended. So we'll simply get all tasks from this process instance and
- * cancel them if they are still active.
- *
- */
- private List getTasksForToken(Token token) {
- Query query = jbpmContext.getSession().getNamedQuery("TaskMgmtSession.findTaskInstancesByTokenId");
- query.setLong("tokenId", token.getId());
- return query.list();
-
+ /**
+ * @param oldNode
+ * @return the name of the new node (given in the map or return default value, which is the old node name)
+ */
+ private String getNewNodeName(Node oldNode)
+ {
+ String oldName = oldNode.getFullyQualifiedName();
+ if (nameMapping.containsKey(oldName))
+ {
+ return (String)nameMapping.get(oldName);
}
+ // return new node name = old node name as default
+ return oldName;
+ }
- public Map getNameMapping() {
- return nameMapping;
- }
+ /**
+ * We may still have open tasks, even though their parent tokens have been ended. So we'll simply get all tasks from
+ * this process instance and cancel them if they are still active.
+ *
+ */
+ private List getTasksForToken(Token token)
+ {
+ Query query = jbpmContext.getSession().getNamedQuery("TaskMgmtSession.findTaskInstancesByTokenId");
+ query.setLong("tokenId", token.getId());
+ return query.list();
- public void setNameMapping(Map nameMapping) {
- if (nameMapping==null)
- this.nameMapping = new HashMap();
- else
- this.nameMapping = nameMapping;
- }
+ }
- public int getNewVersion() {
- return newVersion;
- }
+ public Map getNameMapping()
+ {
+ return nameMapping;
+ }
- public void setNewVersion(int newVersion) {
- this.newVersion = newVersion;
- }
+ public void setNameMapping(Map nameMapping)
+ {
+ if (nameMapping == null)
+ this.nameMapping = new HashMap();
+ else
+ this.nameMapping = nameMapping;
+ }
- public long getProcessId() {
- return processId;
- }
+ public int getNewVersion()
+ {
+ return newVersion;
+ }
- public void setProcessId(long processId) {
- this.processId = processId;
- }
+ public void setNewVersion(int newVersion)
+ {
+ this.newVersion = newVersion;
+ }
- public String getProcessName() {
- return processName;
- }
+ public long getProcessId()
+ {
+ return processId;
+ }
- public void setProcessName(String processName) {
- this.processName = processName;
- }
+ public void setProcessId(long processId)
+ {
+ this.processId = processId;
+ }
+ public String getProcessName()
+ {
+ return processName;
+ }
+
+ public void setProcessName(String processName)
+ {
+ this.processName = processName;
+ }
+
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/Command.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/Command.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/Command.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -25,7 +25,8 @@
import org.jbpm.JbpmContext;
-public interface Command extends Serializable {
+public interface Command extends Serializable
+{
Object execute(JbpmContext jbpmContext) throws Exception;
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/CommandService.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/CommandService.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/CommandService.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -22,26 +22,24 @@
package org.jbpm.command;
import org.jbpm.JbpmException;
-import org.jbpm.command.Command;
/**
* Provides jBPM engine services.
*
* @author Jim Rigsbee, Tom Baeyens
*/
-public interface CommandService {
+public interface CommandService
+{
/**
- * is the session facade that takes commands and executes them. The CommandService
- * is responsible for creating or obtaining the JbpmContext. The JbpmContext
- * will be passed to the commands as a parameter. In a transactional environment,
- * the execute method demarcates a transaction. The command can be executed remotely and/or
+ * is the session facade that takes commands and executes them. The CommandService is responsible for creating or
+ * obtaining the JbpmContext. The JbpmContext will be passed to the commands as a parameter. In a transactional
+ * environment, the execute method demarcates a transaction. The command can be executed remotely and/or
* asynchronously.
*
- * @param command
- * engine command to execute
- * @return an object. The types of objects is determined by the command implementation.
- * See those docs for more details on the return object.
+ * @param command engine command to execute
+ * @return an object. The types of objects is determined by the command implementation. See those docs for more
+ * details on the return object.
* @throws JbpmException
*/
public Object execute(Command command);
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/CompositeCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/CompositeCommand.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/CompositeCommand.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -8,25 +8,31 @@
import org.jbpm.JbpmContext;
import org.jbpm.JbpmException;
-public class CompositeCommand implements Command {
+public class CompositeCommand implements Command
+{
private static final long serialVersionUID = 1L;
-
+
List commands = null;
-
- public CompositeCommand(List commands) {
+
+ public CompositeCommand(List commands)
+ {
this.commands = commands;
}
- public Object execute(JbpmContext jbpmContext) throws Exception {
+ public Object execute(JbpmContext jbpmContext) throws Exception
+ {
List results = null;
- if (commands!=null) {
+ if (commands != null)
+ {
Object lastResult = null;
results = new ArrayList(commands.size());
Iterator iter = commands.iterator();
- while(iter.hasNext()) {
+ while (iter.hasNext())
+ {
Command command = (Command)iter.next();
- if (lastResult!=null) {
+ if (lastResult != null)
+ {
tryToInject(lastResult, command);
}
lastResult = command.execute(jbpmContext);
@@ -36,29 +42,33 @@
return results;
}
- protected void tryToInject(Object lastResult, Command command) {
+ protected void tryToInject(Object lastResult, Command command)
+ {
Field field = findField(lastResult.getClass());
- if (field!=null) {
+ if (field != null)
+ {
field.setAccessible(true);
- try {
+ try
+ {
field.set(command, lastResult);
- } catch (Exception e) {
+ }
+ catch (Exception e)
+ {
throw new JbpmException("couldn't propagate composite command context", e);
}
}
}
- protected Field findField(Class clazz) {
+ protected Field findField(Class clazz)
+ {
Field field = null;
- int i=0;
+ int i = 0;
Field[] fields = clazz.getDeclaredFields();
- while ( (i<fields.length)
- && (field==null)
- ) {
+ while ((i < fields.length) && (field == null))
+ {
Field candidate = fields[i];
- if ( (candidate.getType().isAssignableFrom(clazz))
- && (candidate.getName().startsWith("previous"))
- ) {
+ if ((candidate.getType().isAssignableFrom(clazz)) && (candidate.getName().startsWith("previous")))
+ {
field = candidate;
}
i++;
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/DeleteProcessdefinitionCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/DeleteProcessdefinitionCommand.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/DeleteProcessdefinitionCommand.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -22,28 +22,29 @@
package org.jbpm.command;
import org.jbpm.JbpmContext;
-import org.jbpm.graph.def.ProcessDefinition;
/**
- * Delete a proces definition by ID
+ * Delete a proces definition by ID
*
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
-public class DeleteProcessdefinitionCommand extends AbstractGetObjectBaseCommand {
+public class DeleteProcessdefinitionCommand extends AbstractGetObjectBaseCommand
+{
- private static final long serialVersionUID = -1908847549444051495L;
+ private static final long serialVersionUID = -1908847549444051495L;
- private long id;
-
- public DeleteProcessdefinitionCommand(long id) {
- super();
- this.id = id;
- }
+ private long id;
- public Object execute(JbpmContext jbpmContext) throws Exception
- {
- jbpmContext.getGraphSession().deleteProcessDefinition(id);
- return Boolean.TRUE;
- }
+ public DeleteProcessdefinitionCommand(long id)
+ {
+ super();
+ this.id = id;
+ }
+ public Object execute(JbpmContext jbpmContext) throws Exception
+ {
+ jbpmContext.getGraphSession().deleteProcessDefinition(id);
+ return Boolean.TRUE;
+ }
+
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/DeployProcessCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/DeployProcessCommand.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/DeployProcessCommand.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -3,24 +3,22 @@
import java.io.ByteArrayInputStream;
import java.util.zip.ZipInputStream;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.jbpm.JbpmContext;
import org.jbpm.JbpmException;
import org.jbpm.graph.def.ProcessDefinition;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
/**
- * Deploys a process, given as XML-String (be patient with Umlauts or something
- * like that) or par archive (byte-array). if both is given, the byte-array will
- * be preferred
+ * Deploys a process, given as XML-String or process archive.
*
- * The deployed process definition is returned
+ * If both are given, the byte-array will be preferred The deployed process definition is returned
*
* @author Bernd Ruecker (bernd.ruecker(a)camunda.com)
*
*/
-public class DeployProcessCommand extends AbstractGetObjectBaseCommand {
-
+public class DeployProcessCommand extends AbstractGetObjectBaseCommand
+{
private static final long serialVersionUID = -5861811926680981061L;
private String xml;
@@ -29,64 +27,75 @@
private static final Log log = LogFactory.getLog(DeployProcessCommand.class);
- public DeployProcessCommand() {
- }
+ public DeployProcessCommand()
+ {
+ }
- public DeployProcessCommand(byte[] par) {
- this.par = par;
+ public DeployProcessCommand(byte[] par)
+ {
+ setPar(par);
}
- public DeployProcessCommand(String xml) {
- this.xml = xml;
+ public DeployProcessCommand(String xml)
+ {
+ setXml(xml);
}
/**
* @return deployed ProcessDefinition
*/
- public Object execute(JbpmContext jbpmContext) throws Exception {
- ProcessDefinition processDefinition = null;
- if (par != null && par.length > 0) {
+ public Object execute(JbpmContext jbpmContext) throws Exception
+ {
+ if (par == null && xml == null)
+ throw new JbpmException("either xml string or process archive must be given.");
+
+ ProcessDefinition processDefinition;
+ if (par != null)
+ {
log.debug("parse process from archive");
// Thanks to George Mournos who helped to improve this:
- ZipInputStream zipInputStream = new ZipInputStream(
- new ByteArrayInputStream(par));
- processDefinition = ProcessDefinition
- .parseParZipInputStream(zipInputStream);
-
- jbpmContext.deployProcessDefinition(processDefinition);
- log.debug("deployment sucessfull");
+ ZipInputStream zipInputStream = new ZipInputStream(new ByteArrayInputStream(par));
+ processDefinition = ProcessDefinition.parseParZipInputStream(zipInputStream);
}
- else if (xml != null && xml.length() > 0) {
+ else
+ {
log.debug("parse process from string");
if (log.isTraceEnabled())
log.trace("deploy process:\n" + xml);
- processDefinition = ProcessDefinition
- .parseXmlString(xml);
+ processDefinition = ProcessDefinition.parseXmlString(xml);
+ }
- jbpmContext.deployProcessDefinition(processDefinition);
- log.debug("deployment sucessfull");
- }
- else
- throw new JbpmException("either xml string or process archive must be given.");
+ jbpmContext.deployProcessDefinition(processDefinition);
+ log.debug("deployment sucessfull");
+
return retrieveProcessDefinition(processDefinition);
}
-public byte[] getPar() {
+ public byte[] getPar()
+ {
return par;
-}
+ }
-public void setPar(byte[] par) {
+ public void setPar(byte[] par)
+ {
this.par = par;
-}
-public String getXml() {
+ if (par == null || par.length == 0)
+ throw new IllegalArgumentException("Cannot process null process archive");
+ }
+
+ public String getXml()
+ {
return xml;
-}
+ }
-public void setXml(String xml) {
+ public void setXml(String xml)
+ {
this.xml = xml;
-}
+ if (xml == null || xml.length() == 0)
+ throw new IllegalArgumentException("Cannot process null process definition");
+ }
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/ExecuteJobsCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/ExecuteJobsCommand.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/ExecuteJobsCommand.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -19,129 +19,156 @@
import org.jbpm.job.Timer;
/**
- * Execute all overdue Jobs (may be enhanced with more attributes in future if
- * needed)
+ * Execute all overdue Jobs (may be enhanced with more attributes in future if needed)
*
* @author ruecker
*/
-public class ExecuteJobsCommand implements Command {
+public class ExecuteJobsCommand implements Command
+{
private static final long serialVersionUID = -2457066688404533959L;
private static final Log log = LogFactory.getLog(ExecuteJobsCommand.class);
-
+
private static final int maxLockTime = 60000;
-
+
private transient JbpmContext jbpmContext;
- public Object execute(JbpmContext jbpmContext) throws Exception {
+ public Object execute(JbpmContext jbpmContext) throws Exception
+ {
this.jbpmContext = jbpmContext;
- try {
+ try
+ {
Collection acquiredJobs = acquireJobs();
- if (! acquiredJobs.isEmpty()) {
+ if (!acquiredJobs.isEmpty())
+ {
Iterator iter = acquiredJobs.iterator();
- while (iter.hasNext()) {
- Job job = (Job) iter.next();
+ while (iter.hasNext())
+ {
+ Job job = (Job)iter.next();
executeJob(job);
}
}
-
-// Job job = jbpmContext.getJobSession().getFirstAcquirableJob("");
-// if (job != null) {
-// log.info("execution job: " + job);
-// job.execute(jbpmContext);
-// }
- } catch (JbpmException ex) {
+ // Job job = jbpmContext.getJobSession().getFirstAcquirableJob("");
+ // if (job != null) {
+ // log.info("execution job: " + job);
+ // job.execute(jbpmContext);
+ // }
+ }
+ catch (JbpmException ex)
+ {
log.warn("exception while executing job", ex);
}
this.jbpmContext = null;
return null;
}
-
- private String getName() {
+
+ private String getName()
+ {
return this.toString();
}
- protected Collection acquireJobs() {
+ protected Collection acquireJobs()
+ {
Collection acquiredJobs = null;
Collection jobsToLock = new ArrayList();
log.debug("acquiring jobs for execution...");
- try {
- JobSession jobSession = jbpmContext.getJobSession();
- log.debug("querying for acquirable job...");
- Job job = jobSession.getFirstAcquirableJob(getName());
- if (job!=null) {
- if (job.isExclusive()) {
- log.debug("exclusive acquirable job found ("+job+"). querying for other exclusive jobs to lock them all in one tx...");
- List otherExclusiveJobs = jobSession.findExclusiveJobs(getName(), job.getProcessInstance());
- jobsToLock.addAll(otherExclusiveJobs);
- log.debug("trying to obtain a process-instance exclusive locks for '"+otherExclusiveJobs+"'");
- } else {
- log.debug("trying to obtain a lock for '"+job+"'");
- jobsToLock.add(job);
- }
-
- Iterator iter = jobsToLock.iterator();
- while (iter.hasNext()) {
- job = (Job) iter.next();
- job.setLockOwner(getName());
- job.setLockTime(new Date());
- // jbpmContext.getSession().update(job);
- }
+ try
+ {
+ JobSession jobSession = jbpmContext.getJobSession();
+ log.debug("querying for acquirable job...");
+ Job job = jobSession.getFirstAcquirableJob(getName());
+ if (job != null)
+ {
+ if (job.isExclusive())
+ {
+ log.debug("exclusive acquirable job found (" + job + "). querying for other exclusive jobs to lock them all in one tx...");
+ List otherExclusiveJobs = jobSession.findExclusiveJobs(getName(), job.getProcessInstance());
+ jobsToLock.addAll(otherExclusiveJobs);
+ log.debug("trying to obtain a process-instance exclusive locks for '" + otherExclusiveJobs + "'");
+ }
+ else
+ {
+ log.debug("trying to obtain a lock for '" + job + "'");
+ jobsToLock.add(job);
+ }
- // HACKY HACK : this is a workaround for a hibernate problem that is fixed in hibernate 3.2.1
- if (job instanceof Timer) {
- Hibernate.initialize(((Timer)job).getGraphElement());
- }
+ Iterator iter = jobsToLock.iterator();
+ while (iter.hasNext())
+ {
+ job = (Job)iter.next();
+ job.setLockOwner(getName());
+ job.setLockTime(new Date());
+ // jbpmContext.getSession().update(job);
+ }
- } else {
- log.debug("no acquirable jobs in job table");
+ // HACKY HACK : this is a workaround for a hibernate problem that is fixed in hibernate 3.2.1
+ if (job instanceof Timer)
+ {
+ Hibernate.initialize(((Timer)job).getGraphElement());
}
-
+
+ }
+ else
+ {
+ log.debug("no acquirable jobs in job table");
+ }
+
acquiredJobs = jobsToLock;
- log.debug("obtained locks on following jobs: "+acquiredJobs);
+ log.debug("obtained locks on following jobs: " + acquiredJobs);
- } catch (StaleStateException e) {
- log.debug("couldn't acquire lock on job(s): "+jobsToLock);
}
+ catch (StaleStateException e)
+ {
+ log.debug("couldn't acquire lock on job(s): " + jobsToLock);
+ }
return acquiredJobs;
}
- protected void executeJob(Job job) {
- JobSession jobSession = jbpmContext.getJobSession();
- job = jobSession.loadJob(job.getId());
+ protected void executeJob(Job job)
+ {
+ JobSession jobSession = jbpmContext.getJobSession();
+ job = jobSession.loadJob(job.getId());
- try {
- log.debug("executing job "+job);
- if (job.execute(jbpmContext)) {
- jobSession.deleteJob(job);
- }
-
- } catch (Exception e) {
- log.debug("exception while executing '"+job+"'", e);
- StringWriter sw = new StringWriter();
- e.printStackTrace(new PrintWriter(sw));
- job.setException(sw.toString());
- job.setRetries(job.getRetries()-1);
+ try
+ {
+ log.debug("executing job " + job);
+ if (job.execute(jbpmContext))
+ {
+ jobSession.deleteJob(job);
}
-
- // if this job is locked too long
- long totalLockTimeInMillis = System.currentTimeMillis() - job.getLockTime().getTime();
- if (totalLockTimeInMillis > maxLockTime) {
- jbpmContext.setRollbackOnly();
- }
+ }
+ catch (Exception e)
+ {
+ log.debug("exception while executing '" + job + "'", e);
+ StringWriter sw = new StringWriter();
+ e.printStackTrace(new PrintWriter(sw));
+ job.setException(sw.toString());
+ job.setRetries(job.getRetries() - 1);
+ }
+
+ // if this job is locked too long
+ long totalLockTimeInMillis = System.currentTimeMillis() - job.getLockTime().getTime();
+ if (totalLockTimeInMillis > maxLockTime)
+ {
+ jbpmContext.setRollbackOnly();
+ }
+
}
- protected Date getNextDueDate() {
+
+ protected Date getNextDueDate()
+ {
Date nextDueDate = null;
- JobSession jobSession = jbpmContext.getJobSession();
- Job job = jobSession.getFirstDueJob(getName(), new ArrayList());
- if (job!=null) {
- nextDueDate = job.getDueDate();
- }
+ JobSession jobSession = jbpmContext.getJobSession();
+ Job job = jobSession.getFirstDueJob(getName(), new ArrayList());
+ if (job != null)
+ {
+ nextDueDate = job.getDueDate();
+ }
return nextDueDate;
}
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetProcessDefinitionCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetProcessDefinitionCommand.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetProcessDefinitionCommand.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -7,50 +7,57 @@
*
* @author Bernd Ruecker (bernd.ruecker(a)camunda.com)
*/
-public class GetProcessDefinitionCommand extends AbstractGetObjectBaseCommand {
-
- private static final long serialVersionUID = -1908847549444051495L;
-
- private int version = -1;
-
- private String name;
+public class GetProcessDefinitionCommand extends AbstractGetObjectBaseCommand
+{
- public GetProcessDefinitionCommand() {
- }
+ private static final long serialVersionUID = -1908847549444051495L;
- public GetProcessDefinitionCommand(String name) {
- super();
- this.name = name;
- }
-
- public GetProcessDefinitionCommand(String name, int version) {
- super();
- this.version = version;
- this.name = name;
- }
-
- public Object execute(JbpmContext jbpmContext) throws Exception {
- if (version >= 0)
- return retrieveProcessDefinition(
- jbpmContext.getGraphSession().findProcessDefinition(name, version));
- else
- return retrieveProcessDefinition(
- jbpmContext.getGraphSession().findLatestProcessDefinition(name));
- }
+ private int version = -1;
- public String getName() {
- return name;
- }
+ private String name;
- public void setName(String name) {
- this.name = name;
- }
+ public GetProcessDefinitionCommand()
+ {
+ }
- public int getVersion() {
- return version;
- }
+ public GetProcessDefinitionCommand(String name)
+ {
+ super();
+ this.name = name;
+ }
- public void setVersion(int version) {
- this.version = version;
- }
+ public GetProcessDefinitionCommand(String name, int version)
+ {
+ super();
+ this.version = version;
+ this.name = name;
+ }
+
+ public Object execute(JbpmContext jbpmContext) throws Exception
+ {
+ if (version >= 0)
+ return retrieveProcessDefinition(jbpmContext.getGraphSession().findProcessDefinition(name, version));
+ else
+ return retrieveProcessDefinition(jbpmContext.getGraphSession().findLatestProcessDefinition(name));
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public int getVersion()
+ {
+ return version;
+ }
+
+ public void setVersion(int version)
+ {
+ this.version = version;
+ }
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetProcessDefinitionsCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetProcessDefinitionsCommand.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetProcessDefinitionsCommand.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -7,47 +7,52 @@
import org.jbpm.graph.def.ProcessDefinition;
/**
- * This Command returns all process definitions (or only the latest if
- * onlyLatest is true)
+ * This Command returns all process definitions (or only the latest if onlyLatest is true)
*
* @author Bernd Ruecker (bernd.ruecker(a)camunda.com)
*/
-public class GetProcessDefinitionsCommand extends AbstractGetObjectBaseCommand {
+public class GetProcessDefinitionsCommand extends AbstractGetObjectBaseCommand
+{
- private static final long serialVersionUID = -1908847549444051495L;
+ private static final long serialVersionUID = -1908847549444051495L;
- private boolean onlyLatest = true;
+ private boolean onlyLatest = true;
- public GetProcessDefinitionsCommand() {
- }
+ public GetProcessDefinitionsCommand()
+ {
+ }
- public GetProcessDefinitionsCommand(boolean onlyLatest) {
- this.onlyLatest = onlyLatest;
- }
+ public GetProcessDefinitionsCommand(boolean onlyLatest)
+ {
+ this.onlyLatest = onlyLatest;
+ }
- public Object execute(JbpmContext jbpmContext) throws Exception {
- setJbpmContext(jbpmContext);
- List result = (onlyLatest ? jbpmContext.getGraphSession().findLatestProcessDefinitions() : jbpmContext.getGraphSession().findAllProcessDefinitions());
+ public Object execute(JbpmContext jbpmContext) throws Exception
+ {
+ setJbpmContext(jbpmContext);
+ List result = (onlyLatest ? jbpmContext.getGraphSession().findLatestProcessDefinitions() : jbpmContext.getGraphSession().findAllProcessDefinitions());
- /*
- * traverse and access property if it is missing in the default
- * fetchgroup
- */
- Iterator iter = result.iterator();
- while (iter.hasNext()) {
- ProcessDefinition pd = (ProcessDefinition) iter.next();
- retrieveProcessDefinition(pd);
- }
-
- return result;
+ /*
+ * traverse and access property if it is missing in the default fetchgroup
+ */
+ Iterator iter = result.iterator();
+ while (iter.hasNext())
+ {
+ ProcessDefinition pd = (ProcessDefinition)iter.next();
+ retrieveProcessDefinition(pd);
}
- public boolean isOnlyLatest() {
- return onlyLatest;
- }
+ return result;
+ }
- public void setOnlyLatest(boolean onlyLatest) {
- this.onlyLatest = onlyLatest;
- }
+ public boolean isOnlyLatest()
+ {
+ return onlyLatest;
+ }
+ public void setOnlyLatest(boolean onlyLatest)
+ {
+ this.onlyLatest = onlyLatest;
+ }
+
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetProcessInstanceCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetProcessInstanceCommand.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetProcessInstanceCommand.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -4,72 +4,84 @@
import org.jbpm.graph.exe.ProcessInstance;
/**
- * This command can retrieve the matching process instances (e.g. for admin
- * client) with the given process-id, token id or task-id
+ * This command can retrieve the matching process instances (e.g. for admin client) with the given process-id, token id
+ * or task-id
*
* @author Bernd Ruecker (bernd.ruecker(a)camunda.com)
*/
-public class GetProcessInstanceCommand extends AbstractGetObjectBaseCommand {
+public class GetProcessInstanceCommand extends AbstractGetObjectBaseCommand
+{
- private static final long serialVersionUID = -8436697080972165601L;
+ private static final long serialVersionUID = -8436697080972165601L;
- private long processInstanceId;
+ private long processInstanceId;
- private long tokenId;
+ private long tokenId;
- private long taskInstanceId;
+ private long taskInstanceId;
- public GetProcessInstanceCommand() {
- }
+ public GetProcessInstanceCommand()
+ {
+ }
- public GetProcessInstanceCommand(long processInstanceId) {
- this.processInstanceId = processInstanceId;
- }
+ public GetProcessInstanceCommand(long processInstanceId)
+ {
+ this.processInstanceId = processInstanceId;
+ }
- public GetProcessInstanceCommand(long processInstanceId, boolean includeVariables, boolean includeLogs) {
- super(true, true);
- this.processInstanceId = processInstanceId;
- }
+ public GetProcessInstanceCommand(long processInstanceId, boolean includeVariables, boolean includeLogs)
+ {
+ super(true, true);
+ this.processInstanceId = processInstanceId;
+ }
- public Object execute(JbpmContext jbpmContext) throws Exception {
- setJbpmContext(jbpmContext);
+ public Object execute(JbpmContext jbpmContext) throws Exception
+ {
+ setJbpmContext(jbpmContext);
- ProcessInstance processInstance = null;
- if (processInstanceId != 0)
- processInstance = jbpmContext.getProcessInstance(processInstanceId);
- else if (tokenId != 0)
- processInstance = jbpmContext.getToken(tokenId).getProcessInstance();
- else if (taskInstanceId != 0)
- processInstance = jbpmContext.getTaskInstance(taskInstanceId).getProcessInstance();
+ ProcessInstance processInstance = null;
+ if (processInstanceId != 0)
+ processInstance = jbpmContext.getProcessInstance(processInstanceId);
+ else if (tokenId != 0)
+ processInstance = jbpmContext.getToken(tokenId).getProcessInstance();
+ else if (taskInstanceId != 0)
+ processInstance = jbpmContext.getTaskInstance(taskInstanceId).getProcessInstance();
- if (processInstance != null) {
- processInstance = retrieveProcessInstance(processInstance);
- }
- return processInstance;
+ if (processInstance != null)
+ {
+ processInstance = retrieveProcessInstance(processInstance);
}
+ return processInstance;
+ }
- public long getProcessInstanceId() {
- return processInstanceId;
- }
+ public long getProcessInstanceId()
+ {
+ return processInstanceId;
+ }
- public void setProcessInstanceId(long processInstanceId) {
- this.processInstanceId = processInstanceId;
- }
+ public void setProcessInstanceId(long processInstanceId)
+ {
+ this.processInstanceId = processInstanceId;
+ }
- public long getTaskInstanceId() {
- return taskInstanceId;
- }
+ public long getTaskInstanceId()
+ {
+ return taskInstanceId;
+ }
- public void setTaskInstanceId(long taskInstanceId) {
- this.taskInstanceId = taskInstanceId;
- }
+ public void setTaskInstanceId(long taskInstanceId)
+ {
+ this.taskInstanceId = taskInstanceId;
+ }
- public long getTokenId() {
- return tokenId;
- }
+ public long getTokenId()
+ {
+ return tokenId;
+ }
- public void setTokenId(long tokenId) {
- this.tokenId = tokenId;
- }
+ public void setTokenId(long tokenId)
+ {
+ this.tokenId = tokenId;
+ }
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetProcessInstanceLogCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetProcessInstanceLogCommand.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetProcessInstanceLogCommand.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -9,75 +9,84 @@
import org.jbpm.logging.log.ProcessLog;
/**
- * Retrieve the <code>org.jbpm.logging.log.ProcessLog</code> for the
- * process with the given process-id
+ * Retrieve the <code>org.jbpm.logging.log.ProcessLog</code> for the process with the given process-id
*
* returns a map that maps {@link Token}s to {@link List}s.
*
* @author Bernd Ruecker (bernd.ruecker(a)camunda.com)
- *
+ *
*/
-public class GetProcessInstanceLogCommand implements Command {
-
- private static final long serialVersionUID = -2812852941518870502L;
-
- private long processInstanceId;
-
- public GetProcessInstanceLogCommand() {
- }
-
- public GetProcessInstanceLogCommand(long processInstanceId) {
+public class GetProcessInstanceLogCommand implements Command
+{
+
+ private static final long serialVersionUID = -2812852941518870502L;
+
+ private long processInstanceId;
+
+ public GetProcessInstanceLogCommand()
+ {
+ }
+
+ public GetProcessInstanceLogCommand(long processInstanceId)
+ {
this.processInstanceId = processInstanceId;
}
- public Object execute(JbpmContext jbpmContext) throws Exception {
- Map logMap = jbpmContext.getLoggingSession().findLogsByProcessInstance(processInstanceId);
- return loadLogdFromMap(logMap);
- }
+ public Object execute(JbpmContext jbpmContext) throws Exception
+ {
+ Map logMap = jbpmContext.getLoggingSession().findLogsByProcessInstance(processInstanceId);
+ return loadLogdFromMap(logMap);
+ }
- /**
- * access everything on all ProcessLog objects,
- * which is not in the default fetch group from hibernate,
- * but needs to be accesible from the client
- *
- * overwrite this method, if you need more details in your client
- */
- protected Map loadLogdFromMap(Map logMap) {
- Iterator iter = logMap.keySet().iterator();
- while (iter.hasNext()) {
- Token t = (Token) iter.next();
+ /**
+ * access everything on all ProcessLog objects, which is not in the default fetch group from hibernate, but needs to
+ * be accesible from the client
+ *
+ * overwrite this method, if you need more details in your client
+ */
+ protected Map loadLogdFromMap(Map logMap)
+ {
+ Iterator iter = logMap.keySet().iterator();
+ while (iter.hasNext())
+ {
+ Token t = (Token)iter.next();
- List logs = (List) logMap.get(t);
- Iterator iter2 = logs.iterator();
- while (iter2.hasNext()) {
- ProcessLog pl = (ProcessLog) iter2.next();
- // TODO: I am not sure if we need that, write a test for it
- pl.getActorId();
- pl.toString();
- }
- }
- return logMap;
- }
+ List logs = (List)logMap.get(t);
+ Iterator iter2 = logs.iterator();
+ while (iter2.hasNext())
+ {
+ ProcessLog pl = (ProcessLog)iter2.next();
+ // TODO: I am not sure if we need that, write a test for it
+ pl.getActorId();
+ pl.toString();
+ }
+ }
+ return logMap;
+ }
- /**
- * @deprecated use getProcessInstanceId instead
- */
- public long getProcessId() {
- return processInstanceId;
- }
+ /**
+ * @deprecated use getProcessInstanceId instead
+ */
+ public long getProcessId()
+ {
+ return processInstanceId;
+ }
/**
* @deprecated use setProcessInstanceId instead
*/
- public void setProcessId(long processId) {
- this.processInstanceId = processId;
- }
+ public void setProcessId(long processId)
+ {
+ this.processInstanceId = processId;
+ }
- public long getProcessInstanceId() {
+ public long getProcessInstanceId()
+ {
return processInstanceId;
}
- public void setProcessInstanceId(long processInstanceId) {
+ public void setProcessInstanceId(long processInstanceId)
+ {
this.processInstanceId = processInstanceId;
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetProcessInstancesCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetProcessInstancesCommand.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetProcessInstancesCommand.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -10,194 +10,215 @@
/**
* This command can retrieve all process instances (e.g. for admin client).
- *
- * You have the possibility to filter the command, therefor use the available
- * attributes
- *
+ *
+ * You have the possibility to filter the command, therefor use the available attributes
+ *
* @author Bernd Ruecker (bernd.ruecker(a)camunda.com)
*/
-public class GetProcessInstancesCommand extends AbstractGetObjectBaseCommand {
+public class GetProcessInstancesCommand extends AbstractGetObjectBaseCommand
+{
- private static final long serialVersionUID = -5601050489405283851L;
+ private static final long serialVersionUID = -5601050489405283851L;
- /*
- * is true, only the running process instances are retrieved (ended and
- * canceled ones are skipped)
+ /*
+ * is true, only the running process instances are retrieved (ended and canceled ones are skipped)
*/
- private boolean onlyRunning = true;
+ private boolean onlyRunning = true;
- /*
+ /*
* if given, only processes with start date >= given date are shown
*/
- private Date fromStartDate;
+ private Date fromStartDate;
- /*
+ /*
* if given, only processes with start date <= given date are shown
*/
- private Date untilStartDate;
+ private Date untilStartDate;
- /*
+ /*
* if given, only processes with this name are retrieved
*/
- private String processName;
+ private String processName;
- private long processId = -1;
- /*
+ private long processId = -1;
+ /*
* if given, only processes with this name are retrieved
*/
- private String stateName;
+ private String stateName;
- private String version = null;
+ private String version = null;
- private transient boolean firstExpression = true;
+ private transient boolean firstExpression = true;
- private String getConcatExpression() {
- if (firstExpression) {
- firstExpression = false;
- return " where ";
- }
- return " and ";
- }
+ private String getConcatExpression()
+ {
+ if (firstExpression)
+ {
+ firstExpression = false;
+ return " where ";
+ }
+ return " and ";
+ }
- public Object execute(JbpmContext jbpmContext) throws Exception {
- setJbpmContext(jbpmContext);
- firstExpression = true;
- StringBuffer queryText = new StringBuffer("select pi" + " from org.jbpm.graph.exe.ProcessInstance as pi ");
+ public Object execute(JbpmContext jbpmContext) throws Exception
+ {
+ setJbpmContext(jbpmContext);
+ firstExpression = true;
+ StringBuffer queryText = new StringBuffer("select pi" + " from org.jbpm.graph.exe.ProcessInstance as pi ");
- if (onlyRunning) {
- queryText.append(getConcatExpression()).append(" pi.end = null");
- }
+ if (onlyRunning)
+ {
+ queryText.append(getConcatExpression()).append(" pi.end = null");
+ }
- if (fromStartDate != null) {
- queryText.append(getConcatExpression()).append(" pi.start >= :from ");
- }
- if (untilStartDate != null) {
- queryText.append(getConcatExpression()).append(" pi.start <= :until ");
- }
- if (version != null) {
- queryText.append(getConcatExpression()).append(" pi.version = :version ");
- }
+ if (fromStartDate != null)
+ {
+ queryText.append(getConcatExpression()).append(" pi.start >= :from ");
+ }
+ if (untilStartDate != null)
+ {
+ queryText.append(getConcatExpression()).append(" pi.start <= :until ");
+ }
+ if (version != null)
+ {
+ queryText.append(getConcatExpression()).append(" pi.version = :version ");
+ }
- // name
- if(processId!=-1)
- {
- queryText.append(getConcatExpression()).append(" pi.processDefinition.id = :processId ");
- }
- else if (processName != null && processName.length() > 0) {
- queryText.append(getConcatExpression()).append(" pi.processDefinition.name = :processDefinitionName ");
- }
+ // name
+ if (processId != -1)
+ {
+ queryText.append(getConcatExpression()).append(" pi.processDefinition.id = :processId ");
+ }
+ else if (processName != null && processName.length() > 0)
+ {
+ queryText.append(getConcatExpression()).append(" pi.processDefinition.name = :processDefinitionName ");
+ }
- // TODO: this code only fecthes root tokens, child-tokens has to be
- // considered too!
- if (stateName != null && stateName.length() > 0) {
- queryText.append(getConcatExpression()).append(" pi.rootToken.node.name = :nodeName ");
- }
+ // TODO: this code only fecthes root tokens, child-tokens has to be
+ // considered too!
+ if (stateName != null && stateName.length() > 0)
+ {
+ queryText.append(getConcatExpression()).append(" pi.rootToken.node.name = :nodeName ");
+ }
- queryText.append(" order by pi.start desc");
+ queryText.append(" order by pi.start desc");
- Query query = jbpmContext.getSession().createQuery(queryText.toString());
+ Query query = jbpmContext.getSession().createQuery(queryText.toString());
- if (fromStartDate != null) {
- query.setTimestamp("from", fromStartDate);
- }
- if (untilStartDate != null) {
- query.setTimestamp("until", untilStartDate);
- }
+ if (fromStartDate != null)
+ {
+ query.setTimestamp("from", fromStartDate);
+ }
+ if (untilStartDate != null)
+ {
+ query.setTimestamp("until", untilStartDate);
+ }
- if(processId!=-1)
- {
- query.setLong("processId", processId);
- }
- if (processName != null && processName.length() > 0) {
- query.setString("processDefinitionName", processName);
- }
+ if (processId != -1)
+ {
+ query.setLong("processId", processId);
+ }
+ if (processName != null && processName.length() > 0)
+ {
+ query.setString("processDefinitionName", processName);
+ }
- if (stateName != null && stateName.length() > 0) {
- query.setString("nodeName", stateName);
- }
+ if (stateName != null && stateName.length() > 0)
+ {
+ query.setString("nodeName", stateName);
+ }
- if(version!=null)
- {
- query.setString("version", version);
- }
+ if (version != null)
+ {
+ query.setString("version", version);
+ }
- return retrieveProcessInstanceDetails(query.list());
- }
+ return retrieveProcessInstanceDetails(query.list());
+ }
- /**
- * access everything on all processInstance objects, which is not in the
- * default fetch group from hibernate, but needs to be accesible from the
- * client
- *
- * overwrite this, if you need more details in your client
- */
- public List retrieveProcessInstanceDetails(List processInstanceList) {
- Iterator it = processInstanceList.iterator();
- while (it.hasNext()) {
- retrieveProcessInstance((ProcessInstance) it.next());
- }
- return processInstanceList;
- }
+ /**
+ * access everything on all processInstance objects, which is not in the default fetch group from hibernate, but needs
+ * to be accesible from the client
+ *
+ * overwrite this, if you need more details in your client
+ */
+ public List retrieveProcessInstanceDetails(List processInstanceList)
+ {
+ Iterator it = processInstanceList.iterator();
+ while (it.hasNext())
+ {
+ retrieveProcessInstance((ProcessInstance)it.next());
+ }
+ return processInstanceList;
+ }
- public Date getFromStartDate() {
- return fromStartDate;
- }
+ public Date getFromStartDate()
+ {
+ return fromStartDate;
+ }
- public void setFromStartDate(Date fromStartDate) {
- this.fromStartDate = fromStartDate;
- }
+ public void setFromStartDate(Date fromStartDate)
+ {
+ this.fromStartDate = fromStartDate;
+ }
- public boolean isOnlyRunning() {
- return onlyRunning;
- }
+ public boolean isOnlyRunning()
+ {
+ return onlyRunning;
+ }
- public void setOnlyRunning(boolean onlyRunning) {
- this.onlyRunning = onlyRunning;
- }
+ public void setOnlyRunning(boolean onlyRunning)
+ {
+ this.onlyRunning = onlyRunning;
+ }
- public String getProcessName() {
- return processName;
- }
+ public String getProcessName()
+ {
+ return processName;
+ }
- public void setProcessName(String processName) {
- this.processName = processName;
- }
+ public void setProcessName(String processName)
+ {
+ this.processName = processName;
+ }
- public String getStateName() {
- return stateName;
- }
+ public String getStateName()
+ {
+ return stateName;
+ }
- public void setStateName(String stateName) {
- this.stateName = stateName;
- }
+ public void setStateName(String stateName)
+ {
+ this.stateName = stateName;
+ }
- public Date getUntilStartDate() {
- return untilStartDate;
- }
+ public Date getUntilStartDate()
+ {
+ return untilStartDate;
+ }
- public void setUntilStartDate(Date untilStartDate) {
- this.untilStartDate = untilStartDate;
- }
+ public void setUntilStartDate(Date untilStartDate)
+ {
+ this.untilStartDate = untilStartDate;
+ }
+ public String getVersion()
+ {
+ return version;
+ }
- public String getVersion()
- {
- return version;
- }
+ public void setVersion(String version)
+ {
+ this.version = version;
+ }
- public void setVersion(String version)
- {
- this.version = version;
- }
+ public long getProcessId()
+ {
+ return processId;
+ }
-
- public long getProcessId()
- {
- return processId;
- }
-
- public void setProcessId(long processId)
- {
- this.processId = processId;
- }
+ public void setProcessId(long processId)
+ {
+ this.processId = processId;
+ }
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetTaskInstanceCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetTaskInstanceCommand.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetTaskInstanceCommand.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -7,106 +7,122 @@
import org.jbpm.taskmgmt.exe.TaskInstance;
/**
- * This command can retrieve a task instance (for client) with the given task-id
- * or the token-id (then, the first task for the token is searched)
+ * This command can retrieve a task instance (for client) with the given task-id or the token-id (then, the first task
+ * for the token is searched)
*
* @author Bernd Ruecker (bernd.ruecker(a)camunda.com)
*/
-public class GetTaskInstanceCommand extends AbstractGetObjectBaseCommand {
+public class GetTaskInstanceCommand extends AbstractGetObjectBaseCommand
+{
- private static final long serialVersionUID = -8436697080972165601L;
+ private static final long serialVersionUID = -8436697080972165601L;
- private long taskInstanceId;
+ private long taskInstanceId;
- /**
- * if given, all tasks for this token are searched and a List of
- * TaskInstances is given
- */
- private long tokenId;
+ /**
+ * if given, all tasks for this token are searched and a List of TaskInstances is given
+ */
+ private long tokenId;
- /**
- * if given, all tasks for this process are searched and a List of
- * TaskInstances is given
- */
- private long processInstanceId;
+ /**
+ * if given, all tasks for this process are searched and a List of TaskInstances is given
+ */
+ private long processInstanceId;
- /**
- * NOT YET USED! JUST TO DOCUMENT THE IDEA...
- *
- * result of the Command: a gui element, configured via the TaskController.
- * Can be used to identify a Swing-Class, JSF-Site, ...
- */
- private String configuredGuiElement;
+ /**
+ * NOT YET USED! JUST TO DOCUMENT THE IDEA...
+ *
+ * result of the Command: a gui element, configured via the TaskController. Can be used to identify a Swing-Class,
+ * JSF-Site, ...
+ */
+ private String configuredGuiElement;
- public GetTaskInstanceCommand() {
- }
+ public GetTaskInstanceCommand()
+ {
+ }
- public GetTaskInstanceCommand(long taskInstanceId) {
- this.taskInstanceId = taskInstanceId;
- }
+ public GetTaskInstanceCommand(long taskInstanceId)
+ {
+ this.taskInstanceId = taskInstanceId;
+ }
- public GetTaskInstanceCommand(long taskInstanceId, boolean includeVariables, boolean includeLogs) {
- super(includeVariables, includeLogs);
- this.taskInstanceId = taskInstanceId;
- }
+ public GetTaskInstanceCommand(long taskInstanceId, boolean includeVariables, boolean includeLogs)
+ {
+ super(includeVariables, includeLogs);
+ this.taskInstanceId = taskInstanceId;
+ }
- public GetTaskInstanceCommand(long taskInstanceId, String[] variablesToInclude) {
- super(variablesToInclude);
- this.taskInstanceId = taskInstanceId;
- }
+ public GetTaskInstanceCommand(long taskInstanceId, String[] variablesToInclude)
+ {
+ super(variablesToInclude);
+ this.taskInstanceId = taskInstanceId;
+ }
- public Object execute(JbpmContext jbpmContext) throws Exception {
+ public Object execute(JbpmContext jbpmContext) throws Exception
+ {
- if (taskInstanceId > 0) {
- TaskInstance taskInstance = jbpmContext.getTaskInstance(taskInstanceId);
- if (taskInstance != null) {
- retrieveTaskInstanceDetails(taskInstance);
- }
+ if (taskInstanceId > 0)
+ {
+ TaskInstance taskInstance = jbpmContext.getTaskInstance(taskInstanceId);
+ if (taskInstance != null)
+ {
+ retrieveTaskInstanceDetails(taskInstance);
+ }
- return taskInstance;
- }
- else if (tokenId > 0) {
- List result = jbpmContext.getTaskMgmtSession().findTaskInstancesByToken(tokenId);
- for (Iterator iter = result.iterator(); iter.hasNext();) {
- TaskInstance ti = (TaskInstance) iter.next();
- retrieveTaskInstanceDetails(ti);
- }
- return result;
- }
- else if (processInstanceId > 0) {
- List result = jbpmContext.getTaskMgmtSession().findTaskInstancesByProcessInstance(jbpmContext.getProcessInstance(processInstanceId));
- for (Iterator iter = result.iterator(); iter.hasNext();) {
- TaskInstance ti = (TaskInstance) iter.next();
- retrieveTaskInstanceDetails(ti);
- }
- return result;
- }
- else
- return null;
+ return taskInstance;
}
-
- public long getTaskInstanceId() {
- return taskInstanceId;
+ else if (tokenId > 0)
+ {
+ List result = jbpmContext.getTaskMgmtSession().findTaskInstancesByToken(tokenId);
+ for (Iterator iter = result.iterator(); iter.hasNext();)
+ {
+ TaskInstance ti = (TaskInstance)iter.next();
+ retrieveTaskInstanceDetails(ti);
+ }
+ return result;
}
-
- public void setTaskInstanceId(long taskInstanceId) {
- this.taskInstanceId = taskInstanceId;
+ else if (processInstanceId > 0)
+ {
+ List result = jbpmContext.getTaskMgmtSession().findTaskInstancesByProcessInstance(jbpmContext.getProcessInstance(processInstanceId));
+ for (Iterator iter = result.iterator(); iter.hasNext();)
+ {
+ TaskInstance ti = (TaskInstance)iter.next();
+ retrieveTaskInstanceDetails(ti);
+ }
+ return result;
}
+ else
+ return null;
+ }
- public long getTokenId() {
- return tokenId;
- }
+ public long getTaskInstanceId()
+ {
+ return taskInstanceId;
+ }
- public void setTokenId(long tokenId) {
- this.tokenId = tokenId;
- }
+ public void setTaskInstanceId(long taskInstanceId)
+ {
+ this.taskInstanceId = taskInstanceId;
+ }
- public long getProcessInstanceId() {
- return processInstanceId;
- }
+ public long getTokenId()
+ {
+ return tokenId;
+ }
- public void setProcessInstanceId(long processInstanceId) {
- this.processInstanceId = processInstanceId;
- }
+ public void setTokenId(long tokenId)
+ {
+ this.tokenId = tokenId;
+ }
+ public long getProcessInstanceId()
+ {
+ return processInstanceId;
+ }
+
+ public void setProcessInstanceId(long processInstanceId)
+ {
+ this.processInstanceId = processInstanceId;
+ }
+
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetTaskListCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetTaskListCommand.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/GetTaskListCommand.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -11,8 +11,7 @@
import org.jbpm.taskmgmt.exe.TaskInstance;
/**
- * return a {@link java.util.List} of {@link org.jbpm.taskmgmt.exe.TaskInstance}s
- * for the given actor(s).
+ * return a {@link java.util.List} of {@link org.jbpm.taskmgmt.exe.TaskInstance}s for the given actor(s).
*
* if no actor is used, the current authenticated user is taken as actor.
*
@@ -20,67 +19,78 @@
*
* @author Bernd Ruecker (bernd.ruecker(a)camunda.com)
*/
-public class GetTaskListCommand extends AbstractGetObjectBaseCommand implements Command {
+public class GetTaskListCommand extends AbstractGetObjectBaseCommand implements Command
+{
- private static final long serialVersionUID = -1627380259541998349L;
+ private static final long serialVersionUID = -1627380259541998349L;
- static final Log log = LogFactory.getLog(GetTaskListCommand.class);
+ static final Log log = LogFactory.getLog(GetTaskListCommand.class);
- private String[] actor;
+ private String[] actor;
- public GetTaskListCommand(String[] actor) {
- setActor(actor);
- }
+ public GetTaskListCommand(String[] actor)
+ {
+ setActor(actor);
+ }
- public GetTaskListCommand(String actor, boolean includeVariables) {
- super(includeVariables, false);
- setActor(actor);
- }
+ public GetTaskListCommand(String actor, boolean includeVariables)
+ {
+ super(includeVariables, false);
+ setActor(actor);
+ }
- public GetTaskListCommand(String actor, String[] variablesToInclude) {
- super(variablesToInclude);
- setActor(actor);
+ public GetTaskListCommand(String actor, String[] variablesToInclude)
+ {
+ super(variablesToInclude);
+ setActor(actor);
+ }
+
+ public Object execute(JbpmContext jbpmContext) throws Exception
+ {
+ setJbpmContext(jbpmContext);
+ List result = null;
+ if (actor == null || actor.length == 0)
+ result = jbpmContext.getTaskList();
+ else
+ {
+ result = new ArrayList();
+ for (int i = 0; i < actor.length; i++)
+ {
+ result.addAll(jbpmContext.getTaskList(actor[i]));
+ }
+ result.addAll(jbpmContext.getGroupTaskList(Arrays.asList(actor)));
}
- public Object execute(JbpmContext jbpmContext) throws Exception {
- setJbpmContext(jbpmContext);
- List result = null;
- if (actor == null || actor.length == 0)
- result = jbpmContext.getTaskList();
- else {
- result = new ArrayList();
- for (int i = 0; i < actor.length; i++) {
- result.addAll(jbpmContext.getTaskList(actor[i]));
- }
- result.addAll(jbpmContext.getGroupTaskList(Arrays.asList(actor)));
- }
+ return retrieveTaskInstanceDetails(result);
+ }
- return retrieveTaskInstanceDetails(result);
+ /**
+ * access everything on all TaskInstance objects, which is not in the default fetch group from hibernate, but needs to
+ * be accesible from the client
+ *
+ * overwrite this, if you need more details in your client
+ */
+ public List retrieveTaskInstanceDetails(List taskInstanceList)
+ {
+ for (Iterator iter = taskInstanceList.iterator(); iter.hasNext();)
+ {
+ retrieveTaskInstanceDetails((TaskInstance)iter.next());
}
+ return taskInstanceList;
+ }
- /**
- * access everything on all TaskInstance objects, which is not in the
- * default fetch group from hibernate, but needs to be accesible from the
- * client
- *
- * overwrite this, if you need more details in your client
- */
- public List retrieveTaskInstanceDetails(List taskInstanceList) {
- for (Iterator iter = taskInstanceList.iterator(); iter.hasNext();) {
- retrieveTaskInstanceDetails((TaskInstance) iter.next());
- }
- return taskInstanceList;
- }
+ public String[] getActor()
+ {
+ return actor;
+ }
- public String[] getActor() {
- return actor;
- }
+ public void setActor(String actor)
+ {
+ this.actor = new String[] { actor };
+ }
- public void setActor(String actor) {
- this.actor = new String[] { actor };
- }
-
- public void setActor(String[] actor) {
- this.actor = actor;
- }
+ public void setActor(String[] actor)
+ {
+ this.actor = actor;
+ }
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/NewProcessInstanceCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/NewProcessInstanceCommand.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/NewProcessInstanceCommand.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -30,113 +30,149 @@
import org.jbpm.graph.exe.ProcessInstance;
/**
- * Graph command to start a new process and create a task instance if the start
- * node has a start task definition.
+ * Graph command to start a new process and create a task instance if the start node has a start task definition.
*
- * The result of this command, if requested, is a {@link Long} value containing
- * the process instance id.
+ * The result of this command, if requested, is a {@link Long} value containing the process instance id.
*
* @author Jim Rigsbee, Tom Baeyens, Bernd Ruecker
*/
-public class NewProcessInstanceCommand implements Command {
+public class NewProcessInstanceCommand implements Command
+{
private static final long serialVersionUID = 1L;
private String processDefinitionName = null;
private long processDefinitionId = 0;
-
+
// TODO: This is not clear to me, what for do we need that actorId here? // Bernd Ruecker
- // It specifies who is creating this new process instance command // Tom Baeyens
+ // It specifies who is creating this new process instance command // Tom Baeyens
String actorId = null;
private Map variables = null;
private boolean createStartTask = false;
-
+
private String key;
- public NewProcessInstanceCommand() {
+ public NewProcessInstanceCommand()
+ {
}
- public NewProcessInstanceCommand(String processDefinitionName) {
+ public NewProcessInstanceCommand(String processDefinitionName)
+ {
this.processDefinitionName = processDefinitionName;
}
/**
- * return the id of the newly created process instance.
- * @throws Exception
+ * return the id of the newly created process instance.
+ *
+ * @throws Exception
*/
- public Object execute(JbpmContext jbpmContext) throws Exception {
+ public Object execute(JbpmContext jbpmContext) throws Exception
+ {
- if (actorId!=null) {
+ if (actorId != null)
+ {
jbpmContext.setActorId(actorId);
}
-
+
ProcessInstance processInstance = null;
- if (processDefinitionName!=null) {
+ if (processDefinitionName != null)
+ {
processInstance = jbpmContext.newProcessInstance(processDefinitionName);
- } else {
+ }
+ else
+ {
ProcessDefinition processDefinition = jbpmContext.getGraphSession().loadProcessDefinition(processDefinitionId);
processInstance = new ProcessInstance(processDefinition);
}
- if (key!=null) {
+ if (key != null)
+ {
processInstance.setKey(key);
}
Object result = null;
- if (createStartTask) {
+ if (createStartTask)
+ {
result = processInstance.getTaskMgmtInstance().createStartTaskInstance();
- } else {
+ }
+ else
+ {
result = processInstance;
}
-
- if (variables!=null) {
+
+ if (variables != null)
+ {
ContextInstance contextInstance = processInstance.getContextInstance();
Iterator iter = variables.keySet().iterator();
- while (iter.hasNext()) {
- String variableName = (String) iter.next();
+ while (iter.hasNext())
+ {
+ String variableName = (String)iter.next();
contextInstance.setVariable(variableName, variables.get(variableName));
- }
- }
+ }
+ }
jbpmContext.save(processInstance);
return result;
}
- public String getActorId() {
+ public String getActorId()
+ {
return actorId;
}
- public void setActorId(String actorId) {
+
+ public void setActorId(String actorId)
+ {
this.actorId = actorId;
}
- public long getProcessId() {
+
+ public long getProcessId()
+ {
return processDefinitionId;
}
- public void setProcessId(long processId) {
+
+ public void setProcessId(long processId)
+ {
this.processDefinitionId = processId;
}
- public String getProcessName() {
+
+ public String getProcessName()
+ {
return processDefinitionName;
}
- public void setProcessName(String processName) {
+
+ public void setProcessName(String processName)
+ {
this.processDefinitionName = processName;
}
- public boolean isCreateStartTask() {
+
+ public boolean isCreateStartTask()
+ {
return createStartTask;
}
- public void setCreateStartTask(boolean createStartTask) {
+
+ public void setCreateStartTask(boolean createStartTask)
+ {
this.createStartTask = createStartTask;
}
- public Map getVariables() {
+
+ public Map getVariables()
+ {
return variables;
}
- public void setVariables(Map variables) {
+
+ public void setVariables(Map variables)
+ {
this.variables = variables;
}
- public String getKey() {
+
+ public String getKey()
+ {
return key;
}
- public void setKey(String key) {
+
+ public void setKey(String key)
+ {
this.key = key;
}
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/SignalCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/SignalCommand.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/SignalCommand.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -27,114 +27,133 @@
import org.apache.commons.logging.LogFactory;
import org.jbpm.JbpmContext;
import org.jbpm.JbpmException;
+import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.graph.exe.Token;
-import org.jbpm.graph.exe.ProcessInstance;
/**
* Signals a token. After signalling the token is returned
*
* @author ??, Bernd Ruecker
*/
-public class SignalCommand implements Command {
+public class SignalCommand implements Command
+{
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
- private long tokenId = 0;
+ private long tokenId = 0;
- private String transitionName = null;
-
- /**
- * if given, it is checked if the state is as expected. If not, a exception is thrown
- * Ignored if null
- */
- private String expectedStateName = null;
+ private String transitionName = null;
- private Token previousToken = null;
+ /**
+ * if given, it is checked if the state is as expected. If not, a exception is thrown Ignored if null
+ */
+ private String expectedStateName = null;
- private ProcessInstance previousProcessInstance = null;
+ private Token previousToken = null;
- private Map variables;
+ private ProcessInstance previousProcessInstance = null;
- public SignalCommand() {
- }
+ private Map variables;
- public SignalCommand(long tokenId, String transitionName) {
- this.tokenId = tokenId;
- this.transitionName = transitionName;
- }
+ public SignalCommand()
+ {
+ }
- public Object execute(JbpmContext jbpmContext) {
- log.debug("executing " + this);
- if (previousProcessInstance != null) {
+ public SignalCommand(long tokenId, String transitionName)
+ {
+ this.tokenId = tokenId;
+ this.transitionName = transitionName;
+ }
- if (variables != null && variables.size() > 0)
- previousProcessInstance.getContextInstance().addVariables(variables);
+ public Object execute(JbpmContext jbpmContext)
+ {
+ log.debug("executing " + this);
+ if (previousProcessInstance != null)
+ {
- if (transitionName == null) {
- previousProcessInstance.signal();
- }
- else {
- previousProcessInstance.signal(transitionName);
- }
- return previousProcessInstance.getRootToken();
- }
- else {
- Token token = getToken(jbpmContext);
-
- if (expectedStateName!=null && !expectedStateName.equals( token.getNode().getName() ))
- throw new JbpmException("token is not in expected state '"+expectedStateName+"' but in '" + token.getNode().getName() + "'");
+ if (variables != null && variables.size() > 0)
+ previousProcessInstance.getContextInstance().addVariables(variables);
- if (variables != null && variables.size() > 0)
- token.getProcessInstance().getContextInstance().addVariables(variables);
-
- if (transitionName == null) {
- token.signal();
- }
- else {
- token.signal(transitionName);
- }
- return token;
- }
+ if (transitionName == null)
+ {
+ previousProcessInstance.signal();
+ }
+ else
+ {
+ previousProcessInstance.signal(transitionName);
+ }
+ return previousProcessInstance.getRootToken();
}
+ else
+ {
+ Token token = getToken(jbpmContext);
- protected Token getToken(JbpmContext jbpmContext) {
- if (previousToken != null) {
- return previousToken;
- }
- return jbpmContext.loadTokenForUpdate(tokenId);
- }
+ if (expectedStateName != null && !expectedStateName.equals(token.getNode().getName()))
+ throw new JbpmException("token is not in expected state '" + expectedStateName + "' but in '" + token.getNode().getName() + "'");
- public long getTokenId() {
- return tokenId;
- }
+ if (variables != null && variables.size() > 0)
+ token.getProcessInstance().getContextInstance().addVariables(variables);
- public void setTokenId(long tokenId) {
- this.tokenId = tokenId;
+ if (transitionName == null)
+ {
+ token.signal();
+ }
+ else
+ {
+ token.signal(transitionName);
+ }
+ return token;
}
+ }
- public String getTransitionName() {
- return transitionName;
+ protected Token getToken(JbpmContext jbpmContext)
+ {
+ if (previousToken != null)
+ {
+ return previousToken;
}
+ return jbpmContext.loadTokenForUpdate(tokenId);
+ }
- public void setTransitionName(String transitionName) {
- this.transitionName = transitionName;
- }
+ public long getTokenId()
+ {
+ return tokenId;
+ }
- private static Log log = LogFactory.getLog(SignalCommand.class);
+ public void setTokenId(long tokenId)
+ {
+ this.tokenId = tokenId;
+ }
- public Map getVariables() {
- return variables;
- }
+ public String getTransitionName()
+ {
+ return transitionName;
+ }
- public void setVariables(Map variables) {
- this.variables = variables;
- }
+ public void setTransitionName(String transitionName)
+ {
+ this.transitionName = transitionName;
+ }
- public String getExpectedStateName() {
- return expectedStateName;
- }
+ private static Log log = LogFactory.getLog(SignalCommand.class);
- public void setExpectedStateName(String expectedStateName) {
- this.expectedStateName = expectedStateName;
- }
+ public Map getVariables()
+ {
+ return variables;
+ }
+
+ public void setVariables(Map variables)
+ {
+ this.variables = variables;
+ }
+
+ public String getExpectedStateName()
+ {
+ return expectedStateName;
+ }
+
+ public void setExpectedStateName(String expectedStateName)
+ {
+ this.expectedStateName = expectedStateName;
+ }
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/StartProcessInstanceCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/StartProcessInstanceCommand.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/StartProcessInstanceCommand.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -4,44 +4,45 @@
import org.jbpm.graph.exe.ProcessInstance;
/**
- * Graph command to start a new process and signal it immidiatly.
- * The transition named in <code>startTransitionName</code> is used (or the default transition if it is null).
+ * Graph command to start a new process and signal it immidiatly. The transition named in
+ * <code>startTransitionName</code> is used (or the default transition if it is null).
*
- * The result of this command, if requested, is a {@link Long} value containing
- * the process instance id.
+ * The result of this command, if requested, is a {@link Long} value containing the process instance id.
*
* @author Jim Rigsbee, Tom Baeyens, Bernd Ruecker
*/
-public class StartProcessInstanceCommand extends NewProcessInstanceCommand
- implements Command {
+public class StartProcessInstanceCommand extends NewProcessInstanceCommand implements Command
+{
- private static final long serialVersionUID = -2428234069404269048L;
+ private static final long serialVersionUID = -2428234069404269048L;
- /**
- * this transition name is used for signalling (if null, the default
- * transition is used)
- */
- private String startTransitionName = null;
+ /**
+ * this transition name is used for signalling (if null, the default transition is used)
+ */
+ private String startTransitionName = null;
- public Object execute(JbpmContext jbpmContext) throws Exception {
- Object object = super.execute(jbpmContext);
- if (object instanceof ProcessInstance) {
- ProcessInstance processInstance = (ProcessInstance) object;
- if (startTransitionName == null
- || startTransitionName.length() == 0)
- processInstance.signal();
- else
- processInstance.signal(startTransitionName);
- }
- return object;
- }
+ public Object execute(JbpmContext jbpmContext) throws Exception
+ {
+ Object object = super.execute(jbpmContext);
+ if (object instanceof ProcessInstance)
+ {
+ ProcessInstance processInstance = (ProcessInstance)object;
+ if (startTransitionName == null || startTransitionName.length() == 0)
+ processInstance.signal();
+ else
+ processInstance.signal(startTransitionName);
+ }
+ return object;
+ }
- public String getStartTransitionName() {
- return startTransitionName;
- }
+ public String getStartTransitionName()
+ {
+ return startTransitionName;
+ }
- public void setStartTransitionName(String startTransitionName) {
- this.startTransitionName = startTransitionName;
- }
+ public void setStartTransitionName(String startTransitionName)
+ {
+ this.startTransitionName = startTransitionName;
+ }
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/StartWorkOnTaskCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/StartWorkOnTaskCommand.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/StartWorkOnTaskCommand.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -1,76 +1,81 @@
package org.jbpm.command;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.jbpm.JbpmContext;
-import org.jbpm.db.JbpmSchema;
import org.jbpm.taskmgmt.exe.TaskInstance;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
/**
- * The current authorizes actor starts to work on the TaskInstance
- * so the actor is set to the given actor
+ * The current authorizes actor starts to work on the TaskInstance so the actor is set to the given actor
*
* @author Bernd Ruecker
*/
-public class StartWorkOnTaskCommand implements Command {
+public class StartWorkOnTaskCommand implements Command
+{
- private static final long serialVersionUID = 53004484398726736L;
+ private static final long serialVersionUID = 53004484398726736L;
- private static final Log log = LogFactory.getLog(StartWorkOnTaskCommand.class);
+ private static final Log log = LogFactory.getLog(StartWorkOnTaskCommand.class);
- private long taskInstanceId;
-
- private boolean overwriteSwimlane = false;
+ private long taskInstanceId;
- private String actorId;
+ private boolean overwriteSwimlane = false;
- public StartWorkOnTaskCommand(long taskInstanceId, boolean overwriteSwimlane) {
- this.taskInstanceId = taskInstanceId;
- this.overwriteSwimlane = overwriteSwimlane;
- }
+ private String actorId;
- public StartWorkOnTaskCommand() {
- }
-
- public Object execute(JbpmContext jbpmContext) throws Exception {
- String actor = this.actorId==null ? jbpmContext.getActorId() : this.actorId;
- TaskInstance taskInstance = jbpmContext.getTaskInstance(taskInstanceId);
+ public StartWorkOnTaskCommand(long taskInstanceId, boolean overwriteSwimlane)
+ {
+ this.taskInstanceId = taskInstanceId;
+ this.overwriteSwimlane = overwriteSwimlane;
+ }
+ public StartWorkOnTaskCommand()
+ {
+ }
- if(taskInstance.getStart()!=null)
- {
- log.warn("Force stop on task " + taskInstance.getId() + ". Will be restarted.");
- taskInstance.setStart(null); // strange, but means isNotStarted()
- }
+ public Object execute(JbpmContext jbpmContext) throws Exception
+ {
+ String actor = this.actorId == null ? jbpmContext.getActorId() : this.actorId;
+ TaskInstance taskInstance = jbpmContext.getTaskInstance(taskInstanceId);
- taskInstance.start(actor, overwriteSwimlane);
-
- return null;
- }
+ if (taskInstance.getStart() != null)
+ {
+ log.warn("Force stop on task " + taskInstance.getId() + ". Will be restarted.");
+ taskInstance.setStart(null); // strange, but means isNotStarted()
+ }
- public boolean isOverwriteSwimlane() {
- return overwriteSwimlane;
- }
+ taskInstance.start(actor, overwriteSwimlane);
- public void setOverwriteSwimlane(boolean overwriteSwimlane) {
- this.overwriteSwimlane = overwriteSwimlane;
- }
+ return null;
+ }
- public long getTaskInstanceId() {
- return taskInstanceId;
- }
+ public boolean isOverwriteSwimlane()
+ {
+ return overwriteSwimlane;
+ }
- public void setTaskInstanceId(long taskInstanceId) {
- this.taskInstanceId = taskInstanceId;
- }
+ public void setOverwriteSwimlane(boolean overwriteSwimlane)
+ {
+ this.overwriteSwimlane = overwriteSwimlane;
+ }
- public void setActorId(String actorId)
- {
- this.actorId = actorId;
- }
+ public long getTaskInstanceId()
+ {
+ return taskInstanceId;
+ }
- public String getActorId()
- {
- return actorId;
- }
+ public void setTaskInstanceId(long taskInstanceId)
+ {
+ this.taskInstanceId = taskInstanceId;
+ }
+
+ public void setActorId(String actorId)
+ {
+ this.actorId = actorId;
+ }
+
+ public String getActorId()
+ {
+ return actorId;
+ }
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/TaskInstanceEndCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/TaskInstanceEndCommand.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/TaskInstanceEndCommand.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -27,82 +27,97 @@
import org.jbpm.taskmgmt.exe.TaskInstance;
/**
- * end the task with the given id if variables are given as a map, they are
- * added/changed bevore ending the task
+ * end the task with the given id if variables are given as a map, they are added/changed bevore ending the task
*
* @author ??, Bernd Ruecker (bernd.ruecker(a)camunda.com)
*/
-public class TaskInstanceEndCommand implements Command {
+public class TaskInstanceEndCommand implements Command
+{
- private static final long serialVersionUID = 5721341060757950369L;
+ private static final long serialVersionUID = 5721341060757950369L;
- private long taskInstanceId = 0;
+ private long taskInstanceId = 0;
- private String transitionName = null;
+ private String transitionName = null;
- private Map variables;
+ private Map variables;
- private TaskInstance previoustaskInstance = null;
+ private TaskInstance previoustaskInstance = null;
- public TaskInstanceEndCommand() {
- }
-
- public TaskInstanceEndCommand(long taskInstanceId, String transitionName) {
- this.taskInstanceId = taskInstanceId;
- this.transitionName = transitionName;
- }
+ public TaskInstanceEndCommand()
+ {
+ }
- public TaskInstanceEndCommand(long taskInstanceId, String transitionName,
- Map variables) {
- this.taskInstanceId = taskInstanceId;
- this.transitionName = transitionName;
- this.variables = variables;
- }
+ public TaskInstanceEndCommand(long taskInstanceId, String transitionName)
+ {
+ this.taskInstanceId = taskInstanceId;
+ this.transitionName = transitionName;
+ }
- public Object execute(JbpmContext jbpmContext) {
- TaskInstance taskInstance = getTaskInstance(jbpmContext);
+ public TaskInstanceEndCommand(long taskInstanceId, String transitionName, Map variables)
+ {
+ this.taskInstanceId = taskInstanceId;
+ this.transitionName = transitionName;
+ this.variables = variables;
+ }
- if (variables != null && variables.size() > 0) {
- taskInstance.getContextInstance().addVariables(variables);
- }
+ public Object execute(JbpmContext jbpmContext)
+ {
+ TaskInstance taskInstance = getTaskInstance(jbpmContext);
- if (transitionName == null) {
- taskInstance.end();
- } else {
- taskInstance.end(transitionName);
- }
- return taskInstance;
- }
+ if (variables != null && variables.size() > 0)
+ {
+ taskInstance.getContextInstance().addVariables(variables);
+ }
- protected TaskInstance getTaskInstance(JbpmContext jbpmContext) {
- if (previoustaskInstance != null) {
- return previoustaskInstance;
- }
- return jbpmContext.getTaskInstance(taskInstanceId);
- }
+ if (transitionName == null)
+ {
+ taskInstance.end();
+ }
+ else
+ {
+ taskInstance.end(transitionName);
+ }
+ return taskInstance;
+ }
- public long getTaskInstanceId() {
- return taskInstanceId;
- }
+ protected TaskInstance getTaskInstance(JbpmContext jbpmContext)
+ {
+ if (previoustaskInstance != null)
+ {
+ return previoustaskInstance;
+ }
+ return jbpmContext.getTaskInstance(taskInstanceId);
+ }
- public void setTaskInstanceId(long taskInstanceId) {
- this.taskInstanceId = taskInstanceId;
- }
+ public long getTaskInstanceId()
+ {
+ return taskInstanceId;
+ }
- public String getTransitionName() {
- return transitionName;
- }
+ public void setTaskInstanceId(long taskInstanceId)
+ {
+ this.taskInstanceId = taskInstanceId;
+ }
- public void setTransitionName(String transitionName) {
- this.transitionName = transitionName;
- }
+ public String getTransitionName()
+ {
+ return transitionName;
+ }
- public Map getVariables() {
- return variables;
- }
+ public void setTransitionName(String transitionName)
+ {
+ this.transitionName = transitionName;
+ }
- public void setVariables(Map variables) {
- this.variables = variables;
- }
+ public Map getVariables()
+ {
+ return variables;
+ }
+ public void setVariables(Map variables)
+ {
+ this.variables = variables;
+ }
+
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/VariablesCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/VariablesCommand.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/VariablesCommand.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -8,68 +8,87 @@
import org.jbpm.graph.exe.Token;
import org.jbpm.taskmgmt.exe.TaskInstance;
-public class VariablesCommand implements Command {
-
+public class VariablesCommand implements Command
+{
+
private static final long serialVersionUID = 1L;
long tokenId = 0;
long taskInstanceId = 0;
Map variables = null;
-
+
ProcessInstance previousProcessInstance = null;
Token previousToken = null;
TaskInstance previousTaskInstance = null;
- public Object execute(JbpmContext jbpmContext) throws Exception {
+ public Object execute(JbpmContext jbpmContext) throws Exception
+ {
VariableContainer variableContainer = getVariableContainer(jbpmContext);
- if ( (variableContainer!=null)
- && (variables!=null)
- ) {
+ if ((variableContainer != null) && (variables != null))
+ {
variableContainer.addVariables(variables);
}
return variableContainer;
}
- protected VariableContainer getVariableContainer(JbpmContext jbpmContext) {
- if (previousProcessInstance!=null) {
+ protected VariableContainer getVariableContainer(JbpmContext jbpmContext)
+ {
+ if (previousProcessInstance != null)
+ {
return getVariableContainer(previousProcessInstance.getRootToken());
}
- if (previousToken!=null) {
+ if (previousToken != null)
+ {
return getVariableContainer(previousToken);
}
- if (previousTaskInstance!=null) {
+ if (previousTaskInstance != null)
+ {
return previousTaskInstance;
}
-
- if (tokenId!=0) {
+
+ if (tokenId != 0)
+ {
return getVariableContainer(jbpmContext.getToken(tokenId));
}
- if (taskInstanceId!=0) {
+ if (taskInstanceId != 0)
+ {
return jbpmContext.getTaskInstance(taskInstanceId);
}
return null;
}
- protected VariableContainer getVariableContainer(Token token) {
+ protected VariableContainer getVariableContainer(Token token)
+ {
return token.getProcessInstance().getContextInstance().getTokenVariableMap(token);
}
- public long getTaskInstanceId() {
+ public long getTaskInstanceId()
+ {
return taskInstanceId;
}
- public void setTaskInstanceId(long taskInstanceId) {
+
+ public void setTaskInstanceId(long taskInstanceId)
+ {
this.taskInstanceId = taskInstanceId;
}
- public long getTokenId() {
+
+ public long getTokenId()
+ {
return tokenId;
}
- public void setTokenId(long tokenId) {
+
+ public void setTokenId(long tokenId)
+ {
this.tokenId = tokenId;
}
- public Map getVariables() {
+
+ public Map getVariables()
+ {
return variables;
}
- public void setVariables(Map variables) {
+
+ public void setVariables(Map variables)
+ {
this.variables = variables;
}
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/impl/CommandServiceImpl.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/impl/CommandServiceImpl.java 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/impl/CommandServiceImpl.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -32,46 +32,49 @@
import org.jbpm.command.CommandService;
/**
- * Provide services for accessing the jBPM engine. Access is currently provided
- * through a set of {@link org.jbpm.command.Command} derived operations.
+ * Provide services for accessing the jBPM engine. Access is currently provided through a set of
+ * {@link org.jbpm.command.Command} derived operations.
*
* @author Jim Rigsbee, Tom Baeyens
*/
-public class CommandServiceImpl implements CommandService, Serializable {
-
+public class CommandServiceImpl implements CommandService, Serializable
+{
private static final long serialVersionUID = 1L;
protected JbpmConfiguration jbpmConfiguration = null;
/**
- * Establish an instance of the command service with a particular jBPM
- * configuration which provides connectivity to the jBPM engine and its
- * related services including the persistence manager.
+ * Establish an instance of the command service with a particular jBPM configuration which provides connectivity to
+ * the jBPM engine and its related services including the persistence manager.
*
- * @param jbpmConfiguration
- * jBPM Configuration
+ * @param jbpmConfiguration jBPM Configuration
*/
- public CommandServiceImpl(JbpmConfiguration jbpmConfiguration) {
+ public CommandServiceImpl(JbpmConfiguration jbpmConfiguration)
+ {
this.jbpmConfiguration = jbpmConfiguration;
}
/**
- * Executes command based on its current context. Each command contains the
- * appropriate context information such as token, process instance, etc. to
- * insure that the operation is carried out on the proper graph object.
+ * Executes command based on its current context. Each command contains the appropriate context information such as
+ * token, process instance, etc. to insure that the operation is carried out on the proper graph object.
*
- * @param command
- * jBPM engine command to execute
+ * @param command jBPM engine command to execute
*/
- public Object execute(Command command) {
+ public Object execute(Command command)
+ {
Object result = null;
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
- try {
+ try
+ {
log.debug("executing " + command);
result = command.execute(jbpmContext);
- } catch (Exception e) {
- throw new JbpmException("couldn't execute "+command, e);
- } finally {
+ }
+ catch (Exception e)
+ {
+ throw new JbpmException("couldn't execute " + command, e);
+ }
+ finally
+ {
jbpmContext.close();
}
return result;
Added: jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/enterprise/deploy/DeployerTest.java
===================================================================
--- jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/enterprise/deploy/DeployerTest.java (rev 0)
+++ jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/enterprise/deploy/DeployerTest.java 2008-11-21 13:10:25 UTC (rev 3029)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.enterprise.deploy;
+
+import org.jbpm.api.test.IntegrationTestCase;
+
+/**
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ */
+public class DeployerTest extends IntegrationTestCase
+{
+
+ public void testSimpleDeployment()
+ {
+
+ }
+}
Property changes on: jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/enterprise/deploy/DeployerTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: jbpm3/trunk/modules/integration/api/pom.xml (from rev 3019, jbpm3/trunk/modules/integration/pom.xml)
===================================================================
--- jbpm3/trunk/modules/integration/api/pom.xml (rev 0)
+++ jbpm3/trunk/modules/integration/api/pom.xml 2008-11-21 13:10:25 UTC (rev 3029)
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ====================================================================== -->
+<!-- -->
+<!-- JBoss, the OpenSource J2EE webOS -->
+<!-- -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- -->
+<!-- ====================================================================== -->
+
+<!-- $Id$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ 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 API</name>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>jbpm-integration-api</artifactId>
+ <packaging>jar</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>jbpm-integration</artifactId>
+ <version>3.3.1-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <!-- Properties -->
+ <properties>
+ <mvel.version>1.3.7-java1.5</mvel.version>
+ </properties>
+
+ <!-- Dependencies -->
+ <dependencies>
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-spec-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>jbpm-jpdl</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>jbpm-jpdl</artifactId>
+ <classifier>config</classifier>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mvel</groupId>
+ <artifactId>mvel</artifactId>
+ <version>${mvel.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-spec-dialect-api10</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-spec-cts</artifactId>
+ <scope>test</scope>
+ <type>zip</type>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>src/test</directory>
+ <includes>
+ <include>java/org/jbpm/test/**</include>
+ </includes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-spec-cts</artifactId>
+ <type>zip</type>
+ </artifactItem>
+ </artifactItems>
+ <outputDirectory>src/test</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>org/jbpm/test/incubator/**/*Test.java</exclude>
+ <exclude>org/jbpm/test/pattern/**/*Test.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Copied: jbpm3/trunk/modules/integration/api/src (from rev 3019, jbpm3/trunk/modules/integration/src)
Deleted: jbpm3/trunk/modules/integration/pom.xml
===================================================================
--- jbpm3/trunk/modules/integration/pom.xml 2008-11-21 11:50:41 UTC (rev 3028)
+++ jbpm3/trunk/modules/integration/pom.xml 2008-11-21 13:10:25 UTC (rev 3029)
@@ -1,125 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ====================================================================== -->
-<!-- -->
-<!-- JBoss, the OpenSource J2EE webOS -->
-<!-- -->
-<!-- Distributable under LGPL license. -->
-<!-- See terms of license at http://www.gnu.org. -->
-<!-- -->
-<!-- ====================================================================== -->
-
-<!-- $Id$ -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- 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>
- <groupId>org.jbpm.jbpm3</groupId>
- <artifactId>jbpm-integration</artifactId>
- <packaging>jar</packaging>
-
- <!-- Parent -->
- <parent>
- <groupId>org.jbpm.jbpm3</groupId>
- <artifactId>jbpm</artifactId>
- <version>3.3.1-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <!-- Properties -->
- <properties>
- <mvel.version>1.3.7-java1.5</mvel.version>
- </properties>
-
- <!-- Dependencies -->
- <dependencies>
- <dependency>
- <groupId>org.jbpm.jbpm4</groupId>
- <artifactId>jbpm-spec-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jbpm.jbpm3</groupId>
- <artifactId>jbpm-jpdl</artifactId>
- <version>${version}</version>
- </dependency>
- <dependency>
- <groupId>org.jbpm.jbpm3</groupId>
- <artifactId>jbpm-jpdl</artifactId>
- <classifier>config</classifier>
- <version>${version}</version>
- </dependency>
- <dependency>
- <groupId>org.mvel</groupId>
- <artifactId>mvel</artifactId>
- <version>${mvel.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jbpm.jbpm4</groupId>
- <artifactId>jbpm-spec-dialect-api10</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jbpm.jbpm4</groupId>
- <artifactId>jbpm-spec-cts</artifactId>
- <scope>test</scope>
- <type>zip</type>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-clean-plugin</artifactId>
- <configuration>
- <filesets>
- <fileset>
- <directory>src/test</directory>
- <includes>
- <include>java/org/jbpm/test/**</include>
- </includes>
- </fileset>
- </filesets>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.jbpm.jbpm4</groupId>
- <artifactId>jbpm-spec-cts</artifactId>
- <type>zip</type>
- </artifactItem>
- </artifactItems>
- <outputDirectory>src/test</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>org/jbpm/test/incubator/**/*Test.java</exclude>
- <exclude>org/jbpm/test/pattern/**/*Test.java</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
17 years, 5 months
JBoss JBPM SVN: r3028 - in projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server: integration and 1 other directory.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-11-21 06:50:41 -0500 (Fri, 21 Nov 2008)
New Revision: 3028
Modified:
projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java
projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/JBPM3MgmtFacade.java
projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/ManagementFactory.java
Log:
docs and comments
Modified: projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java
===================================================================
--- projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java 2008-11-21 11:42:46 UTC (rev 3027)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java 2008-11-21 11:50:41 UTC (rev 3028)
@@ -26,6 +26,8 @@
import java.util.Set;
/**
+ * JAX-RS core component.
+ *
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
public class ConsoleServerApplication extends Application
Modified: projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/JBPM3MgmtFacade.java
===================================================================
--- projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/JBPM3MgmtFacade.java 2008-11-21 11:42:46 UTC (rev 3027)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/JBPM3MgmtFacade.java 2008-11-21 11:50:41 UTC (rev 3028)
@@ -41,6 +41,8 @@
import java.util.List;
/**
+ * REST server module for accessing proprietary jbpm data.
+ *
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
@Path("jbpm3")
Modified: projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/ManagementFactory.java
===================================================================
--- projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/ManagementFactory.java 2008-11-21 11:42:46 UTC (rev 3027)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/ManagementFactory.java 2008-11-21 11:50:41 UTC (rev 3028)
@@ -25,14 +25,18 @@
/**
* Construct management implementations.
+ * Defaults to <code>org.jboss.bpm.console.server.integration.internal.JBPM3ManagementFactory</code>
+ *
+ * @see org.jboss.bpm.console.server.util.ServiceLoader
*
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
public abstract class ManagementFactory
{
+ private static final String DEFAULT_FACTORY = "org.jboss.bpm.console.server.integration.internal.JBPM3ManagementFactory";
+
public abstract ProcessManagement createProcessManagement();
-
- // TODO: remove from base class. It's proprietary to jbpm3
+
public abstract JBPM3Extension createExtensionManagement();
public abstract TaskManagement createTaskManagement();
@@ -46,7 +50,7 @@
public static ManagementFactory newInstance()
{
ManagementFactory factory = (ManagementFactory)
- ServiceLoader.loadFromServices(ManagementFactory.class.getName(), "org.jboss.bpm.console.server.integration.internal.JBPM3ManagementFactory");
+ ServiceLoader.loadFromServices(ManagementFactory.class.getName(), DEFAULT_FACTORY);
if(null==factory)
throw new RuntimeException("Failed to load ManagementFactory.");
17 years, 5 months
JBoss JBPM SVN: r3027 - in projects/gwt-console/trunk: war/src/main/java/org/jboss/bpm/console/client/process and 1 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-11-21 06:42:46 -0500 (Fri, 21 Nov 2008)
New Revision: 3027
Added:
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/widgets/ModelModificationCallback.java
Modified:
projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/InvocationProxy.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/TokenEditor.java
Log:
Use ModelListenerRegistry to propagate state changes in process instance list editor
Modified: projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/InvocationProxy.java
===================================================================
--- projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/InvocationProxy.java 2008-11-21 11:31:29 UTC (rev 3026)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/InvocationProxy.java 2008-11-21 11:42:46 UTC (rev 3027)
@@ -30,7 +30,8 @@
import java.lang.reflect.Method;
/**
- * Decorates management invocations with common system aspects, i.e. transaction demarcation.
+ * Decorates management invocations with common system aspects,
+ * i.e. transaction demarcation.
*
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
Added: 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 (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceDetailForm.java 2008-11-21 11:42:46 UTC (rev 3027)
@@ -0,0 +1,178 @@
+/*
+ * 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.process;
+
+import com.allen_sauer.gwt.log.client.Log;
+import com.google.gwt.http.client.*;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+import com.gwtext.client.widgets.form.DateField;
+import com.gwtext.client.widgets.form.FormPanel;
+import com.gwtext.client.widgets.form.TextField;
+import com.gwtext.client.data.Record;
+import org.jboss.bpm.console.client.MainView;
+import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+import org.jboss.bpm.console.client.widgets.FormWidgets;
+import org.jboss.bpm.console.client.widgets.ModelChangeListener;
+import org.jboss.bpm.console.client.widgets.ModelListenerRegistry;
+import org.jboss.bpm.console.client.widgets.ModelModificationCallback;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class ProcessInstanceDetailForm extends Panel implements ModelChangeListener
+{
+
+ private FormPanel detailsForm;
+
+ private ProcessInstanceRef selectedInstance;
+
+ private ModelModificationCallback callback;
+
+ private MainView mainView;
+
+ private Button suspendButton;
+ private Button resumeButton;
+
+ public ProcessInstanceDetailForm(MainView view, ModelModificationCallback callback)
+ {
+ super();
+
+ this.mainView = mainView;
+ this.callback = callback;
+
+ setTitle("Instance Details");
+ setBorder(false);
+ setFrame(false);
+
+ // ---------------
+
+ detailsForm = FormWidgets.createBaseFormPanel();
+
+ // ---------------
+
+ TextField idField = new TextField("Id", "instanceId", 230);
+ idField.setReadOnly(true);
+ detailsForm.add(idField);
+ TextField keyField = new TextField("Key", "key", 230);
+ keyField.setReadOnly(true);
+ detailsForm.add(keyField);
+ TextField stateField = new TextField("State", "state", 230);
+ stateField.setReadOnly(true);
+ detailsForm.add(stateField);
+ DateField startDateField = new DateField("Start Date", "startDate", 230);
+ startDateField.setReadOnly(true);
+ detailsForm.add(startDateField);
+ //detailsForm.add(new DateField("End Date", "endDate", 230));
+
+ suspendButton = new Button("Suspend",
+ new ButtonListenerAdapter()
+ {
+ public void onClick(Button button, EventObject eventObject)
+ {
+ selectedInstance.setState(ProcessInstanceRef.STATE.SUSPENDED);
+ persistStateChange();
+ }
+ }
+ );
+
+ resumeButton = new Button("Resume",
+ new ButtonListenerAdapter()
+ {
+
+ public void onClick(Button button, EventObject eventObject)
+ {
+ selectedInstance.setState(ProcessInstanceRef.STATE.RUNNING);
+ persistStateChange();
+ }
+ }
+ );
+
+ detailsForm.addButton(suspendButton);
+ detailsForm.addButton(resumeButton);
+
+ this.add(detailsForm);
+
+ }
+
+ private void persistStateChange()
+ {
+ String url = mainView.getUrlBuilder().getStateChangeURL(
+ selectedInstance.getInstanceId(), selectedInstance.getState()
+ );
+
+ RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url);
+
+ try
+ {
+ rb.sendRequest(null,
+ new RequestCallback() {
+
+ public void onResponseReceived(Request request, Response response)
+ {
+ if(response.getStatusCode()!=200)
+ Log.error("Failed to change state: " +response.getStatusText());
+ else
+ callback.onStaleModel();
+ }
+
+ public void onError(Request request, Throwable t)
+ {
+ // Unknown error
+ Log.error("Unknown error", t);
+ }
+ });
+ }
+ catch (RequestException e1)
+ {
+ Log.error("Request failed", e1);
+ }
+ }
+
+
+ public void onModelChange(ModelListenerRegistry parent, Object changeEvent)
+ {
+ // not used
+ }
+
+ public void onRecordChange(ModelListenerRegistry parent, Record record)
+ {
+ selectedInstance = ProcessInstanceList.transform(record);
+
+ if(selectedInstance.isSuspended())
+ {
+ suspendButton.disable();
+ resumeButton.enable();
+ }
+ else
+ {
+ resumeButton.disable();
+ suspendButton.enable();
+ }
+
+ detailsForm.getForm().loadRecord(record);
+ detailsForm.doLayout();
+
+ }
+}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java 2008-11-21 11:31:29 UTC (rev 3026)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java 2008-11-21 11:42:46 UTC (rev 3027)
@@ -21,18 +21,10 @@
*/
package org.jboss.bpm.console.client.process;
-import com.allen_sauer.gwt.log.client.Log;
-import com.google.gwt.http.client.*;
-import com.gwtext.client.core.EventObject;
import com.gwtext.client.data.Record;
-import com.gwtext.client.widgets.Button;
import com.gwtext.client.widgets.PaddedPanel;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.TabPanel;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-import com.gwtext.client.widgets.form.DateField;
-import com.gwtext.client.widgets.form.FormPanel;
-import com.gwtext.client.widgets.form.TextField;
import com.gwtext.client.widgets.grid.RowSelectionModel;
import com.gwtext.client.widgets.grid.event.RowSelectionListenerAdapter;
import com.gwtext.client.widgets.layout.ColumnLayout;
@@ -42,7 +34,6 @@
import org.jboss.bpm.console.client.UIConstants;
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
import org.jboss.bpm.console.client.model.ProcessInstanceRef;
-import org.jboss.bpm.console.client.model.jbpm3.TokenReference;
import org.jboss.bpm.console.client.widgets.*;
/**
@@ -56,14 +47,17 @@
private ProcessDefinitionRef parent;
private ProcessInstanceList instanceList;
- private FormPanel detailsForm;
private Panel tokenEditorPanel;
private ProcessInstanceRef selectedInstance;
private TokenEditor currentTokenEditor;
private TabPanel tabPanel;
-
- public ProcessInstanceListEditor(ProcessDefinitionRef proc, MainView view)
+
+ private ModelListenerRegistry modelListeners;
+
+ private ModelModificationCallback modelModificationCallback;
+
+ public ProcessInstanceListEditor(ProcessDefinitionRef proc, final MainView view)
{
super();
@@ -78,14 +72,16 @@
// ---------------
+ this.modelListeners = new ModelListenerRegistry(this);
+
+ // ---------------
+
Panel leftHand = new Panel();
leftHand.setFrame(false);
leftHand.setHeader(false);
- leftHand.setBorder(false);
+ leftHand.setBorder(false);
- instanceList = new ProcessInstanceList(
- proc, "Process Instances", view
- );
+ instanceList = new ProcessInstanceList(proc, "Process Instances", view);
// ---------------
@@ -99,87 +95,21 @@
// ----------------------------------------
- Panel detailsForm = assembleDetailsForm();
- tokenEditorPanel = new Panel("Tokens");
- tokenEditorPanel.setIconCls("bpm-tools-icon");
-
- tabPanel.add( detailsForm );
- tabPanel.add(tokenEditorPanel);
-
- // ----------------------------------
-
- HelpPanel help = new HelpPanel(UIConstants.TEASER_PANEL_WIDTH, 200, "Managing process instances");
-
- TeaserPanel teaserPanel = new TeaserPanel();
- teaserPanel.add(help);
-
- // ----------------------------------
-
- leftHand.add(instanceList);
- leftHand.add(tabPadding);
-
- this.add(leftHand, new ColumnLayoutData(0.7) );
- this.add(teaserPanel , new ColumnLayoutData(0.3) );
-
- }
-
- private Panel assembleDetailsForm()
- {
- // ---------------
-
- Panel outerFormPanel = new Panel();
- outerFormPanel.setTitle("Instance Details");
- outerFormPanel.setBorder(false);
- outerFormPanel.setFrame(false);
-
- // ---------------
-
- detailsForm = FormWidgets.createBaseFormPanel();
-
- // ---------------
-
- TextField idField = new TextField("Id", "instanceId", 230);
- idField.setReadOnly(true);
- detailsForm.add(idField);
- TextField keyField = new TextField("Key", "key", 230);
- keyField.setReadOnly(true);
- detailsForm.add(keyField);
- TextField stateField = new TextField("State", "state", 230);
- stateField.setReadOnly(true);
- detailsForm.add(stateField);
- DateField startDateField = new DateField("Start Date", "startDate", 230);
- startDateField.setReadOnly(true);
- detailsForm.add(startDateField);
- //detailsForm.add(new DateField("End Date", "endDate", 230));
-
- final Button suspendButton = new Button("Suspend",
- new ButtonListenerAdapter()
- {
- public void onClick(Button button, EventObject eventObject)
- {
- selectedInstance.setState(ProcessInstanceRef.STATE.SUSPENDED);
- persistStateChange();
- }
- }
+ modelModificationCallback = new ModelModificationCallback()
+ {
+ public void onStaleModel()
+ {
+ resetEditor();
+ }
+ };
+ Panel detailsForm = new ProcessInstanceDetailForm(view,
+ modelModificationCallback
);
+ modelListeners.addListener( (ModelChangeListener) detailsForm);
- final Button resumeButton = new Button("Resume",
- new ButtonListenerAdapter()
- {
-
- public void onClick(Button button, EventObject eventObject)
- {
- selectedInstance.setState(ProcessInstanceRef.STATE.RUNNING);
- persistStateChange();
- }
- }
- );
-
- detailsForm.addButton(suspendButton);
- detailsForm.addButton(resumeButton);
-
// ----------------
+
final RowSelectionModel sm = new RowSelectionModel(true);
sm.addListener(
new RowSelectionListenerAdapter()
@@ -188,32 +118,15 @@
{
selectedInstance = ProcessInstanceList.transform(record);
- if(selectedInstance.isSuspended())
- {
- suspendButton.disable();
- resumeButton.enable();
- }
- else
- {
- resumeButton.disable();
- suspendButton.enable();
- }
+ modelListeners.fireRecordChangeEvent(record);
+ modelListeners.fireModelChangeEvent(selectedInstance);
- detailsForm.getForm().loadRecord(record);
- detailsForm.doLayout();
-
- final TokenEditor.SignalCallback callback = new TokenEditor.SignalCallback()
- {
- public void onSignalToken(TokenReference tok, String signal)
- {
- Log.debug("signal -> " +signal );
- remoteSignal(tok, signal);
- }
- };
-
+ // --------------------
+
// token form update
+ // TODO: can't this use ModelChangeListener callbacks as well?
tokenEditorPanel.clear();
- currentTokenEditor = new TokenEditor(selectedInstance, callback);
+ currentTokenEditor = new TokenEditor(view, selectedInstance, modelModificationCallback);
tokenEditorPanel.add( // TODO: LRU caching (i.e. last 5)
currentTokenEditor
);
@@ -223,80 +136,30 @@
);
instanceList.setRowSelectionModel(sm);
- outerFormPanel.add(detailsForm);
- return outerFormPanel;
- }
+ tokenEditorPanel = new Panel("Tokens");
+ tokenEditorPanel.setIconCls("bpm-tools-icon");
-
- private void remoteSignal(TokenReference tok, String signal)
- {
+ tabPanel.add( detailsForm );
+ tabPanel.add(tokenEditorPanel);
- String url = signal.equals(UIConstants.DEFAULT_TRANSITION) ?
- view.getUrlBuilder().getTokenSignalUrl(tok) :
- view.getUrlBuilder().getTokenSignalUrl(tok, signal);
-
- RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url);
+ // ----------------------------------
- try
- {
- rb.sendRequest(null,
- new RequestCallback() {
+ HelpPanel help = new HelpPanel(UIConstants.TEASER_PANEL_WIDTH, 200, "Managing process instances");
- public void onResponseReceived(Request request, Response response)
- {
- if(response.getStatusCode()!=200)
- Log.error("Signaling failed: " +response.getText());
- else
- resetEditor();
- }
+ TeaserPanel teaserPanel = new TeaserPanel();
+ teaserPanel.add(help);
- public void onError(Request request, Throwable t)
- {
- // Unknown error
- Log.error("Unknown error", t);
- }
- });
- }
- catch (RequestException e1)
- {
- Log.error("Request failed", e1);
- }
- }
+ // ----------------------------------
- private void persistStateChange()
- {
- RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, view.getUrlBuilder().getStateChangeURL(
- selectedInstance.getInstanceId(), selectedInstance.getState())
- );
+ leftHand.add(instanceList);
+ leftHand.add(tabPadding);
- try
- {
- rb.sendRequest(null,
- new RequestCallback() {
+ this.add(leftHand, new ColumnLayoutData(0.7) );
+ this.add(teaserPanel , new ColumnLayoutData(0.3) );
- public void onResponseReceived(Request request, Response response)
- {
- if(response.getStatusCode()!=200)
- Log.error("Failed to change state: " +response.getStatusText());
- else
- resetEditor();
- }
-
- public void onError(Request request, Throwable t)
- {
- // Unknown error
- Log.error("Unknown error", t);
- }
- });
- }
- catch (RequestException e1)
- {
- Log.error("Request failed", e1);
- }
}
-
public String getEditorId()
{
return getId();
@@ -318,14 +181,12 @@
instanceList.reloadStore();
selectedInstance = null;
- detailsForm.getForm().reset();
-
if(currentTokenEditor!=null)
currentTokenEditor.resetEditor();
tokenEditorPanel.clear();
tokenEditorPanel.doLayout();
-
+
//tabPanel.setActiveTab(0);
}
}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/TokenEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/TokenEditor.java 2008-11-21 11:31:29 UTC (rev 3026)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/TokenEditor.java 2008-11-21 11:42:46 UTC (rev 3027)
@@ -21,6 +21,8 @@
*/
package org.jboss.bpm.console.client.process;
+import com.allen_sauer.gwt.log.client.Log;
+import com.google.gwt.http.client.*;
import com.gwtext.client.core.EventObject;
import com.gwtext.client.data.Node;
import com.gwtext.client.widgets.Panel;
@@ -29,6 +31,9 @@
import com.gwtext.client.widgets.tree.TreeNode;
import com.gwtext.client.widgets.tree.TreePanel;
import com.gwtext.client.widgets.tree.event.TreeNodeListenerAdapter;
+import org.jboss.bpm.console.client.MainView;
+import org.jboss.bpm.console.client.UIConstants;
+import org.jboss.bpm.console.client.widgets.ModelModificationCallback;
import org.jboss.bpm.console.client.model.ProcessInstanceRef;
import org.jboss.bpm.console.client.model.jbpm3.TokenReference;
@@ -40,11 +45,19 @@
private TokenForm tokenForm;
private TokenTree tokenTree;
+ private MainView mainView;
+ private ModelModificationCallback callback;
- public TokenEditor(final ProcessInstanceRef instance, final SignalCallback callback)
+ public TokenEditor(
+ MainView mainView, final ProcessInstanceRef instance,
+ ModelModificationCallback callback
+ )
{
super();
+ this.mainView = mainView;
+ this.callback = callback;
+
this.setHeader(false);
this.setBorder(false);
this.setFrame(false);
@@ -68,8 +81,17 @@
// ----------------
- tokenForm = new TokenForm(callback);
+ tokenForm = new TokenForm(
+ new SignalCallback()
+ {
+ public void onSignalToken(TokenReference tok, String signal)
+ {
+ remoteSignal(tok, signal);
+ }
+ }
+ );
+
// ----------------
this.add(tokenTree, new ColumnLayoutData(0.3));
@@ -142,5 +164,43 @@
{
void onSignalToken(TokenReference tok, String signal);
}
+
+ private void remoteSignal(TokenReference tok, String signal)
+ {
+
+ String url = signal.equals(UIConstants.DEFAULT_TRANSITION) ?
+ mainView.getUrlBuilder().getTokenSignalUrl(tok) :
+ mainView.getUrlBuilder().getTokenSignalUrl(tok, signal);
+
+ RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url);
+
+ try
+ {
+ rb.sendRequest(null,
+ new RequestCallback() {
+
+ public void onResponseReceived(Request request, Response response)
+ {
+ if(response.getStatusCode()!=200)
+ Log.error("Signaling failed: " +response.getText());
+ else
+ {
+ resetEditor();
+ callback.onStaleModel();
+ }
+ }
+
+ public void onError(Request request, Throwable t)
+ {
+ // Unknown error
+ Log.error("Unknown error", t);
+ }
+ });
+ }
+ catch (RequestException e1)
+ {
+ Log.error("Request failed", e1);
+ }
+ }
}
Added: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/ModelModificationCallback.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/ModelModificationCallback.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/ModelModificationCallback.java 2008-11-21 11:42:46 UTC (rev 3027)
@@ -0,0 +1,32 @@
+/*
+ * 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.widgets;
+
+import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public interface ModelModificationCallback
+{
+ void onStaleModel();
+}
17 years, 5 months
JBoss JBPM SVN: r3026 - jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/enterprise/jta.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-21 06:31:29 -0500 (Fri, 21 Nov 2008)
New Revision: 3026
Modified:
jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/enterprise/jta/JtaDbPersistenceTest.java
Log:
format
Modified: jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/enterprise/jta/JtaDbPersistenceTest.java
===================================================================
--- jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/enterprise/jta/JtaDbPersistenceTest.java 2008-11-21 11:26:42 UTC (rev 3025)
+++ jbpm3/trunk/modules/enterprise/jar/src/test/java/org/jbpm/enterprise/jta/JtaDbPersistenceTest.java 2008-11-21 11:31:29 UTC (rev 3026)
@@ -96,9 +96,16 @@
try
{
assertEquals(tx == null, isTxCreatedByService(jbpmContext));
- ProcessDefinition definition = ProcessDefinition.parseXmlString("<process-definition name='tx'>" + " <start-state name='start'>"
- + " <transition to='midway' />" + " </start-state>" + " <state name='midway'>" + " <transition to='end' />" + " </state>"
- + " <end-state name='end' />" + "</process-definition>");
+ ProcessDefinition definition = ProcessDefinition.parseXmlString(
+ "<process-definition name='tx'>" +
+ " <start-state name='start'>" +
+ " <transition to='midway' />" +
+ " </start-state>" +
+ " <state name='midway'>" +
+ " <transition to='end' />" +
+ " </state>" +
+ " <end-state name='end' />" +
+ "</process-definition>");
jbpmContext.deployProcessDefinition(definition);
definitionId = definition.getId();
}
17 years, 5 months