JBoss JBPM SVN: r5213 - jbpm4/trunk/modules/integration/report/src/main/resources.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-07-03 06:23:07 -0400 (Fri, 03 Jul 2009)
New Revision: 5213
Modified:
jbpm4/trunk/modules/integration/report/src/main/resources/overall_activity.rptdesign
jbpm4/trunk/modules/integration/report/src/main/resources/process_summary.rptconfig
jbpm4/trunk/modules/integration/report/src/main/resources/process_summary.rptdesign
Log:
Clean up jdbc sources in birt reports
Modified: jbpm4/trunk/modules/integration/report/src/main/resources/overall_activity.rptdesign
===================================================================
--- jbpm4/trunk/modules/integration/report/src/main/resources/overall_activity.rptdesign 2009-07-03 10:12:00 UTC (rev 5212)
+++ jbpm4/trunk/modules/integration/report/src/main/resources/overall_activity.rptdesign 2009-07-03 10:23:07 UTC (rev 5213)
@@ -12,12 +12,6 @@
<encrypted-property name="odaPassword" encryptionID="base64">amJwbQ==</encrypted-property>
<property name="odaJndiName">java:/JbpmDS</property>
</oda-data-source>
- <oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="HSQLDB" id="248">
- <property name="odaDriverClass">org.hsqldb.jdbcDriver</property>
- <property name="odaURL">jdbc:hsqldb:hsql://localhost:1701</property>
- <property name="odaUser">sa</property>
- <property name="odaJndiName">java:/JbpmDS</property>
- </oda-data-source>
</data-sources>
<data-sets>
<oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" name="process_definitions" id="9">
@@ -62,7 +56,7 @@
</structure>
</list-property>
</structure>
- <property name="dataSource">HSQLDB</property>
+ <property name="dataSource">MySQL</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
@@ -175,7 +169,7 @@
</structure>
</list-property>
</structure>
- <property name="dataSource">HSQLDB</property>
+ <property name="dataSource">MySQL</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
@@ -286,7 +280,7 @@
</structure>
</list-property>
</structure>
- <property name="dataSource">HSQLDB</property>
+ <property name="dataSource">MySQL</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
@@ -348,7 +342,7 @@
</structure>
</list-property>
</structure>
- <property name="dataSource">HSQLDB</property>
+ <property name="dataSource">MySQL</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
@@ -544,7 +538,7 @@
</structure>
</list-property>
</structure>
- <property name="dataSource">HSQLDB</property>
+ <property name="dataSource">MySQL</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
@@ -1500,7 +1494,7 @@
<Prefix></Prefix>
<Separator>, </Separator>
</DataPoint>
- <LabelPosition>Inside</LabelPosition>
+ <LabelPosition>Outside</LabelPosition>
<Stacked>false</Stacked>
<Triggers>
<Condition>onclick</Condition>
Modified: jbpm4/trunk/modules/integration/report/src/main/resources/process_summary.rptconfig
===================================================================
--- jbpm4/trunk/modules/integration/report/src/main/resources/process_summary.rptconfig 2009-07-03 10:12:00 UTC (rev 5212)
+++ jbpm4/trunk/modules/integration/report/src/main/resources/process_summary.rptconfig 2009-07-03 10:23:07 UTC (rev 5213)
@@ -3,11 +3,11 @@
<list-property name="configVars">
<structure>
<property name="name">__isdisplay__procId_42_0</property>
- <property name="value">vacation2-1</property>
+ <property name="value">vacation2-2</property>
</structure>
<structure>
<property name="name">procId_42_1</property>
- <property name="value">vacation2-1</property>
+ <property name="value">vacation2-2</property>
</structure>
<structure>
<property name="name">procId_42_type_</property>
Modified: jbpm4/trunk/modules/integration/report/src/main/resources/process_summary.rptdesign
===================================================================
--- jbpm4/trunk/modules/integration/report/src/main/resources/process_summary.rptdesign 2009-07-03 10:12:00 UTC (rev 5212)
+++ jbpm4/trunk/modules/integration/report/src/main/resources/process_summary.rptdesign 2009-07-03 10:23:07 UTC (rev 5213)
@@ -26,12 +26,6 @@
<encrypted-property name="odaPassword" encryptionID="base64">amJwbQ==</encrypted-property>
<property name="odaJndiName">java:/JbpmDS</property>
</oda-data-source>
- <oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="HSQLDB" id="275">
- <property name="odaDriverClass">org.hsqldb.jdbcDriver</property>
- <property name="odaURL">jdbc:hsqldb:hsql://localhost:1701</property>
- <property name="odaUser">sa</property>
- <property name="odaJndiName">java:/JbpmDS</property>
- </oda-data-source>
</data-sources>
<data-sets>
<oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" name="active_instances" id="126">
@@ -139,7 +133,7 @@
</structure>
</list-property>
</structure>
- <property name="dataSource">HSQLDB</property>
+ <property name="dataSource">MySQL</property>
<list-property name="parameters">
<structure>
<property name="name">id</property>
@@ -262,7 +256,7 @@
</structure>
</list-property>
</structure>
- <property name="dataSource">HSQLDB</property>
+ <property name="dataSource">MySQL</property>
<list-property name="parameters">
<structure>
<property name="name">id</property>
@@ -536,7 +530,7 @@
</structure>
</list-property>
</structure>
- <property name="dataSource">HSQLDB</property>
+ <property name="dataSource">MySQL</property>
<list-property name="parameters">
<structure>
<property name="name">id</property>
@@ -660,7 +654,7 @@
</structure>
</list-property>
</structure>
- <property name="dataSource">HSQLDB</property>
+ <property name="dataSource">MySQL</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
15 years, 4 months
JBoss JBPM SVN: r5212 - projects.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-07-03 06:12:00 -0400 (Fri, 03 Jul 2009)
New Revision: 5212
Added:
projects/kukeltjes-console/
Log:
adding space for kukeltjes console
15 years, 4 months
JBoss JBPM SVN: r5211 - in jbpm4/trunk/modules: integration/console/src/main/java/org/jbpm/integration/console and 7 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-07-03 05:47:17 -0400 (Fri, 03 Jul 2009)
New Revision: 5211
Added:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/TaskQueryImpl.java
Removed:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskQueryImpl.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinitionQuery.java
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateTaskQueryCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/DbSessionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/DbSession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/SuspendDeploymentTest.java
Log:
JBPM-2383 made process definition query consistent wrt notSuspended() suspended() and updated the console integration query to only show the notSuspended process definitions
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinitionQuery.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinitionQuery.java 2009-07-03 09:32:54 UTC (rev 5210)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessDefinitionQuery.java 2009-07-03 09:47:17 UTC (rev 5211)
@@ -39,7 +39,9 @@
ProcessDefinitionQuery processDefinitionNameLike(String name);
ProcessDefinitionQuery processDefinitionName(String name);
ProcessDefinitionQuery deploymentId(String deploymentId);
+
ProcessDefinitionQuery suspended();
+ ProcessDefinitionQuery notSuspended();
ProcessDefinitionQuery orderAsc(String property);
ProcessDefinitionQuery orderDesc(String property);
Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java 2009-07-03 09:32:54 UTC (rev 5210)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java 2009-07-03 09:47:17 UTC (rev 5211)
@@ -59,6 +59,7 @@
// active processes
List<ProcessDefinition> activePds = repositoryService.createProcessDefinitionQuery()
+ .notSuspended()
.orderAsc(ProcessDefinitionQuery.PROPERTY_NAME)
.list();
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateTaskQueryCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateTaskQueryCmd.java 2009-07-03 09:32:54 UTC (rev 5210)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateTaskQueryCmd.java 2009-07-03 09:47:17 UTC (rev 5211)
@@ -22,8 +22,8 @@
package org.jbpm.pvm.internal.cmd;
import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.query.TaskQueryImpl;
import org.jbpm.pvm.internal.session.DbSession;
-import org.jbpm.pvm.internal.task.TaskQueryImpl;
/**
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/DbSessionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/DbSessionImpl.java 2009-07-03 09:32:54 UTC (rev 5210)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/DbSessionImpl.java 2009-07-03 09:47:17 UTC (rev 5211)
@@ -46,9 +46,9 @@
import org.jbpm.pvm.internal.query.HistoryProcessInstanceQueryImpl;
import org.jbpm.pvm.internal.query.JobQueryImpl;
import org.jbpm.pvm.internal.query.ProcessInstanceQueryImpl;
+import org.jbpm.pvm.internal.query.TaskQueryImpl;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.task.TaskImpl;
-import org.jbpm.pvm.internal.task.TaskQueryImpl;
import org.jbpm.pvm.internal.util.Clock;
/**
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java 2009-07-03 09:32:54 UTC (rev 5210)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java 2009-07-03 09:47:17 UTC (rev 5211)
@@ -58,7 +58,7 @@
protected String key;
protected String nameLike;
protected String name;
- protected boolean suspended;
+ protected Boolean suspended;
protected String deploymentId;
public Object execute(Session session) {
@@ -90,10 +90,12 @@
hql.append(DeploymentProperty.class.getName());
hql.append(" as versionProperty ");
- if (suspended) {
- appendWhereClause("deployment.state = '"+Deployment.STATE_SUSPENDED+"'", hql);
- } else {
- appendWhereClause("deployment.state != '"+Deployment.STATE_SUSPENDED+"'", hql);
+ if (suspended!=null) {
+ if (suspended) {
+ appendWhereClause("deployment.state = '"+Deployment.STATE_SUSPENDED+"'", hql);
+ } else {
+ appendWhereClause("deployment.state != '"+Deployment.STATE_SUSPENDED+"'", hql);
+ }
}
appendWhereClause("idProperty.key = '"+DeploymentImpl.KEY_PROCESS_DEFINITION_ID+"'", hql);
@@ -158,6 +160,11 @@
return this;
}
+ public ProcessDefinitionQuery notSuspended() {
+ this.suspended = false;
+ return this;
+ }
+
public ProcessDefinitionQuery processDefinitionNameLike(String name) {
this.nameLike = name;
return this;
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/TaskQueryImpl.java (from rev 5192, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskQueryImpl.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/TaskQueryImpl.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/TaskQueryImpl.java 2009-07-03 09:47:17 UTC (rev 5211)
@@ -0,0 +1,210 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.query;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hibernate.Query;
+import org.jbpm.api.JbpmException;
+import org.jbpm.api.TaskQuery;
+import org.jbpm.api.identity.Group;
+import org.jbpm.api.task.Task;
+import org.jbpm.internal.log.Log;
+import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.identity.spi.IdentitySession;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.task.ParticipationImpl;
+import org.jbpm.pvm.internal.task.TaskImpl;
+
+/**
+ * @author Tom Baeyens
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ */
+public class TaskQueryImpl extends AbstractQuery implements TaskQuery {
+
+ private static final long serialVersionUID = 1L;
+
+ private static Log log = Log.getLog(TaskQueryImpl.class.getName());
+
+ protected boolean unassigned = false;
+ protected String assignee = null;
+ protected String candidate = null;
+ protected Boolean suspended = null;
+ protected String processInstanceId = null;
+ protected String processDefinitionId = null;
+ protected String activityName = null;
+
+ /* groupIds transports the groupIds from the hql to the applyParameters */
+ protected List<String> groupIds;
+
+ public TaskQuery assignee(String assignee) {
+ if (candidate!=null) {
+ throw new JbpmException("assignee(...) cannot be combined with candidate(...) in one query");
+ }
+ this.assignee = assignee;
+ return this;
+ }
+
+ public TaskQuery candidate(String userId) {
+ this.candidate = userId;
+ unassigned();
+ return this;
+ }
+
+ public TaskQuery processInstanceId(String processInstanceId) {
+ this.processInstanceId = processInstanceId;
+ return this;
+ }
+
+ public TaskQuery processDefinitionId(String processDefinitionId) {
+ this.processDefinitionId = processDefinitionId;
+ return this;
+ }
+
+ public TaskQuery activityName(String activityName) {
+ this.activityName = activityName;
+ return this;
+ }
+
+ public TaskQuery unassigned() {
+ this.assignee = null;
+ this.unassigned = true;
+ return this;
+ }
+
+ public TaskQuery suspended() {
+ this.suspended = true;
+ return this;
+ }
+
+ public TaskQuery notSuspended() {
+ this.suspended = false;
+ return this;
+ }
+
+ public TaskQuery orderAsc(String property) {
+ orderByClause = "task." + property + " asc ";
+ return this;
+ }
+
+ public TaskQuery orderDesc(String property) {
+ orderByClause = "task." + property + " desc ";
+ return this;
+ }
+
+ public TaskQuery page(int firstResult, int maxResults) {
+ page = new Page(firstResult, maxResults);
+ return this;
+ }
+
+ protected void applyParameters(Query query) {
+ if (assignee!=null) {
+ log.debug("setting parameter assignee: "+assignee);
+ query.setString("assignee", assignee);
+ }
+
+ if (candidate!=null) {
+ log.debug("setting parameter candidateUserId: "+candidate);
+ query.setString("candidateUserId", candidate);
+
+ if (groupIds!=null) {
+ log.debug("setting parameter candidateGroupIds: "+groupIds);
+ query.setParameterList("candidateGroupIds", groupIds);
+ }
+ }
+ }
+
+ public String hql() {
+ StringBuilder hql = new StringBuilder();
+ hql.append("select task ");
+ hql.append("from ");
+ hql.append(TaskImpl.class.getName());
+ hql.append(" as task ");
+
+ // participations
+ if (candidate!=null) {
+ hql.append(", ");
+ hql.append(ParticipationImpl.class.getName());
+ hql.append(" as participant ");
+
+ appendWhereClause("participant.task = task ", hql);
+ appendWhereClause("participant.type = 'candidate' ", hql);
+
+ IdentitySession identitySession = Environment.getFromCurrent(IdentitySession.class);
+ List<Group> groups = identitySession.findGroupsByUser(candidate);
+ if (groups.isEmpty()) {
+ groupIds = null;
+ appendWhereClause("participant.userId = :candidateUserId ", hql);
+
+ } else {
+ groupIds = new ArrayList<String>();
+ for (Group group: groups) {
+ groupIds.add(group.getId());
+ }
+ appendWhereClause("((participant.userId = :candidateUserId) or (participant.groupId in (:candidateGroupIds)))", hql);
+ }
+ }
+
+ if (suspended!=null) {
+ if (suspended) {
+ appendWhereClause("task.state = '"+ExecutionImpl.STATE_SUSPENDED+"' ", hql);
+ } else {
+ appendWhereClause("task.state != '"+ExecutionImpl.STATE_SUSPENDED+"' ", hql);
+ }
+ }
+
+ if (processInstanceId!=null) {
+ appendWhereClause("task.processInstance.id = '"+processInstanceId+"' ", hql);
+ }
+
+ if (activityName!=null) {
+ appendWhereClause("task.execution.activityName = '"+activityName+"' ", hql);
+ }
+
+ if (processDefinitionId!=null) {
+ appendWhereClause("task.processInstance.processDefinitionId = '"+processDefinitionId+"' ", hql);
+ }
+
+ if (assignee!=null) {
+ appendWhereClause("task.assignee = :assignee ", hql);
+ } else if (unassigned) {
+ appendWhereClause("task.assignee is null ", hql);
+ }
+
+ appendOrderByClause(hql);
+
+ String hqlQuery = hql.toString();
+
+ log.debug(hqlQuery);
+
+ return hqlQuery;
+ }
+
+ public List<Task> list() {
+ return (List<Task>) commandService.execute(this);
+ }
+
+ public Task uniqueResult() {
+ return (Task)untypedUniqueResult();
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/TaskQueryImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/DbSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/DbSession.java 2009-07-03 09:32:54 UTC (rev 5210)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/session/DbSession.java 2009-07-03 09:47:17 UTC (rev 5211)
@@ -34,7 +34,7 @@
import org.jbpm.pvm.internal.query.HistoryProcessInstanceQueryImpl;
import org.jbpm.pvm.internal.query.JobQueryImpl;
import org.jbpm.pvm.internal.query.ProcessInstanceQueryImpl;
-import org.jbpm.pvm.internal.task.TaskQueryImpl;
+import org.jbpm.pvm.internal.query.TaskQueryImpl;
/**
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java 2009-07-03 09:32:54 UTC (rev 5210)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/TaskServiceImpl.java 2009-07-03 09:47:17 UTC (rev 5211)
@@ -50,8 +50,8 @@
import org.jbpm.pvm.internal.cmd.RemoveParticipantCmd;
import org.jbpm.pvm.internal.cmd.SaveTaskCmd;
import org.jbpm.pvm.internal.cmd.SetTaskVariablesCmd;
+import org.jbpm.pvm.internal.query.TaskQueryImpl;
import org.jbpm.pvm.internal.task.TaskImpl;
-import org.jbpm.pvm.internal.task.TaskQueryImpl;
/**
* @author Alejandro Guizar, Tom Baeyens
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskQueryImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskQueryImpl.java 2009-07-03 09:32:54 UTC (rev 5210)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskQueryImpl.java 2009-07-03 09:47:17 UTC (rev 5211)
@@ -1,210 +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.pvm.internal.task;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.hibernate.Query;
-import org.jbpm.api.JbpmException;
-import org.jbpm.api.TaskQuery;
-import org.jbpm.api.identity.Group;
-import org.jbpm.api.task.Task;
-import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Environment;
-import org.jbpm.pvm.internal.identity.spi.IdentitySession;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.query.AbstractQuery;
-import org.jbpm.pvm.internal.query.Page;
-
-/**
- * @author Tom Baeyens
- * @author Heiko Braun <heiko.braun(a)jboss.com>
- */
-public class TaskQueryImpl extends AbstractQuery implements TaskQuery {
-
- private static final long serialVersionUID = 1L;
-
- private static Log log = Log.getLog(TaskQueryImpl.class.getName());
-
- protected boolean unassigned = false;
- protected String assignee = null;
- protected String candidate = null;
- protected Boolean suspended = null;
- protected String processInstanceId = null;
- protected String processDefinitionId = null;
- protected String activityName = null;
-
- /* groupIds transports the groupIds from the hql to the applyParameters */
- protected List<String> groupIds;
-
- public TaskQuery assignee(String assignee) {
- if (candidate!=null) {
- throw new JbpmException("assignee(...) cannot be combined with candidate(...) in one query");
- }
- this.assignee = assignee;
- return this;
- }
-
- public TaskQuery candidate(String userId) {
- this.candidate = userId;
- unassigned();
- return this;
- }
-
- public TaskQuery processInstanceId(String processInstanceId) {
- this.processInstanceId = processInstanceId;
- return this;
- }
-
- public TaskQuery processDefinitionId(String processDefinitionId) {
- this.processDefinitionId = processDefinitionId;
- return this;
- }
-
- public TaskQuery activityName(String activityName) {
- this.activityName = activityName;
- return this;
- }
-
- public TaskQuery unassigned() {
- this.assignee = null;
- this.unassigned = true;
- return this;
- }
-
- public TaskQuery suspended() {
- this.suspended = true;
- return this;
- }
-
- public TaskQuery notSuspended() {
- this.suspended = false;
- return this;
- }
-
- public TaskQuery orderAsc(String property) {
- orderByClause = "task." + property + " asc ";
- return this;
- }
-
- public TaskQuery orderDesc(String property) {
- orderByClause = "task." + property + " desc ";
- return this;
- }
-
- public TaskQuery page(int firstResult, int maxResults) {
- page = new Page(firstResult, maxResults);
- return this;
- }
-
- protected void applyParameters(Query query) {
- if (assignee!=null) {
- log.debug("setting parameter assignee: "+assignee);
- query.setString("assignee", assignee);
- }
-
- if (candidate!=null) {
- log.debug("setting parameter candidateUserId: "+candidate);
- query.setString("candidateUserId", candidate);
-
- if (groupIds!=null) {
- log.debug("setting parameter candidateGroupIds: "+groupIds);
- query.setParameterList("candidateGroupIds", groupIds);
- }
- }
- }
-
- public String hql() {
- StringBuilder hql = new StringBuilder();
- hql.append("select task ");
- hql.append("from ");
- hql.append(TaskImpl.class.getName());
- hql.append(" as task ");
-
- // participations
- if (candidate!=null) {
- hql.append(", ");
- hql.append(ParticipationImpl.class.getName());
- hql.append(" as participant ");
-
- appendWhereClause("participant.task = task ", hql);
- appendWhereClause("participant.type = 'candidate' ", hql);
-
- IdentitySession identitySession = Environment.getFromCurrent(IdentitySession.class);
- List<Group> groups = identitySession.findGroupsByUser(candidate);
- if (groups.isEmpty()) {
- groupIds = null;
- appendWhereClause("participant.userId = :candidateUserId ", hql);
-
- } else {
- groupIds = new ArrayList<String>();
- for (Group group: groups) {
- groupIds.add(group.getId());
- }
- appendWhereClause("((participant.userId = :candidateUserId) or (participant.groupId in (:candidateGroupIds)))", hql);
- }
- }
-
- if (suspended!=null) {
- if (suspended) {
- appendWhereClause("task.state = '"+ExecutionImpl.STATE_SUSPENDED+"' ", hql);
- } else {
- appendWhereClause("task.state != '"+ExecutionImpl.STATE_SUSPENDED+"' ", hql);
- }
- }
-
- if (processInstanceId!=null) {
- appendWhereClause("task.processInstance.id = '"+processInstanceId+"' ", hql);
- }
-
- if (activityName!=null) {
- appendWhereClause("task.execution.activityName = '"+activityName+"' ", hql);
- }
-
- if (processDefinitionId!=null) {
- appendWhereClause("task.processInstance.processDefinitionId = '"+processDefinitionId+"' ", hql);
- }
-
- if (assignee!=null) {
- appendWhereClause("task.assignee = :assignee ", hql);
- } else if (unassigned) {
- appendWhereClause("task.assignee is null ", hql);
- }
-
- appendOrderByClause(hql);
-
- String hqlQuery = hql.toString();
-
- log.debug(hqlQuery);
-
- return hqlQuery;
- }
-
- public List<Task> list() {
- return (List<Task>) commandService.execute(this);
- }
-
- public Task uniqueResult() {
- return (Task)untypedUniqueResult();
- }
-}
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/SuspendDeploymentTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/SuspendDeploymentTest.java 2009-07-03 09:32:54 UTC (rev 5210)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/SuspendDeploymentTest.java 2009-07-03 09:47:17 UTC (rev 5211)
@@ -96,8 +96,6 @@
repositoryService.suspendDeployment(deploymentHireId);
-
- expectedProcessNames.remove("hire");
processDefinitions = repositoryService
.createProcessDefinitionQuery()
@@ -177,6 +175,48 @@
assertEquals(expectedProcessNames, getProcessDefinitionNames(processDefinitions));
}
+ public void testQueryNonSuspendProcessDefinitions() {
+ deployJpdlXmlString(
+ "<process name='claim'>" +
+ " <start>" +
+ " <transition to='c' />" +
+ " </start>" +
+ " <state name='c' />" +
+ "</process>"
+ );
+
+ String deploymentHireId = deployJpdlXmlString(
+ "<process name='hire'>" +
+ " <start>" +
+ " <transition to='h' />" +
+ " </start>" +
+ " <state name='h' />" +
+ "</process>"
+ );
+
+ String deploymentFireId = deployJpdlXmlString(
+ "<process name='fire'>" +
+ " <start>" +
+ " <transition to='f' />" +
+ " </start>" +
+ " <state name='f' />" +
+ "</process>"
+ );
+
+ repositoryService.suspendDeployment(deploymentHireId);
+
+ List<ProcessDefinition> processDefinitions = repositoryService
+ .createProcessDefinitionQuery()
+ .notSuspended()
+ .list();
+
+ Set<String> expectedProcessNames = new HashSet<String>();
+ expectedProcessNames.add("claim");
+ expectedProcessNames.add("fire");
+
+ assertEquals(expectedProcessNames, getProcessDefinitionNames(processDefinitions));
+ }
+
int countProcessInstancesFor(List<ProcessInstance> processInstances, String processDefinitionKey) {
int count = 0;
for (Execution processInstance: processInstances) {
15 years, 4 months
JBoss JBPM SVN: r5210 - jbpm4/trunk/modules/devguide/src/main/docbook/en/modules.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-07-03 05:32:54 -0400 (Fri, 03 Jul 2009)
New Revision: 5210
Added:
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-Incubation.xml
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-ProcessVirtualMachine.xml
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch08-Configuration.xml
Removed:
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-ProcessVirtualMachine.xml
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Configuration.xml
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch08-AdvancedJpdl.xml
Modified:
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch01-Introduction.xml
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch13-JBossIntegration.xml
Log:
introducing incubation chapter in the devguide
Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch01-Introduction.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch01-Introduction.xml 2009-07-03 09:28:20 UTC (rev 5209)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch01-Introduction.xml 2009-07-03 09:32:54 UTC (rev 5210)
@@ -10,6 +10,21 @@
</section>
<section>
+ <title>Overview</title>
+ <para><xref linkend="incubation" /> explains the features that are intended to
+ move to the userguide eventually and become part of the supported offering. But
+ incubation features are not yet considered stable.
+ </para>
+ <para><xref linkend="processvirtualmachine" /> through <xref linkend="advancedgraphexecution" />
+ explain the process virtual machine and how activity and event listener can be build
+ for it.
+ </para>
+ <para><xref linkend="configuration" /> through <xref linkend="jbossintegration" />
+ explain internal developer topics.
+ </para>
+ </section>
+
+ <section>
<title>Sources and WIKI</title>
<para>The source code for jBPM can be found in our <ulink url="http://subversion.tigris.org/">SVN</ulink> repository:</para>
<ulink url="https://anonsvn.jboss.org/repos/jbpm/jbpm4/">https://anonsvn.jboss.org/repos/jbpm/jbpm4/</ulink>
Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-Incubation.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-Incubation.xml (rev 0)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-Incubation.xml 2009-07-03 09:32:54 UTC (rev 5210)
@@ -0,0 +1,585 @@
+<chapter id="incubation">
+ <title>Incubation</title>
+
+ <para>This section documents some of the more advanced activities and
+ features of jPDL that are still in incubation. Meaning these features
+ and activities are not supported yet. But they are available for you
+ to try and use. We don't give any stability guarantees on these
+ activities and features. So use at your own risk.
+ </para>
+
+ <!-- ### Timer ########################################################## -->
+ <section id="timer">
+ <title><literal>timer</literal> </title>
+ <para>IMPORTANT NOTE : Timers will be changed before they are moved to the
+ Userguide. See also
+ <ulink url="https://jira.jboss.org/jira/browse/JBPM-2329">https://jira.jboss.org/jira/browse/JBPM-2329</ulink>
+ </para>
+ <para>A timer can be specified in the <literal>transition</literal>
+ element in wait state activities such as <literal>state</literal>s,
+ <literal>task</literal>s, <literal>sub-process</literal>es and
+ <literal>group</literal>s.
+ When such a timer fires, that transition is taken.
+ </para>
+ <para>A timer can also be specified in custom events in wait state
+ activities such as <literal>state</literal>s,
+ <literal>task</literal>s, <literal>sub-process</literal>es and
+ <literal>group</literal>s. The <literal>timer</literal> element
+ should then be the first element in the <literal>on</literal> element representing
+ the event. In that case the event fires upon the duedate of the timer.
+ </para>
+ <para>Timers are created when the activity is entered. The timer can fire
+ when the execution remains in the activity until the <literal>duedate</literal>.
+ When the execution leaves the activity, the timer is cancelled.
+ </para>
+ <table><title><literal>timer</literal> 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>duedate</literal></entry>
+ <entry><link linkend="duedateexpressions">duedate expression</link></entry>
+ <entry></entry>
+ <entry><emphasis role="bold">required</emphasis></entry>
+ <entry>Specifies when the timer needs to fire. For
+ example: <literal>20 minutes</literal> or
+ <literal>3 business days</literal>
+ </entry>
+ </row>
+ <row>
+ <entry><literal>repeat</literal></entry>
+ <entry><link linkend="duedateexpressions">duedate expression</link></entry>
+ <entry></entry>
+ <entry>optional</entry>
+ <entry>When a timer fires, this attribute specifies when the timer
+ needs to fire again. For example: <literal>20 minutes</literal> or
+ <literal>3 business days</literal>
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <section id="duedateexpressions">
+ <title>Duedate expressions</title>
+ <para>A duedate expression has the following syntax:</para>
+ <programlisting>quantity [business] {second | seconds | minute | minutes |
+ hour | hours | day | days | week |
+ weeks | month | months | year | years}</programlisting>
+ <para>where <literal>quantity</literal> is a positive integer.
+ </para>
+ <para>And adding the optional indication <literal>business</literal> means
+ that only business hours should be taken into account for this duration. Without
+ the indication business, the duration will be interpreted as an absolute time period.
+ How to configure business hours is explained in <xref linkend="businesscalendar"/>
+ </para>
+ </section>
+
+ <section id="businesscalendar">
+ <title>Business calendar</title>
+ <para>The default configuration will contain a reference to the file
+ <literal>jbpm.business.calendar.xml</literal>. That contains a
+ configuration of business hours in the following format:
+ </para>
+ <programlisting><?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration xmlns="http://jbpm.org/xsd/cfg">
+
+ <process-engine-context>
+
+ <business-calendar>
+ <monday hours="9:00-12:00 and 12:30-17:00"/>
+ <tuesday hours="9:00-12:00 and 12:30-17:00"/>
+ <wednesday hours="9:00-12:00 and 12:30-17:00"/>
+ <thursday hours="9:00-12:00 and 12:30-17:00"/>
+ <friday hours="9:00-12:00 and 12:30-17:00"/>
+ <holiday period="01/07/2008 - 31/08/2008"/>
+ </business-calendar>
+
+ </process-engine-context>
+
+</jbpm-configuration></programlisting>
+ <para>For an example of where the business calendar is used, see
+ <xref linkedn="timerbusinesstime" />
+ </para>
+ </section>
+
+ <section id="timertransition">
+ <title>Timer transition</title>
+ <para>Example TimerTransitionTest shows how to put a timer on a transition.</para>
+ <figure id="process.timer.transition">
+ <title>The timer transition example process</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.timer.transition.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="TimerTransition" xmlns="http://jbpm.org/4.0/jpdl">
+
+ <start>
+ <transition to="guardedWait" />
+ </start>
+
+ <state name="guardedWait">
+ <transition name="go on" to="next step" />
+ <transition name="timeout" to="escalation">
+ <emphasis role="bold"><timer duedate="10 minutes" /></emphasis>
+ </transition>
+ </state>
+
+ <state name="next step" />
+ <state name="escalation" />
+
+</process></programlisting>
+ <para>When an process instance for this process is started, it arrives immediately
+ in the <literal>guardedWait</literal> state. At that time, a timer is created that will fire
+ after 10 minutes.
+ </para>
+ <programlisting>Execution processInstance = executionService
+ .startProcessInstanceByKey("TimerTransition");</programlisting>
+ <para>With the following query, we can query for the timers related to the newly created
+ processInstance. We know that there should be exactly one such timer.
+ </para>
+ <programlisting>Job job = managementService.createJobQuery()
+ .timers()
+ .processInstanceId(processInstance.getId())
+ .uniqueResult();
+ </programlisting>
+ <para>In a unit test, we won't use the JobExecutor to execute the timer. Instead,
+ we execute timers directly in the thread of the unit test. That way it is easy to
+ simulate one scenario though an execution.
+ </para>
+ <para>So as the next step, we assume that the timer will fire. We simulate this
+ by executing the timer programmatically:
+ </para>
+ <programlisting>managementService.executeJob(job.getDbid());</programlisting>
+ <para>After that the process instance will have taken the
+ <literal>timeout</literal> transition and moved to the escalation state.
+ </para>
+ <programlisting>processInstance = executionService.findExecutionById(processInstance.getId());
+assertEquals("escalation", processInstance.getActivityName());</programlisting>
+ <para>The second scenario in TimerTransitionTest shows that the
+ timer is cancelled in case the signal <literal>go on</literal> is given
+ before the timer fires. In that case the execution ends up in the
+ <literal>next step</literal>.
+ </para>
+ </section>
+
+ <section id="timerevent">
+ <title>Timer event</title>
+ <para>Example TimerEventTest shows how to put a timer on a custom event.</para>
+ <figure id="process.timer.event">
+ <title>The timer event example process</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.timer.event.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="TimerEvent" xmlns="http://jbpm.org/4.0/jpdl">
+
+ <start>
+ <transition to="guardedWait" />
+ </start>
+
+ <state name="guardedWait" >
+ <emphasis role="bold"><on event="timeout">
+ <timer duedate="10 minutes"/>
+ <event-listener class="org.jbpm.examples.timer.event.Escalate" />
+ </on></emphasis>
+ <transition name="go on" to="next step" />
+ </state>
+
+ <state name="next step" />
+
+</process></programlisting>
+ <para>In this case, if the execution is not signalled within 10 minutes after the
+ activity is started, the event <literal>timeout</literal> is fired
+ and the event listener <literal>org.jbpm.examples.timer.event.Escalate</literal>
+ will be notified.
+ </para>
+ <para>Again, if the <literal>guardedWait</literal> activity is ended within
+ 10 minutes, then the timer is cancelled and the <literal>Escalate</literal>
+ event listener will not be notified.
+ </para>
+ </section>
+
+ <section id="timerbusinesstime">
+ <title>Timer business time</title>
+ <para>Example TimerBusinessTimeTest shows how business time works.</para>
+ <figure id="process.timer.event">
+ <title>The timer businesstime example process</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.timer.transition.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="TimerBusinessTime" xmlns="http://jbpm.org/4.0/jpdl">
+
+ <start>
+ <transition to="guardedWait" />
+ </start>
+
+ <state name="guardedWait" >
+ <transition name="go on" to="next step" />
+ <transition name="timeout" to="escalation" >
+ <timer <emphasis role="bold">duedate="9 business hours"</emphasis> />
+ </transition>
+ </state>
+
+ <state name="next step" />
+ <state name="escalation" />
+
+</process></programlisting>
+ <para>Suppose that a new <literal>TimerBusinessTime</literal> process instance is started
+ at 11:30am on a tuesday. The default configured business calendar specifies working hours
+ between 9:00-12:00 and 12:30-17:00. So 9 business hours later results in an actual duedate
+ for the timer of wednesday 13:00 (1pm).
+ </para>
+ <para>Since we do not know when the TimerBusinessTimeTest will be ran, we only assert
+ in the test that the actual duedate of the scheduled timer at least 24 hours ahead.
+ </para>
+ </section>
+
+ <section id="timerrepeat">
+ <title>Timer repeat</title>
+ <para>Example TimerRepeatTest shows how to put a timer with a repeat. The attribute
+ <literal>repeat</literal> on a timer will cause the timer to be rescheduled automatically
+ after it is executed.
+ </para>
+ <figure id="process.timer.repeat">
+ <title>The timer repeat example process</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.timer.event.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="TimerRepeat" xmlns="http://jbpm.org/4.0/jpdl">
+
+ <start>
+ <transition to="guardedWait" />
+ </start>
+
+ <state name="guardedWait">
+ <on event="timeout">
+ <timer duedate="20 minutes" <emphasis role="bold">repeat="10 seconds"</emphasis> />
+ <event-listener class="org.jbpm.examples.timer.repeat.Escalate" />
+ </on>
+ <transition name="go on" to="next step"/>
+ </state>
+
+ <state name="next step"/>
+
+</process></programlisting>
+ <para>When a new process is started, a timer is created and the duedate
+ will be 20 minutes ahead. When the timer fires, a new timer will be created
+ with a duedate of 10 seconds ahead. When that timer fires, a new timer will
+ be created again 10 seconds ahead. And so on.
+ </para>
+ <para>New timers will be created each time the timer fires until the
+ <literal>guardedWait</literal> state activity is ended with a signal.
+ When the <literal>guardedWait</literal> state activity is ended, the
+ existing timer will be cancelled.
+ </para>
+ </section>
+ </section>
+
+ <!-- ### GROUP ########################################################## -->
+ <section id="group">
+ <title><literal>group</literal></title>
+
+ <para>A group groups a set of activities in a process. Contained groups must
+ be hierarchically nested. A group corresponds to a BPMN expanded sub process.
+ </para>
+
+ <table><title><literal>group</literal> elements:</title>
+ <tgroup cols="3" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Element</entry>
+ <entry>Multiplicity</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>any activity</entry>
+ <entry>0..*</entry>
+ <entry>Contained activities.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>transition</literal></entry>
+ <entry>0..*</entry>
+ <entry>Outgoing transitions for the group activity.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <!-- ~~~ GROUP SIMPLE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <section id="groupsimple">
+ <title><literal>group</literal> simple</title>
+ <para>This example scenario shows the basic operations of a <literal>group</literal>.
+ </para>
+ <figure id="process.group.simple">
+ <title>The simple group example process</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.group.simple.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="GroupSimple" xmlns="http://jbpm.org/4.0/jpdl">
+
+ <start>
+ <transition to="evaluate document" />
+ </start>
+
+ <emphasis role="bold"><group name="evaluate document"></emphasis>
+ <start>
+ <transition to="distribute document" />
+ </start>
+ <state name="distribute document">
+ <transition to="collect feedback" />
+ </state>
+ <state name="collect feedback">
+ <transition name="approved" to="done" />
+ <transition name="rejected" to="update document" />
+ </state>
+ <state name="update document">
+ <transition to="distribute document" />
+ </state>
+ <end name="done" />
+ <transition to="publish document" />
+ <emphasis role="bold"></group></emphasis>
+
+ <state name="publish document" />
+
+</process></programlisting>
+ <para>The next code snippet shows a test scenario that rejects a document
+ when it comes in the <literal>collect feedback</literal> first time round.
+ Then it goes through <literal>update document</literal>, <literal>distribute document</literal>
+ and back to <literal>collect feedback</literal>. The second time,
+ it will be approved. All activities involved are wait <literal>state</literal>s.
+ </para>
+ <programlisting>ProcessInstance processInstance = executionService
+ .startProcessInstanceByKey("GroupSimple");
+String pid = processInstance.getId();
+assertEquals("distribute document", processInstance.getActivityName());
+
+processInstance = executionService.signalExecutionById(pid);
+assertEquals("collect feedback", processInstance.getActivityName());
+
+processInstance = executionService.signalExecutionById(pid, "rejected");
+assertEquals("update document", processInstance.getActivityName());
+
+processInstance = executionService.signalExecutionById(pid);
+assertEquals("distribute document", processInstance.getActivityName());
+
+processInstance = executionService.signalExecutionById(pid);
+assertEquals("collect feedback", processInstance.getActivityName());
+
+processInstance = executionService.signalExecutionById(pid, "approved");
+assertEquals("publish document", processInstance.getActivityName());</programlisting>
+ </section>
+
+ <!-- ~~~ GROUP TIMER ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <section id="grouptimer">
+ <title><literal>group</literal> timer</title>
+ <figure id="process.group.timer">
+ <title>The group timer example process</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.group.timer.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="GroupTimer" xmlns="http://jbpm.org/4.0/jpdl">
+
+ <start>
+ <transition to="evaluate document" />
+ </start>
+
+ <emphasis role="bold"><group name="evaluate document"></emphasis>
+ <start>
+ <transition to="approve" />
+ </start>
+ <state name="approve">
+ <transition to="done" />
+ </state>
+ <end name="done" />
+
+ <transition to="publish document" />
+ <emphasis role="bold"><transition name="timeout" to="escalate">
+ <timer duedate="2 business hours" />
+ </transition></emphasis>
+
+ <emphasis role="bold"></group></emphasis>
+
+ <state name="escalate" />
+ <state name="publish document" />
+
+</process></programlisting>
+ <para>The next code snippet shows a test scenario in which the timer will
+ fire before the group activity <literal>evaluate document</literal> completes.
+ </para>
+ <programlisting>ProcessInstance processInstance = executionService
+ .startProcessInstanceByKey("GroupTimer");
+Execution approveExecution = processInstance
+ .findActiveExecutionIn("approve");
+assertNotNull(approveExecution);
+
+List<Job> jobs = managementService
+ .createJobQuery()
+ .processInstanceId(processInstance.getId())
+ .list();
+
+assertEquals(1, jobs.size());
+
+Timer timer = (Timer) jobs.get(0);
+
+managementService.executeJob(timer.getDbid());
+
+processInstance = executionService
+ .findProcessInstanceById(processInstance.getId());
+assertNotNull(processInstance.findActiveExecutionIn("escalate") );</programlisting>
+ </section>
+
+ <!-- ~~~ GROUP MULTIPLE ENTRIES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <section id="groupmultipleentries">
+ <title><literal>group</literal> multiple entries</title>
+ <para>This shows how a group can have multiple exclusive entry points.</para>
+ <para>Analogue to multiple entry points, a group can also have
+ multiple exit points.</para>
+ <figure id="process.group.multipleentries">
+ <title>The group multiple entries example process</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.group.multipleentries.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="GroupMultipleEntries" xmlns="http://jbpm.org/4.0/jpdl">
+
+ <start>
+ <transition to="choose strategy" />
+ </start>
+
+ <decision name="choose strategy" expr="#{time}">
+ <emphasis role="bold"><transition name="plenty" to="play" />
+ <transition name="running out" to="plan" /></emphasis>
+ </decision>
+
+ <group name="evaluate project">
+ <emphasis role="bold"><start name="play">
+ <transition to="distribute document" />
+ </start></emphasis>
+ <state name="distribute document" />
+
+ <emphasis role="bold"><start name="plan">
+ <transition to="make planning" />
+ </start></emphasis>
+ <state name="make planning" />
+ </group>
+
+</process></programlisting>
+ <para>The following scenario will be when there is plenty of time:
+ </para>
+ <programlisting>Map<String, Object> variables = new HashMap<String, Object>();
+variables.put("time", "plenty");
+
+ProcessInstance pi = executionService
+ .startProcessInstanceByKey("GroupMultipleEntries", variables);
+
+assertNotNull(pi.findActiveExecutionIn("distribute document"));</programlisting>
+ <para>The following scenario will be when there is time is running out:
+ </para>
+ <programlisting>Map<String, Object> variables = new HashMap<String, Object>();
+variables.put("time", "running out");
+
+ProcessInstance pi = executionService
+ .startProcessInstanceByKey("GroupMultipleEntries", variables);
+
+assertNotNull(pi.findActiveExecutionIn("make planning"));</programlisting>
+ </section>
+
+ <!-- ~~~ GROUP CONCURRENCY ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <section id="groupconcurrency">
+ <title><literal>group</literal> concurrency</title>
+ <para>This scenario shows how a group can be used to create concurrent paths
+ of execution. When an execution arrives in a group, each activity that doesn't
+ have incoming transitions is started. So the first activities don't have to be
+ start activities. The group takes the default transition out when all contained
+ work is done.
+ </para>
+ <figure id="process.group.concurrency">
+ <title>The group concurrency example process</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.group.concurrency.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting>
+
+<process name="GroupConcurrency" xmlns="http://jbpm.org/4.0/jpdl">
+
+ <start>
+ <transition to="evaluate project" />
+ </start>
+
+ <group name="evaluate project">
+ <emphasis role="bold"><start>
+ <transition to="distribute document" />
+ </start></emphasis>
+ <state name="distribute document">
+ <transition to="collect feedback" />
+ </state>
+ <state name="collect feedback">
+ <transition to="document finished" />
+ </state>
+ <end name="document finished" />
+
+ <emphasis role="bold"><start>
+ <transition to="make planning" />
+ </start></emphasis>
+ <state name="make planning">
+ <transition to="estimate budget" />
+ </state>
+ <state name="estimate budget">
+ <transition to="planning finished" />
+ </state>
+ <end name="planning finished" />
+
+ <transition to="public project announcement" />
+ </group>
+
+ <state name="public project announcement" />
+
+</process></programlisting>
+ <para>The following scenario will show a scenario in which all
+ wait <literal>state</literal> acitivities are signalled in some random
+ order till all work is done:
+ </para>
+ <programlisting>ProcessInstance pi = executionService
+ .startProcessInstanceByKey("GroupConcurrency");
+
+String documentExecutionId = pi
+ .findActiveExecutionIn("distribute document").getId();
+
+String planningExecutionId = pi
+ .findActiveExecutionIn("make planning").getId();
+
+pi = executionService.signalExecutionById(documentExecutionId);
+assertNotNull(pi.findActiveExecutionIn("collect feedback"));
+assertNotNull(pi.findActiveExecutionIn("make planning"));
+
+pi = executionService.signalExecutionById(planningExecutionId);
+assertNotNull(pi.findActiveExecutionIn("collect feedback"));
+assertNotNull(pi.findActiveExecutionIn("estimate budget"));
+
+pi = executionService.signalExecutionById(planningExecutionId);
+assertNotNull(pi.findActiveExecutionIn("collect feedback"));
+
+pi = executionService.signalExecutionById(documentExecutionId);
+assertNotNull(pi.findActiveExecutionIn("public project announcement"));</programlisting>
+
+ </section>
+
+ <!-- ~~~ GROUP SECRET ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <section id="groupsecret">
+ <title><literal>group</literal> secret</title>
+ <para>Groups also support that you create transitions over group
+ boundaries. So it's possible to have a tranition from an activity
+ outside the group directly to an activity inside the group without
+ modelling a start activity on the border of the group. Similarly
+ with transitions from activities inside the group to activities
+ outside the group. But shhhhhhhhh!
+ Don't tell anyone cause this is not BPMN compliant.
+ </para>
+ </section>
+
+ </section>
+
+</chapter>
Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-Incubation.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-ProcessVirtualMachine.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-ProcessVirtualMachine.xml 2009-07-03 09:28:20 UTC (rev 5209)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-ProcessVirtualMachine.xml 2009-07-03 09:32:54 UTC (rev 5210)
@@ -1,50 +0,0 @@
-<chapter id="processvirtualmachine">
- <title>The Process Virtual Machine</title>
- <para>To accomodate multiple process languages and activity pluggability, jBPM is based on
- the Process Virtual Machine. In essence, the Process Virtual Machine is a framework specifying
- executable graphs. A process definition represents an execution flow
- and has a structure that be represented graphically as a diagram.
- </para>
- <para>The Process Virtual Machine separates the structure from a process definition from
- the activity behaviours. The Process Virtual Machine takes the execution of a process from
- one activity to the next and delegates the behaviour of the activities to pluggable Java classes.
- There is an API (<literal>ActivityBehaviour</literal>) that serves as the interface between
- the Process Virtual Machine and the activity behaviour code. Languages like jPDL are
- merely a set of ActivityBehaviour implementations and a parser.
- </para>
- <figure id="example.process.graph">
- <title>Example process definition</title>
- <mediaobject><imageobject><imagedata align="center" fileref="images/process.loan.png"/></imageobject></mediaobject>
- </figure>
- <para>Typically, process definitions are static. A process definition is composed of
- activities and transitions. The runtime behaviour of a activity is encapsulated in a so called
- Activity and it's decoupled from the process graph structure.
- </para>
- <figure id="class.diagram.process.definition">
- <title>Process structure class diagram</title>
- <mediaobject><imageobject><imagedata align="center" fileref="images/class.diagram.process.definition.png"/></imageobject></mediaobject>
- </figure>
- <para>The Process Virtual
- Machine doesn't contain any such activity implementations. It only provides the
- execution environment and an activity API to write <literal>ActivityBehaviour</literal>
- implementations as Java components. Activities can also be wait states. This means
- that the activity control flow goes outside the process system. For example a human task
- or invoking an service asynchronously. While the execution is waiting, the runtime state
- of that execution can be persisted in a DB.
- </para>
- <para>Many executions can be started for one process definition. An execution is a pointer
- that keeps track of the current activity.
- </para>
- <figure id="example.execution">
- <title>Example execution</title>
- <mediaobject><imageobject><imagedata align="center" fileref="images/loan.execution.png"/></imageobject></mediaobject>
- </figure>
- <para>To represent concurrent paths of execution, there is
- a hierarchical parent-child relation between so that one process instance can cope with concurrent
- paths of execution.
- </para>
- <figure id="class.diagram.process.execution">
- <title>Execution class diagram</title>
- <mediaobject><imageobject><imagedata align="center" fileref="images/class.diagram.process.execution.png"/></imageobject></mediaobject>
- </figure>
-</chapter>
Deleted: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Configuration.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Configuration.xml 2009-07-03 09:28:20 UTC (rev 5209)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Configuration.xml 2009-07-03 09:32:54 UTC (rev 5210)
@@ -1,118 +0,0 @@
-<chapter id="configuration">
- <title>Configuration</title>
-
- <section>
- <title>Configuration basics</title>
-
- <para>The userguide explains how to install jBPM into the most
- common runtime environments. That is the most simple and convenient
- way to get started with jBPM. Please use those instructions.
- These docs provide some background information for developers
- that want to understand more about the way how configurations are
- handled. Use at your own risk :-)
- </para>
- <para>The jbpm.jar contains a number of default configuration
- files that can be imported by the user configuration file.
- </para>
- <para>This way, it's easy to include
- or exclude features for users. And also the configuration details are kept in
- the implementation so users that only import those configuration files
- will not be affected when we release changes in those configuration files.
- </para>
- <para>Configuration files that can be imported by the user's <literal>jbpm.cfg.xml</literal>:</para>
- <itemizedlist>
- <listitem>jbpm.default.cfg.xml</listitem>
- <listitem>jbpm.identity.cfg.xml</listitem>
- <listitem>jbpm.jbossremote.cfg.xml</listitem>
- <listitem>jbpm.jobexecutor.cfg.xml</listitem>
- <listitem>jbpm.tx.hibernate.cfg.xml</listitem>
- <listitem>jbpm.tx.jta.cfg.xml</listitem>
- </itemizedlist>
- <para><literal>jbpm.default.cfg.xml</literal>: Contains the default configurations
- like the services, the hibernate configuration (configured from resource jbpm.hibernate.cfg.xml),
- hibernate session factory, business calendar and so on.
- </para>
- <para>A typical configuration for standard java would look like this:
- </para>
- <programlisting><?xml version="1.0" encoding="UTF-8"?>
-
- <jbpm-configuration>
-
- <import resource="jbpm.default.cfg.xml" />
- <import resource="jbpm.tx.hibernate.cfg.xml" />
- <import resource="jbpm.jpdl.cfg.xml" />
- <import resource="jbpm.identity.cfg.xml" />
- <import resource="jbpm.jobexecutor.cfg.xml" />
-
- </jbpm-configuration></programlisting>
-
- <para>When you want to change the configuration, first consider
- to change an import with one of the other provided importable
- configuration files.
- </para>
-
- <para>For example, in a JTA environment, replace the import of
- <literal>jbpm.tx.hibernate.cfg.xml</literal>
- with <literal>jbpm.tx.jta.cfg.xml</literal>
- </para>
-
- <para>The second way to define a more customized configuration is to
- specify configuration items directly into the <literal>jbpm.cfg.xml</literal>.
- For an example, see <xref linkend="customizingtheidentitycomponent" /> below.
- The more you customize, the more likely you are doing things we didn't
- anticipate.
- </para>
-
- <para>The jbpm.jar contains also following hibernate mapping configuration files:</para>
- <programlisting>jbpm.execution.hbm.xml
- jbpm.history.hbm.xml
- jbpm.identity.hbm.xml
- jbpm.repository.hbm.xml
- jbpm.task.hbm.xml</programlisting>
- <para>These all map the java domain model objects to a relational database.
- </para>
- <para>Other various configuration files that are included in jbpm.jar:</para>
- <programlisting>jbpm.task.lifecycle.xml
- jbpm.variable.types.xml
- jbpm.wire.bindings.xml
- jbpm.jpdl.activities.xml
- jbpm.jpdl.eventlisteners.xml</programlisting>
-
- <para>Normally it is not necessary to dive into the parsing itself. It's most
- a matter of figuring out how to specify the configuration that you want :-)
- But just in case: To get started on the parsing for the configuration files, see
- </para>
- <itemizedlist>
- <listitem>class org.jbpm.pvm.internal.env.JbpmConfigurationParser</listitem>
- <listitem>resource modules/pvm/src/main/resources/jbpm.wire.bindings.xml</listitem>
- <listitem>package modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding</listitem>
- </itemizedlist>
- </section>
-
- <section id="customizingtheidentitycomponent">
- <title>Customizing the identity component</title>
- <para>There are 2 identity components that we support out of the box:
- </para>
- <itemizedlist>
- <listitem>jBPM's built-in identity component: ships with the jBPM project distro</listitem>
- <listitem>JBoss IDM: ships in the JBoss product platforms</listitem>
- </itemizedlist>
- <para>The <literal>jboss/build.xml</literal> installation scripts can be used
- to install jBPM in JBoss using the JBoss IDM component. There is some
- property in that build file to overwrite the default built-in identity component
- with the value for the JBoss IDM component.
- </para>
- <para>If you want to plug in your own identity component, remove the
- following line in the <literal>jbpm.cfg.xml</literal>:
- </para>
- <programlisting><import resource="jbpm.identity.cfg.xml" /></programlisting>
- <para>And in the same file, add following section</para>
- <programlisting><transaction-context>
- <object class="your.package.YourIdentitySessionImpl" />
-</transaction-context></programlisting>
- <para>YourIdentitySessionImpl should implement <literal>org.jbpm.pvm.internal.identity.spi.IdentitySession</literal>
- Making this identity pluggable is not our first target, but it was taken into the design. Let us know how it goes.
- </para>
- </section>
-
-</chapter>
\ No newline at end of file
Copied: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-ProcessVirtualMachine.xml (from rev 5192, jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-ProcessVirtualMachine.xml)
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-ProcessVirtualMachine.xml (rev 0)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-ProcessVirtualMachine.xml 2009-07-03 09:32:54 UTC (rev 5210)
@@ -0,0 +1,50 @@
+<chapter id="processvirtualmachine">
+ <title>The Process Virtual Machine</title>
+ <para>To accomodate multiple process languages and activity pluggability, jBPM is based on
+ the Process Virtual Machine. In essence, the Process Virtual Machine is a framework specifying
+ executable graphs. A process definition represents an execution flow
+ and has a structure that be represented graphically as a diagram.
+ </para>
+ <para>The Process Virtual Machine separates the structure from a process definition from
+ the activity behaviours. The Process Virtual Machine takes the execution of a process from
+ one activity to the next and delegates the behaviour of the activities to pluggable Java classes.
+ There is an API (<literal>ActivityBehaviour</literal>) that serves as the interface between
+ the Process Virtual Machine and the activity behaviour code. Languages like jPDL are
+ merely a set of ActivityBehaviour implementations and a parser.
+ </para>
+ <figure id="example.process.graph">
+ <title>Example process definition</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.loan.png"/></imageobject></mediaobject>
+ </figure>
+ <para>Typically, process definitions are static. A process definition is composed of
+ activities and transitions. The runtime behaviour of a activity is encapsulated in a so called
+ Activity and it's decoupled from the process graph structure.
+ </para>
+ <figure id="class.diagram.process.definition">
+ <title>Process structure class diagram</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/class.diagram.process.definition.png"/></imageobject></mediaobject>
+ </figure>
+ <para>The Process Virtual
+ Machine doesn't contain any such activity implementations. It only provides the
+ execution environment and an activity API to write <literal>ActivityBehaviour</literal>
+ implementations as Java components. Activities can also be wait states. This means
+ that the activity control flow goes outside the process system. For example a human task
+ or invoking an service asynchronously. While the execution is waiting, the runtime state
+ of that execution can be persisted in a DB.
+ </para>
+ <para>Many executions can be started for one process definition. An execution is a pointer
+ that keeps track of the current activity.
+ </para>
+ <figure id="example.execution">
+ <title>Example execution</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/loan.execution.png"/></imageobject></mediaobject>
+ </figure>
+ <para>To represent concurrent paths of execution, there is
+ a hierarchical parent-child relation between so that one process instance can cope with concurrent
+ paths of execution.
+ </para>
+ <figure id="class.diagram.process.execution">
+ <title>Execution class diagram</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/class.diagram.process.execution.png"/></imageobject></mediaobject>
+ </figure>
+</chapter>
Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-ProcessVirtualMachine.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch08-AdvancedJpdl.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch08-AdvancedJpdl.xml 2009-07-03 09:28:20 UTC (rev 5209)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch08-AdvancedJpdl.xml 2009-07-03 09:32:54 UTC (rev 5210)
@@ -1,581 +0,0 @@
-<chapter id="advancedjpdl">
- <title>Advanced jPDL</title>
-
- <para>This section documents some of the more advanced activities and
- features of jPDL that are still in incubation. Meaning these features
- and activities are not supported yet. But they are available for you
- to try and use. We don't give any stability guarantees on these
- activities and features. So use at your own risk.
- </para>
-
- <!-- ### Timer ########################################################## -->
- <section id="timer">
- <title><literal>timer</literal> </title>
- <para>A timer can be specified in the <literal>transition</literal>
- element in wait state activities such as <literal>state</literal>s,
- <literal>task</literal>s, <literal>sub-process</literal>es and
- <literal>group</literal>s.
- When such a timer fires, that transition is taken.
- </para>
- <para>A timer can also be specified in custom events in wait state
- activities such as <literal>state</literal>s,
- <literal>task</literal>s, <literal>sub-process</literal>es and
- <literal>group</literal>s. The <literal>timer</literal> element
- should then be the first element in the <literal>on</literal> element representing
- the event. In that case the event fires upon the duedate of the timer.
- </para>
- <para>Timers are created when the activity is entered. The timer can fire
- when the execution remains in the activity until the <literal>duedate</literal>.
- When the execution leaves the activity, the timer is cancelled.
- </para>
- <table><title><literal>timer</literal> 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>duedate</literal></entry>
- <entry><link linkend="duedateexpressions">duedate expression</link></entry>
- <entry></entry>
- <entry><emphasis role="bold">required</emphasis></entry>
- <entry>Specifies when the timer needs to fire. For
- example: <literal>20 minutes</literal> or
- <literal>3 business days</literal>
- </entry>
- </row>
- <row>
- <entry><literal>repeat</literal></entry>
- <entry><link linkend="duedateexpressions">duedate expression</link></entry>
- <entry></entry>
- <entry>optional</entry>
- <entry>When a timer fires, this attribute specifies when the timer
- needs to fire again. For example: <literal>20 minutes</literal> or
- <literal>3 business days</literal>
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <section id="duedateexpressions">
- <title>Duedate expressions</title>
- <para>A duedate expression has the following syntax:</para>
- <programlisting>quantity [business] {second | seconds | minute | minutes |
- hour | hours | day | days | week |
- weeks | month | months | year | years}</programlisting>
- <para>where <literal>quantity</literal> is a positive integer.
- </para>
- <para>And adding the optional indication <literal>business</literal> means
- that only business hours should be taken into account for this duration. Without
- the indication business, the duration will be interpreted as an absolute time period.
- How to configure business hours is explained in <xref linkend="businesscalendar"/>
- </para>
- </section>
-
- <section id="businesscalendar">
- <title>Business calendar</title>
- <para>The default configuration will contain a reference to the file
- <literal>jbpm.business.calendar.xml</literal>. That contains a
- configuration of business hours in the following format:
- </para>
- <programlisting><?xml version="1.0" encoding="UTF-8"?>
-
-<jbpm-configuration xmlns="http://jbpm.org/xsd/cfg">
-
- <process-engine-context>
-
- <business-calendar>
- <monday hours="9:00-12:00 and 12:30-17:00"/>
- <tuesday hours="9:00-12:00 and 12:30-17:00"/>
- <wednesday hours="9:00-12:00 and 12:30-17:00"/>
- <thursday hours="9:00-12:00 and 12:30-17:00"/>
- <friday hours="9:00-12:00 and 12:30-17:00"/>
- <holiday period="01/07/2008 - 31/08/2008"/>
- </business-calendar>
-
- </process-engine-context>
-
-</jbpm-configuration></programlisting>
- <para>For an example of where the business calendar is used, see
- <xref linkedn="timerbusinesstime" />
- </para>
- </section>
-
- <section id="timertransition">
- <title>Timer transition</title>
- <para>Example TimerTransitionTest shows how to put a timer on a transition.</para>
- <figure id="process.timer.transition">
- <title>The timer transition example process</title>
- <mediaobject><imageobject><imagedata align="center" fileref="images/process.timer.transition.png"/></imageobject></mediaobject>
- </figure>
- <programlisting><process name="TimerTransition" xmlns="http://jbpm.org/4.0/jpdl">
-
- <start>
- <transition to="guardedWait" />
- </start>
-
- <state name="guardedWait">
- <transition name="go on" to="next step" />
- <transition name="timeout" to="escalation">
- <emphasis role="bold"><timer duedate="10 minutes" /></emphasis>
- </transition>
- </state>
-
- <state name="next step" />
- <state name="escalation" />
-
-</process></programlisting>
- <para>When an process instance for this process is started, it arrives immediately
- in the <literal>guardedWait</literal> state. At that time, a timer is created that will fire
- after 10 minutes.
- </para>
- <programlisting>Execution processInstance = executionService
- .startProcessInstanceByKey("TimerTransition");</programlisting>
- <para>With the following query, we can query for the timers related to the newly created
- processInstance. We know that there should be exactly one such timer.
- </para>
- <programlisting>Job job = managementService.createJobQuery()
- .timers()
- .processInstanceId(processInstance.getId())
- .uniqueResult();
- </programlisting>
- <para>In a unit test, we won't use the JobExecutor to execute the timer. Instead,
- we execute timers directly in the thread of the unit test. That way it is easy to
- simulate one scenario though an execution.
- </para>
- <para>So as the next step, we assume that the timer will fire. We simulate this
- by executing the timer programmatically:
- </para>
- <programlisting>managementService.executeJob(job.getDbid());</programlisting>
- <para>After that the process instance will have taken the
- <literal>timeout</literal> transition and moved to the escalation state.
- </para>
- <programlisting>processInstance = executionService.findExecutionById(processInstance.getId());
-assertEquals("escalation", processInstance.getActivityName());</programlisting>
- <para>The second scenario in TimerTransitionTest shows that the
- timer is cancelled in case the signal <literal>go on</literal> is given
- before the timer fires. In that case the execution ends up in the
- <literal>next step</literal>.
- </para>
- </section>
-
- <section id="timerevent">
- <title>Timer event</title>
- <para>Example TimerEventTest shows how to put a timer on a custom event.</para>
- <figure id="process.timer.event">
- <title>The timer event example process</title>
- <mediaobject><imageobject><imagedata align="center" fileref="images/process.timer.event.png"/></imageobject></mediaobject>
- </figure>
- <programlisting><process name="TimerEvent" xmlns="http://jbpm.org/4.0/jpdl">
-
- <start>
- <transition to="guardedWait" />
- </start>
-
- <state name="guardedWait" >
- <emphasis role="bold"><on event="timeout">
- <timer duedate="10 minutes"/>
- <event-listener class="org.jbpm.examples.timer.event.Escalate" />
- </on></emphasis>
- <transition name="go on" to="next step" />
- </state>
-
- <state name="next step" />
-
-</process></programlisting>
- <para>In this case, if the execution is not signalled within 10 minutes after the
- activity is started, the event <literal>timeout</literal> is fired
- and the event listener <literal>org.jbpm.examples.timer.event.Escalate</literal>
- will be notified.
- </para>
- <para>Again, if the <literal>guardedWait</literal> activity is ended within
- 10 minutes, then the timer is cancelled and the <literal>Escalate</literal>
- event listener will not be notified.
- </para>
- </section>
-
- <section id="timerbusinesstime">
- <title>Timer business time</title>
- <para>Example TimerBusinessTimeTest shows how business time works.</para>
- <figure id="process.timer.event">
- <title>The timer businesstime example process</title>
- <mediaobject><imageobject><imagedata align="center" fileref="images/process.timer.transition.png"/></imageobject></mediaobject>
- </figure>
- <programlisting><process name="TimerBusinessTime" xmlns="http://jbpm.org/4.0/jpdl">
-
- <start>
- <transition to="guardedWait" />
- </start>
-
- <state name="guardedWait" >
- <transition name="go on" to="next step" />
- <transition name="timeout" to="escalation" >
- <timer <emphasis role="bold">duedate="9 business hours"</emphasis> />
- </transition>
- </state>
-
- <state name="next step" />
- <state name="escalation" />
-
-</process></programlisting>
- <para>Suppose that a new <literal>TimerBusinessTime</literal> process instance is started
- at 11:30am on a tuesday. The default configured business calendar specifies working hours
- between 9:00-12:00 and 12:30-17:00. So 9 business hours later results in an actual duedate
- for the timer of wednesday 13:00 (1pm).
- </para>
- <para>Since we do not know when the TimerBusinessTimeTest will be ran, we only assert
- in the test that the actual duedate of the scheduled timer at least 24 hours ahead.
- </para>
- </section>
-
- <section id="timerrepeat">
- <title>Timer repeat</title>
- <para>Example TimerRepeatTest shows how to put a timer with a repeat. The attribute
- <literal>repeat</literal> on a timer will cause the timer to be rescheduled automatically
- after it is executed.
- </para>
- <figure id="process.timer.repeat">
- <title>The timer repeat example process</title>
- <mediaobject><imageobject><imagedata align="center" fileref="images/process.timer.event.png"/></imageobject></mediaobject>
- </figure>
- <programlisting><process name="TimerRepeat" xmlns="http://jbpm.org/4.0/jpdl">
-
- <start>
- <transition to="guardedWait" />
- </start>
-
- <state name="guardedWait">
- <on event="timeout">
- <timer duedate="20 minutes" <emphasis role="bold">repeat="10 seconds"</emphasis> />
- <event-listener class="org.jbpm.examples.timer.repeat.Escalate" />
- </on>
- <transition name="go on" to="next step"/>
- </state>
-
- <state name="next step"/>
-
-</process></programlisting>
- <para>When a new process is started, a timer is created and the duedate
- will be 20 minutes ahead. When the timer fires, a new timer will be created
- with a duedate of 10 seconds ahead. When that timer fires, a new timer will
- be created again 10 seconds ahead. And so on.
- </para>
- <para>New timers will be created each time the timer fires until the
- <literal>guardedWait</literal> state activity is ended with a signal.
- When the <literal>guardedWait</literal> state activity is ended, the
- existing timer will be cancelled.
- </para>
- </section>
- </section>
-
- <!-- ### GROUP ########################################################## -->
- <section id="group">
- <title><literal>group</literal></title>
-
- <para>A group groups a set of activities in a process. Contained groups must
- be hierarchically nested. A group corresponds to a BPMN expanded sub process.
- </para>
-
- <table><title><literal>group</literal> elements:</title>
- <tgroup cols="3" rowsep="1" colsep="1">
- <thead>
- <row>
- <entry>Element</entry>
- <entry>Multiplicity</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>any activity</entry>
- <entry>0..*</entry>
- <entry>Contained activities.
- </entry>
- </row>
- <row>
- <entry><literal>transition</literal></entry>
- <entry>0..*</entry>
- <entry>Outgoing transitions for the group activity.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <!-- ~~~ GROUP SIMPLE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <section id="groupsimple">
- <title><literal>group</literal> simple</title>
- <para>This example scenario shows the basic operations of a <literal>group</literal>.
- </para>
- <figure id="process.group.simple">
- <title>The simple group example process</title>
- <mediaobject><imageobject><imagedata align="center" fileref="images/process.group.simple.png"/></imageobject></mediaobject>
- </figure>
- <programlisting><process name="GroupSimple" xmlns="http://jbpm.org/4.0/jpdl">
-
- <start>
- <transition to="evaluate document" />
- </start>
-
- <emphasis role="bold"><group name="evaluate document"></emphasis>
- <start>
- <transition to="distribute document" />
- </start>
- <state name="distribute document">
- <transition to="collect feedback" />
- </state>
- <state name="collect feedback">
- <transition name="approved" to="done" />
- <transition name="rejected" to="update document" />
- </state>
- <state name="update document">
- <transition to="distribute document" />
- </state>
- <end name="done" />
- <transition to="publish document" />
- <emphasis role="bold"></group></emphasis>
-
- <state name="publish document" />
-
-</process></programlisting>
- <para>The next code snippet shows a test scenario that rejects a document
- when it comes in the <literal>collect feedback</literal> first time round.
- Then it goes through <literal>update document</literal>, <literal>distribute document</literal>
- and back to <literal>collect feedback</literal>. The second time,
- it will be approved. All activities involved are wait <literal>state</literal>s.
- </para>
- <programlisting>ProcessInstance processInstance = executionService
- .startProcessInstanceByKey("GroupSimple");
-String pid = processInstance.getId();
-assertEquals("distribute document", processInstance.getActivityName());
-
-processInstance = executionService.signalExecutionById(pid);
-assertEquals("collect feedback", processInstance.getActivityName());
-
-processInstance = executionService.signalExecutionById(pid, "rejected");
-assertEquals("update document", processInstance.getActivityName());
-
-processInstance = executionService.signalExecutionById(pid);
-assertEquals("distribute document", processInstance.getActivityName());
-
-processInstance = executionService.signalExecutionById(pid);
-assertEquals("collect feedback", processInstance.getActivityName());
-
-processInstance = executionService.signalExecutionById(pid, "approved");
-assertEquals("publish document", processInstance.getActivityName());</programlisting>
- </section>
-
- <!-- ~~~ GROUP TIMER ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <section id="grouptimer">
- <title><literal>group</literal> timer</title>
- <figure id="process.group.timer">
- <title>The group timer example process</title>
- <mediaobject><imageobject><imagedata align="center" fileref="images/process.group.timer.png"/></imageobject></mediaobject>
- </figure>
- <programlisting><process name="GroupTimer" xmlns="http://jbpm.org/4.0/jpdl">
-
- <start>
- <transition to="evaluate document" />
- </start>
-
- <emphasis role="bold"><group name="evaluate document"></emphasis>
- <start>
- <transition to="approve" />
- </start>
- <state name="approve">
- <transition to="done" />
- </state>
- <end name="done" />
-
- <transition to="publish document" />
- <emphasis role="bold"><transition name="timeout" to="escalate">
- <timer duedate="2 business hours" />
- </transition></emphasis>
-
- <emphasis role="bold"></group></emphasis>
-
- <state name="escalate" />
- <state name="publish document" />
-
-</process></programlisting>
- <para>The next code snippet shows a test scenario in which the timer will
- fire before the group activity <literal>evaluate document</literal> completes.
- </para>
- <programlisting>ProcessInstance processInstance = executionService
- .startProcessInstanceByKey("GroupTimer");
-Execution approveExecution = processInstance
- .findActiveExecutionIn("approve");
-assertNotNull(approveExecution);
-
-List<Job> jobs = managementService
- .createJobQuery()
- .processInstanceId(processInstance.getId())
- .list();
-
-assertEquals(1, jobs.size());
-
-Timer timer = (Timer) jobs.get(0);
-
-managementService.executeJob(timer.getDbid());
-
-processInstance = executionService
- .findProcessInstanceById(processInstance.getId());
-assertNotNull(processInstance.findActiveExecutionIn("escalate") );</programlisting>
- </section>
-
- <!-- ~~~ GROUP MULTIPLE ENTRIES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <section id="groupmultipleentries">
- <title><literal>group</literal> multiple entries</title>
- <para>This shows how a group can have multiple exclusive entry points.</para>
- <para>Analogue to multiple entry points, a group can also have
- multiple exit points.</para>
- <figure id="process.group.multipleentries">
- <title>The group multiple entries example process</title>
- <mediaobject><imageobject><imagedata align="center" fileref="images/process.group.multipleentries.png"/></imageobject></mediaobject>
- </figure>
- <programlisting><process name="GroupMultipleEntries" xmlns="http://jbpm.org/4.0/jpdl">
-
- <start>
- <transition to="choose strategy" />
- </start>
-
- <decision name="choose strategy" expr="#{time}">
- <emphasis role="bold"><transition name="plenty" to="play" />
- <transition name="running out" to="plan" /></emphasis>
- </decision>
-
- <group name="evaluate project">
- <emphasis role="bold"><start name="play">
- <transition to="distribute document" />
- </start></emphasis>
- <state name="distribute document" />
-
- <emphasis role="bold"><start name="plan">
- <transition to="make planning" />
- </start></emphasis>
- <state name="make planning" />
- </group>
-
-</process></programlisting>
- <para>The following scenario will be when there is plenty of time:
- </para>
- <programlisting>Map<String, Object> variables = new HashMap<String, Object>();
-variables.put("time", "plenty");
-
-ProcessInstance pi = executionService
- .startProcessInstanceByKey("GroupMultipleEntries", variables);
-
-assertNotNull(pi.findActiveExecutionIn("distribute document"));</programlisting>
- <para>The following scenario will be when there is time is running out:
- </para>
- <programlisting>Map<String, Object> variables = new HashMap<String, Object>();
-variables.put("time", "running out");
-
-ProcessInstance pi = executionService
- .startProcessInstanceByKey("GroupMultipleEntries", variables);
-
-assertNotNull(pi.findActiveExecutionIn("make planning"));</programlisting>
- </section>
-
- <!-- ~~~ GROUP CONCURRENCY ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <section id="groupconcurrency">
- <title><literal>group</literal> concurrency</title>
- <para>This scenario shows how a group can be used to create concurrent paths
- of execution. When an execution arrives in a group, each activity that doesn't
- have incoming transitions is started. So the first activities don't have to be
- start activities. The group takes the default transition out when all contained
- work is done.
- </para>
- <figure id="process.group.concurrency">
- <title>The group concurrency example process</title>
- <mediaobject><imageobject><imagedata align="center" fileref="images/process.group.concurrency.png"/></imageobject></mediaobject>
- </figure>
- <programlisting>
-
-<process name="GroupConcurrency" xmlns="http://jbpm.org/4.0/jpdl">
-
- <start>
- <transition to="evaluate project" />
- </start>
-
- <group name="evaluate project">
- <emphasis role="bold"><start>
- <transition to="distribute document" />
- </start></emphasis>
- <state name="distribute document">
- <transition to="collect feedback" />
- </state>
- <state name="collect feedback">
- <transition to="document finished" />
- </state>
- <end name="document finished" />
-
- <emphasis role="bold"><start>
- <transition to="make planning" />
- </start></emphasis>
- <state name="make planning">
- <transition to="estimate budget" />
- </state>
- <state name="estimate budget">
- <transition to="planning finished" />
- </state>
- <end name="planning finished" />
-
- <transition to="public project announcement" />
- </group>
-
- <state name="public project announcement" />
-
-</process></programlisting>
- <para>The following scenario will show a scenario in which all
- wait <literal>state</literal> acitivities are signalled in some random
- order till all work is done:
- </para>
- <programlisting>ProcessInstance pi = executionService
- .startProcessInstanceByKey("GroupConcurrency");
-
-String documentExecutionId = pi
- .findActiveExecutionIn("distribute document").getId();
-
-String planningExecutionId = pi
- .findActiveExecutionIn("make planning").getId();
-
-pi = executionService.signalExecutionById(documentExecutionId);
-assertNotNull(pi.findActiveExecutionIn("collect feedback"));
-assertNotNull(pi.findActiveExecutionIn("make planning"));
-
-pi = executionService.signalExecutionById(planningExecutionId);
-assertNotNull(pi.findActiveExecutionIn("collect feedback"));
-assertNotNull(pi.findActiveExecutionIn("estimate budget"));
-
-pi = executionService.signalExecutionById(planningExecutionId);
-assertNotNull(pi.findActiveExecutionIn("collect feedback"));
-
-pi = executionService.signalExecutionById(documentExecutionId);
-assertNotNull(pi.findActiveExecutionIn("public project announcement"));</programlisting>
-
- </section>
-
- <!-- ~~~ GROUP SECRET ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <section id="groupsecret">
- <title><literal>group</literal> secret</title>
- <para>Groups also support that you create transitions over group
- boundaries. So it's possible to have a tranition from an activity
- outside the group directly to an activity inside the group without
- modelling a start activity on the border of the group. Similarly
- with transitions from activities inside the group to activities
- outside the group. But shhhhhhhhh!
- Don't tell anyone cause this is not BPMN compliant.
- </para>
- </section>
-
- </section>
-
-</chapter>
Copied: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch08-Configuration.xml (from rev 5192, jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Configuration.xml)
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch08-Configuration.xml (rev 0)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch08-Configuration.xml 2009-07-03 09:32:54 UTC (rev 5210)
@@ -0,0 +1,118 @@
+<chapter id="configuration">
+ <title>Configuration</title>
+
+ <section>
+ <title>Configuration basics</title>
+
+ <para>The userguide explains how to install jBPM into the most
+ common runtime environments. That is the most simple and convenient
+ way to get started with jBPM. Please use those instructions.
+ These docs provide some background information for developers
+ that want to understand more about the way how configurations are
+ handled. Use at your own risk :-)
+ </para>
+ <para>The jbpm.jar contains a number of default configuration
+ files that can be imported by the user configuration file.
+ </para>
+ <para>This way, it's easy to include
+ or exclude features for users. And also the configuration details are kept in
+ the implementation so users that only import those configuration files
+ will not be affected when we release changes in those configuration files.
+ </para>
+ <para>Configuration files that can be imported by the user's <literal>jbpm.cfg.xml</literal>:</para>
+ <itemizedlist>
+ <listitem>jbpm.default.cfg.xml</listitem>
+ <listitem>jbpm.identity.cfg.xml</listitem>
+ <listitem>jbpm.jbossremote.cfg.xml</listitem>
+ <listitem>jbpm.jobexecutor.cfg.xml</listitem>
+ <listitem>jbpm.tx.hibernate.cfg.xml</listitem>
+ <listitem>jbpm.tx.jta.cfg.xml</listitem>
+ </itemizedlist>
+ <para><literal>jbpm.default.cfg.xml</literal>: Contains the default configurations
+ like the services, the hibernate configuration (configured from resource jbpm.hibernate.cfg.xml),
+ hibernate session factory, business calendar and so on.
+ </para>
+ <para>A typical configuration for standard java would look like this:
+ </para>
+ <programlisting><?xml version="1.0" encoding="UTF-8"?>
+
+ <jbpm-configuration>
+
+ <import resource="jbpm.default.cfg.xml" />
+ <import resource="jbpm.tx.hibernate.cfg.xml" />
+ <import resource="jbpm.jpdl.cfg.xml" />
+ <import resource="jbpm.identity.cfg.xml" />
+ <import resource="jbpm.jobexecutor.cfg.xml" />
+
+ </jbpm-configuration></programlisting>
+
+ <para>When you want to change the configuration, first consider
+ to change an import with one of the other provided importable
+ configuration files.
+ </para>
+
+ <para>For example, in a JTA environment, replace the import of
+ <literal>jbpm.tx.hibernate.cfg.xml</literal>
+ with <literal>jbpm.tx.jta.cfg.xml</literal>
+ </para>
+
+ <para>The second way to define a more customized configuration is to
+ specify configuration items directly into the <literal>jbpm.cfg.xml</literal>.
+ For an example, see <xref linkend="customizingtheidentitycomponent" /> below.
+ The more you customize, the more likely you are doing things we didn't
+ anticipate.
+ </para>
+
+ <para>The jbpm.jar contains also following hibernate mapping configuration files:</para>
+ <programlisting>jbpm.execution.hbm.xml
+ jbpm.history.hbm.xml
+ jbpm.identity.hbm.xml
+ jbpm.repository.hbm.xml
+ jbpm.task.hbm.xml</programlisting>
+ <para>These all map the java domain model objects to a relational database.
+ </para>
+ <para>Other various configuration files that are included in jbpm.jar:</para>
+ <programlisting>jbpm.task.lifecycle.xml
+ jbpm.variable.types.xml
+ jbpm.wire.bindings.xml
+ jbpm.jpdl.activities.xml
+ jbpm.jpdl.eventlisteners.xml</programlisting>
+
+ <para>Normally it is not necessary to dive into the parsing itself. It's most
+ a matter of figuring out how to specify the configuration that you want :-)
+ But just in case: To get started on the parsing for the configuration files, see
+ </para>
+ <itemizedlist>
+ <listitem>class org.jbpm.pvm.internal.env.JbpmConfigurationParser</listitem>
+ <listitem>resource modules/pvm/src/main/resources/jbpm.wire.bindings.xml</listitem>
+ <listitem>package modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding</listitem>
+ </itemizedlist>
+ </section>
+
+ <section id="customizingtheidentitycomponent">
+ <title>Customizing the identity component</title>
+ <para>There are 2 identity components that we support out of the box:
+ </para>
+ <itemizedlist>
+ <listitem>jBPM's built-in identity component: ships with the jBPM project distro</listitem>
+ <listitem>JBoss IDM: ships in the JBoss product platforms</listitem>
+ </itemizedlist>
+ <para>The <literal>jboss/build.xml</literal> installation scripts can be used
+ to install jBPM in JBoss using the JBoss IDM component. There is some
+ property in that build file to overwrite the default built-in identity component
+ with the value for the JBoss IDM component.
+ </para>
+ <para>If you want to plug in your own identity component, remove the
+ following line in the <literal>jbpm.cfg.xml</literal>:
+ </para>
+ <programlisting><import resource="jbpm.identity.cfg.xml" /></programlisting>
+ <para>And in the same file, add following section</para>
+ <programlisting><transaction-context>
+ <object class="your.package.YourIdentitySessionImpl" />
+</transaction-context></programlisting>
+ <para>YourIdentitySessionImpl should implement <literal>org.jbpm.pvm.internal.identity.spi.IdentitySession</literal>
+ Making this identity pluggable is not our first target, but it was taken into the design. Let us know how it goes.
+ </para>
+ </section>
+
+</chapter>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch08-Configuration.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch13-JBossIntegration.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch13-JBossIntegration.xml 2009-07-03 09:28:20 UTC (rev 5209)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch13-JBossIntegration.xml 2009-07-03 09:32:54 UTC (rev 5210)
@@ -1,4 +1,4 @@
-<chapter id="identity">
+<chapter id="jbossintegration">
<title>JBoss Integration</title>
<para>
15 years, 4 months
JBoss JBPM SVN: r5209 - jbpm4/trunk/modules/devguide/src/main/docbook/en.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-07-03 05:28:20 -0400 (Fri, 03 Jul 2009)
New Revision: 5209
Modified:
jbpm4/trunk/modules/devguide/src/main/docbook/en/master.xml
Log:
introducing incubation chapter in the devguide
Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/master.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/master.xml 2009-07-03 09:14:48 UTC (rev 5208)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/master.xml 2009-07-03 09:28:20 UTC (rev 5209)
@@ -2,13 +2,13 @@
<!DOCTYPE book [
<!ENTITY ch01-Introduction SYSTEM "modules/ch01-Introduction.xml">
- <!ENTITY ch02-ProcessVirtualMachine SYSTEM "modules/ch02-ProcessVirtualMachine.xml">
- <!ENTITY ch03-Configuration SYSTEM "modules/ch03-Configuration.xml">
+ <!ENTITY ch02-Incubation SYSTEM "modules/ch02-Incubation.xml">
+ <!ENTITY ch03-ProcessVirtualMachine SYSTEM "modules/ch03-ProcessVirtualMachine.xml">
<!ENTITY ch04-Architecture SYSTEM "modules/ch04-Architecture.xml">
<!ENTITY ch05-ImplementingBasicActivities SYSTEM "modules/ch05-ImplementingBasicActivities.xml">
<!ENTITY ch06-ProcessAnatomy SYSTEM "modules/ch06-ProcessAnatomy.xml">
<!ENTITY ch07-ImplementingAdvancedActivities SYSTEM "modules/ch07-ImplementingAdvancedActivities.xml">
- <!ENTITY ch08-AdvancedJpdl SYSTEM "modules/ch08-AdvancedJpdl.xml">
+ <!ENTITY ch08-Configuration SYSTEM "modules/ch08-Configuration.xml">
<!ENTITY ch09-Persistence SYSTEM "modules/ch09-Persistence.xml">
<!ENTITY ch10-JobExecutor SYSTEM "modules/ch10-JobExecutor.xml">
<!ENTITY ch11-SoftwareLogging SYSTEM "modules/ch11-SoftwareLogging.xml">
@@ -27,13 +27,13 @@
<toc />
&ch01-Introduction;
- &ch02-ProcessVirtualMachine;
- &ch03-Configuration;
+ &ch02-Incubation;
+ &ch03-ProcessVirtualMachine;
&ch04-Architecture;
&ch05-ImplementingBasicActivities;
&ch06-ProcessAnatomy;
&ch07-ImplementingAdvancedActivities;
- &ch08-AdvancedJpdl;
+ &ch08-Configuration;
&ch09-Persistence;
&ch10-JobExecutor;
&ch11-SoftwareLogging;
15 years, 4 months
JBoss JBPM SVN: r5208 - in jbpm3/branches/jbpm-3.2-soa/modules/core/src: test/java/org/jbpm and 1 other directories.
by do-not-reply@jboss.org
Author: mputz
Date: 2009-07-03 05:14:48 -0400 (Fri, 03 Jul 2009)
New Revision: 5208
Added:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2375/
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2375/JBPM2375Test.java
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/job/executor/JobExecutor.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/job/executor/LockMonitorThread.java
Log:
Fix for JBPM-2375 - JobExecutorThread is terminated after an Error: LockMonitorThread restarts terminated JobExecutorThreads.
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/job/executor/JobExecutor.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/job/executor/JobExecutor.java 2009-07-03 09:03:10 UTC (rev 5207)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/job/executor/JobExecutor.java 2009-07-03 09:14:48 UTC (rev 5208)
@@ -48,7 +48,8 @@
for (int i = 0; i < nbrOfThreads; i++) {
startThread();
}
- lockMonitorThread = new LockMonitorThread(jbpmConfiguration, lockMonitorInterval, maxLockTime, lockBufferTime);
+ lockMonitorThread = new LockMonitorThread(getLockMonitorThreadName(), this);
+ lockMonitorThread.start();
isStarted = true;
}
else {
@@ -92,9 +93,30 @@
if (lockMonitorThread != null) lockMonitorThread.join();
}
+
+ public void ensureThreadsAreActive() {
+ List deadThreads = new ArrayList();
+ for (Iterator i = threads.values().iterator(); i.hasNext();) {
+ Thread thread = (Thread) i.next();
+ if (!thread.isAlive()) {
+ if(log.isDebugEnabled())
+ {
+ log.debug("detected dead thread '" + thread.getName() + "'");
+ }
+ deadThreads.add(thread.getName());
+ i.remove();
+ }
+ }
+ for (int i = 0; i<deadThreads.size(); i++) {
+ startThread((String)deadThreads.get(i));
+ }
+ }
+
+ protected void startThread() {
+ startThread(getNextThreadName());
+ }
- protected synchronized void startThread() {
- String threadName = getNextThreadName();
+ protected synchronized void startThread(String threadName) {
Thread thread = createThread(threadName);
threads.put(threadName, thread);
@@ -117,6 +139,10 @@
private String getThreadName(int index) {
return name + ":" + getHostAddress() + ":" + index;
}
+
+ private String getLockMonitorThreadName() {
+ return name + ':' + LockMonitorThread.DEFAULT_NAME + '@' + getHostAddress();
+ }
private static String getHostAddress() {
if (hostName == null) {
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/job/executor/LockMonitorThread.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/job/executor/LockMonitorThread.java 2009-07-03 09:03:10 UTC (rev 5207)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/job/executor/LockMonitorThread.java 2009-07-03 09:14:48 UTC (rev 5208)
@@ -16,57 +16,69 @@
public class LockMonitorThread extends Thread {
- final JbpmConfiguration jbpmConfiguration;
- final int lockMonitorInterval;
- final int maxLockMonitorInterval;
- final int maxLockTime;
- final int lockBufferTime;
+ public static final String DEFAULT_NAME = "LockMonitorThread";
+ JbpmConfiguration jbpmConfiguration;
+ int lockMonitorInterval;
+ int maxLockTime;
+ int lockBufferTime;
+
int currentLockMonitorInterval;
volatile boolean isActive = true;
+
+ public LockMonitorThread(JobExecutor jobExecutor) {
+ this(DEFAULT_NAME, jobExecutor);
+ }
+ public LockMonitorThread(String name, JobExecutor jobExecutor) {
+ super(name);
+ jbpmConfiguration = jobExecutor.getJbpmConfiguration();
+ lockMonitorInterval = jobExecutor.getLockMonitorInterval();
+ maxLockTime = jobExecutor.getMaxLockTime();
+ lockBufferTime = jobExecutor.getLockBufferTime();
+ }
+
+ /** @deprecated As of jBPM 3.2.6, replaced by {@link #LockMonitorThread(JobExecutor)} */
public LockMonitorThread(JbpmConfiguration jbpmConfiguration, int lockMonitorInterval,
int maxLockTime, int lockBufferTime) {
this.jbpmConfiguration = jbpmConfiguration;
this.lockMonitorInterval = lockMonitorInterval;
- this.maxLockMonitorInterval = jbpmConfiguration.getJobExecutor().getMaxIdleInterval();
this.maxLockTime = maxLockTime;
this.lockBufferTime = lockBufferTime;
}
public void run() {
- currentLockMonitorInterval = lockMonitorInterval;
- while (isActive) {
- try {
- unlockOverdueJobs();
- if (isActive) {
- sleep(currentLockMonitorInterval);
- }
- // no exception, reset current lock monitor interval
- currentLockMonitorInterval = lockMonitorInterval;
- }
- catch (RuntimeException e) {
- log.error("exception in lock monitor thread. waiting " +
- currentLockMonitorInterval +
- " milliseconds", e);
+ try {
+ while (isActive) {
try {
- sleep(currentLockMonitorInterval);
+ unlockOverdueJobs();
+ jbpmConfiguration.getJobExecutor().ensureThreadsAreActive();
+ if (isActive && lockMonitorInterval > 0) {
+ sleep(lockMonitorInterval);
+ }
}
- catch (InterruptedException ie) {
- log.debug("delay after exception got interrupted", ie);
+ catch (InterruptedException e) {
+ log.info("lock monitor thread '" + getName() + "' got interrupted");
}
- // after an exception, double the current lock monitor interval to prevent
- // continuous exception generation when e.g. the db is unreachable
- currentLockMonitorInterval <<= 1;
- if (currentLockMonitorInterval > maxLockMonitorInterval || currentLockMonitorInterval < 0) {
- currentLockMonitorInterval = maxLockMonitorInterval;
+ catch (Exception e) {
+ log.error("exception in lock monitor thread. waiting "
+ + lockMonitorInterval
+ + " milliseconds", e);
+ try {
+ sleep(lockMonitorInterval);
+ }
+ catch (InterruptedException e2) {
+ log.debug("delay after exception got interrupted", e2);
+ }
}
}
- catch (InterruptedException e) {
- log.info("lock monitor thread '" + getName() + "' got interrupted");
- }
}
- log.info(getName() + " leaves cyberspace");
+ catch (Exception e) {
+ log.error("exception in lock monitor thread", e);
+ }
+ finally {
+ log.info(getName() + " leaves cyberspace");
+ }
}
protected void unlockOverdueJobs() {
@@ -78,7 +90,10 @@
overdueJobs = jobSession.findJobsWithOverdueLockTime(threshold);
for (Iterator i = overdueJobs.iterator(); i.hasNext();) {
Job job = (Job) i.next();
- log.debug("unlocking " + job + " owned by thread " + job.getLockOwner());
+ if(log.isDebugEnabled())
+ {
+ log.debug("unlocking " + job + " owned by thread " + job.getLockOwner());
+ }
job.setLockOwner(null);
job.setLockTime(null);
}
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2375/JBPM2375Test.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2375/JBPM2375Test.java (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2375/JBPM2375Test.java 2009-07-03 09:14:48 UTC (rev 5208)
@@ -0,0 +1,121 @@
+package org.jbpm.jbpm2375;
+
+import org.jbpm.JbpmConfiguration;
+import org.jbpm.db.AbstractDbTestCase;
+import org.jbpm.graph.def.ActionHandler;
+import org.jbpm.graph.def.Event;
+import org.jbpm.graph.def.EventCallback;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ExecutionContext;
+import org.jbpm.graph.exe.ProcessInstance;
+import org.jbpm.job.executor.JobExecutor;
+
+/**
+ * Test if the JobExecutorThread recovers from an Error
+ *
+ * @see <a href="https://jira.jboss.org/jira/browse/JBPM-2357">JBPM-2357</a>
+ * @author mputz(a)redhat.com
+ * @since 30-Jun-2009
+ */
+public class JBPM2375Test extends AbstractDbTestCase {
+
+ private static final int TEST_TIMEOUT = 10 * 1000;
+
+ private JobExecutor jobExecutor = new JobExecutor();
+ private long processDefinitionId;
+
+ // a process definition with two timers moving the token forward
+ // the second state has an action associated with the node-enter event,
+ // which can simulate an Error condition by throwing a NoClassDefFoundError
+ private static final String PROCESS_DEFINITION = "<process-definition name='jbpm2375-timer-error-test'>"
+ + " <event type='process-end'>"
+ + " <action expression='#{eventCallback.processEnd}' />"
+ + " </event>"
+ + " <start-state name='start'>"
+ + " <transition to='state1' name='to_state1'/>"
+ + " </start-state>"
+ + " <state name='state1'>"
+ + " <timer name='moveToDefaultEndAfter1second' duedate='1 second' transition='to_state2'/>"
+ + " <transition to='state2' name='to_state2'/>"
+ + " </state>"
+ + " <state name='state2'>"
+ + " <timer name='moveToEndAfter1second' duedate='1 second' transition='to_end'/>"
+ + " <event type='node-enter'>"
+ + " <action name='exceptionTest' class='"
+ + TimerExceptionAction.class.getName()
+ + "'>"
+ + " </action>"
+ + " </event>"
+ + " <transition to='end' name='to_end'/>"
+ + " </state>"
+ + " <end-state name='end' />"
+ + "</process-definition>";
+
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(PROCESS_DEFINITION);
+ jbpmContext.deployProcessDefinition(processDefinition);
+ newTransaction();
+ processDefinitionId = processDefinition.getId();
+
+ getJbpmConfiguration().getJobExecutor().setLockMonitorInterval(TEST_TIMEOUT/2);
+ startJobExecutor();
+
+
+ }
+
+ protected void tearDown() throws Exception {
+ stopJobExecutor();
+
+ graphSession.deleteProcessDefinition(processDefinitionId);
+
+ EventCallback.clear();
+ super.tearDown();
+ }
+
+ // check if the process ends correctly if no Error is thrown
+ public void testTimerWithoutErrorAction() {
+ runTimerErrorAction(Boolean.FALSE);
+ }
+
+ // check if the process ends correctly if an Error is thrown in the ActionHandler
+ public void testTimerWithErrorAction() {
+ runTimerErrorAction(Boolean.TRUE);
+ }
+
+ private void runTimerErrorAction(Boolean withError) {
+
+ // kick off process instance
+ ProcessDefinition processDefinition = graphSession.loadProcessDefinition(processDefinitionId);
+ ProcessInstance processInstance = new ProcessInstance(processDefinition);
+ processInstance.getContextInstance().setVariable("eventCallback", new EventCallback());
+ processInstance.getContextInstance().setVariable("throwError", withError);
+ processInstance.signal();
+ jbpmContext.save(processInstance);
+
+ commitAndCloseSession();
+ try {
+ EventCallback.waitForEvent(Event.EVENTTYPE_PROCESS_END, TEST_TIMEOUT);
+
+ waitForJobs(TEST_TIMEOUT);
+
+ } finally {
+ beginSessionTransaction();
+ }
+
+ }
+
+
+ public static class TimerExceptionAction implements ActionHandler {
+
+ private static final long serialVersionUID = 1L;
+
+ public void execute(ExecutionContext executionContext) throws Exception {
+ Boolean throwError = (Boolean)executionContext.getVariable("throwError");
+ if (throwError.booleanValue())
+ throw new NoClassDefFoundError("org.jbpm.no.class.Class");
+ }
+ }
+}
15 years, 4 months
JBoss JBPM SVN: r5207 - jbpm3/branches/jbpm-3.2-soa/hudson.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-07-03 05:03:10 -0400 (Fri, 03 Jul 2009)
New Revision: 5207
Modified:
jbpm3/branches/jbpm-3.2-soa/hudson/profiles.xml.redhat.qa
Log:
revert to jbpm3 sybase user
Modified: jbpm3/branches/jbpm-3.2-soa/hudson/profiles.xml.redhat.qa
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/hudson/profiles.xml.redhat.qa 2009-07-03 09:02:32 UTC (rev 5206)
+++ jbpm3/branches/jbpm-3.2-soa/hudson/profiles.xml.redhat.qa 2009-07-03 09:03:10 UTC (rev 5207)
@@ -22,8 +22,8 @@
<jdbc.sybase.port>4100</jdbc.sybase.port>
<jdbc.sybase.database>jbpm3</jdbc.sybase.database>
<jdbc.sybase.url>jdbc:sybase:Tds:${jdbc.sybase.server}:${jdbc.sybase.port}/${jdbc.sybase.database}</jdbc.sybase.url>
- <jdbc.sybase.username>jbpm3xa</jdbc.sybase.username>
- <jdbc.sybase.password>jbpm3xa</jdbc.sybase.password>
+ <jdbc.sybase.username>jbpm3</jdbc.sybase.username>
+ <jdbc.sybase.password>jbpm3</jdbc.sybase.password>
<jdbc.sybase.driver>com.sybase.jdbc3.jdbc.SybDriver</jdbc.sybase.driver>
<jdbc.sybase.datasource>com.sybase.jdbc3.jdbc.SybXADataSource</jdbc.sybase.datasource>
15 years, 4 months
JBoss JBPM SVN: r5206 - jbpm4/trunk/modules/devguide/src/main/docbook/en/modules.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-07-03 05:02:32 -0400 (Fri, 03 Jul 2009)
New Revision: 5206
Modified:
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch14-SpringIntegration.xml
Log:
Changed Spring doc after review from Andries
Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch14-SpringIntegration.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch14-SpringIntegration.xml 2009-07-03 08:55:23 UTC (rev 5205)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch14-SpringIntegration.xml 2009-07-03 09:02:32 UTC (rev 5206)
@@ -42,7 +42,7 @@
<programlisting>
<process-engine-context>
<command-service>
- <emphasis role="bold"><spring-transaction-interceptor current="true" /></emphasis>
+ <emphasis role="bold"><spring-transaction-interceptor /></emphasis>
...
</command-service>
...
@@ -111,7 +111,9 @@
The scripting engine will look into all contexts from the bean named echoService.
If you configured the ScriptManager as above, Spring will be the last context to search for.
- A good practice is to use unique names for the beans.
+ You can also add a Spring bean to the Spring Application context
+ (eg IdentitySessionImpl with id <emphasis role="italic">identitySession</emphasis>)
+ and use it in the jBPM config (eg by adding <env class="identitySession" />)
</para>
</section>
15 years, 4 months
JBoss JBPM SVN: r5205 - jbpm4/trunk/modules/devguide/src/main/docbook/en/modules.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-07-03 04:55:23 -0400 (Fri, 03 Jul 2009)
New Revision: 5205
Modified:
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch15-Jpdl3Migration.xml
Log:
Changed API example for migration after remarks from Jim Ma
Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch15-Jpdl3Migration.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch15-Jpdl3Migration.xml 2009-07-03 07:40:05 UTC (rev 5204)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch15-Jpdl3Migration.xml 2009-07-03 08:55:23 UTC (rev 5205)
@@ -65,7 +65,7 @@
internal api to convert the process file:
<programlisting>
URL url = new URL("simple.jpdl");
- Jpdl3ConverterReader jpdlConverter = new Jpdl3ConverterReader(url);
+ Jpdl3Converter jpdlConverter = new Jpdl3Converter(url);
Document jpdl4Doc = jpdlConverter.readAndConvert();
for (Problem problem : jpdlConverter.problems) {
15 years, 4 months
JBoss JBPM SVN: r5203 - in jbpm3/branches/jbpm-3.2-soa: modules/core/src/main/resources and 1 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-07-02 20:10:09 -0400 (Thu, 02 Jul 2009)
New Revision: 5203
Modified:
jbpm3/branches/jbpm-3.2-soa/hudson/profiles.xml.redhat.qa
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/hibernate.common.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/log4j.xml
Log:
enable sql and connection logging to aid in diagnosing sybase and db2 hangs
Modified: jbpm3/branches/jbpm-3.2-soa/hudson/profiles.xml.redhat.qa
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/hudson/profiles.xml.redhat.qa 2009-07-03 00:08:25 UTC (rev 5202)
+++ jbpm3/branches/jbpm-3.2-soa/hudson/profiles.xml.redhat.qa 2009-07-03 00:10:09 UTC (rev 5203)
@@ -22,8 +22,8 @@
<jdbc.sybase.port>4100</jdbc.sybase.port>
<jdbc.sybase.database>jbpm3</jdbc.sybase.database>
<jdbc.sybase.url>jdbc:sybase:Tds:${jdbc.sybase.server}:${jdbc.sybase.port}/${jdbc.sybase.database}</jdbc.sybase.url>
- <jdbc.sybase.username>jbpm3</jdbc.sybase.username>
- <jdbc.sybase.password>jbpm3jbpm3</jdbc.sybase.password>
+ <jdbc.sybase.username>jbpm3xa</jdbc.sybase.username>
+ <jdbc.sybase.password>jbpm3xa</jdbc.sybase.password>
<jdbc.sybase.driver>com.sybase.jdbc3.jdbc.SybDriver</jdbc.sybase.driver>
<jdbc.sybase.datasource>com.sybase.jdbc3.jdbc.SybXADataSource</jdbc.sybase.datasource>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/hibernate.common.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/hibernate.common.xml 2009-07-03 00:08:25 UTC (rev 5202)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/hibernate.common.xml 2009-07-03 00:10:09 UTC (rev 5203)
@@ -19,16 +19,14 @@
<!-- Automatic schema creation (begin) -->
<property name="hibernate.hbm2ddl.auto">create</property>
- <property name="connection.pool_size">5</property>
<!-- Automatic schema creation (end) -->
<!-- Simple memory-only cache -->
<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
- <!-- SQL rendering properties (begin) ===
+ <!-- SQL rendering properties -->
<property name="hibernate.format_sql">true</property>
<property name="hibernate.use_sql_comments">true</property>
- ==== SQL rendering properties (end) -->
<!-- ############################################ -->
<!-- # mapping files with external dependencies # -->
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/log4j.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/log4j.xml 2009-07-03 00:08:25 UTC (rev 5202)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/log4j.xml 2009-07-03 00:10:09 UTC (rev 5203)
@@ -36,7 +36,6 @@
<priority value="INFO" />
</category>
- <!--
<category name="org.hibernate.SQL">
<priority value="DEBUG" />
</category>
@@ -44,7 +43,6 @@
<category name="org.hibernate.connection">
<priority value="TRACE" />
</category>
- -->
<!-- ======================= -->
<!-- Setup the Root category -->
15 years, 4 months