JBoss JBPM SVN: r3354 - jbpm3/trunk/modules/distribution/src/main/resources/installer.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-12-12 04:36:19 -0500 (Fri, 12 Dec 2008)
New Revision: 3354
Modified:
jbpm3/trunk/modules/distribution/src/main/resources/installer/install-definition.xml
Log:
Deploy the spec integration in the bpm-service.sar
Modified: jbpm3/trunk/modules/distribution/src/main/resources/installer/install-definition.xml
===================================================================
--- jbpm3/trunk/modules/distribution/src/main/resources/installer/install-definition.xml 2008-12-12 08:26:18 UTC (rev 3353)
+++ jbpm3/trunk/modules/distribution/src/main/resources/installer/install-definition.xml 2008-12-12 09:36:19 UTC (rev 3354)
@@ -188,14 +188,6 @@
<description>The jBPM3 JBoss Integration</description>
- <!-- server/lib -->
- <fileset dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/lib" override="true">
- <include name="bpm-spec-api.jar" />
- <include name="bpm-spec-integration-jboss42.jar" />
- <include name="slf4j-api.jar" />
- <include name="slf4j-log4j12.jar" />
- </fileset>
-
<!-- jbpm/jbpm-integration.beans -->
<fileset dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-integration.beans" override="true">
<include name="bpm-spec-dialect-api10.jar" />
@@ -214,8 +206,12 @@
<include name="bpm-process-deployer.xml" />
</fileset>
<fileset dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-service.sar" override="true">
+ <include name="bpm-spec-api.jar" />
+ <include name="bpm-spec-integration-jboss42.jar" />
<include name="jbpm-jpdl.jar" />
<include name="jbpm-identity.jar" />
+ <include name="slf4j-api.jar" />
+ <include name="slf4j-log4j12.jar" />
</fileset>
<file src="@{deploy.artifacts.dir}/lib/jbpm-identity-service.zip" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-service.sar"
unpack="true" override="true" />
17 years, 4 months
JBoss JBPM SVN: r3353 - in jbpm3/trunk/modules: enterprise/src/test/java/org/jbpm/enterprise and 7 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-12-12 03:26:18 -0500 (Fri, 12 Dec 2008)
New Revision: 3353
Added:
jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/deployment/
jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/deployment/DeploymentPARTest.java
jbpm3/trunk/modules/enterprise/src/test/resources/deployment/
jbpm3/trunk/modules/enterprise/src/test/resources/enterprise/
jbpm3/trunk/modules/enterprise/src/test/resources/enterprise/WEB-INF/
Removed:
jbpm3/trunk/modules/enterprise/src/test/resources/WEB-INF/
jbpm3/trunk/modules/integration/src/test/resources/jndi.properties
Modified:
jbpm3/trunk/modules/enterprise/scripts/antrun-test-jars.xml
jbpm3/trunk/modules/integration/pom.xml
jbpm3/trunk/modules/integration/src/test/java/org/jbpm/test/integration/spec/deployment/DeploymentPARTest.java
Log:
Mode deployment tests to enterprise
Modified: jbpm3/trunk/modules/enterprise/scripts/antrun-test-jars.xml
===================================================================
--- jbpm3/trunk/modules/enterprise/scripts/antrun-test-jars.xml 2008-12-12 05:58:44 UTC (rev 3352)
+++ jbpm3/trunk/modules/enterprise/scripts/antrun-test-jars.xml 2008-12-12 08:26:18 UTC (rev 3353)
@@ -21,18 +21,23 @@
<mkdir dir="${tests.output.dir}/test-libs"/>
<!-- enterprise-test -->
- <war warfile="${tests.output.dir}/test-libs/enterprise-test.war" webxml="${tests.resources.dir}/WEB-INF/web.xml">
+ <war warfile="${tests.output.dir}/test-libs/enterprise-test.war" webxml="${tests.resources.dir}/enterprise/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes" />
<lib dir="${tests.output.dir}/test-dependencies">
<include name="aspectjrt*.jar"/>
<include name="cactus*.jar"/>
<include name="junit*.jar"/>
</lib>
- <webinf dir="${tests.resources.dir}/WEB-INF">
+ <webinf dir="${tests.resources.dir}/enterprise/WEB-INF">
<exclude name="web.xml"/>
</webinf>
</war>
+ <!-- fork-join-example -->
+ <jar jarfile="${tests.output.dir}/test-libs/fork-join-example.par">
+ <fileset dir="${tests.resources.dir}/deployment/fork-join-example"/>
+ </jar>
+
<!-- Please add alphabetically -->
</target>
Copied: jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/deployment/DeploymentPARTest.java (from rev 3352, jbpm3/trunk/modules/integration/src/test/java/org/jbpm/test/integration/spec/deployment/DeploymentPARTest.java)
===================================================================
--- jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/deployment/DeploymentPARTest.java (rev 0)
+++ jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/deployment/DeploymentPARTest.java 2008-12-12 08:26:18 UTC (rev 3353)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.enterprise.deployment;
+
+// $Id$
+
+import org.jboss.bpm.api.test.IntegrationTestCase;
+
+/**
+ * Test simple PAR deployment
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Nov-2008
+ */
+public class DeploymentPARTest extends IntegrationTestCase
+{
+ public void testRemoteDeploy() throws Exception
+ {
+ deploy("fork-join-example.par");
+ }
+
+ public void testRemoteUndeploy() throws Exception
+ {
+ undeploy("fork-join-example.par");
+ }
+}
Property changes on: jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/deployment/DeploymentPARTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm3/trunk/modules/enterprise/src/test/resources/deployment (from rev 3352, jbpm3/trunk/modules/integration/src/test/resources/deployment)
Property changes on: jbpm3/trunk/modules/enterprise/src/test/resources/deployment
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: jbpm3/trunk/modules/enterprise/src/test/resources/enterprise/WEB-INF (from rev 3352, jbpm3/trunk/modules/enterprise/src/test/resources/WEB-INF)
Modified: jbpm3/trunk/modules/integration/pom.xml
===================================================================
--- jbpm3/trunk/modules/integration/pom.xml 2008-12-12 05:58:44 UTC (rev 3352)
+++ jbpm3/trunk/modules/integration/pom.xml 2008-12-12 08:26:18 UTC (rev 3353)
@@ -212,29 +212,6 @@
<!-- Profiles -->
<profiles>
-
- <!--
- Name: no-jboss-bind-address
- Descr: Skip tests if no jboss.bind address is given
- -->
- <profile>
- <id>no-jboss-bind-address</id>
- <activation>
- <property>
- <name>!jboss.bind.address</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skipTests>true</skipTests>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
+ </profiles>
- </profiles>
</project>
Modified: jbpm3/trunk/modules/integration/src/test/java/org/jbpm/test/integration/spec/deployment/DeploymentPARTest.java
===================================================================
--- jbpm3/trunk/modules/integration/src/test/java/org/jbpm/test/integration/spec/deployment/DeploymentPARTest.java 2008-12-12 05:58:44 UTC (rev 3352)
+++ jbpm3/trunk/modules/integration/src/test/java/org/jbpm/test/integration/spec/deployment/DeploymentPARTest.java 2008-12-12 08:26:18 UTC (rev 3353)
@@ -33,7 +33,7 @@
import org.jboss.bpm.api.model.ProcessInstance;
import org.jboss.bpm.api.runtime.Token;
import org.jboss.bpm.api.service.DeploymentService;
-import org.jboss.bpm.api.test.IntegrationTestCase;
+import org.jboss.bpm.api.test.APITestCase;
import org.jboss.bpm.incubator.service.TaskInstanceService;
/**
@@ -42,7 +42,7 @@
* @author thomas.diesler(a)jboss.com
* @since 24-Nov-2008
*/
-public class DeploymentPARTest extends IntegrationTestCase
+public class DeploymentPARTest extends APITestCase
{
public void testSimplePARDeploy() throws Exception
@@ -76,16 +76,6 @@
assertTrue("Undeploy successful", depService.undeploy(dep));
}
- public void testRemoteDeploy() throws Exception
- {
- deploy("fork-join-example.par");
- }
-
- public void testRemoteUndeploy() throws Exception
- {
- undeploy("fork-join-example.par");
- }
-
private Token getChildToken(Token token, String nodeName)
{
Map<String, Token> childToks = new HashMap<String, Token>();
Deleted: jbpm3/trunk/modules/integration/src/test/resources/jndi.properties
===================================================================
--- jbpm3/trunk/modules/integration/src/test/resources/jndi.properties 2008-12-12 05:58:44 UTC (rev 3352)
+++ jbpm3/trunk/modules/integration/src/test/resources/jndi.properties 2008-12-12 08:26:18 UTC (rev 3353)
@@ -1,3 +0,0 @@
-java.naming.provider.url=jnp://@jboss.bind.address@:1099
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.factory.url.pkgs=org.jboss.naming.client
17 years, 4 months
JBoss JBPM SVN: r3352 - jbpm4/trunk/modules/distro.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2008-12-12 00:58:44 -0500 (Fri, 12 Dec 2008)
New Revision: 3352
Modified:
jbpm4/trunk/modules/distro/assembly-distro-package.xml
jbpm4/trunk/modules/distro/assembly-jbpm-single-jar.xml
jbpm4/trunk/modules/distro/pom.xml
Log:
packaged task classes in jbpm.jar and sources in jbpm-distro
Modified: jbpm4/trunk/modules/distro/assembly-distro-package.xml
===================================================================
--- jbpm4/trunk/modules/distro/assembly-distro-package.xml 2008-12-12 00:20:39 UTC (rev 3351)
+++ jbpm4/trunk/modules/distro/assembly-distro-package.xml 2008-12-12 05:58:44 UTC (rev 3352)
@@ -111,6 +111,14 @@
<outputDirectory>src</outputDirectory>
</fileSet>
<fileSet>
+ <directory>../task/src/main/java</directory>
+ <outputDirectory>src</outputDirectory>
+ </fileSet>
+ <fileSet>
+ <directory>../task/src/main/resources</directory>
+ <outputDirectory>src</outputDirectory>
+ </fileSet>
+ <fileSet>
<directory>../test-base/src/main/java</directory>
<outputDirectory>src</outputDirectory>
</fileSet>
Modified: jbpm4/trunk/modules/distro/assembly-jbpm-single-jar.xml
===================================================================
--- jbpm4/trunk/modules/distro/assembly-jbpm-single-jar.xml 2008-12-12 00:20:39 UTC (rev 3351)
+++ jbpm4/trunk/modules/distro/assembly-jbpm-single-jar.xml 2008-12-12 05:58:44 UTC (rev 3352)
@@ -37,6 +37,13 @@
</dependencySet>
<dependencySet>
<includes>
+ <include>org.jbpm.jbpm4:jbpm-task</include>
+ </includes>
+ <unpack>true</unpack>
+ <outputDirectory></outputDirectory>
+ </dependencySet>
+ <dependencySet>
+ <includes>
<include>org.jbpm.jbpm4:jbpm-test-base</include>
</includes>
<unpack>true</unpack>
Modified: jbpm4/trunk/modules/distro/pom.xml
===================================================================
--- jbpm4/trunk/modules/distro/pom.xml 2008-12-12 00:20:39 UTC (rev 3351)
+++ jbpm4/trunk/modules/distro/pom.xml 2008-12-12 05:58:44 UTC (rev 3352)
@@ -68,6 +68,11 @@
</dependency>
<dependency>
<groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-task</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-test-db</artifactId>
<version>${version}</version>
</dependency>
@@ -127,4 +132,4 @@
<reporting>
</reporting>
-</project>
\ No newline at end of file
+</project>
17 years, 4 months
JBoss JBPM SVN: r3351 - jbpm4/trunk/modules/userguide/src/main/docbook/en/modules.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-12-11 19:20:39 -0500 (Thu, 11 Dec 2008)
New Revision: 3351
Modified:
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml
Log:
fixed gpd installation docs
Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml 2008-12-11 22:02:01 UTC (rev 3350)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml 2008-12-12 00:20:39 UTC (rev 3351)
@@ -55,117 +55,91 @@
</section>
</section>
- <section id="eclipse">
+ <section id="graphicalprocessdesigner">
<title>Graphical Process Designer (GPD)</title>
<para>Eclipse is used as the platform to host the jPDL graphical process
- designer. This section will describe how to obtain Eclipse and install
+ designer. This section will describe how to obtain Eclipse, install it
the GPD.</para>
<section>
- <title>Obtaining Eclipse</title>
- <para>If you have already an Eclipse installation and you want to
- install the GPD in that one, please first make sure that your installation
- includes an XML editor. An XML editor comes in handy if you want to add
- technical details to the process files that are produced by the GPD.
- If you have one of those you can safely skip the rest of this section and
- directly proceed with the GPD installation. If you don't have one
- yet, there are two ways of getting it.</para>
- <section>
- <title>Use the jBPM Installer</title>
- <para>TODO</para>
- </section>
- <section>
- <title>Download Eclipse</title>
- <para>You can download Eclipse from http://www.eclipse.org/downloads/.
- We recommend to download either the Eclipse IDE for Java EE Developers
- or the Eclipse IDE for Java Developers over the Eclipse Classic as the
- former two contain an XML editor while the latter doesn't.</para>
+ <title>Download Eclipse</title>
+ <para>You'll need Eclipse 3.4.1.
+ </para>
+ <para>Download the
+ <ulink url="http://www.eclipse.org/downloads/download.php?file=/technology/epp/downlo...">Eclipse IDE for Java Developers (85 MB)</ulink> or
+ <ulink url="http://www.eclipse.org/downloads/download.php?file=/technology/epp/downlo...">Eclipse IDE for Java EE Developers (163 MB)</ulink>.
+ </para>
+ <para>The classic version of eclipse will not be sufficient as it does
+ not have an XML editor.
+ </para>
</section>
<section>
- <title>GPD Installation</title>
+ <title>Add the update site <literal>gpd/jbpm-gpd-site.zip</literal></title>
<para>The installation of the GPD uses the Eclipse Software Update
- mechanism and is pretty straightforward. An archived update site
- containing the different Eclipse plugins that you need is shipped
- with the jBPM download. You will find it in the gpd subfolder of the
- distribution. The site is called jbpm-gpd-site.zip.</para>
- <para>To do the installation, fire up Eclipse and choose
- 'Help->Software Updates'. On the following dialog, select the
- 'Available Software' tab and push the 'Add Site...' button. In the
- 'Add Site' dialog, push the 'Archive...' button. Then, navigate to the
- jbpm-gpd-site.zip file mentioned above and select it. Push 'OK' to
- come back to the 'Software Updates and Add-ons' dialog. Select the
- 'jPDL 4 GPD Update Site' that has appeared and push the 'Install...'
- button. Eclipse will calculate the needed dependencies and open the
- 'Install' dialog. Make sure both the 'Flow Common Feature' and the
- 'jPDL 4 Feature' are selected and push the 'Next' button. On the
- next screen, select the 'Accept...' radio button and push 'Finish'
- to complete the installation. Restart your Eclipse and you are all set.
+ mechanism and is pretty straightforward. There is an archived update
+ site included in the runtime installation of jBPM when you unzip it
+ at <literal>gpd/jbpm-gpd-site.zip</literal>
+ </para>
+ <para>To add the update site to eclipse:
+ </para>
+ <itemizedlist>
+ <listitem><literal>Help</literal> --> <literal>Software Updates</literal></listitem>
+ <listitem>Select tab <literal>Available Software</literal></listitem>
+ <listitem>Click <literal>Add Site...</literal> </listitem>
+ <listitem>In dialog <literal>Add Site</literal> dialog, click <literal>Archive...</literal></listitem>
+ <listitem>Navigate to <literal>gpd/jbpm-gpd-site.zip</literal></listitem>
+ <listitem>Clicking <literal>OK</literal> will bring you back to the dialog 'Software Updates and Add-ons'</listitem>
+ <listitem>Select the <literal>jPDL 4 GPD Update Site</literal> that has appeared</listitem>
+ <listitem>Click <literal>Install...</literal> </listitem>
+ <listitem>In dialog <literal>Install</literal>, select <literal>Flow Common Feature</literal>
+ and <literal>jPDL 4 Feature</literal></listitem>
+ <listitem>Click <literal>Next</literal></listitem>
+ <listitem>Select <literal>Accept</literal> and click <literal>Finish</literal></listitem>
+ <listitem>Restart eclipse</listitem>
+ </itemizedlist>
</section>
<section>
- <title>Workspace</title>
- <para>In this section we will show you a possible setup of your
- workspace. This includes the definition of a user library containing
- the dependencies that you might need while developing jPDL applications
- and importing the examples from the distribution in a newly created
- project.</para>
- <section>
- <title>Define the jBPM User Library</title>
- <para>This section shows how to define a library for your workspace
- that contains the jBPM classes as well as its dependencies. If you
- create a new Java project, it will be sufficient to add this user
- library to the build path of your project for things to compile
- smoothly.</para>
- <para>Open the Eclipse preferences dialog and navigate to the
- 'Java->Build Path->User Libraries' page. Push the 'New...' button
- and choose a name e.g. 'jBPM Libraries'. Push the 'Add JARs...'
- button and navigate to the 'lib' folder within your jBPM installation.
- Select all the jar files in this folder and push the 'Open' button
- to include them.</para>
- <para>So far we have added all the jBPM dependencies.
- Now let's add the jBPM classes themselves and attach the sources so
- we can easily navigate to them when we are debugging. Select the
- 'jBPM Libraries' entry and push the 'Add JARs...' button again.
- This time select the jbpm.jar file in the root of your jBPM installation
- and push the 'Open' button again. Next, select the 'Source attachment'
- entry under the jbpm.jar file that we just added and push the 'Edit...'
- button. The 'Source Attachment Configuration' dialog opens. Select the
- 'External Folder...' button and navigate to the 'src' folder in your
- jBPM installation. Select 'Choose' and twice 'OK' to close all the open
- dialogs.</para>
- <para>Now that we have done all these steps we are ready to create
- projects and add this newly created user library to the build path of
- these projects. Let's start doing this in the next section while
- importing the examples.</para>
- </section>
- <section>
- <title>Importing the Examples</title>
- <para>In this section we will create a Java project in our Eclipse
- workspace and import the jBPM examples that came with the distribution.</para>
- <para>Bring up the 'New Java Project' wizard by selecting
- 'File->New->Java Project'. Choose a name for your project,
- e.g. jbpm-examples and push the 'Finish' button. Next bring up the
- properties dialog for the newly created project by selecting it and
- choosing 'File->Properties...'. In this properties dialog, select the
- 'Java Build Path' page, then the tab 'Libraries' and push the
- 'Add Library...' button. The 'Add Library' wizard opens. Select
- 'User Library' and push the 'Next >' button. On the following page
- select the 'jBPM Libraries' entry and push finish. Push the 'OK' button
- to close the properties dialog. We have successfully added the jBPM classes
- and their dependencies to our newly created Java project. Next, let's
- import the examples.
- <para>Select the 'src' folder in the jbpm-examples project and then the
- 'File->Import...' menu. The 'Import' wizard opens. Select
- 'General->File System' and push the 'Next >' button.
- On the following page, push the 'Browse...' button next to
- the 'From directory' text field and navigate to the 'examples/src' folder
- of your jBPM installation. Push the 'Choose' button to select it. Check
- the checkbox next to the 'src' entry that appears. Also, make sure that the
- 'Into folder' text field refers to the 'src' folder of the jbpm-examples
- project. Push the 'Finish' button to complete the import.
- </para>
- <para>That's it. Now you are ready to look at the examples and take it
- from there.</para>
- </section>
+ <title>Define the jBPM User Library</title>
+ <para>This section shows how to define a user library for your workspace
+ that is a placeholder for the jBPM library as well as its dependencies.
+ If you create a new Java project, it will be sufficient to add this user
+ library to the build path.
+ </para>
+ <itemizedlist>
+ <listitem>Click <literal>Window</literal> --> <literal>Preferences</literal> </listitem>
+ <listitem>Select <literal>Java</literal> --> <literal>Build Path</literal> --> <literal>User Libraries</literal> </listitem>
+ <listitem>Click <literal>New...</literal> </listitem>
+ <listitem>Type name <literal>jBPM Libraries</literal> </listitem>
+ <listitem>Click <literal>Add JARs...</literal> </listitem>
+ <listitem>Navigate to the 'lib' folder of your jBPM installation</listitem>
+ <listitem>Select all jar files and click <literal>Open</literal> </listitem>
+ <listitem>Select the <literal>jBPM Libraries</literal> entry</listitem>
+ <listitem>Click <literal>Add JARs...</literal> again</listitem>
+ <listitem>Select the <literal>jbpm.jar</literal> file in the root of your jBPM installation</listitem>
+ <listitem>Click <literal>Open</literal> </listitem>
+ <listitem>Select entry <literal>Source attachment</literal> under <literal>jbpm.jar</literal> </listitem>
+ <listitem>Click <literal>Edit</literal> </listitem>
+ <listitem>In dialog <literal>Source Attachment Configuration</literal>, click <literal>External Folder...</literal> </listitem>
+ <listitem>Navigate to the <literal>src</literal> folder in your jBPM installation</listitem>
+ <listitem>Click <literal>Choose</literal> </listitem>
+ <listitem>Click <literal>OK</literal> twice to close all the open dialogs</listitem>
+ </itemizedlist>
</section>
+ <section>
+ <title>Importing the Examples</title>
+ <para>In this section we will import the examples project in the
+ installation in Eclipse
+ </para>
+ <itemizedlist>
+ <listitem>Select <literal>File</literal> --> <literal>Import...</literal> </listitem>
+ <listitem>Select <literal>General</literal> --> <literal>Existing Projects into Workspace</literal> </listitem>
+ <listitem>Click <literal>Next</literal></listitem>
+ <listitem>Click <literal>Browse...</literal> to select a root directory</listitem>
+ <listitem>Navigate to the jBPM root installation directory</listitem>
+ <listitem>Click <literal>OK</literal> </listitem>
+ <listitem>The <literal>examples</literal> project is automatically found and selected</listitem>
+ <listitem>Click <literal>Finish</literal> </listitem>
+ </itemizedlist>
+ <para>You're all set to start playing with the coolest Java process technology!</para>
+ </section>
</section>
-
</chapter>
\ No newline at end of file
17 years, 4 months
JBoss JBPM SVN: r3350 - in jbpm4/trunk/modules: examples/src/test/java/org/jbpm/examples/state and 6 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-12-11 17:02:01 -0500 (Thu, 11 Dec 2008)
New Revision: 3350
Added:
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/sequence/
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/sequence/StateSequenceTest.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/state/sequence/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/state/sequence/process.jpdl.xml
Removed:
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/states/StateSequenceTest.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/states/process.jpdl.xml
Modified:
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/processinstance/EndProcessInstanceTest.java
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml
Log:
more examples
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/processinstance/EndProcessInstanceTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/processinstance/EndProcessInstanceTest.java 2008-12-11 21:04:38 UTC (rev 3349)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/processinstance/EndProcessInstanceTest.java 2008-12-11 22:02:01 UTC (rev 3350)
@@ -30,33 +30,10 @@
*/
public class EndProcessInstanceTest extends DbTestCase {
- public void testEndOk() {
- deployJpdlResource("org/jbpm/examples/end/multiple/process.jpdl.xml");
+ public void testEndProcessInstance() {
+ deployJpdlResource("org/jbpm/examples/end/processinstance/process.jpdl.xml");
- Execution execution = executionService.startExecutionByKey("EndMultiple");
- String executionId = execution.getId();
-
- execution = executionService.signalExecutionById(executionId, "200");
- assertEquals("ok", execution.getNodeName());
+ Execution execution = executionService.startExecutionByKey("EndProcessInstance");
+ assertTrue(execution.isEnded());
}
-
- public void testEndBadRequest() {
- deployJpdlResource("org/jbpm/examples/end/multiple/process.jpdl.xml");
-
- Execution execution = executionService.startExecutionByKey("EndMultiple");
- String executionId = execution.getId();
-
- execution = executionService.signalExecutionById(executionId, "400");
- assertEquals("bad request", execution.getNodeName());
- }
-
- public void testEndInternalServerError() {
- deployJpdlResource("org/jbpm/examples/end/multiple/process.jpdl.xml");
-
- Execution execution = executionService.startExecutionByKey("EndMultiple");
- String executionId = execution.getId();
-
- execution = executionService.signalExecutionById(executionId, "500");
- assertEquals("internal server error", execution.getNodeName());
- }
}
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/sequence/StateSequenceTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/sequence/StateSequenceTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/sequence/StateSequenceTest.java 2008-12-11 22:02:01 UTC (rev 3350)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.examples.state.sequence;
+
+import org.jbpm.Execution;
+import org.jbpm.test.DbTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class StateSequenceTest extends DbTestCase {
+
+ public void testWaitStatesSequence() {
+ deployJpdlResource("org/jbpm/examples/state/sequence/process.jpdl.xml");
+
+ Execution execution = executionService.startExecutionByKey("StateSequence");
+ assertEquals("a", execution.getNodeName());
+
+ String executionId = execution.getId();
+ execution = executionService.signalExecutionById(executionId);
+ assertEquals("b", execution.getNodeName());
+
+ execution = executionService.signalExecutionById(executionId);
+ assertEquals("c", execution.getNodeName());
+ }
+
+}
Deleted: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/states/StateSequenceTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/states/StateSequenceTest.java 2008-12-11 21:04:38 UTC (rev 3349)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/states/StateSequenceTest.java 2008-12-11 22:02:01 UTC (rev 3350)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.examples.state.sequence;
-
-import org.jbpm.Execution;
-import org.jbpm.test.DbTestCase;
-
-
-/**
- * @author Tom Baeyens
- */
-public class StateSequenceTest extends DbTestCase {
-
- public void testWaitStatesSequence() {
- deployJpdlResource("org/jbpm/examples/state/sequence/process.jpdl.xml");
-
- Execution execution = executionService.startExecutionByKey("StateSequence");
- assertEquals("a", execution.getNodeName());
-
- String executionId = execution.getId();
- execution = executionService.signalExecutionById(executionId);
- assertEquals("b", execution.getNodeName());
-
- execution = executionService.signalExecutionById(executionId);
- assertEquals("c", execution.getNodeName());
- }
-
-}
Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/state/sequence/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/state/sequence/process.jpdl.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/state/sequence/process.jpdl.xml 2008-12-11 22:02:01 UTC (rev 3350)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="StateSequence" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="a" />
+ </start>
+
+ <state name="a">
+ <flow to="b" />
+ </state>
+
+ <state name="b">
+ <flow to="c" />
+ </state>
+
+ <state name="c" />
+
+</process>
Deleted: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/states/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/states/process.jpdl.xml 2008-12-11 21:04:38 UTC (rev 3349)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/states/process.jpdl.xml 2008-12-11 22:02:01 UTC (rev 3350)
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<process name="StateSequence" xmlns="http://jbpm.org/4/jpdl">
-
- <start>
- <flow to="a" />
- </start>
-
- <state name="a">
- <flow to="b" />
- </state>
-
- <state name="b">
- <flow to="c" />
- </state>
-
- <state name="c" />
-
-</process>
Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml 2008-12-11 21:04:38 UTC (rev 3349)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml 2008-12-11 22:02:01 UTC (rev 3350)
@@ -462,6 +462,16 @@
are still active within the same process instance, all of
them will be ended.
</para>
+ <programlisting><process name="EndProcessInstance" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="end" />
+ </start>
+
+ <end name="end" />
+
+</process></programlisting>
+ <para>When a new process instance is created, it immediately ends.</para>
</section>
<section id="endexecution">
<title><literal>end</literal> execution</title>
@@ -470,16 +480,65 @@
should be left active. To get this behaviour, set
attribute <literal>ends="execution"</literal>
</para>
+ <table><title><literal>end</literal> execution attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>ends</literal></entry>
+ <entry>{processinstance|execution}</entry>
+ <entry>processinstance</entry>
+ <entry>optional</entry>
+ <entry>specifies if the whole process instance should be ended or
+ just the path of execution that arrives in the end activity.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
</section>
<section id="endmultiple">
<title><literal>end</literal> multiple</title>
- <para>TODO
+ <para>A process can have multiple end states. This can be handy to indicate
+ different outcomes of a process instance. For example
</para>
+ <programlisting></programlisting>
</section>
<section id="endstate">
<title><literal>end</literal> state</title>
<para>TODO
</para>
+ <table><title><literal>end</literal> execution attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>state</literal></entry>
+ <entry>String</entry>
+ <entry></entry>
+ <entry>optional</entry>
+ <entry>the state assigned to the execution.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
</section>
</section>
17 years, 4 months
JBoss JBPM SVN: r3349 - projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/public.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-12-11 16:04:38 -0500 (Thu, 11 Dec 2008)
New Revision: 3349
Modified:
projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/public/Application.html
Log:
Fix JBPM-1915: GWT console is blank in Firefox 3
Modified: projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/public/Application.html
===================================================================
--- projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/public/Application.html 2008-12-11 20:49:46 UTC (rev 3348)
+++ projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/public/Application.html 2008-12-11 21:04:38 UTC (rev 3349)
@@ -18,7 +18,9 @@
<!-- If you add any GWT meta tags, they must -->
<!-- be added before this line. -->
<!-- -->
- <script language='javascript' src='org.jboss.bpm.console.Application.nocache.js'/>
+ <script language='javascript' src='org.jboss.bpm.console.Application.nocache.js'>
+
+ </script>
<link rel="stylesheet" href="console.css" type="text/css">
17 years, 4 months
JBoss JBPM SVN: r3348 - projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-12-11 15:49:46 -0500 (Thu, 11 Dec 2008)
New Revision: 3348
Modified:
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
Log:
use ConsoleLog in DTOParser
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2008-12-11 17:02:03 UTC (rev 3347)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2008-12-11 20:49:46 UTC (rev 3348)
@@ -22,7 +22,6 @@
package org.jboss.bpm.console.client.model;
import com.google.gwt.json.client.*;
-import com.allen_sauer.gwt.log.client.Log;
import org.jboss.bpm.console.client.util.ConsoleLog;
import org.jboss.bpm.console.client.model.forms.FieldDef;
import org.jboss.bpm.console.client.model.forms.FormDef;
@@ -132,7 +131,7 @@
JSONValue jsonValue = arr.get(k);
if(jsonValue.toString().equals("null"))
{
- Log.warn("FIXME JBPM-1828: Null value on transitionNames:" +arr.toString());
+ ConsoleLog.debug("FIXME JBPM-1828: Null value on transitionNames:" +arr.toString());
continue; // TODO: JBPM-1828
}
JSONString t = jsonValue.isString();
@@ -238,7 +237,7 @@
JSONValue jsonValue = signals.get(i);
if(jsonValue.toString().equals("null"))
{
- Log.warn("FIXME JBPM-1828: Null value on availableSignals:" +signals.toString());
+ ConsoleLog.debug("FIXME JBPM-1828: Null value on availableSignals:" +signals.toString());
continue; // TODO: JBPM-1828
}
JSONString item = jsonValue.isString();
@@ -269,7 +268,7 @@
JSONValue jsonValue = jsonArray.get(i);
if(jsonValue.toString().equals("null"))
{
- Log.warn("FIXME JBPM-1828: Null value on string array:" +jsonArray.toString());
+ ConsoleLog.debug("FIXME JBPM-1828: Null value on string array:" +jsonArray.toString());
continue; // TODO: JBPM-1828
}
JSONString item = jsonValue.isString();
17 years, 4 months
JBoss JBPM SVN: r3347 - in jbpm4/trunk/modules/examples/src/test: resources/org/jbpm/examples/states and 1 other directory.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-12-11 12:02:03 -0500 (Thu, 11 Dec 2008)
New Revision: 3347
Removed:
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/states/StatesTest.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/states/states.jpdl.xml
Log:
more examples
Deleted: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/states/StatesTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/states/StatesTest.java 2008-12-11 16:58:56 UTC (rev 3346)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/states/StatesTest.java 2008-12-11 17:02:03 UTC (rev 3347)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.examples.states;
-
-import org.jbpm.Execution;
-import org.jbpm.test.DbTestCase;
-
-
-/**
- * @author Tom Baeyens
- */
-public class StatesTest extends DbTestCase {
-
- public void testWaitStatesSequence() {
- deployJpdlResource("org/jbpm/examples/states/states.jpdl.xml");
-
- Execution execution = executionService.startExecutionByKey("states");
- assertEquals("a", execution.getNodeName());
-
- String executionId = execution.getId();
- execution = executionService.signalExecutionById(executionId);
- assertEquals("b", execution.getNodeName());
-
- execution = executionService.signalExecutionById(executionId);
- assertEquals("c", execution.getNodeName());
- }
-
-}
Deleted: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/states/states.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/states/states.jpdl.xml 2008-12-11 16:58:56 UTC (rev 3346)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/states/states.jpdl.xml 2008-12-11 17:02:03 UTC (rev 3347)
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<process name="states" xmlns="http://jbpm.org/4/jpdl">
-
- <start>
- <flow to="a" />
- </start>
-
- <state name="a">
- <flow to="b" />
- </state>
-
- <state name="b">
- <flow to="c" />
- </state>
-
- <state name="c" />
-
-</process>
17 years, 4 months
JBoss JBPM SVN: r3346 - in jbpm4/trunk/modules/examples/src/test: java/org/jbpm/examples/end/processinstance and 11 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-12-11 11:58:56 -0500 (Thu, 11 Dec 2008)
New Revision: 3346
Added:
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/multiple/EndMultipleTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/processinstance/EndProcessInstanceTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/state/EndStateTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/expression/ExclusiveExpressionTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/handler/ContentEvaluation.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/handler/ExclusiveHandlerTest.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/end/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/end/multiple/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/end/multiple/process.jpdl.xml
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/end/processinstance/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/end/processinstance/process.jpdl.xml
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/end/state/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/end/state/process.jpdl.xml
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/exclusive/expression/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/exclusive/expression/process.jpdl.xml
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/exclusive/handler/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/exclusive/handler/process.jpdl.xml
Log:
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/multiple/EndMultipleTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/multiple/EndMultipleTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/multiple/EndMultipleTest.java 2008-12-11 16:58:56 UTC (rev 3346)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.examples.end.multiple;
+
+import org.jbpm.Execution;
+import org.jbpm.test.DbTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class EndMultipleTest extends DbTestCase {
+
+ public void testEndMultipleOk() {
+ deployJpdlResource("org/jbpm/examples/end/multiple/process.jpdl.xml");
+
+ Execution execution = executionService.startExecutionByKey("EndMultiple");
+ String executionId = execution.getId();
+ execution = executionService.signalExecutionById(executionId, "200");
+ assertTrue(execution.isEnded());
+ assertEquals("ok", execution.getNodeName());
+ }
+
+ public void testEndMultipleBadRequest() {
+ deployJpdlResource("org/jbpm/examples/end/multiple/process.jpdl.xml");
+
+ Execution execution = executionService.startExecutionByKey("EndMultiple");
+ String executionId = execution.getId();
+ execution = executionService.signalExecutionById(executionId, "400");
+ assertTrue(execution.isEnded());
+ assertEquals("bad request", execution.getNodeName());
+ }
+
+ public void testEndMultipleInternalServerError() {
+ deployJpdlResource("org/jbpm/examples/end/multiple/process.jpdl.xml");
+
+ Execution execution = executionService.startExecutionByKey("EndMultiple");
+ String executionId = execution.getId();
+ execution = executionService.signalExecutionById(executionId, "500");
+ assertTrue(execution.isEnded());
+ assertEquals("internal server error", execution.getNodeName());
+ }
+}
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/processinstance/EndProcessInstanceTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/processinstance/EndProcessInstanceTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/processinstance/EndProcessInstanceTest.java 2008-12-11 16:58:56 UTC (rev 3346)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.examples.end.processinstance;
+
+import org.jbpm.Execution;
+import org.jbpm.test.DbTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class EndProcessInstanceTest extends DbTestCase {
+
+ public void testEndOk() {
+ deployJpdlResource("org/jbpm/examples/end/multiple/process.jpdl.xml");
+
+ Execution execution = executionService.startExecutionByKey("EndMultiple");
+ String executionId = execution.getId();
+
+ execution = executionService.signalExecutionById(executionId, "200");
+ assertEquals("ok", execution.getNodeName());
+ }
+
+ public void testEndBadRequest() {
+ deployJpdlResource("org/jbpm/examples/end/multiple/process.jpdl.xml");
+
+ Execution execution = executionService.startExecutionByKey("EndMultiple");
+ String executionId = execution.getId();
+
+ execution = executionService.signalExecutionById(executionId, "400");
+ assertEquals("bad request", execution.getNodeName());
+ }
+
+ public void testEndInternalServerError() {
+ deployJpdlResource("org/jbpm/examples/end/multiple/process.jpdl.xml");
+
+ Execution execution = executionService.startExecutionByKey("EndMultiple");
+ String executionId = execution.getId();
+
+ execution = executionService.signalExecutionById(executionId, "500");
+ assertEquals("internal server error", execution.getNodeName());
+ }
+}
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/state/EndStateTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/state/EndStateTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/state/EndStateTest.java 2008-12-11 16:58:56 UTC (rev 3346)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.examples.end.state;
+
+import org.jbpm.Execution;
+import org.jbpm.test.DbTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class EndStateTest extends DbTestCase {
+
+ public void testEndStateCompleted() {
+ deployJpdlResource("org/jbpm/examples/end/state/process.jpdl.xml");
+
+ Execution execution = executionService.startExecutionByKey("EndState");
+ String executionId = execution.getId();
+ execution = executionService.signalExecutionById(executionId, "200");
+ assertEquals("completed", execution.getState());
+ assertEquals("ok", execution.getNodeName());
+ }
+
+ public void testEndStateErrorBadRequest() {
+ deployJpdlResource("org/jbpm/examples/end/state/process.jpdl.xml");
+
+ Execution execution = executionService.startExecutionByKey("EndState");
+ String executionId = execution.getId();
+ execution = executionService.signalExecutionById(executionId, "400");
+ assertEquals("error", execution.getState());
+ assertEquals("bad request", execution.getNodeName());
+ }
+
+ public void testEndStateErrorInternalServerError() {
+ deployJpdlResource("org/jbpm/examples/end/state/process.jpdl.xml");
+
+ Execution execution = executionService.startExecutionByKey("EndState");
+ String executionId = execution.getId();
+ execution = executionService.signalExecutionById(executionId, "500");
+ assertEquals("error", execution.getState());
+ assertEquals("internal server error", execution.getNodeName());
+ }
+}
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/expression/ExclusiveExpressionTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/expression/ExclusiveExpressionTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/expression/ExclusiveExpressionTest.java 2008-12-11 16:58:56 UTC (rev 3346)
@@ -0,0 +1,63 @@
+/*
+ * 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.examples.exclusive.expression;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jbpm.Execution;
+import org.jbpm.test.DbTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ExclusiveExpressionTest extends DbTestCase {
+
+ public void testExclusiveExpressionGood() {
+ deployJpdlResource("org/jbpm/examples/exclusive/expression/process.jpdl.xml");
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("content", "good");
+ Execution execution = executionService.startExecutionByKey("ExclusiveExpression", variables);
+ assertEquals("submit document", execution.getNodeName());
+ }
+
+ public void testExclusiveExpressionBad() {
+ deployJpdlResource("org/jbpm/examples/exclusive/expression/process.jpdl.xml");
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("content", "bad");
+ Execution execution = executionService.startExecutionByKey("ExclusiveExpression", variables);
+ assertEquals("try again", execution.getNodeName());
+ }
+
+ public void testExclusiveExpressionUgly() {
+ deployJpdlResource("org/jbpm/examples/exclusive/expression/process.jpdl.xml");
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("content", "ugly");
+ Execution execution = executionService.startExecutionByKey("ExclusiveExpression", variables);
+ assertEquals("give up", execution.getNodeName());
+ }
+
+}
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/handler/ContentEvaluation.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/handler/ContentEvaluation.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/handler/ContentEvaluation.java 2008-12-11 16:58:56 UTC (rev 3346)
@@ -0,0 +1,39 @@
+/*
+ * 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.examples.exclusive.handler;
+
+import org.jbpm.jpdl.ExclusiveHandler;
+import org.jbpm.model.OpenExecution;
+
+public class ContentEvaluation implements ExclusiveHandler {
+
+ public String select(OpenExecution execution) {
+ String content = (String) execution.getVariable("content");
+ if (content.equals("you're great")) {
+ return "good";
+ }
+ if (content.equals("you gotta improve")) {
+ return "bad";
+ }
+ return "ugly";
+ }
+}
\ No newline at end of file
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/handler/ExclusiveHandlerTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/handler/ExclusiveHandlerTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/handler/ExclusiveHandlerTest.java 2008-12-11 16:58:56 UTC (rev 3346)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.examples.exclusive.handler;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jbpm.Execution;
+import org.jbpm.test.DbTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ExclusiveHandlerTest extends DbTestCase {
+
+ public void testExclusiveHandlerGreat() {
+ deployJpdlResource("org/jbpm/examples/exclusive/handler/process.jpdl.xml");
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("content", "you're great");
+ Execution execution = executionService.startExecutionByKey("ExclusiveHandler", variables);
+ assertEquals("submit document", execution.getNodeName());
+ }
+
+ public void testExclusiveHandlerImprove() {
+ deployJpdlResource("org/jbpm/examples/exclusive/handler/process.jpdl.xml");
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("content", "you gotta improve");
+ Execution execution = executionService.startExecutionByKey("ExclusiveHandler", variables);
+ assertEquals("try again", execution.getNodeName());
+ }
+
+ public void testExclusiveHandlerSuck() {
+ deployJpdlResource("org/jbpm/examples/exclusive/handler/process.jpdl.xml");
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("content", "you suck");
+ Execution execution = executionService.startExecutionByKey("ExclusiveHandler", variables);
+ assertEquals("give up", execution.getNodeName());
+ }
+}
Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/end/multiple/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/end/multiple/process.jpdl.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/end/multiple/process.jpdl.xml 2008-12-11 16:58:56 UTC (rev 3346)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="EndMultiple" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="get return code" />
+ </start>
+
+ <state name="get return code">
+ <flow name="200" to="ok" />
+ <flow name="400" to="bad request" />
+ <flow name="500" to="internal server error" />
+ </state>
+
+ <end name="ok" />
+ <end name="bad request" />
+ <end name="internal server error" />
+
+</process>
Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/end/processinstance/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/end/processinstance/process.jpdl.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/end/processinstance/process.jpdl.xml 2008-12-11 16:58:56 UTC (rev 3346)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="EndProcessInstance" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="end" />
+ </start>
+
+ <end name="end" />
+
+</process>
Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/end/state/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/end/state/process.jpdl.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/end/state/process.jpdl.xml 2008-12-11 16:58:56 UTC (rev 3346)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="EndState" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="get return code" />
+ </start>
+
+ <state name="get return code">
+ <flow name="200" to="ok" />
+ <flow name="400" to="bad request" />
+ <flow name="500" to="internal server error" />
+ </state>
+
+ <end name="ok" state="completed" />
+ <end name="bad request" state="error" />
+ <end name="internal server error" state="error" />
+
+</process>
Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/exclusive/expression/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/exclusive/expression/process.jpdl.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/exclusive/expression/process.jpdl.xml 2008-12-11 16:58:56 UTC (rev 3346)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="ExclusiveExpression">
+
+ <start>
+ <flow to="evaluate document" />
+ </start>
+
+ <exclusive name="evaluate document" expr="#{content}">
+ <flow name="good" to="submit document" />
+ <flow name="bad" to="try again" />
+ <flow name="ugly" to="give up" />
+ </exclusive>
+
+ <state name="submit document" />
+
+ <state name="try again" />
+
+ <state name="give up" />
+
+</process>
Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/exclusive/handler/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/exclusive/handler/process.jpdl.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/exclusive/handler/process.jpdl.xml 2008-12-11 16:58:56 UTC (rev 3346)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="ExclusiveHandler">
+
+ <start>
+ <flow to="evaluate document" />
+ </start>
+
+ <exclusive name="evaluate document">
+ <handler class="org.jbpm.examples.exclusive.handler.ContentEvaluation" />
+ <flow name="good" to="submit document" />
+ <flow name="bad" to="try again" />
+ <flow name="ugly" to="give up" />
+ </exclusive>
+
+ <state name="submit document" />
+
+ <state name="try again" />
+
+ <state name="give up" />
+
+</process>
17 years, 4 months
JBoss JBPM SVN: r3345 - in jbpm3/trunk/modules/core/src/main/java/org/jbpm: security and 1 other directories.
by do-not-reply@jboss.org
Author: camunda
Date: 2008-12-11 11:48:44 -0500 (Thu, 11 Dec 2008)
New Revision: 3345
Added:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/security/authentication/SubjectAuthenticationServiceFactory.java
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/JbpmContext.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/security/AuthenticationService.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/security/authentication/SubjectAuthenticationService.java
Log:
JBPM-1909: added factory for SubjectAuthenticationService, added "setActorId" to AuthenticationService interface, using interface in JbpmContext now
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/JbpmContext.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/JbpmContext.java 2008-12-11 16:47:48 UTC (rev 3344)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/JbpmContext.java 2008-12-11 16:48:44 UTC (rev 3345)
@@ -42,7 +42,7 @@
import org.jbpm.graph.exe.Token;
import org.jbpm.persistence.PersistenceService;
import org.jbpm.persistence.db.DbPersistenceService;
-import org.jbpm.security.authentication.DefaultAuthenticationService;
+import org.jbpm.security.AuthenticationService;
import org.jbpm.svc.ServiceFactory;
import org.jbpm.svc.Services;
import org.jbpm.taskmgmt.exe.TaskInstance;
@@ -660,12 +660,10 @@
/**
* sets the currently authenticated actorId.
- *
- * @throws ClassCastException if another authentication service is configured then the default.
*/
public void setActorId(String actorId)
{
- DefaultAuthenticationService authenticationService = (DefaultAuthenticationService)services.getAuthenticationService();
+ AuthenticationService authenticationService = (AuthenticationService)services.getAuthenticationService();
authenticationService.setActorId(actorId);
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/security/AuthenticationService.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/security/AuthenticationService.java 2008-12-11 16:47:48 UTC (rev 3344)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/security/AuthenticationService.java 2008-12-11 16:48:44 UTC (rev 3345)
@@ -23,7 +23,22 @@
import org.jbpm.svc.Service;
+/**
+ * Responsible for knowing which user is currently logged in.
+ *
+ * @author Original author n.n. (maybe Tom?), bernd.ruecker(a)camunda.com
+ */
public interface AuthenticationService extends Service {
+ /**
+ * retrieve the currently authenticated actor
+ */
String getActorId();
+
+ /**
+ * set the currently authenticated actor. This method maybe ignored
+ * by some implementations (e.g. when using JAAS it is not a good idea
+ * to change the authenticated actor).
+ */
+ void setActorId(String actorId);
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/security/authentication/SubjectAuthenticationService.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/security/authentication/SubjectAuthenticationService.java 2008-12-11 16:47:48 UTC (rev 3344)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/security/authentication/SubjectAuthenticationService.java 2008-12-11 16:48:44 UTC (rev 3345)
@@ -27,38 +27,70 @@
import javax.security.auth.Subject;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.jbpm.JbpmConfiguration;
+import org.jbpm.JbpmContext;
import org.jbpm.security.AuthenticationService;
import org.jbpm.util.ClassLoaderUtil;
/**
* gets the authenticated actor id from the current Subject.
* This Authenticator requires another configuration parameter
- * 'jbpm.authenticator.principal.classname'. This configuration property
+ * 'jbpm.authenticator.principal.classname'. This configuration property
* specifies the class name of the principal that should be used from
- * the current subject. The name of that principal is used as the
- * currently authenticated actorId.
+ * the current subject. This could be for example org.jboss.security.CallerIdentity
+ * in an JBoss AS.
+ *
+ * If not actorId is set, the name of that principal is used as the
+ * currently authenticated actorId. If an actorId!=null is set (via setActorId)
+ * this one overwrites the principal. This behavior is configurable via
+ * the 'jbpm.authenticator.principal.allow.overwrite' attribute. If this
+ * is set to false, setActorId is simply ignored.
+ *
*/
public class SubjectAuthenticationService implements AuthenticationService {
private static final long serialVersionUID = 1L;
+ private static Log log = LogFactory.getLog(JbpmContext.class);
+
private static final String principalClassName = JbpmConfiguration.Configs.getString("jbpm.authenticator.principal.classname");
private static Class principalClass = ClassLoaderUtil.loadClass(principalClassName);
+
+ private static final boolean allowActorIdOverwrite = JbpmConfiguration.Configs.getBoolean("jbpm.authenticator.principal.allow.overwrite");
+
+ private String actorId;
public String getActorId() {
- String authenticatedActorId = null;
- Subject subject = Subject.getSubject(AccessController.getContext());
- Set principals = subject.getPrincipals(principalClass);
- if ( (principals!=null)
- && (!principals.isEmpty())
- ) {
- Principal principal = (Principal) principals.iterator().next();
- authenticatedActorId = principal.getName();
+ if (actorId==null) {
+
+ Subject subject = Subject.getSubject(AccessController.getContext());
+ if (subject==null) {
+ log.warn("no javax.security.auth.Subject exists! Cannot set jbpm actorId");
+ return null;
+ }
+
+ Set principals = subject.getPrincipals(principalClass);
+ if ( (principals!=null)
+ && (!principals.isEmpty())
+ ) {
+ // always use the first one (so be patient what Principal classes are used)
+ Principal principal = (Principal) principals.iterator().next();
+ actorId = principal.getName();
+ }
}
- return authenticatedActorId;
+ return actorId;
}
+ public void setActorId(String actorId)
+ {
+ if (allowActorIdOverwrite && actorId!=null) {
+ this.actorId = actorId;
+ }
+ }
+
public void close() {
}
+
}
Added: jbpm3/trunk/modules/core/src/main/java/org/jbpm/security/authentication/SubjectAuthenticationServiceFactory.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/security/authentication/SubjectAuthenticationServiceFactory.java (rev 0)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/security/authentication/SubjectAuthenticationServiceFactory.java 2008-12-11 16:48:44 UTC (rev 3345)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.security.authentication;
+
+import org.jbpm.svc.Service;
+import org.jbpm.svc.ServiceFactory;
+
+/**
+ * Factory to create a {@link SubjectAuthenticationService}.
+ *
+ * @author bernd.ruecker(a)camunda.com
+ */
+public class SubjectAuthenticationServiceFactory implements ServiceFactory {
+
+ private static final long serialVersionUID = 1L;
+
+ public Service openService() {
+ return new SubjectAuthenticationService();
+ }
+
+ public void close() {
+ }
+}
17 years, 4 months