[jbpm-commits] JBoss JBPM SVN: r3042 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/session and 12 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Nov 21 15:29:11 EST 2008


Author: tom.baeyens at jboss.com
Date: 2008-11-21 15:29:11 -0500 (Fri, 21 Nov 2008)
New Revision: 3042

Added:
   jbpm4/trunk/modules/devguide/.project
   jbpm4/trunk/modules/userguide/.project
   jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch03-Services.xml
Removed:
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/ResourceManager.java
   jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch03-Configuration.xml
   jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml
Modified:
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/Deployment.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessEngine.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/PvmDbSession.java
   jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/cfg/JbpmConfiguration.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessDefinitionCmd.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/DeploymentImpl.java
   jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/DbTestCase.java
   jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/ConfigurationTest.java
   jbpm4/trunk/modules/test-db/src/test/resources/hibernate.properties
   jbpm4/trunk/modules/test-db/src/test/resources/logging.properties
   jbpm4/trunk/modules/userguide/src/main/docbook/en/master.xml
Log:
userguide docs

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/Deployment.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/Deployment.java	2008-11-21 18:36:09 UTC (rev 3041)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/Deployment.java	2008-11-21 20:29:11 UTC (rev 3042)
@@ -30,8 +30,8 @@
 
 
 /** a deployment unit, containing all information to create a process 
- * definition that will be deployed in the persistent store of the 
- * Process Virtual Machine.
+ * definition that will be deployed in the persistent process repository 
+ * of the Process Virtual Machine.
  *  
  * @author Tom Baeyens
  */
@@ -55,5 +55,6 @@
   Deployment addDirectory(File directory);
   Deployment addDirectoryCanonical(File directory);
   
-  List<ProcessDefinition> deploy();
+  ProcessDefinition deploy();
+  List<ProcessDefinition> deployAll();
 }

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessEngine.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessEngine.java	2008-11-21 18:36:09 UTC (rev 3041)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/ProcessEngine.java	2008-11-21 20:29:11 UTC (rev 3042)
@@ -21,13 +21,23 @@
  */
 package org.jbpm;
 
+import java.util.Map;
 
+/** central starting point for all process engine API
+ * interactions. 
+ * 
+ * @author Tom Baeyens
+ */
 public interface ProcessEngine {
 
   ProcessService getProcessService();
+  ProcessService getProcessService(Map<String, Object> txResources);
   ExecutionService getExecutionService();
+  ExecutionService getExecutionService(Map<String, Object> txResources);
   TaskService getTaskService();
+  TaskService getTaskService(Map<String, Object> txResources);
   ManagementService getManagementService();
+  ManagementService getManagementService(Map<String, Object> txResources);
 
-  ResourceManager getResourceManager();
+  <T> T get(Class<T> type);
 }

Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/ResourceManager.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/ResourceManager.java	2008-11-21 18:36:09 UTC (rev 3041)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/ResourceManager.java	2008-11-21 20:29:11 UTC (rev 3042)
@@ -1,40 +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;
-
-/** can be used to provide transactional reasources 
- * like JDBC connection or hibernate session to 
- * the method invocations on a service.
- * 
- * TODO what about subsequent service method invocations ?  
- * will a provided resource only be used once in the next method invocation.
- * Or will the the resource be available for the remainder of the thread.
- * In other words: should interceptor that propagates these resources into the 
- * environment clean them from the thread local or not ? 
- *  
- * @author Tom Baeyens
- */
-public interface ResourceManager {
-
-  void addResource(Object object);
-  void addResource(String name, Object object);
-}

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/PvmDbSession.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/PvmDbSession.java	2008-11-21 18:36:09 UTC (rev 3041)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/PvmDbSession.java	2008-11-21 20:29:11 UTC (rev 3042)
@@ -73,4 +73,7 @@
 
   /** delete the process instance */
   void deleteProcessInstance(String processInstanceId);
+
+  /** delete process definition */
+  void deleteProcessDefinition(String processDefinitionId, boolean deleteProcessInstances);
 }

Modified: jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
===================================================================
--- jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd	2008-11-21 18:36:09 UTC (rev 3041)
+++ jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd	2008-11-21 20:29:11 UTC (rev 3042)
@@ -53,6 +53,12 @@
         be deployed with the same name, as long as they have a different 
         version.</documentation></annotation>
       </attribute>
