JBoss JBPM SVN: r5540 - in jbpm4/trunk/modules: distro/src/main/files/install/src/hsqldb-server and 1 other directories.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-08-26 08:57:25 -0400 (Wed, 26 Aug 2009)
New Revision: 5540
Added:
jbpm4/trunk/modules/distro/src/main/files/install/src/hsqldb-server/start-hsqldb-manager.bat
jbpm4/trunk/modules/distro/src/main/files/install/src/hsqldb-server/start-hsqldb-manager.sh
jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/mgmt/DefaultServerConfig.java
Modified:
jbpm4/trunk/modules/distro/src/main/files/install/build.xml
jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/mgmt/ServerConfigFactory.java
Log:
Added fixes for Tomcat console support
Modified: jbpm4/trunk/modules/distro/src/main/files/install/build.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/install/build.xml 2009-08-26 09:11:53 UTC (rev 5539)
+++ jbpm4/trunk/modules/distro/src/main/files/install/build.xml 2009-08-26 12:57:25 UTC (rev 5540)
@@ -348,6 +348,7 @@
<include name="hibernate-core.jar" />
<include name="hibernate-cglib-repack.jar" />
<include name="javassist.jar" />
+ <include name="jbpm-spi.jar" />
<include name="jta.jar" />
<include name="juel*.jar" />
<include name="livetribe-jsr223.jar" />
Added: jbpm4/trunk/modules/distro/src/main/files/install/src/hsqldb-server/start-hsqldb-manager.bat
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/install/src/hsqldb-server/start-hsqldb-manager.bat (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/install/src/hsqldb-server/start-hsqldb-manager.bat 2009-08-26 12:57:25 UTC (rev 5540)
@@ -0,0 +1 @@
+java -cp hsqldb.jar org.hsqldb.util.DatabaseManager
\ No newline at end of file
Added: jbpm4/trunk/modules/distro/src/main/files/install/src/hsqldb-server/start-hsqldb-manager.sh
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/install/src/hsqldb-server/start-hsqldb-manager.sh (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/install/src/hsqldb-server/start-hsqldb-manager.sh 2009-08-26 12:57:25 UTC (rev 5540)
@@ -0,0 +1 @@
+java -cp hsqldb.jar org.hsqldb.util.DatabaseManager
\ No newline at end of file
Added: jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/mgmt/DefaultServerConfig.java
===================================================================
--- jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/mgmt/DefaultServerConfig.java (rev 0)
+++ jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/mgmt/DefaultServerConfig.java 2009-08-26 12:57:25 UTC (rev 5540)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+/**
+ *
+ */
+package org.jbpm.integration.spi.mgmt;
+
+import java.io.File;
+
+/**
+ * Serverconfig to fall back on when no 'real' serverconfig can be found.
+ *
+ * @author Joram Barrez
+ */
+public class DefaultServerConfig implements ServerConfig {
+
+ private static final String DEFAULT_HOST = "localhost";
+
+ private static final int DEFAULT_PORT = 8080;
+
+ public String getWebServiceHost() {
+ return DEFAULT_HOST;
+ }
+
+ public int getWebServicePort() {
+ return DEFAULT_PORT;
+ }
+
+ public String getImplementationTitle() {
+ return "DefaultImplementation";
+ }
+
+ public String getImplementationVersion() {
+ return "DefaultImplementation";
+ }
+
+ public File getHomeDir() {
+ return null;
+ }
+
+ public File getServerDataDir() {
+ return null;
+ }
+
+ public File getServerTempDir() {
+ return null;
+ }
+
+ public int getWebServiceSecurePort() {
+ return 0;
+ }
+
+}
Modified: jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/mgmt/ServerConfigFactory.java
===================================================================
--- jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/mgmt/ServerConfigFactory.java 2009-08-26 09:11:53 UTC (rev 5539)
+++ jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/mgmt/ServerConfigFactory.java 2009-08-26 12:57:25 UTC (rev 5540)
@@ -25,18 +25,21 @@
/**
* Factory to container independent config
- *
+ *
* @author Thomas.Diesler(a)jboss.org
* @author Heiko.Braun(a)jboss.com
*
* @since 08-May-2006
*/
-public class ServerConfigFactory
-{
- public static ServerConfig getServerConfig()
- {
- return new KernelAwareSPIFactory().getKernelProvidedSPI(
- ServerConfig.BEAN_NAME, ServerConfig.class
- );
- }
+public class ServerConfigFactory {
+
+ public static ServerConfig getServerConfig() {
+ try {
+ return new KernelAwareSPIFactory()
+ .getKernelProvidedSPI(ServerConfig.BEAN_NAME, ServerConfig.class);
+ } catch (NoClassDefFoundError e) { // FIXME: workaround for Tomcat: if no JBoss classes were found, fall back to defaults
+ // Fall back to defaults
+ return new DefaultServerConfig();
+ }
+ }
}
\ No newline at end of file
16 years, 8 months
JBoss JBPM SVN: r5539 - in jbpm4/trunk/modules: distro/src/main/files/install and 8 other directories.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-08-26 05:11:53 -0400 (Wed, 26 Aug 2009)
New Revision: 5539
Added:
jbpm4/trunk/modules/distro/src/main/files/install/src/hsqldb-server/
jbpm4/trunk/modules/distro/src/main/files/install/src/hsqldb-server/shutdown.sql
jbpm4/trunk/modules/distro/src/main/files/install/src/hsqldb-server/start-hsqldb-server.bat
jbpm4/trunk/modules/distro/src/main/files/install/src/hsqldb-server/start-hsqldb-server.sh
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessEngineUtil.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/StartHsqldbServerTask.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetDeploymentResourceNamesCmd.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Configuration.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinition.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/RepositoryService.java
jbpm4/trunk/modules/distro/src/main/files/install/build.xml
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/JBPMIntegration.java
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ManagementFactoryImpl.java
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessEnginePluginImpl.java
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java
jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/AbstractFormDispatcher.java
jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/FormDispatcherComposite.java
jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/ProcessFormDispatcher.java
jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskFormDispatcher.java
jbpm4/trunk/modules/integration/graphView-plugin/src/main/java/org/jbpm/integration/console/graphView/GraphViewerPluginImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
Log:
* Fix for JBPM-2353: remove transaction demarcation from console integration layer. Transactions will be managed now only by jBPM engine. This allows the console to run on Tomcat.
* Enhanced install script to allow jBPM and console installation into Tomcat.
* Enhanced install script to allow installation of standalone HSQLDB server.
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Configuration.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Configuration.java 2009-08-26 02:56:14 UTC (rev 5538)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Configuration.java 2009-08-26 09:11:53 UTC (rev 5539)
@@ -39,6 +39,12 @@
static Map<String, String> implementationClassNames = null;
Configuration impl;
+
+ /**
+ * Cached processEngine instance used by the
+ * convience 'getProcessEngine()' operation.
+ */
+ private static ProcessEngine cachedProcessEngine;
/** default constructor */
public Configuration() {
@@ -143,4 +149,23 @@
public Configuration setHibernateSessionFactory(Object hibernateSessionFactory){
return impl.setHibernateSessionFactory(hibernateSessionFactory);
}
+
+ /**
+ * Convenience method to retrieve the default {@link ProcessEngine}. To
+ * construct this {@link ProcessEngine}, the classpath resource 'jbpm.cfg.xml'
+ * will be used.
+ *
+ * Subsequent calls will return the same {@link ProcessEngine} instance.
+ */
+ public static ProcessEngine getProcessEngine() {
+ if (cachedProcessEngine == null) {
+ synchronized (Configuration.class) {
+ if (cachedProcessEngine == null) {
+ cachedProcessEngine = new Configuration().setResource("jbpm.cfg.xml").buildProcessEngine();
+ }
+ }
+ }
+ return Configuration.cachedProcessEngine;
+ }
+
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinition.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinition.java 2009-08-26 02:56:14 UTC (rev 5538)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinition.java 2009-08-26 09:11:53 UTC (rev 5539)
@@ -58,4 +58,8 @@
/** description of the process definition */
String getDescription();
+
+ /** Returns whether this process definition is currently suspended. */
+ boolean isSuspended();
+
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/RepositoryService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/RepositoryService.java 2009-08-26 02:56:14 UTC (rev 5538)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/RepositoryService.java 2009-08-26 09:11:53 UTC (rev 5539)
@@ -23,6 +23,7 @@
import java.io.InputStream;
import java.util.List;
+import java.util.Set;
import org.jbpm.api.model.ActivityCoordinates;
@@ -60,7 +61,10 @@
/** deletes deployment, contained process definitions, related process instances
* and their history information */
void deleteDeploymentCascade(String deploymentId);
-
+
+ /** Returns all the resources stored in the deployment with the given id. */
+ Set<String> getResourceNames(String deploymentId);
+
/** obtain an InputStream to a resource in a deployment */
InputStream getResourceAsStream(String deploymentId, String resourceName);
Modified: jbpm4/trunk/modules/distro/src/main/files/install/build.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/install/build.xml 2009-08-26 02:56:14 UTC (rev 5538)
+++ jbpm4/trunk/modules/distro/src/main/files/install/build.xml 2009-08-26 09:11:53 UTC (rev 5539)
@@ -31,6 +31,9 @@
<property name="tomcat.distro.dir" value="downloads" />
<property name="tomcat.distro.url" value="http://www.apache.org/dist/tomcat/tomcat-6/v${tomcat.version}/bin/${tomca..." />
<property name="tomcat.distro.path" value="${tomcat.distro.dir}/${tomcat.filename}" />
+
+ <property name="hsqldb.server.install.dir" value="${jbpm.home}/hsqldb-server"/>
+ <property name="hsqldb.server.source.dir" value="${jbpm.home}/install/src/hsqldb-server" />
<property name="jboss.version" value="5.1.0.GA" />
<property name="jboss.parent.dir" value="${jbpm.home}" />
@@ -318,16 +321,19 @@
<!-- ### INSTALL JBPM INTO TOMCAT ####################################### -->
<target name="install.jbpm.into.tomcat"
- depends="create.cfg"
+ depends="create.cfg"
description="Installs jBPM into tomcat">
+
+ <property name="is.tomcat" value="true" />
- <!-- create the jbpm configuration jar file -->
+ <!-- create the jbpm configuration jar file and drop in /lib -->
<jar destfile="${tomcat.home}/lib/jbpm.cfg.jar">
<fileset dir="generated/cfg">
<exclude name="logging.properties"/>
</fileset>
</jar>
+ <!-- Copy jBPM third party libs into /lib -->
<copy todir="${tomcat.home}/lib" overwrite="true">
<fileset dir="${jbpm.home}">
<include name="jbpm.jar" />
@@ -336,6 +342,7 @@
<include name="activation.jar" />
<include name="antlr.jar" />
<include name="commons-collections.jar" />
+ <include name="commons-logging.jar" />
<include name="dom4j.jar" />
<include name="freemarker.jar" />
<include name="hibernate-core.jar" />
@@ -344,6 +351,7 @@
<include name="jta.jar" />
<include name="juel*.jar" />
<include name="livetribe-jsr223.jar" />
+ <include name="log4j.jar" />
<include name="mail.jar" />
<include name="slf4j-api.jar" />
<include name="slf4j-jdk14.jar" />
@@ -355,12 +363,18 @@
</fileset>
</copy>
+ <!-- Copy jbpm-console wars into /webapps -->
<copy todir="${tomcat.home}/webapps" overwrite="true">
<fileset dir="${jbpm.home}/lib">
- <include name="gwt-console.war" />
- <include name="gwt-console-server.war" />
+ <include name="gwt-console-jbpm.war" />
+ <include name="gwt-console-server-jbpm.war" />
</fileset>
</copy>
+
+ <!-- Rename wars (the context root is configured by WEB-INF/jboss-web.xml,
+ which is neglected by Tomcat -->
+ <move file="${tomcat.home}/webapps/gwt-console-jbpm.war" tofile="${tomcat.home}/webapps/jbpm-console.war" />
+ <move file="${tomcat.home}/webapps/gwt-console-server-jbpm.war" tofile="${tomcat.home}/webapps/gwt-console-server.war" />
<!-- reporting -->
<property name="birt.dir" value="${tomcat.home}/birt"/>
@@ -369,10 +383,54 @@
<unzip src="${jbpm.home}/lib/jbpm-console-reports.jar" dest="${birt.dir}"/>
<!-- copy database driver -->
- <property name="driver.destination.dir" value="${tomcat.home}/" />
- <property name="is.tomcat" value="true" />
+ <property name="database.driver.destination.dir" value="${tomcat.home}/lib" />
<antcall target="internal.copy.database.driver" />
+
</target>
+
+ <!-- ### INSTALL HSQLDB SERVER ################################################ -->
+ <target name="install.hsqldb.server">
+ <delete dir="${hsqldb.server.install.dir}" /> <!-- Also deletes old data -->
+ <mkdir dir="${hsqldb.server.install.dir}"/>
+ <copy file="${jbpm.home}/lib/hsqldb.jar" todir="${hsqldb.server.install.dir}" />
+ <copy todir="${hsqldb.server.install.dir}">
+ <fileset dir="${hsqldb.server.source.dir}" />
+ </copy>
+ <chmod perm="a+x" os="Linux, Mac OS X">
+ <fileset dir="${hsqldb.server.install.dir}">
+ <include name="*.sh"/>
+ </fileset>
+ </chmod>
+ </target>
+
+ <!-- ### START HSQLDB SERVER ################################################ -->
+ <target name="start.hsqldb.server" >
+ <taskdef name="start-hsqldb-server" classname="org.jbpm.pvm.internal.ant.StartHsqldbServerTask">
+ <classpath>
+ <fileset dir="${jbpm.home}">
+ <include name="jbpm.jar"/>
+ </fileset>
+ </classpath>
+ </taskdef>
+ <start-hsqldb-server hsqldbServerHome="${hsqldb.server.install.dir}" />
+ </target>
+
+ <!-- ### SHUTDOWN HSQLDB SERVER ################################################ -->
+ <target name="shutdown.hsqldb.server">
+ <property file="${jbpm.home}/install/src/jdbc/${database}.properties" />
+ <sql driver="${jdbc.driver}"
+ password="${jdbc.password}"
+ url="${jdbc.url}"
+ userid="${jdbc.username}"
+ autocommit="true"
+ src="${hsqldb.server.install.dir}/shutdown.sql">
+ <classpath>
+ <fileset dir="${hsqldb.server.install.dir}">
+ <include name="hsqldb.jar"/>
+ </fileset>
+ </classpath>
+ </sql>
+ </target>
<!-- ### START TOMCAT ################################################### -->
@@ -431,6 +489,8 @@
<target name="create.jbpm.schema"
description="creates the jbpm tables in the database">
<property file="${jbpm.home}/install/src/jdbc/${database}.properties" />
+ <echo message="DB driver ... ${jdbc.driver}" />
+ <echo message="DB URL ...... ${jdbc.url}" />
<sql driver="${jdbc.driver}"
url="${jdbc.url}"
userid="${jdbc.username}"
@@ -502,7 +562,8 @@
<target name="internal.copy.database.driver.if.needed" if="database.driver">
<available file="${jbpm.home}/lib/${database.driver}" property="database.driver.jar.available" />
<fail message="please download the ${database} driver jar and put it in the ${jbpm.home}/lib directory" unless="database.driver.jar.available" />
- <copy file="${jbpm.home}/lib/${database.driver}" todir="${database.driver.destination.dir}" />
+ <echo message="Copying database driver ${database.driver} to ${database.driver.destination.dir}" />
+ <copy file="${jbpm.home}/lib/${database.driver}" todir="${database.driver.destination.dir}" />
</target>
</project>
Added: jbpm4/trunk/modules/distro/src/main/files/install/src/hsqldb-server/shutdown.sql
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/install/src/hsqldb-server/shutdown.sql (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/install/src/hsqldb-server/shutdown.sql 2009-08-26 09:11:53 UTC (rev 5539)
@@ -0,0 +1 @@
+SHUTDOWN
\ No newline at end of file
Added: jbpm4/trunk/modules/distro/src/main/files/install/src/hsqldb-server/start-hsqldb-server.bat
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/install/src/hsqldb-server/start-hsqldb-server.bat (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/install/src/hsqldb-server/start-hsqldb-server.bat 2009-08-26 09:11:53 UTC (rev 5539)
@@ -0,0 +1 @@
+java -cp hsqldb.jar org.hsqldb.Server -address localhost -port 1701 -dbname.0 jbpmDatabase
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/distro/src/main/files/install/src/hsqldb-server/start-hsqldb-server.bat
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/distro/src/main/files/install/src/hsqldb-server/start-hsqldb-server.sh
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/install/src/hsqldb-server/start-hsqldb-server.sh (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/install/src/hsqldb-server/start-hsqldb-server.sh 2009-08-26 09:11:53 UTC (rev 5539)
@@ -0,0 +1 @@
+java -cp hsqldb.jar org.hsqldb.Server -address localhost -port 1701 -dbname.0 jbpmDatabase
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/distro/src/main/files/install/src/hsqldb-server/start-hsqldb-server.sh
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/JBPMIntegration.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/JBPMIntegration.java 2009-08-26 02:56:14 UTC (rev 5538)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/JBPMIntegration.java 2009-08-26 09:11:53 UTC (rev 5539)
@@ -21,33 +21,47 @@
*/
package org.jbpm.integration.console;
+import org.jbpm.api.Configuration;
+import org.jbpm.api.ExecutionService;
+import org.jbpm.api.HistoryService;
import org.jbpm.api.ProcessEngine;
+import org.jbpm.api.RepositoryService;
+import org.jbpm.api.TaskService;
import javax.naming.InitialContext;
/**
* Base class for jbpm integration
+ *
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
-public abstract class JBPMIntegration
-{
+public abstract class JBPMIntegration {
+
protected ProcessEngine processEngine;
+
+ protected ExecutionService executionService;
+
+ protected TaskService taskService;
+
+ protected HistoryService historyService;
+
+ protected RepositoryService repositoryService;
- public JBPMIntegration()
- {
+ public JBPMIntegration() {
initializeProcessEngine();
}
- protected void initializeProcessEngine()
- {
- try
- {
- InitialContext ctx = new InitialContext();
- this.processEngine = (ProcessEngine)ctx.lookup("java:/ProcessEngine");
+ protected void initializeProcessEngine() {
+ processEngine = ProcessEngineUtil.retrieveProcessEngine();
+
+ if (processEngine == null) {
+ throw new RuntimeException("Process engine not initialized!");
}
- catch (Exception e)
- {
- throw new RuntimeException("Failed to lookup process engine", e);
- }
+
+ executionService = processEngine.getExecutionService();
+ taskService = processEngine.getTaskService();
+ historyService = processEngine.getHistoryService();
+ repositoryService = processEngine.getRepositoryService();
}
+
}
Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ManagementFactoryImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ManagementFactoryImpl.java 2009-08-26 02:56:14 UTC (rev 5538)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ManagementFactoryImpl.java 2009-08-26 09:11:53 UTC (rev 5539)
@@ -21,32 +21,27 @@
*/
package org.jbpm.integration.console;
-import org.jboss.bpm.console.server.util.InvocationProxy;
import org.jboss.bpm.console.server.integration.ManagementFactory;
-import org.jboss.bpm.console.server.integration.TaskManagement;
import org.jboss.bpm.console.server.integration.ProcessManagement;
+import org.jboss.bpm.console.server.integration.TaskManagement;
import org.jboss.bpm.console.server.integration.UserManagement;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
+ * @author jbarrez
*/
-public class ManagementFactoryImpl extends ManagementFactory
-{
- public ProcessManagement createProcessManagement()
- {
- return (ProcessManagement)
- InvocationProxy.newInstance(new ProcessManagementImpl());
+public class ManagementFactoryImpl extends ManagementFactory {
+
+ public ProcessManagement createProcessManagement() {
+ return new ProcessManagementImpl();
}
- public TaskManagement createTaskManagement()
- {
- return (TaskManagement)
- InvocationProxy.newInstance(new TaskManagementImpl());
+ public TaskManagement createTaskManagement() {
+ return new TaskManagementImpl();
}
-
- public UserManagement createUserManagement()
- {
- throw new IllegalArgumentException("Not implemented");
+ public UserManagement createUserManagement() {
+ throw new UnsupportedOperationException("Not implemented");
}
+
}
Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java 2009-08-26 02:56:14 UTC (rev 5538)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java 2009-08-26 09:11:53 UTC (rev 5539)
@@ -21,62 +21,74 @@
*/
package org.jbpm.integration.console;
-import org.jboss.bpm.console.client.model.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
+
+import org.jboss.bpm.console.client.model.DeploymentRef;
+import org.jboss.bpm.console.client.model.JobRef;
+import org.jboss.bpm.console.client.model.ParticipantRef;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+import org.jboss.bpm.console.client.model.TaskRef;
+import org.jboss.bpm.console.client.model.TokenReference;
import org.jbpm.api.Deployment;
+import org.jbpm.api.Execution;
+import org.jbpm.api.ExecutionService;
+import org.jbpm.api.HistoryService;
import org.jbpm.api.ProcessDefinition;
+import org.jbpm.api.RepositoryService;
+import org.jbpm.api.TaskService;
import org.jbpm.api.job.Job;
import org.jbpm.api.task.Participation;
import org.jbpm.api.task.Task;
import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
-import org.jbpm.pvm.internal.model.Transition;
-import org.jbpm.pvm.internal.repository.DeploymentImpl;
import org.jbpm.pvm.internal.task.TaskImpl;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
-
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
+ * @author jbarrez
*/
-public class ModelAdaptor
-{
- public static ProcessDefinitionRef adoptDefinition(ProcessDefinition processDefinition)
- {
+public class ModelAdaptor {
+
+ public static ProcessDefinitionRef adoptDefinition(ProcessDefinition processDefinition) {
ProcessDefinitionRef def = new ProcessDefinitionRef();
- def.setId( processDefinition.getId() );
+ def.setId(processDefinition.getId());
def.setName(processDefinition.getName());
def.setVersion(processDefinition.getVersion());
- def.setKey( processDefinition.getKey() );
-
- // TODO: why is that not part of the API and requires cast?
- ProcessDefinitionImpl cast = (ProcessDefinitionImpl)processDefinition;
-
- //def.setDescription(processDefinition.getDescription());
- def.setPackageName(cast.getPackageName());
- def.setDeploymentId(String.valueOf(cast.getDeploymentId()));
+ def.setKey(processDefinition.getKey());
+ def.setSuspended(processDefinition.isSuspended());
+ def.setDeploymentId(processDefinition.getDeploymentId());
+
+ // TODO: Are these needed?
+ // ProcessDefinitionImpl cast = (ProcessDefinitionImpl) processDefinition;
+ // def.setDescription(processDefinition.getDescription());
+ // def.setPackageName(cast.getPackageName());
+
return def;
-
}
- public static ProcessInstanceRef adoptExecution(ExecutionImpl e0)
- {
+ public static ProcessInstanceRef adoptExecution(Execution execution) {
ProcessInstanceRef ref = new ProcessInstanceRef();
- ref.setId( e0.getId() );
- ref.setKey(e0.getKey());
- ref.setDefinitionId(e0.getProcessDefinition().getId() );
- ref.setStartDate( new Date() ); // TODO: FIXME
+ ref.setId(execution.getId());
+ ref.setKey(execution.getKey());
+ ref.setDefinitionId(execution.getProcessDefinitionId());
+
+ // Start date is only available through historyService
+ HistoryService historyService = ProcessEngineUtil.retrieveProcessEngine().getHistoryService();
+ Date startDate = historyService.createHistoryProcessInstanceQuery()
+ .processInstanceId(execution.getId())
+ .uniqueResult().getStartTime();
+ ref.setStartDate(startDate);
- ExecutionImpl topLevelExecution = e0.getProcessInstance();
+ Execution topLevelExecution = execution.getProcessInstance();
TokenReference tok = execution2TokenReference(topLevelExecution);
- Collection<ExecutionImpl> childExecutions = (Collection)topLevelExecution.getExecutions();
- if(childExecutions!=null)
- {
- for(ExecutionImpl childExecution : childExecutions)
- {
+ Collection<ExecutionImpl> childExecutions = (Collection) topLevelExecution.getExecutions();
+ if (childExecutions != null) {
+ for (ExecutionImpl childExecution : childExecutions) {
TokenReference childTok = execution2TokenReference(childExecution);
tok.getChildren().add(childTok);
}
@@ -87,122 +99,121 @@
return ref;
}
- private static TokenReference execution2TokenReference(ExecutionImpl topLevelExecution)
- {
+ private static TokenReference execution2TokenReference(Execution execution) {
TokenReference tok = new TokenReference();
- tok.setName(topLevelExecution.getName());
- tok.setId(topLevelExecution.getId());
- tok.setCurrentNodeName( topLevelExecution.getActivityName() );
-
+ tok.setName(execution.getName());
+ tok.setId(execution.getId());
+
+ // Only if the set of current activitities has one element, we can
+ // set the current node name (otherwise it's a parent execution)
+ Set<String> currentActivities = execution.findActiveActivityNames();
+ if (currentActivities.size() == 1) {
+ tok.setCurrentNodeName(currentActivities.iterator().next());
+ }
+
+
+
// transitions
List<String> availableSignals = new ArrayList<String>();
-
- ExecutionImpl openTopLevelExecution = (ExecutionImpl) topLevelExecution;
+ /* TODO: FIX THIS
+ ExecutionImpl openTopLevelExecution = (ExecutionImpl) execution;
+
List<Transition> outTransitions = openTopLevelExecution.getActivity().getOutgoingTransitions();
- if(outTransitions!=null) // crappy jBPM API
- {
- for(Transition t : outTransitions)
- {
+ if (outTransitions != null) {
+ for (Transition t : outTransitions) {
// TODO: Fix when https://jira.jboss.org/jira/browse/JBPM-2220 is done
- String transitionName = t.getName()!=null ? t.getName() : "to_"+t.getDestination().getName();
+ String transitionName = t.getName() != null ? t.getName() : "to_" + t.getDestination().getName();
availableSignals.add(transitionName);
}
}
tok.setAvailableSignals(availableSignals);
+*/
return tok;
}
- public static TaskRef adoptTask(Task t0)
- {
+ public static TaskRef adoptTask(Task jbpmTask) {
TaskRef task = new TaskRef();
- task.setId( ((TaskImpl)t0).getDbid() );
- task.setName( t0.getName());
- task.setAssignee( t0.getAssignee() );
+
+ task.setId(((TaskImpl) jbpmTask).getDbid());
+ task.setName(jbpmTask.getName());
+ task.setAssignee(jbpmTask.getAssignee());
+
+ task.setPriority(jbpmTask.getPriority());
+ task.setDueDate(jbpmTask.getDuedate());
+ task.setCreateDate(jbpmTask.getCreateTime());
+
+ ExecutionService executionService = ProcessEngineUtil.retrieveProcessEngine().getExecutionService();
+ Execution pi = executionService.findExecutionById(jbpmTask.getExecutionId()).getProcessInstance();
+ task.setProcessInstanceId(pi.getId());
+ task.setProcessId(pi.getProcessDefinitionId());
+
+ // cast
+ //TaskImpl cast = ((TaskImpl) jbpmTask);
+ //task.setSignalling(cast.isSignalling()); // TODO: wat met dit?
- TaskImpl cast = ((TaskImpl) t0);
- task.setSignalling( cast.isSignalling());
+ //ExecutionImpl execution = cast.getProcessInstance();
+ //task.setProcessInstanceId(cast.getProcessInstance().getId());
- ExecutionImpl execution = cast.getProcessInstance();
- task.setProcessInstanceId( cast.getProcessInstance().getId() );
-
- // TODO: weird API
- task.setProcessId( execution.getProcessInstance().getProcessDefinition().getId() );
-
// participations
- for(Participation p0 : cast.getParticipations())
- {
- if(p0.getType().equals(Participation.CANDIDATE))
- {
- if(p0.getGroupId()!=null)
- {
- ParticipantRef participant = new ParticipantRef("candidate", p0.getGroupId());
+ TaskService taskService = ProcessEngineUtil.retrieveProcessEngine().getTaskService();
+ List<Participation> participations = taskService.getTaskParticipations(jbpmTask.getId());
+ for (Participation participation : participations) {
+
+ if (participation.getType().equals(Participation.CANDIDATE)) {
+ if (participation.getGroupId() != null) {
+ ParticipantRef participant = new ParticipantRef("candidate", participation.getGroupId());
participant.setGroup(true);
task.getParticipantGroups().add(participant);
- }
- else if(p0.getUserId()!=null)
- {
- ParticipantRef participant = new ParticipantRef("candidate", p0.getUserId());
+ } else if (participation.getUserId() != null) {
+ ParticipantRef participant = new ParticipantRef("candidate", participation.getUserId());
task.getParticipantUsers().add(participant);
+ } else {
+ throw new IllegalArgumentException("Participation doesn't have user or group: " + participation);
}
- else
- {
- throw new IllegalArgumentException("Participation doesn't have user or group: " + p0);
- }
+ } else {
+ throw new IllegalArgumentException("Unknown participation type: " + participation.getType());
}
- else
- {
- throw new IllegalArgumentException("Unknown participation type: " +p0.getType());
- }
}
- // prio and duedate
- task.setPriority(t0.getPriority());
- task.setDueDate(t0.getDuedate());
- task.setCreateDate(t0.getCreateTime());
-
// task formResourceName url
- String url = t0.getFormResourceName()!=null ? t0.getFormResourceName() : "";
- task.setUrl( url );
-
+ String url = jbpmTask.getFormResourceName() != null ? jbpmTask.getFormResourceName() : "";
+ task.setUrl(url);
+
return task;
}
- public static DeploymentRef adoptDeployment(Deployment dpl)
- {
- DeploymentImpl d0 = (DeploymentImpl)dpl;
- DeploymentRef dRef = new DeploymentRef(
- dpl.getId(), d0.isSuspended()
- );
+ public static DeploymentRef adoptDeployment(Deployment deployment) {
+ DeploymentRef dRef = new DeploymentRef();
+ dRef.setId(deployment.getId());
+ dRef.setSuspended(deployment.getState().equals(Deployment.STATE_SUSPENDED));
+ dRef.setTimestamp(deployment.getTimestamp());
+
+ RepositoryService repositoryService = ProcessEngineUtil.retrieveProcessEngine().getRepositoryService();
+ Set<String> resourceNames = repositoryService.getResourceNames(deployment.getId());
+ dRef.getResourceNames().addAll(resourceNames);
- String name = d0.getName();
- dRef.getResourceNames().addAll(d0.getResourceNames());
-
+ String name = deployment.getName();
// strip path info
- if(name.indexOf("/")!=-1)
- {
- name = name.substring(name.lastIndexOf("/")+1, name.length());
+ if (name.indexOf("/") != -1) {
+ name = name.substring(name.lastIndexOf("/") + 1, name.length());
}
-
dRef.setName(name);
- dRef.setTimestamp(d0.getTimestamp());
return dRef;
}
- public static JobRef adoptJob(Job j)
- {
- JobRef job = new JobRef();
- job.setId(String.valueOf(j.getId()));
- if(j.getDueDate()!=null)
- {
- job.setTimestamp(j.getDueDate().getTime());
+ public static JobRef adoptJob(Job job) {
+ JobRef jobRef = new JobRef();
+ jobRef.setId(String.valueOf(job.getId()));
+
+ if (job.getDuedate() != null) {
+ jobRef.setTimestamp(job.getDuedate().getTime());
}
- if(j.getException()!=null)
- {
- job.setErrMsg(j.getException());
+ if (job.getException() != null) {
+ jobRef.setErrMsg(job.getException());
}
- return job;
+ return jobRef;
}
}
Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessEnginePluginImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessEnginePluginImpl.java 2009-08-26 02:56:14 UTC (rev 5538)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessEnginePluginImpl.java 2009-08-26 09:11:53 UTC (rev 5539)
@@ -21,166 +21,102 @@
*/
package org.jbpm.integration.console;
+import java.util.ArrayList;
+import java.util.List;
+
import org.jboss.bpm.console.client.model.DeploymentRef;
import org.jboss.bpm.console.client.model.JobRef;
import org.jboss.bpm.console.server.plugin.ProcessEnginePlugin;
-import org.jbpm.api.*;
+import org.jbpm.api.Deployment;
+import org.jbpm.api.ManagementService;
+import org.jbpm.api.ProcessDefinition;
+import org.jbpm.api.ProcessDefinitionQuery;
+import org.jbpm.api.RepositoryService;
import org.jbpm.api.job.Job;
-import org.jbpm.pvm.internal.env.EnvironmentFactory;
-import org.jbpm.pvm.internal.env.EnvironmentImpl;
-import java.util.ArrayList;
-import java.util.List;
-
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
+ * @author jbarrez
*/
-public class ProcessEnginePluginImpl extends JBPMIntegration
- implements ProcessEnginePlugin
-{
+public class ProcessEnginePluginImpl extends JBPMIntegration implements ProcessEnginePlugin {
- public ProcessEnginePluginImpl()
- {
- initializeProcessEngine();
+ public ProcessEnginePluginImpl() {
+ super();
}
- public List<DeploymentRef> getDeployments()
- {
+ public List<DeploymentRef> getDeployments() {
List<DeploymentRef> results = new ArrayList<DeploymentRef>();
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
+ RepositoryService repositoryService = this.processEngine.getRepositoryService();
+ List<Deployment> dpls = repositoryService.createDeploymentQuery().list();
- try
- {
- RepositoryService repositoryService = this.processEngine.getRepositoryService();
- DeploymentQuery dquery = repositoryService.createDeploymentQuery();
+ for (Deployment dpl : dpls) {
+ DeploymentRef deploymentRef = ModelAdaptor.adoptDeployment(dpl);
- List<Deployment> dpls = dquery.list();
+ // active processes for deployment
+ ProcessDefinitionQuery pdQuery = repositoryService.createProcessDefinitionQuery();
+ pdQuery.deploymentId(dpl.getId());
+ List<ProcessDefinition> activePds = pdQuery.list();
- for(Deployment dpl : dpls)
- {
- DeploymentRef ref = ModelAdaptor.adoptDeployment(dpl);
+ for (ProcessDefinition procDef : activePds) {
+ deploymentRef.getDefinitions().add(procDef.getId());
+ }
- // active processes
- ProcessDefinitionQuery pdQuery = repositoryService.createProcessDefinitionQuery();
- pdQuery.deploymentId(dpl.getId());
- List<ProcessDefinition> activePds = pdQuery.list();
+ // suspended processes for deployment
+ List<ProcessDefinition> suspendedPds =
+ repositoryService.createProcessDefinitionQuery()
+ .deploymentId(dpl.getId())
+ .suspended()
+ .list();
- for(ProcessDefinition p : activePds)
- {
- ref.getDefinitions().add(p.getId());
- }
-
- // suspended processes
- ProcessDefinitionQuery pdQuery2 = repositoryService.createProcessDefinitionQuery();
- pdQuery2.deploymentId(dpl.getId());
- pdQuery2.suspended();
- List<ProcessDefinition> suspendedPds = pdQuery2.list();
-
- for(ProcessDefinition p : suspendedPds)
- {
- ref.getDefinitions().add(p.getId());
- }
-
- results.add(ref);
+ for (ProcessDefinition procDef : suspendedPds) {
+ deploymentRef.getDefinitions().add(procDef.getId());
}
- return results;
+ results.add(deploymentRef);
}
- finally
- {
- env.close();
- }
- }
- public void deleteDeployment(String id)
- {
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
-
- try
- {
- RepositoryService repositoryService = this.processEngine.getRepositoryService();
- repositoryService.deleteDeploymentCascade(id);
- }
- finally
- {
- env.close();
- }
-
+ return results;
}
+
+ public void deleteDeployment(String id) {
+ RepositoryService repositoryService = this.processEngine.getRepositoryService();
+ repositoryService.deleteDeploymentCascade(id);
+ }
- public void suspendDeployment(String id, boolean isSuspended)
- {
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
-
- try
- {
- RepositoryService repositoryService = this.processEngine.getRepositoryService();
- if(isSuspended)
- repositoryService.suspendDeployment(id);
- else
- repositoryService.resumeDeployment(id);
- }
- finally
- {
- env.close();
- }
-
+ public void suspendDeployment(String id, boolean isSuspended) {
+ RepositoryService repositoryService = this.processEngine.getRepositoryService();
+ if (isSuspended)
+ repositoryService.suspendDeployment(id);
+ else
+ repositoryService.resumeDeployment(id);
}
- public List<JobRef> getJobs()
- {
+ public List<JobRef> getJobs() {
+ ManagementService mgmtService = this.processEngine.getManagementService();
List<JobRef> results = new ArrayList<JobRef>();
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
+ // timers
+ List<Job> timers = mgmtService.createJobQuery().timers().list();
+ for (Job t : timers) {
+ JobRef ref = ModelAdaptor.adoptJob(t);
+ ref.setType("timer");
+ results.add(ref);
+ }
- try
- {
- ManagementService mgmtService = this.processEngine.getManagementService();
-
- // jobs
- JobQuery timerQuery = mgmtService.createJobQuery();
- timerQuery.timers();
- List<Job> timers = timerQuery.list();
- for(Job t : timers)
- {
- JobRef ref = ModelAdaptor.adoptJob(t);
- ref.setType("timer");
- results.add(ref);
- }
-
- // messages
- JobQuery msgQuery= mgmtService.createJobQuery();
- msgQuery.messages();
- List<Job> msgs = msgQuery.list();
- for(Job t : msgs)
- {
- JobRef ref = ModelAdaptor.adoptJob(t);
- ref.setType("message");
- results.add(ref);
- }
+ // messages
+ List<Job> msgs = mgmtService.createJobQuery().messages().list();
+ for (Job t : msgs) {
+ JobRef ref = ModelAdaptor.adoptJob(t);
+ ref.setType("message");
+ results.add(ref);
}
- finally
- {
- env.close();
- }
return results;
}
-
- public void executeJob(String jobId)
- {
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
-
- try
- {
- ManagementService mgmtService = this.processEngine.getManagementService();
- mgmtService.executeJob(jobId);
- }
- finally
- {
- env.close();
- }
+ public void executeJob(String jobId) {
+ ManagementService mgmtService = this.processEngine.getManagementService();
+ mgmtService.executeJob(jobId);
}
}
Added: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessEngineUtil.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessEngineUtil.java (rev 0)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessEngineUtil.java 2009-08-26 09:11:53 UTC (rev 5539)
@@ -0,0 +1,40 @@
+package org.jbpm.integration.console;
+
+import javax.naming.InitialContext;
+
+import org.jbpm.api.Configuration;
+import org.jbpm.api.ProcessEngine;
+
+/**
+ * Utility class for retrieving the {@link ProcessEngine}.
+ *
+ * @author jbarrez
+ */
+public final class ProcessEngineUtil {
+
+ private static ProcessEngine processEngine;
+
+ private static final String PROCESS_ENGINE_JNDI_NAME = "java:/ProcessEngine";
+
+ public static ProcessEngine retrieveProcessEngine() {
+ if (processEngine == null) {
+ synchronized (ProcessEngine.class) {
+
+ if (processEngine == null) {
+
+ try {
+ InitialContext ctx = new InitialContext();
+ processEngine = (ProcessEngine) ctx.lookup(PROCESS_ENGINE_JNDI_NAME);
+ } catch (Exception e) {
+ // Fall back to default mechanism which build a procEngine from a default jbpm.cfg.xml
+ processEngine = Configuration.getProcessEngine();
+ }
+
+ }
+
+ }
+ }
+ return processEngine;
+ }
+
+}
Property changes on: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessEngineUtil.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java 2009-08-26 02:56:14 UTC (rev 5538)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java 2009-08-26 09:11:53 UTC (rev 5539)
@@ -22,7 +22,11 @@
package org.jbpm.integration.console;
import java.io.InputStream;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
import org.jboss.bpm.console.client.model.ProcessInstanceRef;
@@ -33,316 +37,155 @@
import org.jbpm.api.ProcessDefinition;
import org.jbpm.api.ProcessDefinitionQuery;
import org.jbpm.api.ProcessInstance;
-import org.jbpm.api.ProcessInstanceQuery;
import org.jbpm.api.RepositoryService;
import org.jbpm.api.history.HistoryProcessInstance;
import org.jbpm.api.history.HistoryProcessInstanceQuery;
-import org.jbpm.pvm.internal.env.EnvironmentImpl;
-import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.model.ExecutionImpl;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
+ * @author jbarrez
*/
-class ProcessManagementImpl extends JBPMIntegration implements ProcessManagement
-{
+class ProcessManagementImpl extends JBPMIntegration implements ProcessManagement {
+
+
+ public ProcessManagementImpl() {
+ super();
+ }
- public List<ProcessDefinitionRef> getProcessDefinitions()
- {
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
+ public List<ProcessDefinitionRef> getProcessDefinitions() {
+ RepositoryService repositoryService = this.processEngine.getRepositoryService();
+ List<ProcessDefinitionRef> results = new ArrayList<ProcessDefinitionRef>();
- try
- {
- List<ProcessDefinitionRef> results = new ArrayList<ProcessDefinitionRef>();
+ // active process definitions
+ List<ProcessDefinition> activePds =
+ repositoryService.createProcessDefinitionQuery()
+ .orderAsc(ProcessDefinitionQuery.PROPERTY_NAME)
+ .list();
- RepositoryService repositoryService = this.processEngine.getRepositoryService();
-
- // active processes
- List<ProcessDefinition> activePds = repositoryService.createProcessDefinitionQuery()
- .notSuspended()
- .orderAsc(ProcessDefinitionQuery.PROPERTY_NAME)
- .list();
-
- for(ProcessDefinition processDefinition : activePds)
- {
- ProcessDefinitionRef ref = ModelAdaptor.adoptDefinition(processDefinition);
- results.add(ref);
- }
-
- // suspended processes
- ProcessDefinitionQuery pdQuery2 = repositoryService.createProcessDefinitionQuery();
- pdQuery2.suspended();
- List<ProcessDefinition> suspendedPds = pdQuery2.list();
-
- for(ProcessDefinition p : suspendedPds)
- {
- ProcessDefinitionRef ref = ModelAdaptor.adoptDefinition(p);
- ref.setSuspended(true);
- results.add(ref);
- }
-
- return results;
+ for (ProcessDefinition processDefinition : activePds) {
+ results.add(ModelAdaptor.adoptDefinition(processDefinition));
}
- finally
- {
- env.close();
- }
+ return results;
}
- public ProcessDefinitionRef getProcessDefinition(String procDefId)
- {
+ public ProcessDefinitionRef getProcessDefinition(String procDefId) {
+ RepositoryService repositoryService = this.processEngine.getRepositoryService();
+ ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(procDefId).uniqueResult();
+ return ModelAdaptor.adoptDefinition(processDefinition);
+ }
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
-
- try
- {
- RepositoryService repositoryService = this.processEngine.getRepositoryService();
- ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
- .processDefinitionId(procDefId)
- .uniqueResult();
- return ModelAdaptor.adoptDefinition(processDefinition);
-
+ public List<ProcessDefinitionRef> removeProcessDefinition(String procDefId) {
+ RepositoryService repositoryService = this.processEngine.getRepositoryService();
+ ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(procDefId).uniqueResult();
+ if (processDefinition != null) {
+ // Todo: this deletes a complete deployment. Currently, there is no way of deleting a procDef only
+ repositoryService.deleteDeploymentCascade(processDefinition.getDeploymentId());
}
- finally
- {
- env.close();
- }
+ return getProcessDefinitions();
}
- public List<ProcessDefinitionRef> removeProcessDefinition(String procDefId)
- {
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
+ public List<ProcessInstanceRef> getProcessInstances(String procDefId) {
+ ExecutionService execService = this.processEngine.getExecutionService();
+ List<ProcessInstance> processInstances = execService.createProcessInstanceQuery()
+ .processDefinitionId(procDefId)
+ .list();
- try
- {
+ List<ProcessInstanceRef> results = adoptProcessInstances(processInstances);
- RepositoryService repositoryService = this.processEngine.getRepositoryService();
- ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
- .processDefinitionId(procDefId)
- .uniqueResult();
- if (processDefinition!=null) {
- repositoryService.deleteDeploymentCascade(processDefinition.getDeploymentId());
- }
- return getProcessDefinitions();
+ // add history info
+ // TODO: optimize w. batch query
+ HistoryService histService = this.processEngine.getHistoryService();
+ for (ProcessInstanceRef inst : results) {
+ HistoryProcessInstanceQuery hQuery = histService.createHistoryProcessInstanceQuery();
+ hQuery.processInstanceId(inst.getId());
+ HistoryProcessInstance entry = hQuery.uniqueResult();
+ inst.setStartDate(entry.getStartTime());
}
- finally
- {
- env.close();
- }
+ return results;
}
- public List<ProcessInstanceRef> getProcessInstances(String procDefId)
- {
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
-
- try
- {
-
- ExecutionService execService = this.processEngine.getExecutionService();
- ProcessInstanceQuery query = execService.createProcessInstanceQuery();
- query.processDefinitionId(String.valueOf(procDefId));
-
- List<ProcessInstance> processInstances = query.list();
-
- List<ProcessInstanceRef> results = adoptProcessInstances(processInstances);
-
- // add history info
- // TODO: optimize w. batch query
- HistoryService histService = this.processEngine.getHistoryService();
- for(ProcessInstanceRef inst : results)
- {
- HistoryProcessInstanceQuery hQuery = histService.createHistoryProcessInstanceQuery();
- hQuery.processInstanceId(inst.getId());
- HistoryProcessInstance entry = hQuery.uniqueResult();
- inst.setStartDate(entry.getStartTime());
+ private List<ProcessInstanceRef> adoptProcessInstances(List<ProcessInstance> processInstances) {
+ List<ProcessInstanceRef> results = new ArrayList<ProcessInstanceRef>();
+ for (Execution processInstance : processInstances) {
+ if (processInstance.isEnded()) {
+ continue; // JBPM-2055: Execution is already ended. Should not show up in query
}
- return results;
- }
- finally
- {
- env.close();
- }
- }
-
- private List<ProcessInstanceRef> adoptProcessInstances(List<ProcessInstance> processInstances)
- {
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
-
- try
- {
-
- List<ProcessInstanceRef> results = new ArrayList<ProcessInstanceRef>();
- for(Execution processInstance : processInstances)
- {
- if(processInstance.isEnded())
- {
- //JBPM-2055: Execution is already ended. Should not show up in query
- continue;
- }
-
- if(processInstance.isProcessInstance()) // parent execution
- {
- results.add( ModelAdaptor.adoptExecution((ExecutionImpl)processInstance) );
- }
+ if (processInstance.isProcessInstance()) { // parent execution
+ results.add(ModelAdaptor.adoptExecution((ExecutionImpl) processInstance));
}
- return results;
}
- finally
- {
- env.close();
- }
+ return results;
}
- public ProcessInstanceRef getProcessInstance(String instanceId)
- {
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
-
- try
- {
- ExecutionService execService = this.processEngine.getExecutionService();
- ProcessInstanceQuery query = execService.createProcessInstanceQuery();
- query.processInstanceId(instanceId);
- ProcessInstance processInstance = query.uniqueResult();
- return ModelAdaptor.adoptExecution( (ExecutionImpl)processInstance);
- }
- finally
- {
- env.close();
- }
+ public ProcessInstanceRef getProcessInstance(String instanceId) {
+ ExecutionService execService = this.processEngine.getExecutionService();
+ ProcessInstance processInstance = execService.createProcessInstanceQuery()
+ .processInstanceId(instanceId)
+ .uniqueResult();
+ return ModelAdaptor.adoptExecution((ExecutionImpl) processInstance);
}
-
- public Map<String, Object> getInstanceData(String instanceId)
- {
+ public Map<String, Object> getInstanceData(String instanceId) {
Map<String, Object> data = new HashMap<String, Object>();
-
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
-
- try
- {
- ExecutionService execService = this.processEngine.getExecutionService();
- Set<String> keys = execService.getVariableNames(instanceId);
- data = execService.getVariables(instanceId, keys);
- }
- finally
- {
- env.close();
- }
-
+ ExecutionService execService = this.processEngine.getExecutionService();
+ Set<String> keys = execService.getVariableNames(instanceId);
+ data = execService.getVariables(instanceId, keys);
return data;
}
- public void setInstanceData(String instanceId, Map<String, Object> data)
- {
+ public void setInstanceData(String instanceId, Map<String, Object> data) {
throw new RuntimeException("Not implemented");
}
- public ProcessInstanceRef newInstance(String definitionId)
- {
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
-
- try
- {
- ExecutionService execService = this.processEngine.getExecutionService();
- Execution exec = execService.startProcessInstanceById(definitionId);
- return ModelAdaptor.adoptExecution((ExecutionImpl)exec);
- }
- finally{
- env.close();
- }
+ public ProcessInstanceRef newInstance(String definitionId) {
+ ExecutionService execService = this.processEngine.getExecutionService();
+ Execution exec = execService.startProcessInstanceById(definitionId);
+ return ModelAdaptor.adoptExecution((ExecutionImpl) exec);
}
-
- public ProcessInstanceRef newInstance(String definitionId, Map<String, Object> processVars)
- {
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
-
- try
- {
- ExecutionService execService = this.processEngine.getExecutionService();
- Execution exec = execService.startProcessInstanceById(definitionId, processVars);
-
- return ModelAdaptor.adoptExecution((ExecutionImpl)exec);
- }
- finally{
- env.close();
- }
+ public ProcessInstanceRef newInstance(String definitionId, Map<String, Object> processVars) {
+ ExecutionService execService = this.processEngine.getExecutionService();
+ Execution exec = execService.startProcessInstanceById(definitionId, processVars);
+ return ModelAdaptor.adoptExecution((ExecutionImpl) exec);
}
- public void endInstance(String instanceId, ProcessInstanceRef.RESULT result)
- {
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
+ public void endInstance(String instanceId, ProcessInstanceRef.RESULT result) {
+ ExecutionService execService = this.processEngine.getExecutionService();
+ Execution exec = execService.findExecutionById(instanceId);
+ if (null == exec)
+ throw new IllegalArgumentException("No such execution with id " + instanceId);
- try
- {
-
- ExecutionService execService = this.processEngine.getExecutionService();
- Execution exec = execService.findExecutionById(instanceId);
- if(null==exec)
- throw new IllegalArgumentException("No such execution with id "+ instanceId);
-
- ProcessInstanceRef.RESULT actualResult = result!=null ? result : ProcessInstanceRef.RESULT.COMPLETED;
- execService.endProcessInstance(instanceId, actualResult.toString());
- }
- finally
- {
- env.close();
- }
+ ProcessInstanceRef.RESULT actualResult = result != null ? result : ProcessInstanceRef.RESULT.COMPLETED;
+ execService.endProcessInstance(instanceId, actualResult.toString());
}
- public void deleteInstance(String instanceId)
- {
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
+ public void deleteInstance(String instanceId) {
+ ExecutionService execService = this.processEngine.getExecutionService();
+ Execution exec = execService.findExecutionById(instanceId);
+
+ if (null == exec)
+ throw new IllegalArgumentException("No such execution with id " + instanceId);
- try
- {
-
- ExecutionService execService = this.processEngine.getExecutionService();
- Execution exec = execService.findExecutionById(instanceId);
- if(null==exec)
- throw new IllegalArgumentException("No such execution with id "+ instanceId);
-
- execService.deleteProcessInstance(instanceId);
- }
- finally
- {
- env.close();
- }
+ execService.deleteProcessInstance(instanceId);
}
- public void setProcessState(
- String executionId,
- ProcessInstanceRef.STATE nextState
- )
- {
+ public void setProcessState(String executionId, ProcessInstanceRef.STATE nextState) {
throw new RuntimeException("Not implemented");
}
- public void signalExecution(String executionId, String signal)
- {
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
+ public void signalExecution(String executionId, String signal) {
+ ExecutionService execService = this.processEngine.getExecutionService();
- try
- {
- ExecutionService execService = this.processEngine.getExecutionService();
-
- if(null==signal)
- execService.signalExecutionById(executionId);
- else
- execService.signalExecutionById(executionId, signal);
- }
- finally
- {
- env.close();
- }
-
+ if (null == signal)
+ execService.signalExecutionById(executionId);
+ else
+ execService.signalExecutionById(executionId, signal);
}
- public void deploy(String fileName, String contentType, InputStream deployment)
- {
+ public void deploy(String fileName, String contentType, InputStream deployment) {
throw new RuntimeException("Not implemented");
}
}
-
Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java 2009-08-26 02:56:14 UTC (rev 5538)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java 2009-08-26 09:11:53 UTC (rev 5539)
@@ -30,146 +30,76 @@
import org.jbpm.api.TaskService;
import org.jbpm.api.task.Participation;
import org.jbpm.api.task.Task;
-import org.jbpm.pvm.internal.env.EnvironmentImpl;
-import org.jbpm.pvm.internal.env.EnvironmentFactory;
-
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
-public class TaskManagementImpl extends JBPMIntegration implements TaskManagement
-{
- public List<TaskRef> getAssignedTasks(String idRef)
- {
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
+public class TaskManagementImpl extends JBPMIntegration implements TaskManagement {
+
+
+ public TaskManagementImpl() {
+ super();
+ }
- try
- {
- TaskService taskService = this.processEngine.get(TaskService.class);
- List<TaskRef> results = new ArrayList<TaskRef>();
+ public List<TaskRef> getAssignedTasks(String idRef) {
+ TaskService taskService = this.processEngine.get(TaskService.class);
+ List<TaskRef> results = new ArrayList<TaskRef>();
- List<Task> assignedTasks = taskService.findPersonalTasks(idRef);
- adoptTasks(assignedTasks, results);
-
- return results;
- }
- finally
- {
- env.close();
- }
+ List<Task> assignedTasks = taskService.findPersonalTasks(idRef);
+ adoptTasks(assignedTasks, results);
+ return results;
}
- public List<TaskRef> getUnassignedTasks(String idRef, String participationType)
- {
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
+ public List<TaskRef> getUnassignedTasks(String idRef, String participationType) {
+ TaskService taskService = this.processEngine.get(TaskService.class);
+ List<TaskRef> results = new ArrayList<TaskRef>();
- try
- {
- TaskService taskService = this.processEngine.get(TaskService.class);
- List<TaskRef> results = new ArrayList<TaskRef>();
-
- if(null==participationType || participationType.equals(Participation.CANDIDATE))
- {
- List<Task> groupTasks = taskService.findGroupTasks(idRef);
- adoptTasks(groupTasks, results);
- }
- else
- {
- throw new IllegalArgumentException("Unknown participation type: " +participationType);
- }
-
- return results;
+ if (null == participationType || participationType.equals(Participation.CANDIDATE)) {
+ List<Task> groupTasks = taskService.findGroupTasks(idRef);
+ adoptTasks(groupTasks, results);
+ } else {
+ throw new IllegalArgumentException("Unknown participation type: " + participationType);
}
- finally
- {
- env.close();
- }
+
+ return results;
}
- private void adoptTasks(List<Task> tasks, List<TaskRef> results)
- {
- for(Task t0 : tasks)
- {
- results.add( ModelAdaptor.adoptTask(t0) );
+ private void adoptTasks(List<Task> tasks, List<TaskRef> results) {
+ for (Task t0 : tasks) {
+ results.add(ModelAdaptor.adoptTask(t0));
}
}
- public TaskRef getTaskById(long taskId)
- {
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
-
- try
- {
- TaskService taskService = this.processEngine.get(TaskService.class);
- Task t0 = taskService.getTask(Long.toString(taskId));
- return ModelAdaptor.adoptTask(t0);
- }
- finally{
- env.close();
- }
+ public TaskRef getTaskById(long taskId) {
+ TaskService taskService = this.processEngine.get(TaskService.class);
+ Task t0 = taskService.getTask(Long.toString(taskId));
+ return ModelAdaptor.adoptTask(t0);
}
- public void assignTask(long taskId, String idRef, String performingUser)
- {
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
-
- try
- {
- TaskService taskService = this.processEngine.get(TaskService.class);
- taskService.assignTask(Long.toString(taskId), idRef);
- }
- finally{
- env.close();
- }
+ public void assignTask(long taskId, String idRef, String performingUser) {
+ TaskService taskService = this.processEngine.get(TaskService.class);
+ taskService.assignTask(Long.toString(taskId), idRef);
}
- public void releaseTask(long taskId, String performingUser)
- {
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
-
- try
- {
- TaskService taskService = this.processEngine.get(TaskService.class);
- taskService.assignTask(Long.toString(taskId), null);
- }
- finally{
- env.close();
- }
+ public void releaseTask(long taskId, String performingUser) {
+ TaskService taskService = this.processEngine.get(TaskService.class);
+ taskService.assignTask(Long.toString(taskId), null);
}
- public void completeTask(long taskId, Map data, String performingUser)
- {
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
+ public void completeTask(long taskId, Map data, String performingUser) {
+ TaskService taskService = this.processEngine.get(TaskService.class);
+ if (data != null)
+ taskService.setVariables(Long.toString(taskId), data);
- try
- {
- TaskService taskService = this.processEngine.get(TaskService.class);
- if(data!=null)
- taskService.setVariables(Long.toString(taskId), data);
-
- taskService.completeTask(Long.toString(taskId));
- }
- finally{
- env.close();
- }
+ taskService.completeTask(Long.toString(taskId));
}
- public void completeTask(long taskId, String outcome, Map data, String performingUser)
- {
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
+ public void completeTask(long taskId, String outcome, Map data, String performingUser) {
+ TaskService taskService = this.processEngine.get(TaskService.class);
+ if (data != null)
+ taskService.setVariables(Long.toString(taskId), data);
- try
- {
- TaskService taskService = this.processEngine.get(TaskService.class);
- if(data!=null)
- taskService.setVariables(Long.toString(taskId), data);
-
- taskService.completeTask(Long.toString(taskId), outcome);
- }
- finally
- {
- env.close();
- }
+ taskService.completeTask(Long.toString(taskId), outcome);
}
}
Modified: jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/AbstractFormDispatcher.java
===================================================================
--- jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/AbstractFormDispatcher.java 2009-08-26 02:56:14 UTC (rev 5538)
+++ jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/AbstractFormDispatcher.java 2009-08-26 09:11:53 UTC (rev 5539)
@@ -23,6 +23,8 @@
import freemarker.template.DefaultObjectWrapper;
import freemarker.template.Template;
+
+import org.jbpm.api.Configuration;
import org.jbpm.api.ProcessEngine;
import org.jbpm.integration.spi.mgmt.ServerConfig;
import org.jbpm.integration.spi.mgmt.ServerConfigFactory;
@@ -34,69 +36,61 @@
import java.util.Map;
/**
- * Base class for freemarker based form dispatcher implementations
- * that should run on JBoss. Uses {@link org.jbpm.integration.spi.mgmt.ServerConfig}
- * to resolve the HTTP host and port.
+ * Base class for freemarker based form dispatcher implementations that should
+ * run on JBoss. Uses {@link org.jbpm.integration.spi.mgmt.ServerConfig} to
+ * resolve the HTTP host and port.
*
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
-public class AbstractFormDispatcher
-{
- //private static final Log log = LogFactory.getLog(AbstractFormDispatcher.class);
+public class AbstractFormDispatcher {
+ // private static final Log log =
+ // LogFactory.getLog(AbstractFormDispatcher.class);
+
protected final static String WEB_CONTEXT = "/gwt-console-server/rs";
-
+
protected ProcessEngine processEngine;
- protected ServerConfig serverConfig = null; // lazy
+
+ protected ServerConfig serverConfig = null; // lazy
+
protected static final String FORM_DIRECTIVE_KEY = "form";
+
protected static final String OUTCOME_DIRECTIVE_NAME = "outcome";
- public AbstractFormDispatcher()
- {
+ public AbstractFormDispatcher() {
initializeProcessEngine();
}
- protected void initializeProcessEngine()
- {
- try
- {
+ protected void initializeProcessEngine() {
+ try {
InitialContext ctx = new InitialContext();
- this.processEngine = (ProcessEngine)ctx.lookup("java:/ProcessEngine");
+ this.processEngine = (ProcessEngine) ctx.lookup("java:/ProcessEngine");
+ } catch (Exception e) {
+ // Fall back to default mechanism
+ this.processEngine = Configuration.getProcessEngine();
}
- catch (Exception e)
- {
- throw new RuntimeException("Failed to lookup process engine", e);
- }
}
- protected ServerConfig getServerConfig()
- {
- if(null==serverConfig)
- {
+ protected ServerConfig getServerConfig() {
+ if (null == serverConfig) {
serverConfig = ServerConfigFactory.getServerConfig();
}
return serverConfig;
}
- protected StringBuilder getBaseUrl()
- {
+ protected StringBuilder getBaseUrl() {
StringBuilder spec = new StringBuilder();
spec.append("http://");
spec.append(getServerConfig().getWebServiceHost());
spec.append(":").append(getServerConfig().getWebServicePort());
spec.append(WEB_CONTEXT);
- return spec;
+ return spec;
}
- protected DataHandler processTemplate(
- final String name, InputStream src,
- Map<String, Object> renderContext
- )
- {
+ protected DataHandler processTemplate(final String name, InputStream src, Map<String, Object> renderContext) {
DataHandler merged = null;
- try
- {
+ try {
freemarker.template.Configuration cfg = new freemarker.template.Configuration();
cfg.setObjectWrapper(new DefaultObjectWrapper());
cfg.setTemplateUpdateDelay(0);
@@ -104,12 +98,11 @@
Template temp = new Template(name, new InputStreamReader(src), cfg);
// dump template
- /* if(log.isDebugEnabled())
- {
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- temp.dump(new PrintWriter(bout));
- log.debug(new String(bout.toByteArray()));
- }*/
+ /*
+ * if(log.isDebugEnabled()) { ByteArrayOutputStream bout = new
+ * ByteArrayOutputStream(); temp.dump(new PrintWriter(bout));
+ * log.debug(new String(bout.toByteArray())); }
+ */
final ByteArrayOutputStream bout = new ByteArrayOutputStream();
Writer out = new OutputStreamWriter(bout);
@@ -118,34 +111,26 @@
merged = new DataHandler(
- new DataSource()
- {
+ new DataSource() {
- public InputStream getInputStream() throws IOException
- {
- return new ByteArrayInputStream(bout.toByteArray());
- }
+ public InputStream getInputStream() throws IOException {
+ return new ByteArrayInputStream(bout.toByteArray());
+ }
- public OutputStream getOutputStream() throws IOException
- {
- return bout;
- }
+ public OutputStream getOutputStream() throws IOException {
+ return bout;
+ }
- public String getContentType()
- {
- return "application/octet-stream";
- }
+ public String getContentType() {
+ return "application/octet-stream";
+ }
- public String getName()
- {
- return name + "_DataSource";
- }
- }
- );
+ public String getName() {
+ return name + "_DataSource";
+ }
+ });
- }
- catch (Exception e)
- {
+ } catch (Exception e) {
throw new RuntimeException("Failed to process task template", e);
}
Modified: jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/FormDispatcherComposite.java
===================================================================
--- jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/FormDispatcherComposite.java 2009-08-26 02:56:14 UTC (rev 5538)
+++ jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/FormDispatcherComposite.java 2009-08-26 09:11:53 UTC (rev 5539)
@@ -21,13 +21,13 @@
*/
package org.jbpm.integration.console.forms;
-import org.jboss.bpm.console.server.plugin.FormDispatcherPlugin;
-import org.jboss.bpm.console.server.plugin.FormAuthorityRef;
+import java.net.URL;
import javax.activation.DataHandler;
-import java.net.URL;
-import java.util.Map;
+import org.jboss.bpm.console.server.plugin.FormAuthorityRef;
+import org.jboss.bpm.console.server.plugin.FormDispatcherPlugin;
+
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
Modified: jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/ProcessFormDispatcher.java
===================================================================
--- jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/ProcessFormDispatcher.java 2009-08-26 02:56:14 UTC (rev 5538)
+++ jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/ProcessFormDispatcher.java 2009-08-26 09:11:53 UTC (rev 5539)
@@ -21,14 +21,6 @@
*/
package org.jbpm.integration.console.forms;
-import org.jboss.bpm.console.server.plugin.FormAuthorityRef;
-import org.jboss.bpm.console.server.plugin.FormDispatcherPlugin;
-import org.jbpm.api.ProcessDefinition;
-import org.jbpm.api.RepositoryService;
-import org.jbpm.pvm.internal.env.EnvironmentImpl;
-import org.jbpm.pvm.internal.env.EnvironmentFactory;
-
-import javax.activation.DataHandler;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
@@ -36,120 +28,90 @@
import java.util.List;
import java.util.Map;
+import javax.activation.DataHandler;
+
+import org.jboss.bpm.console.server.plugin.FormAuthorityRef;
+import org.jboss.bpm.console.server.plugin.FormDispatcherPlugin;
+import org.jbpm.api.ProcessDefinition;
+import org.jbpm.api.RepositoryService;
+
/**
* Processes form data to start processes.
*
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
-public class ProcessFormDispatcher extends AbstractFormDispatcher
- implements FormDispatcherPlugin
-{
+public class ProcessFormDispatcher extends AbstractFormDispatcher implements FormDispatcherPlugin {
- public URL getDispatchUrl(FormAuthorityRef ref)
- {
- if(!processHasForm(ref.getReferenceId()))
+ public URL getDispatchUrl(FormAuthorityRef ref) {
+ if (!processHasForm(ref.getReferenceId())) {
return null;
-
+ }
+
StringBuilder baseUrl = getBaseUrl();
baseUrl.append("/form/process/");
- baseUrl.append( ref.getReferenceId());
+ baseUrl.append(ref.getReferenceId());
baseUrl.append("/render");
- try
- {
+ try {
return new URL(baseUrl.toString());
- }
- catch (MalformedURLException e)
- {
+ } catch (MalformedURLException e) {
throw new RuntimeException("Failed to resolve task dispatch url", e);
}
}
- private boolean processHasForm(String id)
- {
- return getStartFormName(id)!=null;
+ private boolean processHasForm(String id) {
+ return getStartFormName(id) != null;
}
- private String getStartFormName(String id)
- {
- String name = null;
+ private String getStartFormName(String procDefId) {
+ RepositoryService repoService = processEngine.getRepositoryService();
+ List<String> startActivityNames = repoService.getStartActivityNames(procDefId);
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
- try
- {
- RepositoryService repoService = processEngine.getRepositoryService();
- List<String> startActivityNames = repoService.getStartActivityNames(id);
+ if (null == startActivityNames)
+ throw new RuntimeException("Unable to resolve start activity names for process: " + procDefId);
- if(null==startActivityNames) // who knows? I'd expect anything from jbpm
- throw new RuntimeException("Unable to resolve start activity names for process: "+id);
-
- String defaultActitvity = startActivityNames.get(0);
- if(startActivityNames.size()>1)
- {
- System.out.println("WARN: More then 1 start activity found. Default to " + defaultActitvity + " to resolve the form name.");
- }
-
- name = repoService.getStartFormResourceName(id, defaultActitvity);
- }
- finally{
- env.close();
- }
-
- return name;
+ String defaultActitvity = startActivityNames.get(0);
+ if (startActivityNames.size() > 1) {
+ System.out.println("WARN: More then 1 start activity found. Default to " + defaultActitvity + " to resolve the form name.");
+ }
+
+ return repoService.getStartFormResourceName(procDefId, defaultActitvity);
}
- public DataHandler provideForm(FormAuthorityRef ref)
- {
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
-
+ public DataHandler provideForm(FormAuthorityRef ref) {
DataHandler result = null;
- try
- {
+ RepositoryService repoService = processEngine.getRepositoryService();
- RepositoryService repoService = processEngine.getRepositoryService();
+ // check if a template exists
+ String startFormResourceName = getStartFormName(ref.getReferenceId());
+ if (null == startFormResourceName)
+ throw new IllegalArgumentException("Process " + ref.getReferenceId() + " doesn't provide a start form");
- // check if a template exists
- String startFormResourceName = getStartFormName(ref.getReferenceId());
- if(null==startFormResourceName)
- throw new IllegalArgumentException("Process " +ref.getReferenceId() + " doesn't provide a start form");
+ ProcessDefinition procDef = repoService.createProcessDefinitionQuery().processDefinitionId(ref.getReferenceId()).uniqueResult();
+ InputStream template = repoService.getResourceAsStream(procDef.getDeploymentId(), startFormResourceName);
- ProcessDefinition procDef =
- repoService
- .createProcessDefinitionQuery()
- .processDefinitionId(ref.getReferenceId())
- .uniqueResult();
+ // merge template with process variables
+ if (template != null) {
+ // plugin context
+ StringBuilder action = getBaseUrl();
+ action.append("/form/process/");
+ action.append(ref.getReferenceId());
+ action.append("/complete");
- InputStream template = repoService.getResourceAsStream(
- procDef.getDeploymentId(), startFormResourceName
- );
+ Map<String, Object> renderContext = new HashMap<String, Object>();
- // merge template with process variables
- if(template!=null)
- {
- // plugin context
- StringBuilder action = getBaseUrl();
- action.append("/form/process/");
- action.append( ref.getReferenceId() );
- action.append("/complete");
+ // form directive
+ FormDirective formDirective = new FormDirective();
+ formDirective.setAction(action.toString());
+ renderContext.put(FORM_DIRECTIVE_KEY, formDirective);
- Map<String, Object> renderContext = new HashMap<String,Object>();
-
- // form directive
- FormDirective formDirective = new FormDirective();
- formDirective.setAction( action.toString() );
- renderContext.put(FORM_DIRECTIVE_KEY, formDirective);
-
- // outcome directive
- renderContext.put(OUTCOME_DIRECTIVE_NAME, new OutcomeDirective());
-
- result = processTemplate(startFormResourceName, template, renderContext);
- }
-
- return result;
+ // outcome directive
+ renderContext.put(OUTCOME_DIRECTIVE_NAME, new OutcomeDirective());
+
+ result = processTemplate(startFormResourceName, template, renderContext);
}
- finally{
- env.close();
- }
+
+ return result;
}
}
Modified: jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskFormDispatcher.java
===================================================================
--- jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskFormDispatcher.java 2009-08-26 02:56:14 UTC (rev 5538)
+++ jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskFormDispatcher.java 2009-08-26 09:11:53 UTC (rev 5539)
@@ -21,150 +21,113 @@
*/
package org.jbpm.integration.console.forms;
-import org.jboss.bpm.console.server.plugin.FormAuthorityRef;
-import org.jboss.bpm.console.server.plugin.FormDispatcherPlugin;
-import org.jbpm.api.*;
-import org.jbpm.api.task.Task;
-import org.jbpm.pvm.internal.env.EnvironmentImpl;
-import org.jbpm.pvm.internal.env.EnvironmentFactory;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.Transition;
-import org.jbpm.pvm.internal.task.TaskImpl;
-
-import javax.activation.DataHandler;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
import java.util.Set;
+import javax.activation.DataHandler;
+
+import org.jboss.bpm.console.server.plugin.FormAuthorityRef;
+import org.jboss.bpm.console.server.plugin.FormDispatcherPlugin;
+import org.jbpm.api.Execution;
+import org.jbpm.api.ExecutionService;
+import org.jbpm.api.ProcessDefinition;
+import org.jbpm.api.RepositoryService;
+import org.jbpm.api.TaskService;
+import org.jbpm.api.task.Task;
+
/**
* Processes form data to complete tasks.
- *
+ *
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
-public class TaskFormDispatcher extends AbstractFormDispatcher
- implements FormDispatcherPlugin
-{
+public class TaskFormDispatcher extends AbstractFormDispatcher implements FormDispatcherPlugin {
- public TaskFormDispatcher()
- {
+ public TaskFormDispatcher() {
super();
}
- public URL getDispatchUrl(FormAuthorityRef ref)
- {
- if(!taskHasForm(ref.getReferenceId()))
+ public URL getDispatchUrl(FormAuthorityRef ref) {
+ if (!taskHasForm(ref.getReferenceId()))
return null;
StringBuilder baseUrl = getBaseUrl();
baseUrl.append("/form/task/");
- baseUrl.append( ref.getReferenceId());
+ baseUrl.append(ref.getReferenceId());
baseUrl.append("/render");
- try
- {
+ try {
return new URL(baseUrl.toString());
- }
- catch (MalformedURLException e)
- {
+ } catch (MalformedURLException e) {
throw new RuntimeException("Failed to resolve task dispatch url", e);
}
}
- private boolean taskHasForm(String id)
- {
+ private boolean taskHasForm(String id) {
boolean result = false;
-
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
- try
- {
- TaskService taskService = processEngine.getTaskService();
- Task task = taskService.getTask(id);
- result = (task.getFormResourceName()!=null);
- }
- finally
- {
- env.close();
- }
-
+ TaskService taskService = processEngine.getTaskService();
+ Task task = taskService.getTask(id);
+ result = (task.getFormResourceName() != null);
return result;
}
- public DataHandler provideForm(FormAuthorityRef ref)
- {
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
-
- try
- {
- TaskService taskService = processEngine.getTaskService();
- Task task = taskService.getTask(ref.getReferenceId());
+ public DataHandler provideForm(FormAuthorityRef ref) {
+ TaskService taskService = processEngine.getTaskService();
+ ExecutionService executionService = processEngine.getExecutionService();
+ RepositoryService repoService = processEngine.getRepositoryService();
+ Task task = taskService.getTask(ref.getReferenceId());
- // access the processdefition
- TaskImpl cast = ((TaskImpl) task);
- ExecutionImpl processInstance = cast.getProcessInstance();
- String processInstanceId = processInstance.getId();
- String processId = processInstance.getProcessDefinition().getId();
+ String executionId = task.getExecutionId();
+ Execution execution = executionService.findExecutionById(executionId);
+ String procInstId = execution.getProcessInstance().getId();
+ ProcessDefinition procDef = repoService.createProcessDefinitionQuery()
+ .processDefinitionId(execution.getProcessDefinitionId())
+ .uniqueResult();
- RepositoryService repoService = processEngine.getRepositoryService();
- ProcessDefinitionQuery query = repoService.createProcessDefinitionQuery();
- query.processDefinitionId(processId);
- ProcessDefinition procDef = query.uniqueResult();
+ // check if a template exists
+ String name = task.getFormResourceName();
+ InputStream template = repoService.getResourceAsStream(procDef.getDeploymentId(), name);
- // check if a template exists
- String name = task.getFormResourceName();
- InputStream template = repoService.getResourceAsStream(
- procDef.getDeploymentId(), name
- );
+ // merge template with process variables
+ if (template == null)
+ throw new IllegalArgumentException("Task form resource '" + name + "' doesn't exist.");
- // merge template with process variables
- if(template==null)
- throw new IllegalArgumentException("Task form resource '"+name+"' doesn't exist.");
+ Map<String, Object> processContext = new HashMap<String, Object>();
+ ExecutionService execService = processEngine.getExecutionService();
+ Set<String> varNames = execService.getVariableNames(procInstId);
- Map<String, Object> processContext = new HashMap<String, Object>(); // empty default
- ExecutionService execService = processEngine.getExecutionService();
- Set<String> varNames = execService.getVariableNames(processInstanceId);
+ if (varNames != null)
+ processContext = execService.getVariables(procInstId, varNames);
- if(varNames!=null)
- processContext = execService.getVariables(processInstanceId, varNames);
+ // plugin context
+ StringBuilder action = getBaseUrl();
+ action.append("/form/task/");
+ action.append(ref.getReferenceId());
+ action.append("/complete");
- // plugin context
- StringBuilder action = getBaseUrl();
- action.append("/form/task/");
- action.append( ref.getReferenceId() );
- action.append("/complete");
+ Map<String, Object> renderContext = new HashMap<String, Object>();
- Map<String, Object> renderContext = new HashMap<String,Object>();
+ // form directive
+ FormDirective formDirective = new FormDirective();
+ formDirective.setAction(action.toString());
+ renderContext.put(FORM_DIRECTIVE_KEY, formDirective);
- // form directive
- FormDirective formDirective = new FormDirective();
- formDirective.setAction( action.toString() );
- renderContext.put(FORM_DIRECTIVE_KEY, formDirective);
+ // outcome directive
+ OutcomeDirective outcomeDirective = new OutcomeDirective();
+ Set<String> outcomes = taskService.getOutcomes(task.getId());
+ for (String outcome : outcomes) {
+ outcomeDirective.getValues().add(outcome);
+ }
+ renderContext.put(OUTCOME_DIRECTIVE_NAME, outcomeDirective);
- // outcome directive
- // TODO: Fix when https://jira.jboss.org/jira/browse/JBPM-2220 is done
- OutcomeDirective outcomeDirective = new OutcomeDirective();
- List<Transition> transitions =
- ((ExecutionImpl) processInstance).getActivity().getOutgoingTransitions();
- for(Transition t : transitions)
- {
- String outcomeName = t.getName()!=null ? t.getName() : "to_"+t.getDestination().getName();
- outcomeDirective.getValues().add(outcomeName);
- }
- renderContext.put(OUTCOME_DIRECTIVE_NAME, outcomeDirective);
+ // process variables
+ renderContext.putAll(processContext);
- // process variables
- renderContext.putAll(processContext);
-
- DataHandler result = processTemplate(name, template, renderContext);
- return result;
- }
- finally
- {
- env.close();
- }
+ DataHandler result = processTemplate(name, template, renderContext);
+ return result;
}
}
Modified: jbpm4/trunk/modules/integration/graphView-plugin/src/main/java/org/jbpm/integration/console/graphView/GraphViewerPluginImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/graphView-plugin/src/main/java/org/jbpm/integration/console/graphView/GraphViewerPluginImpl.java 2009-08-26 02:56:14 UTC (rev 5538)
+++ jbpm4/trunk/modules/integration/graphView-plugin/src/main/java/org/jbpm/integration/console/graphView/GraphViewerPluginImpl.java 2009-08-26 09:11:53 UTC (rev 5539)
@@ -24,10 +24,11 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.util.List;
-import java.util.ArrayList;
-import java.net.URL;
import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
import javax.naming.InitialContext;
@@ -35,46 +36,47 @@
import org.jboss.bpm.console.client.model.DiagramInfo;
import org.jboss.bpm.console.client.model.DiagramNodeInfo;
import org.jboss.bpm.console.server.plugin.GraphViewerPlugin;
-import org.jbpm.api.ExecutionService;
+import org.jbpm.api.Configuration;
import org.jbpm.api.ProcessDefinition;
import org.jbpm.api.ProcessEngine;
-import org.jbpm.api.ProcessInstanceQuery;
+import org.jbpm.api.ProcessInstance;
import org.jbpm.api.RepositoryService;
import org.jbpm.api.model.ActivityCoordinates;
-import org.jbpm.pvm.internal.env.EnvironmentImpl;
-import org.jbpm.pvm.internal.env.EnvironmentFactory;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.integration.spi.mgmt.ServerConfig;
import org.jbpm.integration.spi.mgmt.ServerConfigFactory;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
-public class GraphViewerPluginImpl implements GraphViewerPlugin
-{
+public class GraphViewerPluginImpl implements GraphViewerPlugin {
protected final static String WEB_CONTEXT = "/gwt-console-server/rs";
protected ProcessEngine processEngine;
- protected ServerConfig serverConfig = null; // lazy
+ protected ServerConfig serverConfig = null; // lazy
-
- public GraphViewerPluginImpl()
- {
+ public GraphViewerPluginImpl() {
initializeProcessEngine();
}
- protected ServerConfig getServerConfig()
- {
- if(null==serverConfig)
- {
+ protected void initializeProcessEngine() {
+ try {
+ InitialContext ctx = new InitialContext();
+ this.processEngine = (ProcessEngine) ctx.lookup("java:/ProcessEngine");
+ } catch (Exception e) {
+ // Fall back to default mechanism
+ this.processEngine = Configuration.getProcessEngine();
+ }
+ }
+
+ protected ServerConfig getServerConfig() {
+ if (null == serverConfig) {
serverConfig = ServerConfigFactory.getServerConfig();
}
return serverConfig;
}
- protected StringBuilder getBaseUrl()
- {
+ protected StringBuilder getBaseUrl() {
StringBuilder spec = new StringBuilder();
spec.append("http://");
spec.append(getServerConfig().getWebServiceHost());
@@ -83,171 +85,90 @@
return spec;
}
- public byte[] getProcessImage(String processId)
- {
+ public byte[] getProcessImage(String processId) {
+ RepositoryService repositoryService = this.processEngine.getRepositoryService();
+ ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(processId).uniqueResult();
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
+ String imgRes = processDefinition.getImageResourceName();
+ InputStream in = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), imgRes);
- try
- {
- RepositoryService repositoryService = this.processEngine.getRepositoryService();
- ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
- .processDefinitionId(processId)
- .uniqueResult();
+ if (null == in)
+ throw new RuntimeException("Failed to retrieve image resource: " + imgRes);
- String imgRes = processDefinition.getImageResourceName();
- InputStream in = repositoryService.getResourceAsStream(
- processDefinition.getDeploymentId(), imgRes
- );
-
- if(null==in)
- throw new RuntimeException("Failed to retrieve image resource: " +imgRes);
-
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- final int BUF_SIZE = 1 << 8; //1KiB buffer
- byte[] buffer = new byte[BUF_SIZE];
- int bytesRead = -1;
- try
- {
- while((bytesRead = in.read(buffer)) > -1)
- {
- out.write(buffer, 0, bytesRead);
- }
- in.close();
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ final int BUF_SIZE = 1 << 8; // 1KiB buffer
+ byte[] buffer = new byte[BUF_SIZE];
+ int bytesRead = -1;
+ try {
+ while ((bytesRead = in.read(buffer)) > -1) {
+ out.write(buffer, 0, bytesRead);
}
- catch (IOException e)
- {
- throw new RuntimeException("Failed to read image resource: "+imgRes, e);
- }
+ in.close();
+ } catch (IOException e) {
+ throw new RuntimeException("Failed to read image resource: " + imgRes, e);
+ }
- byte[] imageBytes = out.toByteArray();
+ byte[] imageBytes = out.toByteArray();
- return imageBytes;
-
- }
- finally{
- env.close();
- }
+ return imageBytes;
}
- public DiagramInfo getDiagramInfo(String processId)
- {
+ public DiagramInfo getDiagramInfo(String processId) {
throw new RuntimeException("Not implemented");
}
- public List<ActiveNodeInfo> getActiveNodeInfo(String instanceId)
- {
-
+ public List<ActiveNodeInfo> getActiveNodeInfo(String processInstanceId) {
List<ActiveNodeInfo> results = new ArrayList<ActiveNodeInfo>();
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
+ ProcessInstance pi = processEngine.getExecutionService().findProcessInstanceById(processInstanceId);
+ Set<String> currentActivities = pi.findActiveActivityNames();
- try
- {
- ExecutionService execService = this.processEngine.getExecutionService();
- ProcessInstanceQuery query = execService.createProcessInstanceQuery();
- query.processInstanceId(instanceId);
- ExecutionImpl processInstance = (ExecutionImpl) query.uniqueResult();
-
- String currentActivity = processInstance.getProcessInstance().getActivityName();
-
- // get coordinates
- RepositoryService repoService = this.processEngine.getRepositoryService();
- ActivityCoordinates coords = repoService.getActivityCoordinates(
- processInstance.getProcessDefinitionId(), currentActivity
- );
-
-
- results.add(new ActiveNodeInfo(
- coords.getWidth(), coords.getHeight(),
- new DiagramNodeInfo(
- currentActivity,
- coords.getX(), coords.getY(),
- coords.getWidth(), coords.getHeight()
- )
- )
- );
-
+ RepositoryService repoService = this.processEngine.getRepositoryService();
+ for (String activityName : currentActivities) {
+ ActivityCoordinates coords = repoService.getActivityCoordinates(pi.getProcessDefinitionId(), activityName);
+ results.add(new ActiveNodeInfo(coords.getWidth(), coords.getHeight(),
+ new DiagramNodeInfo(activityName, coords.getX(),
+ coords.getY(), coords.getWidth(), coords.getHeight())));
}
- finally
- {
- env.close();
- }
return results;
}
- protected void initializeProcessEngine()
- {
- try
- {
- InitialContext ctx = new InitialContext();
- this.processEngine = (ProcessEngine)ctx.lookup("java:/ProcessEngine");
- }
- catch (Exception e)
- {
- throw new RuntimeException("Failed to lookup process engine", e);
- }
- }
-
- public URL getDiagramURL(String id)
- {
+ public URL getDiagramURL(String id) {
URL result = null;
// check resource availability
- EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
boolean hasImageResource = false;
+ RepositoryService repositoryService = this.processEngine.getRepositoryService();
+ ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(id).uniqueResult();
- try
- {
- RepositoryService repositoryService = this.processEngine.getRepositoryService();
- ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
- .processDefinitionId(id)
- .uniqueResult();
+ InputStream inputStream = null;
+ if (processDefinition != null) {
+ String imgRes = processDefinition.getImageResourceName();
+ inputStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), imgRes);
+ }
- InputStream inputStream = null;
- if(processDefinition!=null)//TODO: JBPM-2383 Suspended definitions don't show up here
- {
- String imgRes = processDefinition.getImageResourceName();
- inputStream = repositoryService.getResourceAsStream(
- processDefinition.getDeploymentId(), imgRes
- );
+ if (inputStream != null) {
+ hasImageResource = true;
+ try {
+ inputStream.close();
+ } catch (IOException e) {
+ throw new RuntimeException("Failed to close stream", e);
}
-
- if(inputStream!=null)
- {
- hasImageResource = true;
- try
- {
- inputStream.close();
- }
- catch (IOException e)
- {
- throw new RuntimeException("Failed to close stream", e);
- }
- }
-
}
- finally{
- env.close();
- }
- if(hasImageResource)
- {
+ if (hasImageResource) {
StringBuilder sb = getBaseUrl().append("/process/definition/");
sb.append(id);
sb.append("/image");
- try
- {
+ try {
result = new URL(sb.toString());
- }
- catch (MalformedURLException e)
- {
+ } catch (MalformedURLException e) {
throw new RuntimeException("Failed to create url", e);
}
}
-
+
return result;
}
}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/StartHsqldbServerTask.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/StartHsqldbServerTask.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/StartHsqldbServerTask.java 2009-08-26 09:11:53 UTC (rev 5539)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.ant;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Task;
+
+
+/**
+ * @author jbarrez
+ */
+public class StartHsqldbServerTask extends Task {
+
+ private static final String END_MESSAGE = "use [Ctrl]+[C] to abort abruptly";
+
+ String configuration = null;
+ String hsqldbServerHome = null;
+
+ public void execute() throws BuildException {
+ try {
+ // get some environment variableInstances
+ String fileSeparator = System.getProperty( "file.separator" );
+ String os = getProject().getProperty( "os.name" ).toLowerCase();
+
+ // build the command string
+ String[] command = null;
+ if ( os.indexOf( "windows" ) != -1 ) {
+ command = new String[] {getHsqldbServerHome() + fileSeparator + "start-hsqldb-server.bat"};
+ } else if ( os.indexOf( "linux" ) != -1 || os.indexOf( "mac" ) != -1) {
+ command = new String[] {getHsqldbServerHome() + fileSeparator + "start-hsqldb-server.sh"};
+ } else {
+ throw new BuildException( "os '" + os + "' not supported in the start-hsqldb-server task." );
+ }
+
+ // launch the command and wait till the END_MESSAGE appears
+ Thread launcher = new Launcher(this, command, END_MESSAGE, getHsqldbServerHome());
+ launcher.start();
+ launcher.join();
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public String getHsqldbServerHome() {
+ return hsqldbServerHome;
+ }
+
+ public void setHsqldbServerHome(String hsqldbServerHome) {
+ this.hsqldbServerHome = hsqldbServerHome;
+ }
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/StartHsqldbServerTask.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetDeploymentResourceNamesCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetDeploymentResourceNamesCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetDeploymentResourceNamesCmd.java 2009-08-26 09:11:53 UTC (rev 5539)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.cmd;
+
+import java.util.Set;
+
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
+import org.jbpm.pvm.internal.repository.DeploymentImpl;
+import org.jbpm.pvm.internal.session.RepositorySession;
+
+/**
+ * Command used to retrieve all the resource names of a deployment. The
+ * resources itself can be retrieved using other commands (eg
+ * {@link GetResourceAsStreamCmd}).
+ *
+ * @author jbarrez
+ */
+public class GetDeploymentResourceNamesCmd implements Command<Set<String>> {
+
+ private static final long serialVersionUID = 1L;
+
+ private String deploymentId;
+
+ public GetDeploymentResourceNamesCmd(String deploymentId) {
+ this.deploymentId = deploymentId;
+ }
+
+ public Set<String> execute(Environment environment) throws Exception {
+ RepositorySession repositorySession = environment.get(RepositorySession.class);
+ DeploymentImpl depImpl = repositorySession.getDeployment(deploymentId);
+ return depImpl.getResourceNames();
+ }
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetDeploymentResourceNamesCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java 2009-08-26 02:56:14 UTC (rev 5538)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositoryServiceImpl.java 2009-08-26 09:11:53 UTC (rev 5539)
@@ -24,6 +24,7 @@
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.List;
+import java.util.Set;
import org.jbpm.api.DeploymentQuery;
import org.jbpm.api.NewDeployment;
@@ -35,6 +36,7 @@
import org.jbpm.pvm.internal.cmd.CreateProcessDefinitionQueryCmd;
import org.jbpm.pvm.internal.cmd.DeleteDeploymentCmd;
import org.jbpm.pvm.internal.cmd.GetActivityCoordinatesCmd;
+import org.jbpm.pvm.internal.cmd.GetDeploymentResourceNamesCmd;
import org.jbpm.pvm.internal.cmd.GetResourceAsStreamCmd;
import org.jbpm.pvm.internal.cmd.GetStartActivityNamesCmd;
import org.jbpm.pvm.internal.cmd.GetStartFormResourceNameCmd;
@@ -69,6 +71,10 @@
public void deleteDeploymentCascade(String deploymentId) {
commandService.execute(new DeleteDeploymentCmd(deploymentId, true));
}
+
+ public Set<String> getResourceNames(String deploymentId) {
+ return commandService.execute(new GetDeploymentResourceNamesCmd(deploymentId));
+ }
public InputStream getResourceAsStream(String deploymentId, String resource) {
byte[] bytes = commandService.execute(new GetResourceAsStreamCmd(deploymentId, resource));
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java 2009-08-26 02:56:14 UTC (rev 5538)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java 2009-08-26 09:11:53 UTC (rev 5539)
@@ -152,9 +152,6 @@
} else {
validateRepositoryCache();
}
-
- // if null -> invalidate cache?
- System.out.println("---------------->" + repositoryCache.get("1", "test_process"));
return null;
}
@@ -170,9 +167,6 @@
} else {
validateRepositoryCache();
}
-
- // ? if null -> delete from cache?
- System.out.println("---------------->" + repositoryCache.get("1", "test_process"));
return null;
}
16 years, 8 months
JBoss JBPM SVN: r5538 - jbpm4/trunk.
by do-not-reply@jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-08-25 22:56:14 -0400 (Tue, 25 Aug 2009)
New Revision: 5538
Modified:
jbpm4/trunk/pom.xml
Log:
jbpm.gpd.version update to 4.1
Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml 2009-08-25 14:54:21 UTC (rev 5537)
+++ jbpm4/trunk/pom.xml 2009-08-26 02:56:14 UTC (rev 5538)
@@ -50,7 +50,7 @@
<aspectjrt.version>1.5.3</aspectjrt.version>
<freemarker.version>2.3.15</freemarker.version>
<gwt.console.version>1.1.2-SNAPSHOT</gwt.console.version>
- <jbpm.gpd.version>4.1-SNAPSHOT</jbpm.gpd.version>
+ <jbpm.gpd.version>4.1</jbpm.gpd.version>
<hibernate.version>3.3.1.GA</hibernate.version>
<slf4j.version>1.5.2</slf4j.version>
<hsqldb.version>1.8.0.7</hsqldb.version>
16 years, 8 months
JBoss JBPM SVN: r5537 - in projects/demos/richfaces-spring-jbpm4/trunk: src/main/resources/be/inze/spring/properties and 1 other directories.
by do-not-reply@jboss.org
Author: ainze
Date: 2009-08-25 10:54:21 -0400 (Tue, 25 Aug 2009)
New Revision: 5537
Added:
projects/demos/richfaces-spring-jbpm4/trunk/src/main/resources/be/inze/spring/properties/ApplicationResources.properties
projects/demos/richfaces-spring-jbpm4/trunk/src/main/resources/be/inze/spring/properties/ErrorCodes.properties
Removed:
projects/demos/richfaces-spring-jbpm4/trunk/src/main/resources/be/inze/spring/properties/ApplicationResources_en.properties
projects/demos/richfaces-spring-jbpm4/trunk/src/main/resources/be/inze/spring/properties/ErrorCodes_en.properties
projects/demos/richfaces-spring-jbpm4/trunk/src/main/webapp/WEB-INF/config/.navigation-config.xml.jsfdia
Modified:
projects/demos/richfaces-spring-jbpm4/trunk/pom.xml
Log:
changed resources to default
Modified: projects/demos/richfaces-spring-jbpm4/trunk/pom.xml
===================================================================
--- projects/demos/richfaces-spring-jbpm4/trunk/pom.xml 2009-08-25 14:53:07 UTC (rev 5536)
+++ projects/demos/richfaces-spring-jbpm4/trunk/pom.xml 2009-08-25 14:54:21 UTC (rev 5537)
@@ -68,7 +68,7 @@
<aspectjweaver.version>1.6.4</aspectjweaver.version>
<xerces.version>2.9.1</xerces.version>
<jsf.version>1.2_04-p02</jsf.version>
- <jbpm.version>4.0</jbpm.version>
+ <jbpm.version>4.1-SNAPSHOT</jbpm.version>
<commons-collections.version>3.2.1</commons-collections.version>
<log4j.version>1.2.14</log4j.version>
<el.version>1.2</el.version>
Copied: projects/demos/richfaces-spring-jbpm4/trunk/src/main/resources/be/inze/spring/properties/ApplicationResources.properties (from rev 5522, projects/demos/richfaces-spring-jbpm4/trunk/src/main/resources/be/inze/spring/properties/ApplicationResources_en.properties)
===================================================================
--- projects/demos/richfaces-spring-jbpm4/trunk/src/main/resources/be/inze/spring/properties/ApplicationResources.properties (rev 0)
+++ projects/demos/richfaces-spring-jbpm4/trunk/src/main/resources/be/inze/spring/properties/ApplicationResources.properties 2009-08-25 14:54:21 UTC (rev 5537)
@@ -0,0 +1,16 @@
+website.header=jBPM4 Spring demo
+website.title=jBPM4 Spring demo
+website.subtitle=Demo explaining the integration of Spring - jBPM4 - JSF
+website.footer=� Created by Andries Inz�
+
+website.home.paragraph1=This website is intended as demo showing the integration between Spring and jBPM4
+website.home.paragraph2=You can start by selecting an example process on the right.
+website.home.paragraph3=
+
+menu.home=Home
+
+menu.client.title=Client
+menu.client.1=Start a simple process
+
+menu.processes.title=Demo's
+menu.processes.registration=Registration Process
\ No newline at end of file
Deleted: projects/demos/richfaces-spring-jbpm4/trunk/src/main/resources/be/inze/spring/properties/ApplicationResources_en.properties
===================================================================
--- projects/demos/richfaces-spring-jbpm4/trunk/src/main/resources/be/inze/spring/properties/ApplicationResources_en.properties 2009-08-25 14:53:07 UTC (rev 5536)
+++ projects/demos/richfaces-spring-jbpm4/trunk/src/main/resources/be/inze/spring/properties/ApplicationResources_en.properties 2009-08-25 14:54:21 UTC (rev 5537)
@@ -1,16 +0,0 @@
-website.header=jBPM4 Spring demo
-website.title=jBPM4 Spring demo
-website.subtitle=Demo explaining the integration of Spring - jBPM4 - JSF
-website.footer=� Created by Andries Inz�
-
-website.home.paragraph1=This website is intended as demo showing the integration between Spring and jBPM4
-website.home.paragraph2=You can start by selecting an example process on the right.
-website.home.paragraph3=
-
-menu.home=Home
-
-menu.client.title=Client
-menu.client.1=Start a simple process
-
-menu.processes.title=Demo's
-menu.processes.registration=Registration Process
\ No newline at end of file
Copied: projects/demos/richfaces-spring-jbpm4/trunk/src/main/resources/be/inze/spring/properties/ErrorCodes.properties (from rev 5522, projects/demos/richfaces-spring-jbpm4/trunk/src/main/resources/be/inze/spring/properties/ErrorCodes_en.properties)
===================================================================
--- projects/demos/richfaces-spring-jbpm4/trunk/src/main/resources/be/inze/spring/properties/ErrorCodes.properties (rev 0)
+++ projects/demos/richfaces-spring-jbpm4/trunk/src/main/resources/be/inze/spring/properties/ErrorCodes.properties 2009-08-25 14:54:21 UTC (rev 5537)
@@ -0,0 +1,3 @@
+WSFORMATION001=(EN)De operatie is goed verwerkt
+WSFORMATION002=(EN)Er werd geen data gevonden
+WSFORMATION003=(EN)De operatie is goed verwerkt, maar niet alle data werd teruggegeven
\ No newline at end of file
Deleted: projects/demos/richfaces-spring-jbpm4/trunk/src/main/resources/be/inze/spring/properties/ErrorCodes_en.properties
===================================================================
--- projects/demos/richfaces-spring-jbpm4/trunk/src/main/resources/be/inze/spring/properties/ErrorCodes_en.properties 2009-08-25 14:53:07 UTC (rev 5536)
+++ projects/demos/richfaces-spring-jbpm4/trunk/src/main/resources/be/inze/spring/properties/ErrorCodes_en.properties 2009-08-25 14:54:21 UTC (rev 5537)
@@ -1,3 +0,0 @@
-WSFORMATION001=(EN)De operatie is goed verwerkt
-WSFORMATION002=(EN)Er werd geen data gevonden
-WSFORMATION003=(EN)De operatie is goed verwerkt, maar niet alle data werd teruggegeven
\ No newline at end of file
Deleted: projects/demos/richfaces-spring-jbpm4/trunk/src/main/webapp/WEB-INF/config/.navigation-config.xml.jsfdia
===================================================================
--- projects/demos/richfaces-spring-jbpm4/trunk/src/main/webapp/WEB-INF/config/.navigation-config.xml.jsfdia 2009-08-25 14:53:07 UTC (rev 5536)
+++ projects/demos/richfaces-spring-jbpm4/trunk/src/main/webapp/WEB-INF/config/.navigation-config.xml.jsfdia 2009-08-25 14:54:21 UTC (rev 5537)
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<PROCESS model-entity="JSFProcess">
- <PROCESS-ITEM NAME="rules:*" PATH="*" SHAPE="32,17,0,0" model-entity="JSFProcessGroup">
- <PROCESS-ITEM ID="rules:*:0" NAME="item" PATH="*" model-entity="JSFProcessItem">
- <PROCESS-ITEM-OUTPUT ID="home::#index.xhtml" NAME="output"
- PATH="/index.xhtml" TARGET="rules:#index.xhtml" TITLE="home" model-entity="JSFProcessItemOutput"/>
- <PROCESS-ITEM-OUTPUT
- ID="registrationProcess::#pages#RegistrationProcess.xhtml"
- NAME="output1" PATH="/pages/RegistrationProcess.xhtml"
- TARGET="rules:#pages#RegistrationProcess.xhtml"
- TITLE="registrationProcess" model-entity="JSFProcessItemOutput"/>
- </PROCESS-ITEM>
- </PROCESS-ITEM>
- <PROCESS-ITEM NAME="rules:#index.xhtml" PATH="/index.xhtml"
- SHAPE="288,33,0,0" model-entity="JSFProcessGroup"/>
- <PROCESS-ITEM NAME="rules:#pages#RegistrationProcess.xhtml"
- PATH="/pages/RegistrationProcess.xhtml" SHAPE="256,177,0,0" model-entity="JSFProcessGroup"/>
-</PROCESS>
16 years, 8 months
JBoss JBPM SVN: r5536 - in projects/demos/tapestry-spring-jbpm4: src and 39 other directories.
by do-not-reply@jboss.org
Author: ainze
Date: 2009-08-25 10:53:07 -0400 (Tue, 25 Aug 2009)
New Revision: 5536
Added:
projects/demos/tapestry-spring-jbpm4/pom.xml
projects/demos/tapestry-spring-jbpm4/src/
projects/demos/tapestry-spring-jbpm4/src/main/
projects/demos/tapestry-spring-jbpm4/src/main/java/
projects/demos/tapestry-spring-jbpm4/src/main/java/org/
projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/
projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/
projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/components/
projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/components/Layout.java
projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/dao/
projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/dao/UserDAO.java
projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/dao/impl/
projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/dao/impl/UserDAOImpl.java
projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/model/
projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/model/user/
projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/model/user/User.java
projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/pages/
projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/pages/About.java
projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/pages/Contact.java
projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/pages/Index.java
projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/
projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/AppModule.java
projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/JbpmService.java
projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/UserService.java
projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/impl/
projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/impl/IdentitySessionImpl.java
projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/impl/JbpmServiceImpl.java
projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/impl/UserServiceImpl.java
projects/demos/tapestry-spring-jbpm4/src/main/resources/
projects/demos/tapestry-spring-jbpm4/src/main/resources/jbpm.mail.properties
projects/demos/tapestry-spring-jbpm4/src/main/resources/log4j.properties
projects/demos/tapestry-spring-jbpm4/src/main/resources/org/
projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/
projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/
projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/applicationContext-common.xml
projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/applicationContext-dao.xml
projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/applicationContext-process.xml
projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/applicationContext-service.xml
projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/components/
projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/components/Layout.tml
projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/jbpm.cfg.xml
projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/pages/
projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/pages/Index.properties
projects/demos/tapestry-spring-jbpm4/src/main/resources/user.hbm.xml
projects/demos/tapestry-spring-jbpm4/src/main/webapp/
projects/demos/tapestry-spring-jbpm4/src/main/webapp/About.tml
projects/demos/tapestry-spring-jbpm4/src/main/webapp/Contact.tml
projects/demos/tapestry-spring-jbpm4/src/main/webapp/Index.tml
projects/demos/tapestry-spring-jbpm4/src/main/webapp/WEB-INF/
projects/demos/tapestry-spring-jbpm4/src/main/webapp/WEB-INF/app.properties
projects/demos/tapestry-spring-jbpm4/src/main/webapp/WEB-INF/config/
projects/demos/tapestry-spring-jbpm4/src/main/webapp/WEB-INF/config/applicationContext.xml
projects/demos/tapestry-spring-jbpm4/src/main/webapp/WEB-INF/web.xml
projects/demos/tapestry-spring-jbpm4/src/main/webapp/favicon.ico
projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/
projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/
projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img01.jpg
projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img02.jpg
projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img03.jpg
projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img04.jpg
projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img05.gif
projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img06.gif
projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img07.gif
projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img08.gif
projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img09.gif
projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img10.gif
projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img11.gif
projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img12.gif
projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img13.gif
projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img14.gif
projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img15.gif
projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img16.gif
projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img17.gif
projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img18.gif
projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img19.gif
projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img20.gif
projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/spacer.gif
projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/layout.css
projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/license.txt
projects/demos/tapestry-spring-jbpm4/src/site/
projects/demos/tapestry-spring-jbpm4/src/site/apt/
projects/demos/tapestry-spring-jbpm4/src/site/apt/index.apt
projects/demos/tapestry-spring-jbpm4/src/site/site.xml
projects/demos/tapestry-spring-jbpm4/src/test/
projects/demos/tapestry-spring-jbpm4/src/test/conf/
projects/demos/tapestry-spring-jbpm4/src/test/conf/testng.xml
projects/demos/tapestry-spring-jbpm4/src/test/conf/webdefault.xml
projects/demos/tapestry-spring-jbpm4/src/test/java/
projects/demos/tapestry-spring-jbpm4/src/test/java/org/
projects/demos/tapestry-spring-jbpm4/src/test/java/org/example/
projects/demos/tapestry-spring-jbpm4/src/test/java/org/example/jbpmdemo/
projects/demos/tapestry-spring-jbpm4/src/test/java/org/example/jbpmdemo/service/
projects/demos/tapestry-spring-jbpm4/src/test/java/org/example/jbpmdemo/service/JbpmServiceTest.java
projects/demos/tapestry-spring-jbpm4/src/test/java/org/jbpm/
projects/demos/tapestry-spring-jbpm4/src/test/java/org/jbpm/spring/
projects/demos/tapestry-spring-jbpm4/src/test/java/org/jbpm/spring/test/
projects/demos/tapestry-spring-jbpm4/src/test/java/org/jbpm/spring/test/AbstractTransactionalSpringJbpmTestCase.java
projects/demos/tapestry-spring-jbpm4/src/test/resources/
projects/demos/tapestry-spring-jbpm4/src/test/resources/jbpm/
projects/demos/tapestry-spring-jbpm4/src/test/resources/jbpm/process/
projects/demos/tapestry-spring-jbpm4/src/test/resources/jbpm/process/Review.jpdl.xml
projects/demos/tapestry-spring-jbpm4/src/test/resources/jbpm/process/Review.png
Modified:
projects/demos/tapestry-spring-jbpm4/
Log:
initial import
Property changes on: projects/demos/tapestry-spring-jbpm4
___________________________________________________________________
Name: svn:ignore
+ .settings
target
.classpath
.project
jbpm4.properties
jbpm4.script
Added: projects/demos/tapestry-spring-jbpm4/pom.xml
===================================================================
--- projects/demos/tapestry-spring-jbpm4/pom.xml (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/pom.xml 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,291 @@
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.example</groupId>
+ <artifactId>jbpmdemo</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>war</packaging>
+ <name>jbpmdemo Tapestry 5 Application</name>
+
+ <properties>
+ <tapestry.version>5.1.0.5</tapestry.version>
+ <tapestry-spring.version>5.1.0.5</tapestry-spring.version>
+ <spring.version>2.0.8</spring.version>
+ <hibernate.version>3.3.1.GA</hibernate.version>
+ <acegi-security.version>1.0.3</acegi-security.version>
+ <aspectjweaver.version>1.6.4</aspectjweaver.version>
+ <aspectjtools.version>1.5.4</aspectjtools.version>
+ <xerces.version>2.9.1</xerces.version>
+ <jbpm.version>4.0</jbpm.version>
+ <commons-collections.version>3.2.1</commons-collections.version>
+ </properties>
+
+ <dependencies>
+ <!-- dependencies from tapestry -->
+
+ <dependency>
+ <groupId>org.apache.tapestry</groupId>
+ <artifactId>tapestry-core</artifactId>
+ <version>${tapestry.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tapestry</groupId>
+ <artifactId>tapestry-spring</artifactId>
+ <version>${tapestry-spring.version}</version>
+ </dependency>
+
+ <!--
+ A dependency on either JUnit or TestNG is required, or the surefire
+ plugin (which runs the tests) will fail, preventing Maven from
+ packaging the WAR. Tapestry includes a large number of testing
+ facilities designed for use with TestNG (http://testng.org/), so it's
+ recommended. <dependency> <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId> <version>5.8</version>
+ <classifier>jdk15</classifier> <scope>test</scope> </dependency>
+ -->
+
+ <!--
+ TODO: see if we can reduce this to either easymock or spring-mock
+ -->
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymock</artifactId>
+ <version>2.4</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!--
+ tapestry-test will conflict with RunJettyRun inside Eclipse.
+ tapestry-test brings in Selenium, which is based on Jetty 5.1;
+ RunJettyRun uses Jetty 6. <dependency>
+ <groupId>org.apache.tapestry</groupId>
+ <artifactId>tapestry-test</artifactId>
+ <version>${tapestry.version}</version> <scope>test</scope>
+ </dependency>
+ -->
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- jBPM4 specific dependencies -->
+
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-jpdl</artifactId>
+ <version>${jbpm.version}</version>
+ </dependency>
+
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-mock</artifactId>
+ <version>${spring.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.acegisecurity</groupId>
+ <artifactId>acegi-security</artifactId>
+ <version>${acegi-security.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-remoting</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jdbc</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-support</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <version>${hibernate.version}</version>
+ </dependency>
+
+ <!-- 1.2.14 is minimum (jbpm is tracing) -->
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-dbcp</groupId>
+ <artifactId>commons-dbcp</artifactId>
+ <version>1.2.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>${xerces.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjweaver</artifactId>
+ <version>${aspectjweaver.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjtools</artifactId>
+ <version>${aspectjtools.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>1.8.0.7</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>${commons-collections.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.subethamail</groupId>
+ <artifactId>subethasmtp-wiser</artifactId>
+ <version>1.2</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>jbpmdemo</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <optimize>true</optimize>
+ </configuration>
+ </plugin>
+
+ <!-- Run the application using "mvn jetty:run" -->
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.9</version>
+ <configuration>
+ <!-- Log to the console. -->
+ <requestLog implementation="org.mortbay.jetty.NCSARequestLog">
+ <!--
+ This doesn't do anything for Jetty, but is a workaround for a
+ Maven bug that prevents the requestLog from being set.
+ -->
+ <append>true</append>
+ </requestLog>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <reporting>
+
+ <!--
+ Adds a report detailing the components, mixins and base classes
+ defined by this module.
+ -->
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tapestry</groupId>
+ <artifactId>tapestry-component-report</artifactId>
+ <version>${tapestry.version}</version>
+ <configuration>
+ <rootPackage>org.example.jbpmdemo</rootPackage>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+
+ <repositories>
+
+ <repository>
+ <id>jboss</id>
+ <url>http://repository.jboss.com/maven2</url>
+ </repository>
+
+ <!--
+ This repository is only needed if the Tapestry released artifacts
+ haven't made it to the central Maven repository yet.
+ -->
+ <repository>
+ <id>tapestry</id>
+ <url>http://tapestry.formos.com/maven-repository/</url>
+ </repository>
+
+ <!--
+ This repository is only needed when the tapestry.version is a
+ snapshot release.
+ -->
+ <repository>
+ <id>tapestry-snapshots</id>
+ <url>http://tapestry.formos.com/maven-snapshot-repository/</url>
+ </repository>
+
+ <repository>
+ <id>codehaus.snapshots</id>
+ <url>http://snapshots.repository.codehaus.org</url>
+ </repository>
+
+ <repository>
+ <id>OpenQA_Release</id>
+ <name>OpenQA Release Repository</name>
+ <url>http://archiva.openqa.org/repository/releases/</url>
+ </repository>
+
+ </repositories>
+
+ <pluginRepositories>
+
+ <!--
+ As above, this can be commented out when access to the snapshot
+ version of a Tapestry Maven plugin is not required.
+ -->
+ <pluginRepository>
+ <id>tapestry-snapshots</id>
+ <url>http://tapestry.formos.com/maven-snapshot-repository/</url>
+ </pluginRepository>
+
+
+ </pluginRepositories>
+
+</project>
Added: projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/components/Layout.java
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/components/Layout.java (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/components/Layout.java 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,40 @@
+package org.example.jbpmdemo.components;
+
+import org.apache.tapestry5.*;
+import org.apache.tapestry5.annotations.*;
+import org.apache.tapestry5.ioc.annotations.*;
+import org.apache.tapestry5.BindingConstants;
+
+/**
+ * Layout component for pages of application jbpmdemo.
+ */
+@IncludeStylesheet("context:layout/layout.css")
+public class Layout {
+ /** The page title, for the <title> element and the <h1>element. */
+ @Property
+ @Parameter(required = true, defaultPrefix = BindingConstants.LITERAL)
+ private String title;
+
+ @Property
+ private String pageName;
+
+ @Property
+ @Parameter(defaultPrefix = BindingConstants.LITERAL)
+ private String sidebarTitle;
+
+ @Property
+ @Parameter(defaultPrefix = BindingConstants.LITERAL)
+ private Block sidebar;
+
+ @Inject
+ private ComponentResources resources;
+
+ public String getClassForPageName() {
+ return resources.getPageName().equalsIgnoreCase(pageName) ? "current_page_item"
+ : null;
+ }
+
+ public String[] getPageNames() {
+ return new String[] { "Index", "About", "Contact" };
+ }
+}
Added: projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/dao/UserDAO.java
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/dao/UserDAO.java (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/dao/UserDAO.java 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,19 @@
+package org.example.jbpmdemo.dao;
+
+import java.util.List;
+
+import org.example.jbpmdemo.model.user.User;
+
+public interface UserDAO {
+
+ public String createUser(String userId, String givenName,
+ String familyName, String businessEmail);
+
+ public User findUserById(String userId);
+
+ public List<User> findUsersById(String... userIds);
+
+ public List<User> findUsers();
+
+ public void deleteUser(String userId);
+}
Added: projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/dao/impl/UserDAOImpl.java
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/dao/impl/UserDAOImpl.java (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/dao/impl/UserDAOImpl.java 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,44 @@
+package org.example.jbpmdemo.dao.impl;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.example.jbpmdemo.dao.UserDAO;
+import org.example.jbpmdemo.model.user.User;
+import org.hibernate.criterion.Restrictions;
+import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
+
+public class UserDAOImpl extends HibernateDaoSupport implements UserDAO {
+
+ public String createUser(String userId, String givenName,
+ String familyName, String businessEmail) {
+ User user = new User(userId, givenName, familyName, businessEmail);
+ getSession().save(user);
+ return user.getUserName();
+ }
+
+ public void deleteUser(String userId) {
+ User user = findUserById(userId);
+ getSession().delete(user);
+ }
+
+ public User findUserById(String userId) {
+ return (User) getSession().createCriteria(User.class).add(
+ Restrictions.eq("userName", userId)).uniqueResult();
+ }
+
+ public List<User> findUsers() {
+ return getSession().createCriteria(User.class).list();
+ }
+
+ public List<User> findUsersById(String... userIds) {
+ List<User> users = getSession().createCriteria(User.class).add(
+ Restrictions.in("userName", userIds)).list();
+ if (userIds.length != users.size()) {
+ throw new RuntimeException("not all users were found: "
+ + Arrays.toString(userIds));
+ }
+ return users;
+ }
+
+}
Added: projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/model/user/User.java
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/model/user/User.java (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/model/user/User.java 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,55 @@
+package org.example.jbpmdemo.model.user;
+
+import java.io.Serializable;
+
+public class User implements Serializable {
+
+ private static final long serialVersionUID = -2218132567155784836L;
+
+ private Long dbid;
+
+ private String userName;
+ private String firstName;
+ private String lastName;
+ private String email;
+
+ public User(String userName, String firstName, String lastName, String email) {
+ super();
+ this.userName = userName;
+ this.firstName = firstName;
+ this.lastName = lastName;
+ this.email = email;
+ }
+
+ public void setUserName(String username) {
+ this.userName = username;
+ }
+
+ public String getUserName() {
+ return userName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+}
Added: projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/pages/About.java
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/pages/About.java (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/pages/About.java 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,6 @@
+package org.example.jbpmdemo.pages;
+
+public class About
+{
+
+}
Added: projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/pages/Contact.java
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/pages/Contact.java (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/pages/Contact.java 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,6 @@
+package org.example.jbpmdemo.pages;
+
+public class Contact
+{
+
+}
Added: projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/pages/Index.java
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/pages/Index.java (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/pages/Index.java 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,72 @@
+package org.example.jbpmdemo.pages;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.apache.tapestry5.annotations.OnEvent;
+import org.apache.tapestry5.annotations.Persist;
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.ioc.annotations.Inject;
+import org.example.jbpmdemo.model.user.User;
+import org.example.jbpmdemo.service.JbpmService;
+import org.jbpm.api.ProcessDefinition;
+import org.jbpm.api.task.Task;
+
+/**
+ * Start page of application jbpmdemo.
+ */
+public class Index {
+
+ private static final Logger logger = Logger.getLogger(Index.class);
+
+ @Inject
+ private JbpmService jbpmService;
+
+ @Persist
+ @Property
+ private User user;
+
+ void beginRender() {
+ if(user == null)
+ user = new User("john.doe", "John", "Doe", "john.doe(a)example.org");
+ }
+
+ public Date getCurrentTime() {
+ return new Date();
+ }
+
+ public List<Task> getTasks() {
+ return jbpmService.getAllTasks();
+ }
+
+ public List<ProcessDefinition> getAllDeployedProcesses() {
+ return jbpmService.getAllDeployedProcesses();
+ }
+
+ @OnEvent(component = "deployProcess")
+ public void doDeployProcess() {
+ jbpmService
+ .deployProcessFromString("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ + "<process name=\"Demo Process\" key=\"DP\" xmlns=\"http://jbpm.org/4.0/jpdl\">"
+ + "<start>"
+ + " <transition to=\"Test\"/>"
+ + "</start>"
+ + "<state name=\"running\"/>"
+ + "<task name=\"Test\" assignee=\"#{user.userName}\">"
+ + "<timer duedate=\"10 minutes\"/> "
+ + "<description>This is just a demo task.</description>"
+ + "<transition to=\"end\" />"
+ + "</task>"
+ + "<state name=\"end\"/>" + "</process>");
+ }
+
+ @OnEvent(component = "startProcessInstance")
+ public void doStartProcessInstance() {
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("user", user);
+ jbpmService.startProcessInstanceByKey("DP", variables);
+ }
+}
Added: projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/AppModule.java
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/AppModule.java (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/AppModule.java 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,119 @@
+package org.example.jbpmdemo.service;
+
+import java.io.IOException;
+
+import org.apache.tapestry5.*;
+import org.apache.tapestry5.ioc.MappedConfiguration;
+import org.apache.tapestry5.ioc.OrderedConfiguration;
+import org.apache.tapestry5.ioc.ServiceBinder;
+import org.apache.tapestry5.ioc.annotations.Local;
+import org.apache.tapestry5.services.Request;
+import org.apache.tapestry5.services.RequestFilter;
+import org.apache.tapestry5.services.RequestHandler;
+import org.apache.tapestry5.services.Response;
+import org.slf4j.Logger;
+
+/**
+ * This module is automatically included as part of the Tapestry IoC Registry, it's a good place to
+ * configure and extend Tapestry, or to place your own service definitions.
+ */
+public class AppModule
+{
+ public static void bind(ServiceBinder binder)
+ {
+ // binder.bind(MyServiceInterface.class, MyServiceImpl.class);
+
+ // Make bind() calls on the binder object to define most IoC services.
+ // Use service builder methods (example below) when the implementation
+ // is provided inline, or requires more initialization than simply
+ // invoking the constructor.
+ }
+
+
+ public static void contributeApplicationDefaults(
+ MappedConfiguration<String, String> configuration)
+ {
+ // Contributions to ApplicationDefaults will override any contributions to
+ // FactoryDefaults (with the same key). Here we're restricting the supported
+ // locales to just "en" (English). As you add localised message catalogs and other assets,
+ // you can extend this list of locales (it's a comma separated series of locale names;
+ // the first locale name is the default when there's no reasonable match).
+
+ configuration.add(SymbolConstants.SUPPORTED_LOCALES, "en");
+
+ // The factory default is true but during the early stages of an application
+ // overriding to false is a good idea. In addition, this is often overridden
+ // on the command line as -Dtapestry.production-mode=false
+ configuration.add(SymbolConstants.PRODUCTION_MODE, "false");
+
+ // The application version number is incorprated into URLs for some
+ // assets. Web browsers will cache assets because of the far future expires
+ // header. If existing assets are changed, the version number should also
+ // change, to force the browser to download new versions.
+ configuration.add(SymbolConstants.APPLICATION_VERSION, "1.0-SNAPSHOT");
+ }
+
+
+ /**
+ * This is a service definition, the service will be named "TimingFilter". The interface,
+ * RequestFilter, is used within the RequestHandler service pipeline, which is built from the
+ * RequestHandler service configuration. Tapestry IoC is responsible for passing in an
+ * appropriate Logger instance. Requests for static resources are handled at a higher level, so
+ * this filter will only be invoked for Tapestry related requests.
+ *
+ * <p>
+ * Service builder methods are useful when the implementation is inline as an inner class
+ * (as here) or require some other kind of special initialization. In most cases,
+ * use the static bind() method instead.
+ *
+ * <p>
+ * If this method was named "build", then the service id would be taken from the
+ * service interface and would be "RequestFilter". Since Tapestry already defines
+ * a service named "RequestFilter" we use an explicit service id that we can reference
+ * inside the contribution method.
+ */
+ public RequestFilter buildTimingFilter(final Logger log)
+ {
+ return new RequestFilter()
+ {
+ public boolean service(Request request, Response response, RequestHandler handler)
+ throws IOException
+ {
+ long startTime = System.currentTimeMillis();
+
+ try
+ {
+ // The responsibility of a filter is to invoke the corresponding method
+ // in the handler. When you chain multiple filters together, each filter
+ // received a handler that is a bridge to the next filter.
+
+ return handler.service(request, response);
+ }
+ finally
+ {
+ long elapsed = System.currentTimeMillis() - startTime;
+
+ log.info(String.format("Request time: %d ms", elapsed));
+ }
+ }
+ };
+ }
+
+ /**
+ * This is a contribution to the RequestHandler service configuration. This is how we extend
+ * Tapestry using the timing filter. A common use for this kind of filter is transaction
+ * management or security. The @Local annotation selects the desired service by type, but only
+ * from the same module. Without @Local, there would be an error due to the other service(s)
+ * that implement RequestFilter (defined in other modules).
+ */
+ public void contributeRequestHandler(OrderedConfiguration<RequestFilter> configuration,
+ @Local
+ RequestFilter filter)
+ {
+ // Each contribution to an ordered configuration has a name, When necessary, you may
+ // set constraints to precisely control the invocation order of the contributed filter
+ // within the pipeline.
+
+ configuration.add("Timing", filter);
+ }
+}
Added: projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/JbpmService.java
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/JbpmService.java (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/JbpmService.java 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,19 @@
+package org.example.jbpmdemo.service;
+
+import java.util.List;
+import java.util.Map;
+
+import org.jbpm.api.ProcessDefinition;
+import org.jbpm.api.task.Task;
+
+public interface JbpmService {
+
+ public void deployProcessFromString(String processDefinition);
+
+ public List<Task> getAllTasks();
+
+ public void startProcessInstanceByKey(String key,
+ Map<String, Object> variables);
+
+ public List<ProcessDefinition> getAllDeployedProcesses();
+}
Added: projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/UserService.java
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/UserService.java (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/UserService.java 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,40 @@
+package org.example.jbpmdemo.service;
+
+import java.util.List;
+
+import org.example.jbpmdemo.model.user.User;
+
+public interface UserService {
+
+ /** create a new user */
+ String createUser(String userId, String givenName, String familyName,
+ String businessEmail);
+
+ /**
+ * lookup a user.
+ *
+ * @return the user or null if no such user exists
+ */
+ User findUserById(String userId);
+
+ /**
+ * lookup users with the given identifiers.
+ *
+ * @return an empty list if no such users exist
+ */
+ List<User> findUsersById(String... userIds);
+
+ /**
+ * get all the users in the system.
+ *
+ * @return an empty list if no users exist.
+ */
+ List<User> findUsers();
+
+ /**
+ * delete the given user. No effect (no exception) if the user does not
+ * exist.
+ */
+ void deleteUser(String userId);
+
+}
Added: projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/impl/IdentitySessionImpl.java
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/impl/IdentitySessionImpl.java (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/impl/IdentitySessionImpl.java 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,92 @@
+package org.example.jbpmdemo.service.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.example.jbpmdemo.service.UserService;
+import org.jbpm.api.identity.Group;
+import org.jbpm.api.identity.User;
+import org.jbpm.pvm.internal.identity.impl.UserImpl;
+import org.jbpm.pvm.internal.identity.spi.IdentitySession;
+
+public class IdentitySessionImpl implements IdentitySession {
+
+ private UserService userService;
+
+ public void setUserService(UserService userService) {
+ this.userService = userService;
+ }
+
+ public String createGroup(String groupName, String groupType,
+ String parentGroupId) {
+ throw new RuntimeException("Not implemented");
+ }
+
+ public void createMembership(String userId, String groupId, String role) {
+ throw new RuntimeException("Not implemented");
+ }
+
+ public void deleteGroup(String groupId) {
+ throw new RuntimeException("Not implemented");
+ }
+
+ public void deleteMembership(String userId, String groupId, String role) {
+ throw new RuntimeException("Not implemented");
+ }
+
+ public Group findGroupById(String groupId) {
+ throw new RuntimeException("Not implemented");
+ }
+
+ public List<Group> findGroupsByUser(String userId) {
+ throw new RuntimeException("Not implemented");
+ }
+
+ public List<Group> findGroupsByUserAndGroupType(String userId,
+ String groupType) {
+ throw new RuntimeException("Not implemented");
+ }
+
+ public List<User> findUsersByGroup(String groupId) {
+ throw new RuntimeException("Not implemented");
+ }
+
+ public String createUser(String userId, String givenName,
+ String familyName, String businessEmail) {
+ return userService.createUser(userId, givenName, familyName,
+ businessEmail);
+ }
+
+ public void deleteUser(String userId) {
+ userService.deleteUser(userId);
+ }
+
+ public User findUserById(String userId) {
+ org.example.jbpmdemo.model.user.User user = userService.findUserById(userId);
+ return new UserImpl(user.getUserName(), user.getFirstName(), user
+ .getLastName());
+ }
+
+ public List<User> findUsers() {
+ List<org.example.jbpmdemo.model.user.User> users = userService.findUsers();
+ List<User> jbpmUsers = new ArrayList<User>();
+ for (org.example.jbpmdemo.model.user.User user : users) {
+ jbpmUsers.add(new UserImpl(user.getUserName(), user.getFirstName(),
+ user.getLastName()));
+ }
+ return jbpmUsers;
+ }
+
+ public List<User> findUsersById(String... userIds) {
+ List<org.example.jbpmdemo.model.user.User> users = userService
+ .findUsersById(userIds);
+ List<User> jbpmUsers = new ArrayList<User>();
+ for (org.example.jbpmdemo.model.user.User user : users) {
+ UserImpl jbpmUser = new UserImpl(user.getUserName(), user.getFirstName(),
+ user.getLastName());
+ jbpmUser.setBusinessEmail(user.getEmail());
+ jbpmUsers.add(jbpmUser);
+ }
+ return jbpmUsers;
+ }
+}
Added: projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/impl/JbpmServiceImpl.java
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/impl/JbpmServiceImpl.java (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/impl/JbpmServiceImpl.java 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,56 @@
+package org.example.jbpmdemo.service.impl;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.example.jbpmdemo.service.JbpmService;
+import org.jbpm.api.ExecutionService;
+import org.jbpm.api.ProcessDefinition;
+import org.jbpm.api.RepositoryService;
+import org.jbpm.api.TaskService;
+import org.jbpm.api.task.Task;
+
+public class JbpmServiceImpl implements JbpmService {
+
+ private static final Logger logger = Logger.getLogger(JbpmService.class);
+
+ private RepositoryService repositoryService;
+ private ExecutionService executionService;
+ private TaskService taskService;
+
+ private String deploymentDbid;
+
+ public void setRepositoryService(RepositoryService repositoryService) {
+ this.repositoryService = repositoryService;
+ }
+
+ public void setExecutionService(ExecutionService executionService) {
+ this.executionService = executionService;
+ }
+
+ public void setTaskService(TaskService taskService) {
+ this.taskService = taskService;
+ }
+
+ public List<Task> getAllTasks() {
+ return taskService.createTaskQuery().list();
+ }
+
+ public void startProcessInstanceByKey(String key,
+ Map<String, Object> variables) {
+ executionService.startProcessInstanceByKey(key, variables);
+ }
+
+ public void deployProcessFromString(String processDefinition) {
+ deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromString("xmlstring.jpdl.xml", processDefinition)
+ .deploy();
+ logger.info("Process deployed with deplymentDbid: " + deploymentDbid);
+ }
+
+ public List<ProcessDefinition> getAllDeployedProcesses() {
+ return repositoryService.createProcessDefinitionQuery().list();
+ }
+
+}
Added: projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/impl/UserServiceImpl.java
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/impl/UserServiceImpl.java (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/java/org/example/jbpmdemo/service/impl/UserServiceImpl.java 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,38 @@
+package org.example.jbpmdemo.service.impl;
+
+import java.util.List;
+
+import org.example.jbpmdemo.dao.UserDAO;
+import org.example.jbpmdemo.model.user.User;
+import org.example.jbpmdemo.service.UserService;
+
+public class UserServiceImpl implements UserService {
+
+ private UserDAO userDAO;
+
+ public void setUserDAO(UserDAO userDAO) {
+ this.userDAO = userDAO;
+ }
+
+ public String createUser(String userId, String givenName,
+ String familyName, String businessEmail) {
+ return userDAO.createUser(userId, givenName, familyName, businessEmail);
+ }
+
+ public void deleteUser(String userId) {
+ userDAO.deleteUser(userId);
+ }
+
+ public User findUserById(String userId) {
+ return userDAO.findUserById(userId);
+ }
+
+ public List<User> findUsers() {
+ return userDAO.findUsers();
+ }
+
+ public List<User> findUsersById(String... userIds) {
+ return userDAO.findUsersById(userIds);
+ }
+
+}
Added: projects/demos/tapestry-spring-jbpm4/src/main/resources/jbpm.mail.properties
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/resources/jbpm.mail.properties (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/resources/jbpm.mail.properties 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,3 @@
+mail.smtp.host localhost
+mail.smtp.port 2525
+mail.from noreply(a)test.com
\ No newline at end of file
Added: projects/demos/tapestry-spring-jbpm4/src/main/resources/log4j.properties
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/resources/log4j.properties (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/resources/log4j.properties 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,44 @@
+# Default to info level output; this is very handy if you eventually use Hibernate as well.
+log4j.rootCategory=info, A1
+
+# A1 is set to be a ConsoleAppender.
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+
+# A1 uses PatternLayout.
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=[%p] %c{2} %m%n
+
+# Service category names are the name of the defining module class
+# and then the service id.
+log4j.category.org.example.jbpmdemo.services.AppModule.TimingFilter=info
+
+# Outputs a list of pages, components and mixins at startup.
+log4j.category.org.apache.tapestry5.services.TapestryModule.ComponentClassResolver=info
+
+# Outputs startup statistics; elapsed time to setup and initialize the registry, and a list of
+# available services.
+log4j.category.org.apache.tapestry5.TapestryFilter=info
+
+
+# Turning on debug mode for a page's or component's transformer logger
+# will show all of the code changes that occur when the
+# class is loaded.
+
+# log4j.category.tapestry.transformer.org.example.jbpmdemo.pages.Index=debug
+
+# Turning on debug mode for a component's events logger will show all the events triggered on the
+# component, and which component methods are invoked as a result.
+
+# log4j.category.tapestry.events.org.example.jbpmdemo.pages.Index=debug
+
+# Turning on trace mode for a page's render logger provides extended information about every step
+# in rendering (this is not generally helpful). Turning on debug mode will add a one-line
+# summary that includes the elapsed render time, which can be useful in tracking down
+# performance issues.
+
+# log4j.category.tapestry.render.org.example.jbpmdemo.pages.Index=debug
+
+# Turn on some verbose debugging about everything in the application. This is nice initially,
+# while getting everything set up. You'll probably want to remove this once you are
+# up and running, replacing it with more selective debugging output.
+log4j.category.org.example.jbpmdemo=debug
\ No newline at end of file
Added: projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/applicationContext-common.xml
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/applicationContext-common.xml (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/applicationContext-common.xml 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
+ xmlns:tx="http://www.springframework.org/schema/tx"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+ http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
+
+
+ <bean
+ class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+ <property name="locations">
+ <list>
+ <value>classpath:/log4j.properties
+ </value>
+ </list>
+ </property>
+ </bean>
+
+ <aop:aspectj-autoproxy />
+
+ <tx:advice id="txAdvice" transaction-manager="transactionManager">
+ <tx:attributes>
+ <tx:method name="*" propagation="REQUIRED" />
+ </tx:attributes>
+ </tx:advice>
+
+ <aop:config>
+ <aop:pointcut id="serviceOperation"
+ expression="execution(* org.example.jbpmdemo.service.**.*(..))" type="regex" />
+ <aop:advisor advice-ref="txAdvice" pointcut-ref="serviceOperation" />
+ </aop:config>
+
+ <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
+ destroy-method="close">
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver" />
+ <property name="url" value="jdbc:hsqldb:jbpm4;shutdown=true" />
+ <property name="username" value="sa" />
+ <property name="password" value="" />
+ </bean>
+
+ <bean id="sessionFactory"
+ class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
+ <property name="dataSource" ref="dataSource" />
+ <property name="hibernateProperties">
+ <props>
+ <prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect
+ </prop>
+ <prop key="hibernate.show_sql">true</prop>
+ <prop key="hibernate.hbm2ddl.auto">create-drop</prop>
+ </props>
+ </property>
+ <property name="mappingLocations">
+ <list>
+ <!-- jBPM Mappings -->
+ <value>classpath:jbpm.execution.hbm.xml
+ </value>
+ <value>classpath:jbpm.repository.hbm.xml
+ </value>
+ <value>classpath:jbpm.task.hbm.xml
+ </value>
+ <value>classpath:jbpm.history.hbm.xml
+ </value>
+ <!-- jBPM Demo Model Mappings -->
+ <value>classpath:user.hbm.xml
+ </value>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="transactionManager"
+ class="org.springframework.orm.hibernate3.HibernateTransactionManager">
+ <property name="sessionFactory" ref="sessionFactory" />
+ </bean>
+
+</beans>
\ No newline at end of file
Added: projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/applicationContext-dao.xml
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/applicationContext-dao.xml (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/applicationContext-dao.xml 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+ <bean id="userDAO" class="org.example.jbpmdemo.dao.impl.UserDAOImpl">
+ <property name="sessionFactory" ref="sessionFactory" />
+ </bean>
+
+</beans>
\ No newline at end of file
Added: projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/applicationContext-process.xml
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/applicationContext-process.xml (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/applicationContext-process.xml 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+
+ <bean id="jbpmConfiguration" class="org.jbpm.pvm.internal.cfg.SpringConfiguration">
+ <constructor-arg value="org/example/jbpmdemo/jbpm.cfg.xml" />
+ </bean>
+
+ <bean id="processEngine" factory-bean="jbpmConfiguration" factory-method="buildProcessEngine" />
+ <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
+ <bean id="executionService" factory-bean="processEngine" factory-method="getExecutionService" />
+ <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
+
+</beans>
\ No newline at end of file
Added: projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/applicationContext-service.xml
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/applicationContext-service.xml (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/applicationContext-service.xml 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+ <bean id="jbpmService" class="org.example.jbpmdemo.service.impl.JbpmServiceImpl">
+ <property name="repositoryService" ref="repositoryService" />
+ <property name="executionService" ref="executionService" />
+ <property name="taskService" ref="taskService" />
+ </bean>
+
+ <bean id="userService" class="org.example.jbpmdemo.service.impl.UserServiceImpl">
+ <property name="userDAO" ref="userDAO" />
+ </bean>
+
+ <bean id="identitySession" class="org.example.jbpmdemo.service.impl.IdentitySessionImpl">
+ <property name="userService" ref="userService" />
+ </bean>
+
+</beans>
\ No newline at end of file
Added: projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/components/Layout.tml
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/components/Layout.tml (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/components/Layout.tml 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,82 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<!--
+
+Design by Free CSS Templates
+http://www.freecsstemplates.org
+Released for free under a Creative Commons Attribution 2.5 License
+
+Title : Concrete
+Version : 1.0
+Released : 20080825
+Description: A Web 2.0 design with fluid width suitable for blogs and small websites.
+-->
+ <html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
+ xmlns:p="tapestry:parameter">
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+ <title>${title}</title>
+ </head>
+ <body>
+ <!-- start header -->
+ <div id="header">
+ <div id="logo">
+ <h1>
+ <t:pagelink page="index">org.example:jbpmdemo</t:pagelink>
+ </h1>
+ </div>
+ <div id="menu">
+ <ul>
+ <li t:type="loop" source="pageNames" value="pageName" class="prop:classForPageName">
+ <t:pagelink page="prop:pageName">${pageName}</t:pagelink>
+ </li>
+ </ul>
+ </div>
+ </div>
+ <!-- end header -->
+ <!-- start page -->
+ <div id="page">
+ <!-- start sidebar -->
+ <div id="sidebar">
+ <ul>
+ <li id="search" style="background: none;">
+ </li>
+ <li t:type="if" test="sidebar">
+ <h2>${sidebarTitle}</h2>
+ <div class="sidebar-content">
+ <t:delegate to="sidebar"/>
+ </div>
+ </li>
+ </ul>
+ </div>
+ <!-- end sidebar -->
+ <!-- start content -->
+ <div id="content">
+ <div class="post">
+ <div class="title">
+ <h2>${title}</h2>
+ </div>
+ <div class="entry">
+ <t:body/>
+ </div>
+ </div>
+ </div>
+ <!-- end content -->
+ <br style="clear: both;"/>
+ </div>
+ <!-- end page -->
+ <!-- start footer -->
+ <div id="footer">
+ <p class="legal">
+ ©2009 org.example. All Rights Reserved.
+ •
+ Design by
+ <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>
+ •
+ Icons by
+ <a href="http://famfamfam.com/">FAMFAMFAM</a>.
+ </p>
+ </div>
+ <!-- end footer -->
+ </body>
+</html>
Added: projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/jbpm.cfg.xml
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/jbpm.cfg.xml (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/jbpm.cfg.xml 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <import resource="jbpm.jpdl.cfg.xml" />
+
+ <!-- This is commented out to use a custom IdentitySessionImpl -->
+ <!--<import resource="jbpm.identity.cfg.xml" />-->
+
+ <process-engine-context>
+
+ <repository-service />
+ <repository-cache />
+ <execution-service />
+ <history-service />
+ <management-service />
+ <identity-service />
+ <task-service />
+
+ <script-manager default-expression-language="juel"
+ default-script-language="juel"
+ read-contexts="execution, environment, process-engine, spring"
+ write-context="">
+ <script-language name="juel"
+ factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
+ </script-manager>
+
+ <authentication />
+
+ <id-generator />
+ <types resource="jbpm.variable.types.xml" />
+
+ <address-resolver />
+
+ <business-calendar>
+ <monday hours="9:00-12:00 and 12:30-17:00" />
+ <tuesday hours="9:00-12:00 and 12:30-17:00" />
+ <wednesday hours="9:00-12:00 and 12:30-17:00" />
+ <thursday hours="9:00-12:00 and 12:30-17:00" />
+ <friday hours="9:00-12:00 and 12:30-17:00" />
+ <holiday period="01/07/2008 - 31/08/2008" />
+ </business-calendar>
+
+ <mail-template name='task-notification'>
+ <to users="${task.assignee}" />
+ <subject>${task.name}</subject>
+ <text><![CDATA[Hi ${task.assignee},
+Task "${task.name}" has been assigned to you.
+${task.description}
+
+Sent by JBoss jBPM
+]]></text>
+ </mail-template>
+
+ <mail-template name='task-reminder'>
+ <to users="${task.assignee}" />
+ <subject>${task.name}</subject>
+ <text><![CDATA[Hey ${task.assignee},
+Do not forget about task "${task.name}".
+${task.description}
+
+Sent by JBoss jBPM
+]]></text>
+ </mail-template>
+
+ <command-service>
+ <retry-interceptor />
+ <environment-interceptor />
+ <spring-transaction-interceptor
+ current="true" />
+ </command-service>
+ </process-engine-context>
+
+ <transaction-context>
+ <env class="identitySession" />
+ <repository-session />
+ <db-session />
+ <message-session />
+ <timer-session />
+ <history-session />
+ <mail-session>
+ <mail-server>
+ <session-properties resource="jbpm.mail.properties" />
+ </mail-server>
+ </mail-session>
+ <hibernate-session current="true" />
+ </transaction-context>
+</jbpm-configuration>
\ No newline at end of file
Added: projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/pages/Index.properties
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/pages/Index.properties (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/resources/org/example/jbpmdemo/pages/Index.properties 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1 @@
+greeting=Welcome to Tapestry 5! We hope that this project template will get you going in style.
\ No newline at end of file
Added: projects/demos/tapestry-spring-jbpm4/src/main/resources/user.hbm.xml
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/resources/user.hbm.xml (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/resources/user.hbm.xml 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping package="org.example.jbpmdemo.model.user" default-access="field">
+
+ <!-- ### USER ########################################################### -->
+ <class name="User" table="JBPMDEMO_USER">
+ <id name="dbid" column="DBID_">
+ <generator class="native" />
+ </id>
+
+ <property name="userName" column="USERNAME_" />
+ <property name="firstName" column="FIRSTNAME_" />
+ <property name="lastName" column="LASTNAME_" />
+ <property name="email" column="EMAIL_" />
+ </class>
+
+</hibernate-mapping>
\ No newline at end of file
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/About.tml
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/webapp/About.tml (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/webapp/About.tml 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,7 @@
+<html t:type="layout" title="About jbpmdemo"
+ xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
+ xmlns:p="tapestry:parameter">
+
+ <p>About jbpmdemo application ...</p>
+
+</html>
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/Contact.tml
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/webapp/Contact.tml (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/webapp/Contact.tml 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,7 @@
+<html t:type="layout" title="Contact org.example"
+ xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
+ xmlns:p="tapestry:parameter">
+
+ <p>Contact org.example ...</p>
+
+</html>
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/Index.tml
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/webapp/Index.tml (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/webapp/Index.tml 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,23 @@
+<html t:type="layout" title="jbpmdemo Index" t:sidebarTitle="Current Time"
+ xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter">
+ <!--
+ Most of the page content, including <head>, <body>, etc. tags, comes
+ from Layout.tml
+ -->
+ <ol>
+ <li>
+ <p>First we need to <t:actionlink t:id="deployProcess">Deploy a Process...</t:actionlink></p>
+ <b>Deployed Processes</b><br/>
+ <t:grid source="allDeployedProcesses" />
+ </li>
+ <li>
+ <p>Then we can create a user that will be persisted on the page and passed on to jBPM when starting a new process instance...</p>
+ <t:beaneditform id="test-assignee" object="user"/>
+ </li>
+ <li>
+ <p>Now we're ready to <t:actionlink t:id="startProcessInstance">start a new Process Instance...</t:actionlink></p>
+ <b>Task List</b><br/>
+ <t:grid source="tasks" />
+ </li>
+ </ol>
+</html>
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/WEB-INF/app.properties
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/webapp/WEB-INF/app.properties (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/webapp/WEB-INF/app.properties 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,4 @@
+# This is where global application properties go.
+# You can also have individual message catalogs for each page and each
+# component that override these defaults.
+# The name of this file is based on the <filter-name> element in web.
\ No newline at end of file
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/WEB-INF/config/applicationContext.xml
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/webapp/WEB-INF/config/applicationContext.xml (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/webapp/WEB-INF/config/applicationContext.xml 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xmlns:tx="http://www.springframework.org/schema/tx"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+ http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
+
+ <import resource="classpath:org/example/jbpmdemo/applicationContext-common.xml" />
+ <import resource="classpath:org/example/jbpmdemo/applicationContext-dao.xml" />
+ <import resource="classpath:org/example/jbpmdemo/applicationContext-service.xml" />
+ <import resource="classpath:org/example/jbpmdemo/applicationContext-process.xml" />
+
+</beans>
\ No newline at end of file
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/WEB-INF/web.xml
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/webapp/WEB-INF/web.xml 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app
+ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <display-name>jbpmdemo Tapestry 5 Application</display-name>
+ <context-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>/WEB-INF/config/applicationContext.xml</param-value>
+ </context-param>
+ <context-param>
+ <!--
+ The only significant configuration for Tapestry 5, this informs
+ Tapestry of where to look for pages, components and mixins.
+ -->
+ <param-name>tapestry.app-package</param-name>
+ <param-value>org.example.jbpmdemo</param-value>
+ </context-param>
+ <filter>
+ <filter-name>app</filter-name>
+ <!--
+ Special filter that adds in a T5 IoC module derived from the Spring
+ WebApplicationContext.
+ -->
+ <filter-class>org.apache.tapestry5.spring.TapestrySpringFilter</filter-class>
+ </filter>
+ <!--
+ <filter>
+ <filter-name>app</filter-name>
+ <filter-class>org.apache.tapestry5.TapestryFilter</filter-class>
+ </filter>
+ -->
+ <filter-mapping>
+ <filter-name>app</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+</web-app>
+
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/favicon.ico
===================================================================
(Binary files differ)
Property changes on: projects/demos/tapestry-spring-jbpm4/src/main/webapp/favicon.ico
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img01.jpg
===================================================================
(Binary files differ)
Property changes on: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img01.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img02.jpg
===================================================================
(Binary files differ)
Property changes on: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img02.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img03.jpg
===================================================================
(Binary files differ)
Property changes on: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img03.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img04.jpg
===================================================================
(Binary files differ)
Property changes on: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img04.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img05.gif
===================================================================
(Binary files differ)
Property changes on: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img05.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img06.gif
===================================================================
(Binary files differ)
Property changes on: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img06.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img07.gif
===================================================================
(Binary files differ)
Property changes on: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img07.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img08.gif
===================================================================
(Binary files differ)
Property changes on: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img08.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img09.gif
===================================================================
(Binary files differ)
Property changes on: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img09.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img10.gif
===================================================================
(Binary files differ)
Property changes on: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img10.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img11.gif
===================================================================
(Binary files differ)
Property changes on: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img11.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img12.gif
===================================================================
(Binary files differ)
Property changes on: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img12.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img13.gif
===================================================================
(Binary files differ)
Property changes on: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img13.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img14.gif
===================================================================
(Binary files differ)
Property changes on: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img14.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img15.gif
===================================================================
(Binary files differ)
Property changes on: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img15.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img16.gif
===================================================================
(Binary files differ)
Property changes on: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img16.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img17.gif
===================================================================
(Binary files differ)
Property changes on: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img17.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img18.gif
===================================================================
(Binary files differ)
Property changes on: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img18.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img19.gif
===================================================================
(Binary files differ)
Property changes on: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img19.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img20.gif
===================================================================
(Binary files differ)
Property changes on: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/img20.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/spacer.gif
===================================================================
(Binary files differ)
Property changes on: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/images/spacer.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/layout.css
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/layout.css (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/layout.css 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,369 @@
+/*
+Design by Free CSS Templates
+http://www.freecsstemplates.org
+Released for free under a Creative Commons Attribution 2.5 License
+*/
+
+body {
+ margin: 0;
+ padding: 0;
+ background: #FFFFFF url( images/img01.jpg ) repeat-x;
+ text-align: justify;
+ font: 15px Arial, Helvetica, sans-serif;
+ color: #626262;
+}
+
+form {
+ margin: 0;
+ padding: 0;
+}
+
+input {
+ padding: 5px;
+ background: #FEFEFE url( images/img13.gif ) repeat-x;
+ border: 1px solid #626262;
+ font: normal 1em Arial, Helvetica, sans-serif;
+}
+
+h1, h1 a, h2, h2 a, h3, h3 a {
+ margin: 0;
+ text-decoration: none;
+ font-family: Tahoma, Georgia, "Times New Roman", Times, serif;
+ font-weight: normal;
+ color: #444444;
+}
+
+h1 {
+ letter-spacing: -1px;
+ font-size: 2.2em;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+}
+
+h2 {
+ letter-spacing: -1px;
+ font-size: 2em;
+}
+
+h3 {
+ font-size: 1em;
+}
+
+p, ol, ul {
+ margin-bottom: 2em;
+ line-height: 200%;
+}
+
+blockquote {
+ margin: 0 0 0 1.5em;
+ padding-left: 1em;
+ border-left: 5px solid #DDDDDD;
+}
+
+a {
+ color: #1692B8;
+}
+
+a:hover {
+ text-decoration: none;
+}
+
+/* Header */
+
+#header {
+ height: 42px;
+}
+
+#logo h1, #logo p {
+ float: left;
+ text-transform: lowercase;
+}
+
+#logo h1 {
+ padding: 0px 0 0 40px;
+}
+
+#logo p {
+ margin: 0;
+ padding: 14px 0 0 4px;
+ line-height: normal;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 14px;
+}
+
+#logo a {
+ text-decoration: none;
+ color: #D0C7A6;
+}
+
+#menu {
+ float: right;
+}
+
+#menu ul {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+
+#menu li {
+ display: block;
+ float: left;
+ height: 42px;
+}
+
+#menu a {
+ display: block;
+ padding: 8px 20px 0px 20px;
+ text-decoration: none;
+ text-align: center;
+ text-transform: lowercase;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-weight: normal;
+ font-size: 14px;
+ color: #CEC5A4;
+}
+
+#menu .last {
+ margin-right: 20px;
+}
+
+#menu a:hover {
+ color: #FFFFFF;
+}
+
+#menu .current_page_item A {
+ text-decoration: underline;
+}
+
+#menu .current_page_item a {
+}
+
+/* Page */
+
+#page {
+ padding: 40px 40px 0 40px;
+}
+
+/* Content */
+
+#content {
+ margin-right: 340px;
+}
+
+.post {
+ margin-bottom: 10px;
+}
+
+.post .title {
+ border-bottom: 1px #999999 dashed;
+ font-family: Tahoma, Georgia, "Times New Roman", Times, serif;
+}
+
+.post .title h2 {
+ padding: 30px 30px 0 0px;
+ text-transform: lowercase;
+ font-weight: normal;
+ font-size: 2.2em;
+}
+
+.post .title p {
+ margin: 0;
+ padding: 0 0 10px 0px;
+ line-height: normal;
+ color: #BABABA;
+}
+
+.post .title p a {
+ color: #BABABA;
+}
+
+.post .entry {
+ padding: 20px 0px 20px 0px;
+}
+
+.post .links {
+ margin: 0;
+ padding: 0 30px 30px 0px;
+}
+
+.post .links a {
+ display: block;
+ float: left;
+ margin-right: 10px;
+ margin-bottom: 5px;
+ text-align: center;
+ text-decoration: none;
+ font-weight: bold;
+ color: #FFFFFF;
+}
+
+.post .links a:hover {
+}
+
+.post .links .more {
+ width: 128px;
+ height: 30px;
+ background: url( images/img03.jpg ) no-repeat left center;
+}
+
+.post .links .comments {
+ width: 152px;
+ height: 30px;
+ background: url( images/img04.jpg ) no-repeat left center;
+}
+
+/* Sidebar */
+
+#sidebar {
+ float: right;
+ width: 300px;
+ margin-top: 30px;
+}
+
+#sidebar ul {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+
+#sidebar li {
+ margin-bottom: 10px;
+ background: url( images/img10.gif ) no-repeat left bottom;
+}
+
+#sidebar li ul {
+ padding: 0 30px 40px 30px;
+}
+
+#sidebar li li {
+ margin: 0;
+ padding-left: 20px;
+}
+
+#sidebar h2 {
+ padding: 30px 30px 5px 10px;
+ background: url( images/img09.gif ) no-repeat;
+ text-transform: lowercase;
+ font-weight: normal;
+ font-size: 1.6em;
+ color: #302D26;
+}
+
+#sidebar DIV.sidebar-content {
+ width: 265px;
+ margin-left: 10px;
+ padding-bottom: 1px;
+}
+
+/* Search */
+
+#search {
+ padding: 20px 30px 40px 30px;
+}
+
+#search input {
+ padding: 0;
+ width: 70px;
+ height: 29px;
+ background: #DFDFDF url( images/img14.gif ) repeat-x;
+ font-weight: bold;
+}
+
+#search #s {
+ padding: 5px;
+ width: 150px;
+ height: auto;
+ background: #FEFEFE url( images/img13.gif ) repeat-x;
+ border: 1px solid #626262;
+ font: normal 1em Arial, Helvetica, sans-serif;
+}
+
+#search br {
+ display: none;
+}
+
+/* Categories */
+
+#sidebar #categories li {
+ background: url( images/img12.gif ) no-repeat left center;
+}
+
+/* Calendar */
+
+#calendar_wrap {
+ padding: 0 30px 40px 30px;
+}
+
+#calendar table {
+ width: 100%;
+ text-align: center;
+}
+
+#calendar thead {
+ background: #F1F1F1;
+}
+
+#calendar tbody td {
+ border: 1px solid #F1F1F1;
+}
+
+#calendar #prev {
+ text-align: left;
+}
+
+#calendar #next {
+ text-align: right;
+}
+
+#calendar tfoot a {
+ text-decoration: none;
+ font-weight: bold;
+}
+
+#calendar #today {
+ background: #FFF3A7;
+ border: 1px solid #EB1400;
+ font-weight: bold;
+ color: #EB1400
+}
+
+/* Footer */
+
+#footer {
+ padding: 70px 0 50px 0;
+ background: #757575 url( images/img08.gif ) repeat-x;
+}
+
+#footer p {
+ margin-bottom: 1em;
+ text-align: center;
+ line-height: normal;
+ font-size: .9em;
+ color: #BABABA;
+}
+
+#footer a {
+ padding: 0 20px;
+ text-decoration: none;
+ color: #DDDDDD;
+}
+
+#footer a:hover {
+ color: #FFFFFF;
+}
+
+#footer .rss {
+ background: url( images/img18.gif ) no-repeat left center;
+}
+
+#footer .xhtml {
+ background: url( images/img19.gif ) no-repeat left center;
+}
+
+#footer .css {
+ background: url( images/img20.gif ) no-repeat left center;
+}
+
+#footer .legal a {
+ padding: 0;
+}
Added: projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/license.txt
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/license.txt (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/main/webapp/layout/license.txt 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,243 @@
+Creative Commons </>
+
+Creative Commons Legal Code
+
+*Attribution 2.5*
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
+LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN
+ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION
+ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE
+INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
+ITS USE.
+
+/License/
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE
+COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY
+COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
+AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE
+TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE
+RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS
+AND CONDITIONS.
+
+*1. Definitions*
+
+ 1. *"Collective Work"* means a work, such as a periodical issue,
+ anthology or encyclopedia, in which the Work in its entirety in
+ unmodified form, along with a number of other contributions,
+ constituting separate and independent works in themselves, are
+ assembled into a collective whole. A work that constitutes a
+ Collective Work will not be considered a Derivative Work (as
+ defined below) for the purposes of this License.
+ 2. *"Derivative Work"* means a work based upon the Work or upon the
+ Work and other pre-existing works, such as a translation, musical
+ arrangement, dramatization, fictionalization, motion picture
+ version, sound recording, art reproduction, abridgment,
+ condensation, or any other form in which the Work may be recast,
+ transformed, or adapted, except that a work that constitutes a
+ Collective Work will not be considered a Derivative Work for the
+ purpose of this License. For the avoidance of doubt, where the
+ Work is a musical composition or sound recording, the
+ synchronization of the Work in timed-relation with a moving image
+ ("synching") will be considered a Derivative Work for the purpose
+ of this License.
+ 3. *"Licensor"* means the individual or entity that offers the Work
+ under the terms of this License.
+ 4. *"Original Author"* means the individual or entity who created the
+ Work.
+ 5. *"Work"* means the copyrightable work of authorship offered under
+ the terms of this License.
+ 6. *"You"* means an individual or entity exercising rights under this
+ License who has not previously violated the terms of this License
+ with respect to the Work, or who has received express permission
+ from the Licensor to exercise rights under this License despite a
+ previous violation.
+
+*2. Fair Use Rights.* Nothing in this license is intended to reduce,
+limit, or restrict any rights arising from fair use, first sale or other
+limitations on the exclusive rights of the copyright owner under
+copyright law or other applicable laws.
+
+*3. License Grant.* Subject to the terms and conditions of this License,
+Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
+perpetual (for the duration of the applicable copyright) license to
+exercise the rights in the Work as stated below:
+
+ 1. to reproduce the Work, to incorporate the Work into one or more
+ Collective Works, and to reproduce the Work as incorporated in the
+ Collective Works;
+ 2. to create and reproduce Derivative Works;
+ 3. to distribute copies or phonorecords of, display publicly, perform
+ publicly, and perform publicly by means of a digital audio
+ transmission the Work including as incorporated in Collective Works;
+ 4. to distribute copies or phonorecords of, display publicly, perform
+ publicly, and perform publicly by means of a digital audio
+ transmission Derivative Works.
+ 5.
+
+ For the avoidance of doubt, where the work is a musical composition:
+
+ 1. *Performance Royalties Under Blanket Licenses*. Licensor
+ waives the exclusive right to collect, whether individually
+ or via a performance rights society (e.g. ASCAP, BMI,
+ SESAC), royalties for the public performance or public
+ digital performance (e.g. webcast) of the Work.
+ 2. *Mechanical Rights and Statutory Royalties*. Licensor waives
+ the exclusive right to collect, whether individually or via
+ a music rights agency or designated agent (e.g. Harry Fox
+ Agency), royalties for any phonorecord You create from the
+ Work ("cover version") and distribute, subject to the
+ compulsory license created by 17 USC Section 115 of the US
+ Copyright Act (or the equivalent in other jurisdictions).
+ 6. *Webcasting Rights and Statutory Royalties*. For the avoidance of
+ doubt, where the Work is a sound recording, Licensor waives the
+ exclusive right to collect, whether individually or via a
+ performance-rights society (e.g. SoundExchange), royalties for the
+ public digital performance (e.g. webcast) of the Work, subject to
+ the compulsory license created by 17 USC Section 114 of the US
+ Copyright Act (or the equivalent in other jurisdictions).
+
+The above rights may be exercised in all media and formats whether now
+known or hereafter devised. The above rights include the right to make
+such modifications as are technically necessary to exercise the rights
+in other media and formats. All rights not expressly granted by Licensor
+are hereby reserved.
+
+*4. Restrictions.*The license granted in Section 3 above is expressly
+made subject to and limited by the following restrictions:
+
+ 1. You may distribute, publicly display, publicly perform, or
+ publicly digitally perform the Work only under the terms of this
+ License, and You must include a copy of, or the Uniform Resource
+ Identifier for, this License with every copy or phonorecord of the
+ Work You distribute, publicly display, publicly perform, or
+ publicly digitally perform. You may not offer or impose any terms
+ on the Work that alter or restrict the terms of this License or
+ the recipients' exercise of the rights granted hereunder. You may
+ not sublicense the Work. You must keep intact all notices that
+ refer to this License and to the disclaimer of warranties. You may
+ not distribute, publicly display, publicly perform, or publicly
+ digitally perform the Work with any technological measures that
+ control access or use of the Work in a manner inconsistent with
+ the terms of this License Agreement. The above applies to the Work
+ as incorporated in a Collective Work, but this does not require
+ the Collective Work apart from the Work itself to be made subject
+ to the terms of this License. If You create a Collective Work,
+ upon notice from any Licensor You must, to the extent practicable,
+ remove from the Collective Work any credit as required by clause
+ 4(b), as requested. If You create a Derivative Work, upon notice
+ from any Licensor You must, to the extent practicable, remove from
+ the Derivative Work any credit as required by clause 4(b), as
+ requested.
+ 2. If you distribute, publicly display, publicly perform, or publicly
+ digitally perform the Work or any Derivative Works or Collective
+ Works, You must keep intact all copyright notices for the Work and
+ provide, reasonable to the medium or means You are utilizing: (i)
+ the name of the Original Author (or pseudonym, if applicable) if
+ supplied, and/or (ii) if the Original Author and/or Licensor
+ designate another party or parties (e.g. a sponsor institute,
+ publishing entity, journal) for attribution in Licensor's
+ copyright notice, terms of service or by other reasonable means,
+ the name of such party or parties; the title of the Work if
+ supplied; to the extent reasonably practicable, the Uniform
+ Resource Identifier, if any, that Licensor specifies to be
+ associated with the Work, unless such URI does not refer to the
+ copyright notice or licensing information for the Work; and in the
+ case of a Derivative Work, a credit identifying the use of the
+ Work in the Derivative Work (e.g., "French translation of the Work
+ by Original Author," or "Screenplay based on original Work by
+ Original Author"). Such credit may be implemented in any
+ reasonable manner; provided, however, that in the case of a
+ Derivative Work or Collective Work, at a minimum such credit will
+ appear where any other comparable authorship credit appears and in
+ a manner at least as prominent as such other comparable authorship
+ credit.
+
+*5. Representations, Warranties and Disclaimer*
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR
+OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY
+KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE,
+INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY,
+FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF
+LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS,
+WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE
+EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+*6. Limitation on Liability.* EXCEPT TO THE EXTENT REQUIRED BY
+APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL
+THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY
+DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF
+LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+*7. Termination*
+
+ 1. This License and the rights granted hereunder will terminate
+ automatically upon any breach by You of the terms of this License.
+ Individuals or entities who have received Derivative Works or
+ Collective Works from You under this License, however, will not
+ have their licenses terminated provided such individuals or
+ entities remain in full compliance with those licenses. Sections
+ 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+ 2. Subject to the above terms and conditions, the license granted
+ here is perpetual (for the duration of the applicable copyright in
+ the Work). Notwithstanding the above, Licensor reserves the right
+ to release the Work under different license terms or to stop
+ distributing the Work at any time; provided, however that any such
+ election will not serve to withdraw this License (or any other
+ license that has been, or is required to be, granted under the
+ terms of this License), and this License will continue in full
+ force and effect unless terminated as stated above.
+
+*8. Miscellaneous*
+
+ 1. Each time You distribute or publicly digitally perform the Work or
+ a Collective Work, the Licensor offers to the recipient a license
+ to the Work on the same terms and conditions as the license
+ granted to You under this License.
+ 2. Each time You distribute or publicly digitally perform a
+ Derivative Work, Licensor offers to the recipient a license to the
+ original Work on the same terms and conditions as the license
+ granted to You under this License.
+ 3. If any provision of this License is invalid or unenforceable under
+ applicable law, it shall not affect the validity or enforceability
+ of the remainder of the terms of this License, and without further
+ action by the parties to this agreement, such provision shall be
+ reformed to the minimum extent necessary to make such provision
+ valid and enforceable.
+ 4. No term or provision of this License shall be deemed waived and no
+ breach consented to unless such waiver or consent shall be in
+ writing and signed by the party to be charged with such waiver or
+ consent.
+ 5. This License constitutes the entire agreement between the parties
+ with respect to the Work licensed here. There are no
+ understandings, agreements or representations with respect to the
+ Work not specified here. Licensor shall not be bound by any
+ additional provisions that may appear in any communication from
+ You. This License may not be modified without the mutual written
+ agreement of the Licensor and You.
+
+Creative Commons is not a party to this License, and makes no warranty
+whatsoever in connection with the Work. Creative Commons will not be
+liable to You or any party on any legal theory for any damages
+whatsoever, including without limitation any general, special,
+incidental or consequential damages arising in connection to this
+license. Notwithstanding the foregoing two (2) sentences, if Creative
+Commons has expressly identified itself as the Licensor hereunder, it
+shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work
+is licensed under the CCPL, neither party will use the trademark
+"Creative Commons" or any related trademark or logo of Creative Commons
+without the prior written consent of Creative Commons. Any permitted use
+will be in compliance with Creative Commons' then-current trademark
+usage guidelines, as may be published on its website or otherwise made
+available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/
+<http://creativecommons.org>.
+
+� Back to Commons Deed <./>
Added: projects/demos/tapestry-spring-jbpm4/src/site/apt/index.apt
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/site/apt/index.apt (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/site/apt/index.apt 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,9 @@
+ ----
+ Module org.example:jbpmdemo
+ ----
+
+org.example:jbpmdemo Documentation
+
+ This is where you can start to document your module.
+
+ Create new files in the Maven APT format, and update the site.xml file to point to them.
Added: projects/demos/tapestry-spring-jbpm4/src/site/site.xml
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/site/site.xml (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/site/site.xml 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project name="Generated site for jbpmdemo">
+
+ <publishDate format="dd MMM yyyy"/>
+
+ <version/>
+
+ <body>
+
+ <menu name="jbpmdemo Project">
+ <item name="About" href="index.html"/>
+ </menu>
+
+ <menu ref="reports"/>
+
+ </body>
+</project>
Added: projects/demos/tapestry-spring-jbpm4/src/test/conf/testng.xml
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/test/conf/testng.xml (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/test/conf/testng.xml 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,8 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="jbpmdemo Application Test Suite" annotations="1.5">
+ <test name="Unit Tests">
+ <packages>
+ <package name="org.example.jbpmdemo"/>
+ </packages>
+ </test>
+</suite>
Added: projects/demos/tapestry-spring-jbpm4/src/test/conf/webdefault.xml
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/test/conf/webdefault.xml (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/test/conf/webdefault.xml 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,278 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<web-app
+ xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <description>
+ Default web.xml file.
+ This file is applied to a Web application before it's own WEB_INF/web.xml file
+ </description>
+
+
+ <!-- ==================================================================== -->
+ <!-- Context params to control Session Cookies -->
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+ <!-- UNCOMMENT TO ACTIVATE
+ <context-param>
+ <param-name>org.mortbay.jetty.servlet.SessionDomain</param-name>
+ <param-value>127.0.0.1</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.mortbay.jetty.servlet.SessionPath</param-name>
+ <param-value>/</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.mortbay.jetty.servlet.MaxAge</param-name>
+ <param-value>-1</param-value>
+ </context-param>
+ -->
+
+
+ <!-- ==================================================================== -->
+ <!-- The default servlet. -->
+ <!-- This servlet, normally mapped to /, provides the handling for static -->
+ <!-- content, OPTIONS and TRACE methods for the context. -->
+ <!-- The following initParameters are supported: -->
+ <!-- -->
+ <!-- acceptRanges If true, range requests and responses are -->
+ <!-- supported -->
+ <!-- -->
+ <!-- dirAllowed If true, directory listings are returned if no -->
+ <!-- welcome file is found. Else 403 Forbidden. -->
+ <!-- -->
+ <!-- putAllowed If true, the PUT method is allowed -->
+ <!-- -->
+ <!-- delAllowed If true, the DELETE method is allowed -->
+ <!-- -->
+ <!-- redirectWelcome If true, redirect welcome file requests -->
+ <!-- else use request dispatcher forwards -->
+ <!-- -->
+ <!-- minGzipLength If set to a positive integer, then static content -->
+ <!-- larger than this will be served as gzip content -->
+ <!-- encoded if a matching resource is found ending -->
+ <!-- with ".gz" -->
+ <!-- -->
+ <!-- resoureBase Can be set to replace the context resource base -->
+ <!-- -->
+ <!-- relativeResourceBase -->
+ <!-- Set with a pathname relative to the base of the -->
+ <!-- servlet context root. Useful for only serving -->
+ <!-- static content from only specific subdirectories. -->
+ <!-- -->
+ <!-- The MOVE method is allowed if PUT and DELETE are allowed -->
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+ <servlet>
+ <servlet-name>default</servlet-name>
+ <servlet-class>org.mortbay.jetty.servlet.Default</servlet-class>
+ <init-param>
+ <param-name>acceptRanges</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ <init-param>
+ <param-name>dirAllowed</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ <init-param>
+ <param-name>putAllowed</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <init-param>
+ <param-name>delAllowed</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <init-param>
+ <param-name>redirectWelcome</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <init-param>
+ <param-name>minGzipLength</param-name>
+ <param-value>8192</param-value>
+ </init-param>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+
+
+ <servlet-mapping>
+ <servlet-name>default</servlet-name>
+ <url-pattern>/</url-pattern>
+ </servlet-mapping>
+
+ <!-- ==================================================================== -->
+ <session-config>
+ <session-timeout>30</session-timeout>
+ </session-config>
+
+
+ <!-- ==================================================================== -->
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ <welcome-file>index.htm</welcome-file>
+ </welcome-file-list>
+
+ <!-- ==================================================================== -->
+ <locale-encoding-mapping-list>
+ <locale-encoding-mapping>
+ <locale>ar</locale>
+ <encoding>ISO-8859-6</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>be</locale>
+ <encoding>ISO-8859-5</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>bg</locale>
+ <encoding>ISO-8859-5</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>ca</locale>
+ <encoding>ISO-8859-1</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>cs</locale>
+ <encoding>ISO-8859-2</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>da</locale>
+ <encoding>ISO-8859-1</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>de</locale>
+ <encoding>ISO-8859-1</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>el</locale>
+ <encoding>ISO-8859-7</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>en</locale>
+ <encoding>ISO-8859-1</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>es</locale>
+ <encoding>ISO-8859-1</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>et</locale>
+ <encoding>ISO-8859-1</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>fi</locale>
+ <encoding>ISO-8859-1</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>fr</locale>
+ <encoding>ISO-8859-1</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>hr</locale>
+ <encoding>ISO-8859-2</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>hu</locale>
+ <encoding>ISO-8859-2</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>is</locale>
+ <encoding>ISO-8859-1</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>it</locale>
+ <encoding>ISO-8859-1</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>iw</locale>
+ <encoding>ISO-8859-8</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>ja</locale>
+ <encoding>Shift_JIS</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>ko</locale>
+ <encoding>EUC-KR</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>lt</locale>
+ <encoding>ISO-8859-2</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>lv</locale>
+ <encoding>ISO-8859-2</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>mk</locale>
+ <encoding>ISO-8859-5</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>nl</locale>
+ <encoding>ISO-8859-1</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>no</locale>
+ <encoding>ISO-8859-1</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>pl</locale>
+ <encoding>ISO-8859-2</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>pt</locale>
+ <encoding>ISO-8859-1</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>ro</locale>
+ <encoding>ISO-8859-2</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>ru</locale>
+ <encoding>ISO-8859-5</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>sh</locale>
+ <encoding>ISO-8859-5</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>sk</locale>
+ <encoding>ISO-8859-2</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>sl</locale>
+ <encoding>ISO-8859-2</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>sq</locale>
+ <encoding>ISO-8859-2</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>sr</locale>
+ <encoding>ISO-8859-5</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>sv</locale>
+ <encoding>ISO-8859-1</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>tr</locale>
+ <encoding>ISO-8859-9</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>uk</locale>
+ <encoding>ISO-8859-5</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>zh</locale>
+ <encoding>GB2312</encoding>
+ </locale-encoding-mapping>
+ <locale-encoding-mapping>
+ <locale>zh_TW</locale>
+ <encoding>Big5</encoding>
+ </locale-encoding-mapping>
+ </locale-encoding-mapping-list>
+
+
+</web-app>
+
Added: projects/demos/tapestry-spring-jbpm4/src/test/java/org/example/jbpmdemo/service/JbpmServiceTest.java
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/test/java/org/example/jbpmdemo/service/JbpmServiceTest.java (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/test/java/org/example/jbpmdemo/service/JbpmServiceTest.java 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,73 @@
+package org.example.jbpmdemo.service;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.mail.MessagingException;
+
+import org.example.jbpmdemo.model.user.User;
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.spring.test.AbstractTransactionalSpringJbpmTestCase;
+import org.subethamail.wiser.Wiser;
+import org.subethamail.wiser.WiserMessage;
+
+public class JbpmServiceTest extends AbstractTransactionalSpringJbpmTestCase {
+
+ protected UserService userService;
+ Wiser wiser = null;
+
+ private String deploymentId;
+ private String processInstanceId;
+
+ @Override
+ protected String[] getConfigLocations() {
+ return new String[] {
+ "org/example/jbpmdemo/applicationContext-common.xml",
+ "org/example/jbpmdemo/applicationContext-dao.xml",
+ "org/example/jbpmdemo/applicationContext-process.xml",
+ "org/example/jbpmdemo/applicationContext-service.xml" };
+ }
+
+ @Override
+ protected void onSetUpInTransaction() throws Exception {
+ userService = (UserService) applicationContext.getBean("userService");
+
+ // start mail server
+ wiser = new Wiser();
+ wiser.setPort(2525);
+ wiser.start();
+
+ super.onSetUpInTransaction();
+ deploymentId = repositoryService.createDeployment().addResourceFromUrl(
+ JbpmServiceTest.class
+ .getResource("/jbpm/process/Review.jpdl.xml")).deploy();
+ }
+
+ public void testReviewProcess() throws IOException, MessagingException {
+ String userId = userService.createUser("john.doe", "John", "Doe", "john.doe(a)test.org");
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("user", userService.findUserById(userId));
+ try {
+ ProcessInstance processInstance = executionService
+ .startProcessInstanceByKey("Review_Process", variables);
+ processInstanceId = processInstance.getId();
+ assertTrue(processInstance.isActive("Review"));
+ } catch (RuntimeException e) {
+ assertEquals("Not implemented", e.getMessage());
+ }
+ assertEquals(1, wiser.getMessages().size());
+ for (WiserMessage message : wiser.getMessages()) {
+ logger.info(message.getEnvelopeSender());
+ logger.info(message.getEnvelopeReceiver());
+ logger.info(message.getMimeMessage().getSubject());
+ logger.info(message.getMimeMessage().getContent());
+ // TODO add asserts for email message
+ }
+ }
+
+ @Override
+ protected void onTearDownAfterTransaction() throws Exception {
+ wiser.stop();
+ }
+}
Added: projects/demos/tapestry-spring-jbpm4/src/test/java/org/jbpm/spring/test/AbstractTransactionalSpringJbpmTestCase.java
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/test/java/org/jbpm/spring/test/AbstractTransactionalSpringJbpmTestCase.java (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/test/java/org/jbpm/spring/test/AbstractTransactionalSpringJbpmTestCase.java 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,162 @@
+package org.jbpm.spring.test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.example.jbpmdemo.service.UserService;
+import org.jbpm.api.Configuration;
+import org.jbpm.api.ExecutionService;
+import org.jbpm.api.HistoryService;
+import org.jbpm.api.IdentityService;
+import org.jbpm.api.ManagementService;
+import org.jbpm.api.ProcessEngine;
+import org.jbpm.api.RepositoryService;
+import org.jbpm.api.TaskService;
+import org.jbpm.api.task.Task;
+import org.jbpm.pvm.internal.cmd.CommandService;
+import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests;
+
+/**
+ * Abstract test class that - builds the application context - runs in 1
+ * transaction - adds convenience methods: e.g. deploying a process.
+ *
+ * @author Andries Inze
+ *
+ */
+public abstract class AbstractTransactionalSpringJbpmTestCase extends
+ AbstractTransactionalDataSourceSpringContextTests {
+
+ private Configuration configuration;
+ protected ProcessEngine processEngine;
+
+ protected RepositoryService repositoryService;
+ protected ExecutionService executionService;
+ protected ManagementService managementService;
+ protected TaskService taskService;
+ protected HistoryService historyService;
+ protected IdentityService identityService;
+
+ protected CommandService commandService;
+
+ protected List<String> taskIds;
+
+ /**
+ * registered deployments. registered deployments will be deleted
+ * automatically in the tearDown. This is a convenience function as each
+ * test is expected to clean up the DB.
+ */
+ protected List<String> registeredDeployments = new ArrayList<String>();
+
+ public AbstractTransactionalSpringJbpmTestCase() {
+ super();
+
+ // AUTOWIRE_BY_NAME is default behavior for Spring version 2.5.x
+ // AUTOWIRE_BY_TYPE is default behavior for Spring version 2.0.8, but
+ // fails because of Hibernate specific instances.
+ setAutowireMode(AUTOWIRE_BY_NAME);
+ }
+
+ /**
+ * {@inheritDoc)
+
+ */
+ protected void injectDependencies() throws Exception {
+ super.injectDependencies();
+
+ configuration = (Configuration) applicationContext
+ .getBean("jbpmConfiguration");
+ processEngine = configuration.buildProcessEngine();
+
+ repositoryService = processEngine.get(RepositoryService.class);
+ executionService = processEngine.getExecutionService();
+ historyService = processEngine.getHistoryService();
+ managementService = processEngine.getManagementService();
+ taskService = processEngine.getTaskService();
+ identityService = processEngine.getIdentityService();
+ commandService = processEngine.get(CommandService.class);
+ }
+
+ @Override
+ protected void onSetUp() throws Exception {
+ super.onSetUp();
+
+ }
+
+ @Override
+ protected void onTearDownInTransaction() throws Exception {
+ // super.onTearDownInTransaction();
+ // for (Long deploymentDbid : registeredDeployments) {
+ // repositoryService.deleteDeploymentCascade(deploymentDbid);
+ // }
+
+ // Db.verifyClean(processEngine);
+
+ }
+
+ /**
+ * deploys the process, keeps a reference to the deployment and
+ * automatically deletes the deployment in the tearDown
+ */
+ public String deployJpdlXmlString(String jpdlXmlString) {
+ String deploymentDbid = repositoryService.createDeployment()
+ .addResourceFromString("xmlstring.jpdl.xml", jpdlXmlString)
+ .deploy();
+ registerDeployment(deploymentDbid);
+ return deploymentDbid;
+ }
+
+ /** registered deployments will be deleted in the tearDown */
+ protected void registerDeployment(String deploymentDbid) {
+ registeredDeployments.add(deploymentDbid);
+ }
+
+ public void assertTextPresent(String expected, String value) {
+ // TODO utility!
+ if ((value == null) || (value.indexOf(expected) == -1)) {
+ fail("expected presence of '" + expected + "' but was '" + value
+ + "'");
+ }
+ }
+
+ public static void assertContainsTask(List<Task> taskList, String taskName) {
+ if (getTask(taskList, taskName) == null) {
+ fail("tasklist doesn't contain task '" + taskName + "': "
+ + taskList);
+ }
+ }
+
+ public static void assertContainsTask(List<Task> taskList, String taskName,
+ String assignee) {
+ if (getTask(taskList, taskName, assignee) == null) {
+ fail("tasklist doesn't contain task '" + taskName
+ + "' for assignee '" + assignee + "': " + taskList);
+ }
+ }
+
+ public static Task getTask(List<Task> taskList, String taskName) {
+ for (Task task : taskList) {
+ if (taskName.equals(task.getName())) {
+ return task;
+ }
+ }
+ return null;
+ }
+
+ public static Task getTask(List<Task> taskList, String taskName,
+ String assignee) {
+ for (Task task : taskList) {
+ if (taskName.equals(task.getName())) {
+ if (assignee == null) {
+ if (task.getAssignee() == null) {
+ return task;
+ }
+ } else {
+ if (assignee.equals(task.getAssignee())) {
+ return task;
+ }
+ }
+ }
+ }
+ return null;
+ }
+}
Added: projects/demos/tapestry-spring-jbpm4/src/test/resources/jbpm/process/Review.jpdl.xml
===================================================================
--- projects/demos/tapestry-spring-jbpm4/src/test/resources/jbpm/process/Review.jpdl.xml (rev 0)
+++ projects/demos/tapestry-spring-jbpm4/src/test/resources/jbpm/process/Review.jpdl.xml 2009-08-25 14:53:07 UTC (rev 5536)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="Review Process" xmlns="http://jbpm.org/4.0/jpdl">
+
+ <start g="10,10,48,48" name="start review process">
+ <transition to="Review"/>
+ </start>
+
+ <task assignee="#{user.userName}" name="Review" g="111,13,80,40">
+ <description>Please review the document.</description>
+ <notification/>
+ <transition to="end"/>-->
+ </task>
+
+ <end g="238,10,48,48" name="end"/>
+
+</process>
\ No newline at end of file
Added: projects/demos/tapestry-spring-jbpm4/src/test/resources/jbpm/process/Review.png
===================================================================
(Binary files differ)
Property changes on: projects/demos/tapestry-spring-jbpm4/src/test/resources/jbpm/process/Review.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 8 months
JBoss JBPM SVN: r5535 - projects/demos.
by do-not-reply@jboss.org
Author: ainze
Date: 2009-08-25 10:49:08 -0400 (Tue, 25 Aug 2009)
New Revision: 5535
Added:
projects/demos/tapestry-spring-jbpm4/
Log:
Initial import.
16 years, 8 months
JBoss JBPM SVN: r5534 - in jbpm4/trunk: modules/pvm/src/main/java/org/jbpm/pvm/internal/ant and 1 other directories.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-08-25 09:41:49 -0400 (Tue, 25 Aug 2009)
New Revision: 5534
Modified:
jbpm4/trunk/modules/distro/src/main/files/install/build.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/StartTomcatTask.java
jbpm4/trunk/qa/hudson-jbpm4-tomcat.sh
Log:
Fixed jBPM installation in Tomcat CI
Modified: jbpm4/trunk/modules/distro/src/main/files/install/build.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/install/build.xml 2009-08-25 13:08:27 UTC (rev 5533)
+++ jbpm4/trunk/modules/distro/src/main/files/install/build.xml 2009-08-25 13:41:49 UTC (rev 5534)
@@ -297,25 +297,12 @@
<antcall target="install.tomcat.linuxandmac" />
</target>
- <target name="install.tomcat.linuxandmac" if="isLinuxOrMac">
- <chmod perm="a+x" os="Linux, Mac OS X">
+ <target name="install.tomcat.linuxandmac" if="isLinuxUnixOrMac">
+ <chmod perm="a+x" os="Linux, Mac OS X">
<fileset dir="${tomcat.home}/bin">
<include name="*.sh" />
</fileset>
</chmod>
- <!-- see http://wiki.apache.org/tomcat/HowTo#head-b4cd273179175e013471674e1c2a6003... -->
- <move file="${tomcat.home}/bin/setclasspath.sh" tofile="${tomcat.home}/bin/setclasspath-src.sh" />
- <concat destfile="${tomcat.home}/bin/setclasspath.sh" >
- <filelist dir="${tomcat.home}/bin" files="setclasspath-src.sh" />
- <footer>
-BASEDIR=${tomcat.home}</footer>
- </concat>
- <move file="${tomcat.home}/bin/catalina.sh" tofile="${tomcat.home}/bin/catalina-src.sh" />
- <concat destfile="${tomcat.home}/bin/catalina.sh" >
- <filelist dir="${tomcat.home}/bin" files="catalina-src.sh" />
- <footer>
-CATALINE_HOME=${tomcat.home}</footer>
- </concat>
</target>
<!-- ### GET TOMCAT ###################################################### -->
@@ -386,12 +373,12 @@
<property name="is.tomcat" value="true" />
<antcall target="internal.copy.database.driver" />
</target>
+
<!-- ### START TOMCAT ################################################### -->
<target name="start.tomcat"
description="Starts Tomcat and waits till it is booted, then lets Tomcat run in the background">
- <taskdef name="start-tomcat"
- classname="org.jbpm.pvm.internal.ant.StartTomcatTask">
+ <taskdef name="start-tomcat" classname="org.jbpm.pvm.internal.ant.StartTomcatTask">
<classpath>
<fileset dir="${jbpm.home}">
<include name="jbpm.jar" />
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/StartTomcatTask.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/StartTomcatTask.java 2009-08-25 13:08:27 UTC (rev 5533)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/StartTomcatTask.java 2009-08-25 13:41:49 UTC (rev 5534)
@@ -50,6 +50,9 @@
} else {
throw new BuildException( "os '" + os + "' not supported in the start-tomcat task." );
}
+
+ // CATALINA_HOME MUST BE SET for tomcat to boot
+ System.setProperty("CATALINA_HOME", getTomcatHome());
// launch the command and wait till the END_MESSAGE appears
Thread launcher = new Launcher(this, command, END_MESSAGE, getTomcatHome()+fileSeparator+"bin");
Modified: jbpm4/trunk/qa/hudson-jbpm4-tomcat.sh
===================================================================
--- jbpm4/trunk/qa/hudson-jbpm4-tomcat.sh 2009-08-25 13:08:27 UTC (rev 5533)
+++ jbpm4/trunk/qa/hudson-jbpm4-tomcat.sh 2009-08-25 13:41:49 UTC (rev 5534)
@@ -3,7 +3,6 @@
# runs the jboss integration test suite
MAVEN_OPTS="-Xms1024M -Xmx1024M"
-export CATALINA_HOME=`pwd`/jbpm-4.1-SNAPSHOT/apache-tomcat-6.0.20
ANT_PROPERTIES="-Djbpm.parent.dir=$WORKSPACE -Djboss.distro.dir=$SOURCE_REPO/jboss -Dtomcat.distro.dir=tomcat.downloads"
16 years, 8 months
JBoss JBPM SVN: r5533 - in projects/jopr-integration/trunk/src/main: java/org/rhq/plugins/jbpm4/connector and 1 other directories.
by do-not-reply@jboss.org
Author: jim.ma
Date: 2009-08-25 09:08:27 -0400 (Tue, 25 Aug 2009)
New Revision: 5533
Added:
projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ActivityComponent.java
projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ActivityDiscoveryComponent.java
projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ExceptionalJobComponent.java
projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ProcessInstanceHistoryComponent.java
projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ProcessInstanceHistoryDiscoveryComponent.java
Modified:
projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/JobComponent.java
projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ProcessDefComponent.java
projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ProcessDeploymentComponent.java
projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ProcessInstanceDiscoveryComponent.java
projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/connector/JBPMEngineConnection.java
projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/connector/LocalJBPMEngineConnector.java
projects/jopr-integration/trunk/src/main/resources/META-INF/rhq-plugin.xml
Log:
Added the component to monitor the process instance duration
Added: projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ActivityComponent.java
===================================================================
--- projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ActivityComponent.java (rev 0)
+++ projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ActivityComponent.java 2009-08-25 13:08:27 UTC (rev 5533)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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.rhq.plugins.jbpm4;
+
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jbpm.api.ProcessDefinition;
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.domain.measurement.MeasurementDataTrait;
+import org.rhq.core.domain.measurement.MeasurementReport;
+import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
+import org.rhq.core.pluginapi.measurement.MeasurementFacet;
+import org.rhq.plugins.jbpm4.connector.JBPMEngineConnection;
+
+public class ActivityComponent implements ResourceComponent<ProcessDefComponent> , MeasurementFacet {
+ private ResourceContext<ProcessDefComponent> resourceContext;
+ private Log log = LogFactory.getLog(this.getClass());
+ private String definitionId = null;
+ public void start(ResourceContext<ProcessDefComponent> resourceContext) {
+ definitionId = resourceContext.getParentResourceComponent().getResourceKey();
+ this.resourceContext = resourceContext;
+
+ }
+
+ public void stop() {
+ }
+
+ public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) {
+ for (MeasurementScheduleRequest request : metrics) {
+ if (request.getName().equals("avgDuration")) {
+ Map<String, Long> map = ActivityDiscoveryComponent.defActivityDurationMap.get(definitionId);
+ String activityName = resourceContext.getResourceKey();
+ Long duration = map.get(activityName);
+ MeasurementDataTrait value = new MeasurementDataTrait(request,
+ String.valueOf(duration));
+ report.addData(value);
+ }
+ if (request.getName().equals("name")) {
+ String activityName = resourceContext.getResourceKey();
+ MeasurementDataTrait value = new MeasurementDataTrait(request,
+ String.valueOf(activityName));
+ report.addData(value);
+ }
+ }
+
+ }
+
+
+ public AvailabilityType getAvailability() {
+ ProcessDefinition processDef = getJBPMConnection().getProcessDefById(definitionId);
+ if (processDef != null) {
+ return AvailabilityType.UP;
+ }
+ return AvailabilityType.DOWN;
+ }
+
+ public JBPMEngineConnection getJBPMConnection() {
+ return resourceContext.getParentResourceComponent().getJBPMConnection();
+ }
+}
Added: projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ActivityDiscoveryComponent.java
===================================================================
--- projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ActivityDiscoveryComponent.java (rev 0)
+++ projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ActivityDiscoveryComponent.java 2009-08-25 13:08:27 UTC (rev 5533)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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.rhq.plugins.jbpm4;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.plugins.jbpm4.connector.JBPMEngineConnection;
+
+public class ActivityDiscoveryComponent implements
+ ResourceDiscoveryComponent<ProcessDefComponent> {
+ public static Map<String, Map<String, Long>> defActivityDurationMap = new HashMap<String, Map<String, Long>>();
+ public Set<DiscoveredResourceDetails> discoverResources(
+ ResourceDiscoveryContext<ProcessDefComponent> context) {
+ Set<DiscoveredResourceDetails> activities = new java.util.HashSet<DiscoveredResourceDetails>();
+ String definitionId = context.getParentResourceContext()
+ .getResourceKey();
+ JBPMEngineConnection jbpmConnection = context
+ .getParentResourceComponent().getJBPMConnection();
+ if (defActivityDurationMap.containsKey(definitionId)) {
+ defActivityDurationMap.remove(definitionId);
+ }
+ Map<String, Long> activityDurationMap = jbpmConnection
+ .avgDurationPerActivity(definitionId);
+ defActivityDurationMap.put(definitionId, activityDurationMap);
+ if (activityDurationMap != null) {
+ Iterator<Entry<String, Long>> iterator = activityDurationMap
+ .entrySet().iterator();
+ while (iterator.hasNext()) {
+
+ Entry<String, Long> entry = iterator.next();
+ // activity name can be null?
+ String activityName = entry.getKey();
+
+ DiscoveredResourceDetails details = new DiscoveredResourceDetails(
+ context.getResourceType(), activityName, activityName,
+ null, activityName, null, null);
+ activities.add(details);
+ }
+ }
+ return activities;
+ }
+}
\ No newline at end of file
Added: projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ExceptionalJobComponent.java
===================================================================
--- projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ExceptionalJobComponent.java (rev 0)
+++ projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ExceptionalJobComponent.java 2009-08-25 13:08:27 UTC (rev 5533)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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.rhq.plugins.jbpm4;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.pluginapi.operation.OperationFacet;
+import org.rhq.core.pluginapi.operation.OperationResult;
+/**
+ * @author ema(a)redhat.com
+ *
+ */
+public class ExceptionalJobComponent extends JobComponent implements OperationFacet {
+ public OperationResult invokeOperation(String name, Configuration parameters) throws InterruptedException, Exception {
+ OperationResult result = new OperationResult();
+ if ("RETRY".equals(name.toUpperCase())) {
+ jbpmConnection.executeJob(job.getId());
+ }
+ //TODO handle job exception message...
+ if (result.getErrorMessage() == null) {
+ result.setSimpleResult("Success");
+ } else {
+ result.setErrorMessage(job.getException());
+ result.setSimpleResult("Failed");
+ }
+ return result;
+ }
+}
Modified: projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/JobComponent.java
===================================================================
--- projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/JobComponent.java 2009-08-25 09:12:29 UTC (rev 5532)
+++ projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/JobComponent.java 2009-08-25 13:08:27 UTC (rev 5533)
@@ -39,10 +39,10 @@
*
*/
public class JobComponent implements ResourceComponent , MeasurementFacet {
- private ResourceContext resourceContext;
- private Log log = LogFactory.getLog(this.getClass());
- private Job job = null;
- private JBPMEngineConnection jbpmConnection = null;
+ protected ResourceContext resourceContext;
+ protected Log log = LogFactory.getLog(this.getClass());
+ protected Job job = null;
+ protected JBPMEngineConnection jbpmConnection = null;
public void start(ResourceContext resourceContext) {
this.resourceContext = resourceContext;
if (resourceContext.getParentResourceComponent() instanceof ProcessEngineComponent) {
Modified: projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ProcessDefComponent.java
===================================================================
--- projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ProcessDefComponent.java 2009-08-25 09:12:29 UTC (rev 5532)
+++ projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ProcessDefComponent.java 2009-08-25 13:08:27 UTC (rev 5533)
@@ -21,12 +21,14 @@
*/
package org.rhq.plugins.jbpm4;
+import java.util.List;
import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jbpm.api.ProcessDefinition;
import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.history.HistoryProcessInstance;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.measurement.MeasurementDataTrait;
import org.rhq.core.domain.measurement.MeasurementReport;
@@ -75,8 +77,12 @@
report.addData(value);
}
+ if (request.getName().equals("avgPerProcessInstanceDuration")) {
+ String duration = getAverageProcessInstanceDuration() == null ? "--" : String.valueOf(getAverageProcessInstanceDuration());
+ MeasurementDataTrait value = new MeasurementDataTrait(request, duration);
+ report.addData(value);
+ }
}
-
}
@@ -97,7 +103,7 @@
String resourceTypeName = report.getResourceType().getName();
report.setResourceKey(resourceTypeName);
report.setResourceName(resourceTypeName);
- ProcessInstance instance = jbpmConnection.startProcessInstance(this.resourceContext.getResourceKey());
+ ProcessInstance instance = jbpmConnection.startProcessInstance(resourceContext.getResourceKey());
if (instance == null) {
report.setStatus(CreateResourceStatus.FAILURE);
report.setErrorMessage("Failed to start process instance");
@@ -109,8 +115,18 @@
public String getResourceKey() {
return this.resourceContext.getResourceKey();
+ }
+
+ public Long getAverageProcessInstanceDuration() {
+ List<HistoryProcessInstance> instances = this.jbpmConnection.getHistoryProcessInstances(this.getResourceKey(), null, null, false);
+ Long sumDuration = 0L;
+ for (HistoryProcessInstance instance : instances) {
+ sumDuration = sumDuration + instance.getDuration();
+ }
+ if (sumDuration > 0) {
+ return sumDuration/instances.size();
+ }
+ return null;
}
-
-
}
Modified: projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ProcessDeploymentComponent.java
===================================================================
--- projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ProcessDeploymentComponent.java 2009-08-25 09:12:29 UTC (rev 5532)
+++ projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ProcessDeploymentComponent.java 2009-08-25 13:08:27 UTC (rev 5533)
@@ -88,8 +88,7 @@
if (request.getName().equals("state")) {
MeasurementDataTrait value = new MeasurementDataTrait(request,String.valueOf(deployment.getState()));
report.addData(value);
- }
-
+ }
}
}
Modified: projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ProcessInstanceDiscoveryComponent.java
===================================================================
--- projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ProcessInstanceDiscoveryComponent.java 2009-08-25 09:12:29 UTC (rev 5532)
+++ projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ProcessInstanceDiscoveryComponent.java 2009-08-25 13:08:27 UTC (rev 5533)
@@ -42,7 +42,7 @@
ProcessDefComponent defComponent = context.getParentResourceComponent();
List<ProcessInstance> instances = defComponent.getJBPMConnection().getProcessInstances(context.getParentResourceContext().getResourceKey());
for (ProcessInstance instance: instances) {
- DiscoveredResourceDetails details = new DiscoveredResourceDetails(context.getResourceType(), String.valueOf(instance.getId()), instance.getId(), null, instance.getId(), null, null);
+ DiscoveredResourceDetails details = new DiscoveredResourceDetails(context.getResourceType(), String.valueOf(instance.getProcessInstance().getId()), instance.getId(), null, instance.getId(), null, null);
jbpmDefs.add(details);
}
return jbpmDefs;
Added: projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ProcessInstanceHistoryComponent.java
===================================================================
--- projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ProcessInstanceHistoryComponent.java (rev 0)
+++ projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ProcessInstanceHistoryComponent.java 2009-08-25 13:08:27 UTC (rev 5533)
@@ -0,0 +1,121 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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.rhq.plugins.jbpm4;
+
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jbpm.api.Execution;
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.history.HistoryProcessInstance;
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.domain.measurement.MeasurementDataTrait;
+import org.rhq.core.domain.measurement.MeasurementReport;
+import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
+import org.rhq.core.pluginapi.inventory.DeleteResourceFacet;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
+import org.rhq.core.pluginapi.measurement.MeasurementFacet;
+import org.rhq.plugins.jbpm4.connector.JBPMEngineConnection;
+/**
+ * @author ema(a)redhat.com
+ *
+ */
+public class ProcessInstanceHistoryComponent implements ResourceComponent<ProcessDefComponent>, MeasurementFacet {
+ private Log log = LogFactory.getLog(this.getClass());
+ private JBPMEngineConnection jbpmConnection = null;
+ private HistoryProcessInstance instance = null;
+ private String instanceId;
+ public void start(ResourceContext<ProcessDefComponent> resourceContext) {
+ instanceId = resourceContext.getResourceKey();
+ jbpmConnection = resourceContext.getParentResourceComponent().getJBPMConnection();
+ List<HistoryProcessInstance> instanceList = jbpmConnection.getHistoryProcessInstances(null,instanceId,null, false);
+ instance = instanceList.get(0);
+ }
+
+ public void stop() {
+ }
+
+ public AvailabilityType getAvailability() {
+ return AvailabilityType.UP;
+ }
+
+ public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) {
+ for (MeasurementScheduleRequest request : metrics) {
+ if (request.getName().equals("key")) {
+
+ MeasurementDataTrait value = new MeasurementDataTrait(request,
+ String.valueOf(instance.getKey()));
+ report.addData(value);
+ }
+
+ if (request.getName().equals("processDefinitionId")) {
+
+ MeasurementDataTrait value = new MeasurementDataTrait(request,
+ String.valueOf(instance.getProcessDefinitionId()));
+ report.addData(value);
+ }
+
+ if (request.getName().equals("processInstanceId")) {
+
+ MeasurementDataTrait value = new MeasurementDataTrait(request,
+ String.valueOf(instance.getProcessInstanceId()));
+ report.addData(value);
+ }
+
+ if (request.getName().equals("duration")) {
+
+ MeasurementDataTrait value = new MeasurementDataTrait(request,
+ String.valueOf(instance.getDuration()));
+ report.addData(value);
+ }
+
+ if (request.getName().equals("startTime")) {
+
+ MeasurementDataTrait value = new MeasurementDataTrait(request,
+ String.valueOf(instance.getStartTime()));
+ report.addData(value);
+ }
+
+
+ if (request.getName().equals("endTime")) {
+ MeasurementDataTrait value = new MeasurementDataTrait(request,
+ String.valueOf(instance.getEndTime()));
+ report.addData(value);
+ }
+
+ if (request.getName().equals("state")) {
+ MeasurementDataTrait value = new MeasurementDataTrait(request,
+ String.valueOf(instance.getState()));
+ report.addData(value);
+ }
+
+ }
+ }
+
+ public JBPMEngineConnection getJBPMConnection() {
+ return this.jbpmConnection;
+ }
+}
+
Added: projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ProcessInstanceHistoryDiscoveryComponent.java
===================================================================
--- projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ProcessInstanceHistoryDiscoveryComponent.java (rev 0)
+++ projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/ProcessInstanceHistoryDiscoveryComponent.java 2009-08-25 13:08:27 UTC (rev 5533)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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.rhq.plugins.jbpm4;
+
+import java.lang.reflect.Method;
+import java.util.List;
+import java.util.Set;
+
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.history.HistoryProcessInstance;
+import org.jbpm.api.history.HistoryProcessInstanceQuery;
+
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+/**
+ * @author ema(a)redhat.com
+ *
+ */
+public class ProcessInstanceHistoryDiscoveryComponent implements ResourceDiscoveryComponent<ProcessDefComponent> {
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<ProcessDefComponent> context) {
+
+ Set<DiscoveredResourceDetails> historyInstances = new java.util.HashSet<DiscoveredResourceDetails>();
+ ProcessDefComponent defComponent = context.getParentResourceComponent();
+ List<HistoryProcessInstance> historyProcessInstances = defComponent.getJBPMConnection().getHistoryProcessInstances(defComponent.getResourceKey(), null, HistoryProcessInstanceQuery.PROPERTY_STARTTIME, false);
+ for (HistoryProcessInstance instance: historyProcessInstances) {
+ DiscoveredResourceDetails details = new DiscoveredResourceDetails(context.getResourceType(), String.valueOf(instance.getProcessInstanceId()), "ProcessInstance-" + instance.getProcessInstanceId(), null, null, null, null);
+ historyInstances.add(details);
+ }
+ return historyInstances;
+ }
+
+}
Modified: projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/connector/JBPMEngineConnection.java
===================================================================
--- projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/connector/JBPMEngineConnection.java 2009-08-25 09:12:29 UTC (rev 5532)
+++ projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/connector/JBPMEngineConnection.java 2009-08-25 13:08:27 UTC (rev 5533)
@@ -28,6 +28,7 @@
import org.jbpm.api.Deployment;
import org.jbpm.api.ProcessDefinition;
import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.history.HistoryProcessInstance;
import org.jbpm.api.job.Job;
/**
* @author ema(a)redhat.com
@@ -48,4 +49,6 @@
public List<Job> queryJob(boolean timerOnly , boolean messageOnly, boolean exception, String processInstanceId);
Job getJob(String jobId);
Map<String, Long> avgDurationPerActivity(String processDefinitionId);
+ Job executeJob(String jobDbid);
+ List<HistoryProcessInstance> getHistoryProcessInstances(String definitionId, String processInstanceId, String orderBy, boolean orderAsc);
}
Modified: projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/connector/LocalJBPMEngineConnector.java
===================================================================
--- projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/connector/LocalJBPMEngineConnector.java 2009-08-25 09:12:29 UTC (rev 5532)
+++ projects/jopr-integration/trunk/src/main/java/org/rhq/plugins/jbpm4/connector/LocalJBPMEngineConnector.java 2009-08-25 13:08:27 UTC (rev 5533)
@@ -40,7 +40,11 @@
import org.jbpm.api.ProcessDefinition;
import org.jbpm.api.ProcessEngine;
import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.history.HistoryProcessInstance;
+import org.jbpm.api.history.HistoryProcessInstanceQuery;
import org.jbpm.api.job.Job;
+import org.jbpm.pvm.internal.cmd.CommandService;
+import org.jbpm.pvm.internal.cmd.ExecuteJobCmd;
/**
* @author ema(a)redhat.com
*
@@ -172,5 +176,29 @@
public Map<String, Long> avgDurationPerActivity(String processDefinitionId) {
return processEngine.getHistoryService().avgDurationPerActivity(processDefinitionId);
}
+
+ public Job executeJob(String jobDbid) {
+ CommandService commandService = processEngine.get(CommandService.class);
+ return commandService.execute(new ExecuteJobCmd(jobDbid));
+ }
+
+ public List<HistoryProcessInstance> getHistoryProcessInstances(String definitionId, String processInstanceId, String orderBy, boolean orderAsc) {
+ HistoryProcessInstanceQuery historyQuery = processEngine.getHistoryService().createHistoryProcessInstanceQuery();
+ if (definitionId != null) {
+ historyQuery.processDefinitionId(definitionId);
+ }
+ if (processInstanceId != null) {
+ historyQuery.processInstanceId(processInstanceId);
+ }
+
+ if (orderBy != null && orderAsc) {
+ historyQuery.orderAsc(orderBy);
+ }
+ if (orderBy != null && !orderAsc) {
+ historyQuery.orderDesc(orderBy);
+ }
+ return historyQuery.list();
+ }
+
}
Modified: projects/jopr-integration/trunk/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- projects/jopr-integration/trunk/src/main/resources/META-INF/rhq-plugin.xml 2009-08-25 09:12:29 UTC (rev 5532)
+++ projects/jopr-integration/trunk/src/main/resources/META-INF/rhq-plugin.xml 2009-08-25 13:08:27 UTC (rev 5533)
@@ -73,7 +73,8 @@
</service>
<service name="Exceptional Jobs" discovery="ExceptionJobDiscoveryComponent"
- class="JobComponent" subCategory="Jobs" description="JBPM exceptional jobs">
+ class="ExceptionalJobComponent" subCategory="Jobs" description="JBPM exceptional jobs">
+ <operation name="Retry" displayName="Retry" description="Retry this exceptional job" />
<metric property="id" displayName="id" dataType="trait"
displayType="summary" defaultOn="true" description="job id" />
<metric property="duedate" displayName="duedate" dataType="trait"
@@ -87,6 +88,7 @@
dataType="trait" displayType="summary" defaultOn="true" description="job isExclusive" />
<metric property="exception" displayName="exception" dataType="trait"
displayType="summary" defaultOn="true" description="job exception" />
+
</service>
<service name="Process Deployments" discovery="ProcessDeploymentDiscoveryComponent"
@@ -114,6 +116,11 @@
<metric property="description" displayName="description"
dataType="trait" displayType="summary" defaultOn="true"
description="Process definition id" />
+ <metric property="avgPerProcessInstanceDuration" displayName="avgPerProcessInstanceDuration"
+ dataType="measurement" displayType="summary" defaultOn="true"
+ description="Average process instance duration" />
+
+
<service name="Activies" discovery="ActivityDiscoveryComponent"
class="ActivityComponent" description="Process Activity">
@@ -124,6 +131,32 @@
displayType="summary" defaultOn="true" description="Activity average duration" />
</service>
+ <service name="Process Instance History" discovery="ProcessInstanceHistoryDiscoveryComponent"
+ class="ProcessInstanceHistoryComponent" description="Process Instance History">
+
+ <metric property="key" displayName="key" dataType="trait"
+ displayType="summary" defaultOn="true" description="Process instance key" />
+
+ <metric property="processDefinitionId" displayName="processDefinitionId" dataType="trait"
+ displayType="summary" defaultOn="true" description="Process instance defnitionId" />
+
+ <metric property="processInstanceId" displayName="processInstanceId" dataType="trait"
+ displayType="summary" defaultOn="true" description="Process instance id" />
+
+ <metric property="duration" displayName="duration" dataType="trait"
+ displayType="summary" defaultOn="true" description="Process instance duration" />
+
+ <metric property="startTime" displayName="startTime"
+ dataType="trait" displayType="summary" defaultOn="true"
+ description="Process instance start time" />
+
+ <metric property="endTime" displayName="endTime" dataType="trait"
+ displayType="summary" defaultOn="true" description="Process instance end time" />
+
+ <metric property="state" displayName="state" dataType="trait"
+ displayType="summary" defaultOn="true" description="Process instance state" />
+ </service>
+
<service name="Process Instances" discovery="ProcessInstanceDiscoveryComponent"
class="ProcessInstanceComponent" createDeletePolicy="both"
creationDataType="configuration" description="Process Instance">
16 years, 8 months
JBoss JBPM SVN: r5532 - jbpm4/trunk/qa.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-08-25 05:12:29 -0400 (Tue, 25 Aug 2009)
New Revision: 5532
Modified:
jbpm4/trunk/qa/hudson-jbpm4-db.sh
Log:
appolied dos2unix on jbpm4-db hudson job driver script
Modified: jbpm4/trunk/qa/hudson-jbpm4-db.sh
===================================================================
--- jbpm4/trunk/qa/hudson-jbpm4-db.sh 2009-08-25 09:10:01 UTC (rev 5531)
+++ jbpm4/trunk/qa/hudson-jbpm4-db.sh 2009-08-25 09:12:29 UTC (rev 5532)
@@ -1,8 +1,8 @@
-#!/bin/sh
-#
-# runs the smoke test suite
-
-mvn -U -Ddatabase=$DATABASE clean install
-ant -f qa/build.xml $ANT_PROPERTIES database.drop database.create
-mvn -Ddatabase=$DATABASE test
-ant -f qa/build.xml $ANT_PROPERTIES database.drop
+#!/bin/sh
+#
+# runs the smoke test suite
+
+mvn -U -Ddatabase=$DATABASE clean install
+ant -f qa/build.xml $ANT_PROPERTIES database.drop database.create
+mvn -Ddatabase=$DATABASE test
+ant -f qa/build.xml $ANT_PROPERTIES database.drop
16 years, 8 months
JBoss JBPM SVN: r5531 - jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-08-25 05:10:01 -0400 (Tue, 25 Aug 2009)
New Revision: 5531
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/Launcher.java
Log:
improved command logging of launcher used by ant tasks
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/Launcher.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/Launcher.java 2009-08-25 09:05:41 UTC (rev 5530)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/ant/Launcher.java 2009-08-25 09:10:01 UTC (rev 5531)
@@ -44,11 +44,11 @@
}
public void run() {
+ String logCommand = "";
+ for (String commandPart: command) {
+ logCommand += commandPart+" ";
+ }
try {
- String logCommand = "";
- for (String commandPart: command) {
- logCommand += commandPart+" ";
- }
task.log("starting '" + logCommand + "'...");
Process process = new ProcessBuilder(command)
.redirectErrorStream(true)
@@ -64,7 +64,7 @@
task.log("'" + command[0] + "' started.");
} catch (IOException e) {
- throw new BuildException("couldn't start '" + command + "'", e);
+ throw new BuildException("couldn't start '" + logCommand + "'", e);
}
}
}
16 years, 8 months