+      <attribute name="key" type="string">
+        <annotation><documentation>The key can be used to provide a short 
+        acronym that will replace the name as the basis for the generated 
+        process definition id
+        </documentation></annotation>
+      </attribute>
       <attribute name="version" type="int">
         <annotation><documentation>Indicates the sequence number of this 
         version for all processes with the same name.  By specifying a version

Added: jbpm4/trunk/modules/devguide/.project
===================================================================
--- jbpm4/trunk/modules/devguide/.project	                        (rev 0)
+++ jbpm4/trunk/modules/devguide/.project	2008-11-21 20:29:11 UTC (rev 3042)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>devguide</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.maven.ide.eclipse.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.maven.ide.eclipse.maven2Nature</nature>
+	</natures>
+</projectDescription>

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/cfg/JbpmConfiguration.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/cfg/JbpmConfiguration.java	2008-11-21 18:36:09 UTC (rev 3041)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/cfg/JbpmConfiguration.java	2008-11-21 20:29:11 UTC (rev 3042)
@@ -24,6 +24,7 @@
 import java.io.File;
 import java.io.InputStream;
 import java.net.URL;
+import java.util.Map;
 import java.util.Set;
 
 import org.jbpm.Configuration;
@@ -31,7 +32,6 @@
 import org.jbpm.ManagementService;
 import org.jbpm.ProcessEngine;
 import org.jbpm.ProcessService;
-import org.jbpm.ResourceManager;
 import org.jbpm.TaskService;
 import org.jbpm.env.Context;
 import org.jbpm.env.Environment;
@@ -137,20 +137,36 @@
   public ExecutionService getExecutionService() {
     return environmentFactoryCtxWireContext.get(ExecutionService.class);
   }
+  
+  public ExecutionService getExecutionService(Map<String, Object> txResources) {
+    // TODO Auto-generated method stub
+    return null;
+  }
 
   public ManagementService getManagementService() {
     return environmentFactoryCtxWireContext.get(ManagementService.class);
   }
 
+  public ManagementService getManagementService(Map<String, Object> txResources) {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
   public ProcessService getProcessService() {
     return environmentFactoryCtxWireContext.get(ProcessService.class);
   }
 
+  public ProcessService getProcessService(Map<String, Object> txResources) {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
   public TaskService getTaskService() {
     return environmentFactoryCtxWireContext.get(TaskService.class);
   }
 
-  public ResourceManager getResourceManager() {
+  public TaskService getTaskService(Map<String, Object> txResources) {
+    // TODO Auto-generated method stub
     return null;
   }
 
@@ -239,5 +255,4 @@
   public WireDefinition getEnvironmentCtxWireDefinition() {
     return environmentCtxWireDefinition;
   }
-
 }

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessDefinitionCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessDefinitionCmd.java	2008-11-21 18:36:09 UTC (rev 3041)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessDefinitionCmd.java	2008-11-21 20:29:11 UTC (rev 3042)
@@ -24,6 +24,7 @@
 import java.util.List;
 
 import org.jbpm.JbpmException;
+import org.jbpm.ProcessDefinition;
 import org.jbpm.cmd.Command;
 import org.jbpm.env.Environment;
 import org.jbpm.session.PvmDbSession;
@@ -44,23 +45,16 @@
   }
 
   public DeleteProcessDefinitionCmd(String processDefinitionId, boolean deleteProcessInstances) {
-    this.deleteProcessInstances = deleteProcessInstances;
     this.processDefinitionId = processDefinitionId;
+    this.deleteProcessInstances = deleteProcessInstances;
   }
 
   public Void execute(Environment environment) {
     PvmDbSession pvmDbSession = Environment.getFromCurrent(PvmDbSession.class);
-    List<String> processInstanceIds = pvmDbSession.findProcessInstanceIds(processDefinitionId);
-    
-    if (deleteProcessInstances) {
-      for (String processInstanceId : processInstanceIds) {
-        pvmDbSession.deleteProcessInstance(processInstanceId);
-      }
-    } else {
-      if (processInstanceIds.size()>0) {
-        throw new JbpmException("still "+processInstanceIds.size()+" process instances for process definition "+processDefinitionId);
-      }
+    if (pvmDbSession==null) {
+      throw new JbpmException("no PvmDbSession configured");
     }
+    pvmDbSession.deleteProcessDefinition(processDefinitionId, deleteProcessInstances);
     return null;
   }
 }

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java	2008-11-21 18:36:09 UTC (rev 3041)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java	2008-11-21 20:29:11 UTC (rev 3042)
@@ -25,6 +25,8 @@
 
 import org.hibernate.Query;
 import org.jbpm.Execution;
+import org.jbpm.JbpmException;
+import org.jbpm.ProcessDefinition;
 import org.jbpm.client.ClientExecution;
 import org.jbpm.client.ClientProcessDefinition;
 import org.jbpm.job.Job;
@@ -135,4 +137,21 @@
     log.debug("deleting process instance "+processInstanceId);
     session.delete(processInstance);
   }
+
+  public void deleteProcessDefinition(String processDefinitionId, boolean deleteProcessInstances) {
+    List<String> processInstanceIds = findProcessInstanceIds(processDefinitionId);
+    
+    if (deleteProcessInstances) {
+      for (String processInstanceId : processInstanceIds) {
+        deleteProcessInstance(processInstanceId);
+      }
+    } else {
+      if (processInstanceIds.size()>0) {
+        throw new JbpmException("still "+processInstanceIds.size()+" process instances for process definition "+processDefinitionId);
+      }
+    }
+    
+    ProcessDefinition processDefinition = findProcessDefinitionById(processDefinitionId);
+    session.delete(processDefinition);
+  }
 }

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/DeploymentImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/DeploymentImpl.java	2008-11-21 18:36:09 UTC (rev 3041)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/DeploymentImpl.java	2008-11-21 20:29:11 UTC (rev 3042)
@@ -304,7 +304,15 @@
     return this;
   }
 
-  public List<ProcessDefinition> deploy() {
+  public ProcessDefinition deploy() {
+    List<ProcessDefinition> deployedProcessDefinitions = processServiceImpl.deploy(this);
+    if (deployedProcessDefinitions.size()>0) {
+      return deployedProcessDefinitions.get(0);
+    }
+    return null;
+  }
+  
+  public List<ProcessDefinition> deployAll() {
     return processServiceImpl.deploy(this);
   }
 

Modified: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/DbTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/DbTestCase.java	2008-11-21 18:36:09 UTC (rev 3041)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/DbTestCase.java	2008-11-21 20:29:11 UTC (rev 3042)
@@ -75,7 +75,7 @@
   public void tearDown() throws Exception {
     if (processDefinitions!=null) {
       for (ProcessDefinition processDefinition : processDefinitions) {
-        processService.deleteProcessDefinition(processDefinition.getId());
+        processService.deleteProcessDefinitionAndInstances(processDefinition.getId());
       }
     }
     
@@ -85,7 +85,7 @@
   }
 
   public void deployJpdlXmlString(String jpdlXmlString) {
-    List<ProcessDefinition> deployedProcessDefinitions = 
+    ProcessDefinition deployedProcessDefinition = 
       processService.createDeployment()
         .setLanguage("jpdl")
         .addString("xmlstring.jpdl.xml", jpdlXmlString)
@@ -95,6 +95,6 @@
       processDefinitions = new ArrayList<ProcessDefinition>();
     }
     
-    processDefinitions.addAll(deployedProcessDefinitions);
+    processDefinitions.add(deployedProcessDefinition);
   }
 }

Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/ConfigurationTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/ConfigurationTest.java	2008-11-21 18:36:09 UTC (rev 3041)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/basicfeatures/ConfigurationTest.java	2008-11-21 20:29:11 UTC (rev 3042)
@@ -36,12 +36,14 @@
     assertNotNull(processEngine);
   }
 
+  /*
   public void testResourceConfiguration() {
     ProcessEngine processEngine = new Configuration()
-        .setResource("my-jbpm-configuration.cfg.xml")
+        .setResource("my-jbpm-configuration.xml")
         .buildProcessEngine();
     assertNotNull(processEngine);
   }
+  */
 
   public void testMinimalConfiguration() {
     ProcessEngine processEngine = new Configuration()

Modified: jbpm4/trunk/modules/test-db/src/test/resources/hibernate.properties
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/hibernate.properties	2008-11-21 18:36:09 UTC (rev 3041)
+++ jbpm4/trunk/modules/test-db/src/test/resources/hibernate.properties	2008-11-21 20:29:11 UTC (rev 3042)
@@ -7,5 +7,5 @@
 hibernate.cache.use_second_level_cache true
 hibernate.cache.provider_class         org.hibernate.cache.HashtableCacheProvider
 # hibernate.show_sql                     true
-hibernate.format_sql                   true
-hibernate.use_sql_comments             true
+# hibernate.format_sql                   true
+# hibernate.use_sql_comments             true

Modified: jbpm4/trunk/modules/test-db/src/test/resources/logging.properties
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/logging.properties	2008-11-21 18:36:09 UTC (rev 3041)
+++ jbpm4/trunk/modules/test-db/src/test/resources/logging.properties	2008-11-21 20:29:11 UTC (rev 3042)
@@ -22,7 +22,7 @@
 org.hibernate.level=INFO
 org.hibernate.cfg.HbmBinder.level=SEVERE
 org.hibernate.cfg.SettingsFactory.level=SEVERE
-# org.hibernate.SQL.level=FINEST
+org.hibernate.SQL.level=FINEST
 # org.hibernate.type.level=FINEST
 # org.hibernate.tool.hbm2ddl.SchemaExport.level=FINEST
 # org.hibernate.transaction.level=FINEST

Added: jbpm4/trunk/modules/userguide/.project
===================================================================
--- jbpm4/trunk/modules/userguide/.project	                        (rev 0)
+++ jbpm4/trunk/modules/userguide/.project	2008-11-21 20:29:11 UTC (rev 3042)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>userguide</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.maven.ide.eclipse.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.maven.ide.eclipse.maven2Nature</nature>
+	</natures>
+</projectDescription>

Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/master.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/master.xml	2008-11-21 18:36:09 UTC (rev 3041)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/master.xml	2008-11-21 20:29:11 UTC (rev 3042)
@@ -3,8 +3,7 @@
 <!DOCTYPE book [
   <!ENTITY ch01-Introduction                   SYSTEM "modules/ch01-Introduction.xml">
   <!ENTITY ch02-Environments                   SYSTEM "modules/ch02-Environments.xml">
-  <!ENTITY ch03-Configuration                  SYSTEM "modules/ch03-Configuration.xml">
-  <!ENTITY ch04-Services                       SYSTEM "modules/ch04-Services.xml">
+  <!ENTITY ch03-Services                       SYSTEM "modules/ch03-Services.xml">
 ]>
 
 <book lang="en">
@@ -16,7 +15,7 @@
   <toc />
 
   &ch01-Introduction;
-  &ch02-Configuration;
+  &ch02-Environments;
   &ch03-Services;
 
 </book>
\ No newline at end of file

Deleted: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch03-Configuration.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch03-Configuration.xml	2008-11-21 18:36:09 UTC (rev 3041)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch03-Configuration.xml	2008-11-21 20:29:11 UTC (rev 3042)
@@ -1,10 +0,0 @@
-<chapter id="configuration">
-  <title>Configuration</title>
-  
-  <para>Interacting with jBPM occurs through <link linkend="services">services</link>.
-  The service interfaces can be obtained from the <literal>ProcessEngine</literal>
-  which is build from a <literal>Configuration</literal>. 
-  </para>
-  
-
-</chapter>
\ No newline at end of file

Added: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch03-Services.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch03-Services.xml	                        (rev 0)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch03-Services.xml	2008-11-21 20:29:11 UTC (rev 3042)
@@ -0,0 +1,124 @@
+<chapter id="services">
+  <title>Services</title>
+  
+  <para>Interacting with jBPM occurs through <link linkend="services">services</link>.
+  The service interfaces can be obtained from the <literal>ProcessEngine</literal>
+  which is build from a <literal>Configuration</literal>. 
+  </para>
+  
+  <section id="processengine">
+    <title>ProcessEngine</title>
+  
+    <para>A <literal>ProcessEngine</literal> is thread safe and can be stored in a 
+    static member field or even better in JNDI or some other central location.  
+    One <literal>ProcessEngine</literal> object can be used by all requests and 
+    threads in an application.  Here's how you can obtain a <literal>ProcessEngine</literal>
+    </para>
+    
+    <programlisting>ProcessEngine processEngine = new Configuration()
+      .buildProcessEngine();</programlisting>
+    
+    <para>The previous code snippet shows how to build a <literal>ProcessEngine</literal>
+    from the default configuration file <literal>jbpm.cfg.xml</literal> which is 
+    expected in the root of the classpath.  If you want to specify another 
+    resource location, use the <literal>setResource</literal> method like this: 
+    </para>
+    
+    <programlisting>ProcessEngine processEngine = new Configuration()
+      .setResource("my-own-configuration-file.xml")
+      .buildProcessEngine();</programlisting>
+    
+    <para>There are other <literal>setXxxx</literal> methods that allow to specify 
+    the configuration content as an <literal>InputStream</literal>, an 
+    <literal>xmlString</literal>, <literal>InputSource</literal>, 
+    <literal>URL</literal> or  <literal>File</literal>.  
+    </para>
+  
+    <para>From a <literal>ProcessEngine</literal> the following services 
+    can be obtained:
+    </para>
+    
+    <programlisting>ProcessService processService = processEngine.getProcessService();
+ExecutionService executionService = processEngine.getExecutionService();
+ManagementService managementService = processEngine.getManagementService();
+TaskService taskService = processEngine.getTaskService();</programlisting>
+  </section>
+  
+  <section id="deployingaprocess">
+    <title>Deploying a process</title>
+    <para>A jPDL process file like e.g. <literal>order.jpdl.xml</literal> that is 
+    accessible as a resource on the classpath can be deployed programmatically with the 
+    <literal>ProcessService</literal> like this:
+    </para>
+    <programlisting>processService.createDeployment()
+    .setLanguage("jpdl")
+    .addResource("order.jpdl.xml")
+    .deploy();</programlisting>
+    <para>Analogue to the <literal>addResource</literal> method above, the source of 
+    the processes definitions XML can be picked up from a file, url, string, 
+    input stream, zip or jar archive and a directory.
+    </para>
+    <para>During deployment, an <literal>id</literal> is assigned to the process 
+    definition.  Process definition properties <literal>name</literal> and 
+    <literal>id</literal> are important for referencing the deployed process 
+    definition later on.  The <literal>id</literal> is based on the <literal>name</literal>
+    or <literal>key</literal> and <literal>version</literal>.
+    </para>
+    <para>If a <literal>key</literal> is provided, the <literal>id</literal> 
+    will be <literal>{key}:{version}</literal>, otherwise it's 
+    <literal>{name}:{version}</literal>.  If no <literal>version</literal> is specified,
+    a <literal>version</literal> (<literal>int</literal>) will be assigned.  For version 
+    assignment, the versions of all deployed process definitions with the same name will 
+    be taken into account.  The assigned <literal>version</literal> will be one higher 
+    then the highest <literal>version</literal> number of deployed process definitions 
+    with the same name.  If no similarly named process definitions have been deployed,
+    version number 1 is assigned. 
+    </para>
+    <para>For example, the first time when the process</para>
+    <programlisting>&lt;process name=&quot;order&quot;&gt;
+...
+&lt;/process&gt;</programlisting>
+    <para>is deployed, version 1 will be assigned and the generated <literal>id</literal> 
+    will be <literal>order:1</literal>  The second time when this process is deployed, 
+    version 2 will be assigned and the generated id will be <literal>order:2</literal>
+    </para>
+    <para>The generated id will also replace all non digits and non [a-Z] characters 
+    with underscores.  So the first time when process</para>
+    <programlisting>&lt;process name=&quot;Insurance claim&quot;&gt;
+...
+&lt;/process&gt;</programlisting>
+    <para>is deployed, the assigned id will be <literal>Insurance_claim:1</literal> 
+    </para>
+    <para>To get short <literal>id</literal>s, a <literal>key</literal> like this:</para>
+    <programlisting>&lt;process name=&quot;Insurance claim&quot; key=&quot;ICL&quot;&gt;
+...
+&lt;/process&gt;</programlisting>
+    <para>resulting in id <literal>ICL:1</literal> being generated.</para>
+    <para>The <literal>ProcessService</literal> groups all methods that access 
+    the repository of process definitions.
+    </para>
+  </section>
+  
+  <section id="startinganewprocessinstance">
+    <title>Starting a new process instance</title>
+    <para>Starting a new process instance for a given 
+    </para>
+  </section>
+  
+  <section id="singallingawaitingexecution">
+    <title>Starting a new process instance</title>
+    <para>
+    </para>
+  </section>
+  
+  <section id="taskservice">
+    <title>TaskService</title>
+    <para></para>
+  </section>
+  
+  <section id="managementservice">
+    <title>ManagementService</title>
+    <para></para>
+  </section>
+  
+</chapter>
\ No newline at end of file

Deleted: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml	2008-11-21 18:36:09 UTC (rev 3041)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Services.xml	2008-11-21 20:29:11 UTC (rev 3042)
@@ -1,7 +0,0 @@
-<chapter id="services">
-  <title>Services</title>
-  
-  <para>  
-  </para>
-
-</chapter>
\ No newline at end of file




More information about the jbpm-commits mailing list