diff --git a/config/alfresco/bootstrap-context.xml b/config/alfresco/bootstrap-context.xml
index 46a5e6535c..5a9a2080f2 100644
--- a/config/alfresco/bootstrap-context.xml
+++ b/config/alfresco/bootstrap-context.xml
@@ -53,6 +53,7 @@
+
@@ -360,4 +361,9 @@
+
+
+
+
+
diff --git a/config/alfresco/hibernate-context.xml b/config/alfresco/hibernate-context.xml
index a519a18fd7..8bf49fba9f 100644
--- a/config/alfresco/hibernate-context.xml
+++ b/config/alfresco/hibernate-context.xml
@@ -73,7 +73,7 @@
org/jbpm/graph/node/ProcessState.hbm.xml
org/jbpm/graph/node/Decision.hbm.xml
org/jbpm/graph/node/Fork.hbm.xml
- org/alfresco/repo/workflow/jbpm/Join.hbm.xml
+ org/alfresco/repo/workflow/jbpm/jbpm.Join.hbm.xml
org/jbpm/graph/node/State.hbm.xml
org/jbpm/graph/node/TaskNode.hbm.xml
org/jbpm/context/def/ContextDefinition.hbm.xml
@@ -85,7 +85,7 @@
org/jbpm/module/def/ModuleDefinition.hbm.xml
org/jbpm/bytes/ByteArray.hbm.xml
org/jbpm/file/def/FileDefinition.hbm.xml
- org/jbpm/scheduler/def/CreateTimerAction.hbm.xml
+ org/alfresco/repo/workflow/jbpm/jbpm.CreateTimerAction.hbm.xml
org/jbpm/scheduler/def/CancelTimerAction.hbm.xml
org/jbpm/graph/exe/Comment.hbm.xml
org/jbpm/graph/exe/ProcessInstance.hbm.xml
@@ -103,17 +103,16 @@
org/jbpm/context/exe/variableinstance/LongInstance.hbm.xml
org/jbpm/context/exe/variableinstance/NullInstance.hbm.xml
org/jbpm/context/exe/variableinstance/StringInstance.hbm.xml
- org/jbpm/msg/Message.hbm.xml
- org/jbpm/msg/db/TextMessage.hbm.xml
- org/jbpm/command/ExecuteActionCommand.hbm.xml
- org/jbpm/command/ExecuteNodeCommand.hbm.xml
- org/jbpm/command/SignalCommand.hbm.xml
- org/jbpm/command/TaskInstanceEndCommand.hbm.xml
+ org/jbpm/job/Job.hbm.xml
+ org/jbpm/job/Timer.hbm.xml
+ org/alfresco/repo/workflow/jbpm/jbpm.Timer.hbm.xml
+ org/jbpm/job/ExecuteNodeJob.hbm.xml
+ org/jbpm/job/ExecuteActionJob.hbm.xml
org/jbpm/taskmgmt/exe/TaskMgmtInstance.hbm.xml
org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml
+ org/alfresco/repo/workflow/jbpm/WorkflowTaskInstance.hbm.xml
org/jbpm/taskmgmt/exe/PooledActor.hbm.xml
org/jbpm/taskmgmt/exe/SwimlaneInstance.hbm.xml
- org/jbpm/scheduler/exe/Timer.hbm.xml
org/jbpm/logging/log/ProcessLog.hbm.xml
org/jbpm/logging/log/MessageLog.hbm.xml
org/jbpm/logging/log/CompositeLog.hbm.xml
@@ -121,6 +120,7 @@
org/jbpm/graph/log/NodeLog.hbm.xml
org/jbpm/graph/log/ProcessInstanceCreateLog.hbm.xml
org/jbpm/graph/log/ProcessInstanceEndLog.hbm.xml
+ org/jbpm/graph/log/ProcessStateLog.hbm.xml
org/jbpm/graph/log/SignalLog.hbm.xml
org/jbpm/graph/log/TokenCreateLog.hbm.xml
org/jbpm/graph/log/TokenEndLog.hbm.xml
@@ -142,10 +142,7 @@
org/jbpm/taskmgmt/log/TaskEndLog.hbm.xml
org/jbpm/taskmgmt/log/SwimlaneLog.hbm.xml
org/jbpm/taskmgmt/log/SwimlaneCreateLog.hbm.xml
- org/jbpm/taskmgmt/log/SwimlaneAssignLog.hbm.xml
-
-
- org/alfresco/repo/workflow/jbpm/WorkflowTaskInstance.hbm.xml
+ org/jbpm/taskmgmt/log/SwimlaneAssignLog.hbm.xml
diff --git a/config/alfresco/patch/patch-services-context.xml b/config/alfresco/patch/patch-services-context.xml
index 1c2d7b2b80..667254d3fc 100644
--- a/config/alfresco/patch/patch-services-context.xml
+++ b/config/alfresco/patch/patch-services-context.xml
@@ -669,6 +669,17 @@
classpath:alfresco/dbscripts/upgrade/2.0/${db.script.dialect}/AlfrescoSchemaUpdate-2.0-AVMFKIndexes.sql
+
+
+ patch.db-V2.1-JBPMUpdate
+ patch.schemaUpgradeScript.description
+ 0
+ 51
+ 52
+
+ classpath:alfresco/dbscripts/upgrade/2.1/${db.script.dialect}/AlfrescoSchemaUpdate-2.1-JBPMData.sql
+
+
patch.groupNamesAsIdentifiers
diff --git a/config/alfresco/version.properties b/config/alfresco/version.properties
index c36cb0ad3c..589b133fac 100644
--- a/config/alfresco/version.properties
+++ b/config/alfresco/version.properties
@@ -19,4 +19,4 @@ version.build=@build-number@
# Schema number
-version.schema=51
+version.schema=52
diff --git a/config/alfresco/workflow-context.xml b/config/alfresco/workflow-context.xml
index 5daf205a59..acbc9d47eb 100644
--- a/config/alfresco/workflow-context.xml
+++ b/config/alfresco/workflow-context.xml
@@ -74,7 +74,7 @@
-
+
diff --git a/source/java/org/alfresco/repo/jscript/RhinoScriptProcessor.java b/source/java/org/alfresco/repo/jscript/RhinoScriptProcessor.java
index 76e1097dc1..b6a30e97ff 100644
--- a/source/java/org/alfresco/repo/jscript/RhinoScriptProcessor.java
+++ b/source/java/org/alfresco/repo/jscript/RhinoScriptProcessor.java
@@ -27,6 +27,7 @@ package org.alfresco.repo.jscript;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
@@ -69,6 +70,9 @@ public class RhinoScriptProcessor extends BaseProcessor implements ScriptProcess
private static final String IMPORT_RESOURCE = "resource=\"";
private static final String PATH_CLASSPATH = "classpath:";
private static final String SCRIPT_ROOT = "_root";
+
+ /** Base Value Converter */
+ private ValueConverter valueConverter = new ReturnValueConverter();
/** Store into which to resolve cm:name based script paths */
private StoreRef storeRef;
@@ -506,7 +510,11 @@ public class RhinoScriptProcessor extends BaseProcessor implements ScriptProcess
Object result = cx.evaluateString(scope, script, "AlfrescoScript", 1, null);
// extract java object result if wrapped by Rhino
- if (result instanceof Wrapper)
+ if (result instanceof Serializable)
+ {
+ result = valueConverter.convertValueForRepo((Serializable)result);
+ }
+ else if (result instanceof Wrapper)
{
result = ((Wrapper)result).unwrap();
}
@@ -556,4 +564,30 @@ public class RhinoScriptProcessor extends BaseProcessor implements ScriptProcess
}
return newModel;
}
+
+ /**
+ * Value conversion for handling Javascript return values.
+ */
+ public class ReturnValueConverter extends ValueConverter
+ {
+ /**
+ * Convert an object from any script wrapper value to a valid repository serializable value.
+ * This includes converting JavaScript Array objects to Lists of valid objects.
+ *
+ * @param value Value to convert from script wrapper object to repo serializable value
+ *
+ * @return valid repo value
+ */
+ public Serializable convertValueForRepo(Serializable value)
+ {
+ if (value instanceof Wrapper ||
+ value instanceof ScriptableObject ||
+ value instanceof Serializable[])
+ {
+ value = super.convertValueForRepo(value);
+ }
+ return value;
+ }
+ }
+
}
diff --git a/source/java/org/alfresco/repo/workflow/WorkflowInterpreter.java b/source/java/org/alfresco/repo/workflow/WorkflowInterpreter.java
index 4e353372bf..73fccafa96 100644
--- a/source/java/org/alfresco/repo/workflow/WorkflowInterpreter.java
+++ b/source/java/org/alfresco/repo/workflow/WorkflowInterpreter.java
@@ -600,6 +600,10 @@ public class WorkflowInterpreter
currentPath = null;
out.print(executeCommand("show definitions"));
}
+ else
+ {
+ return "Syntax Error.\n";
+ }
}
else if (command[0].equals("use"))
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/AlfrescoCreateTimerAction.java b/source/java/org/alfresco/repo/workflow/jbpm/AlfrescoCreateTimerAction.java
new file mode 100644
index 0000000000..eef82ba829
--- /dev/null
+++ b/source/java/org/alfresco/repo/workflow/jbpm/AlfrescoCreateTimerAction.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program 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 General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.workflow.jbpm;
+
+import java.util.Date;
+
+import org.alfresco.service.cmr.workflow.WorkflowException;
+import org.jbpm.calendar.BusinessCalendar;
+import org.jbpm.calendar.Duration;
+import org.jbpm.graph.def.GraphElement;
+import org.jbpm.graph.exe.ExecutionContext;
+import org.jbpm.job.Timer;
+import org.jbpm.jpdl.el.impl.JbpmExpressionEvaluator;
+import org.jbpm.scheduler.def.CreateTimerAction;
+
+
+/**
+ * Extended Create Timer action for supporting Alfresco implemented timers.
+ *
+ * Alfresco timer supports ability to provide due date expression that can
+ * evaluate to a date.
+ *
+ * @author davidc
+ */
+public class AlfrescoCreateTimerAction extends CreateTimerAction
+{
+ private static final long serialVersionUID = -7427571820130058416L;
+ protected static BusinessCalendar businessCalendar = new BusinessCalendar();
+
+
+ /* (non-Javadoc)
+ * @see org.jbpm.scheduler.def.CreateTimerAction#createTimer(org.jbpm.graph.exe.ExecutionContext)
+ */
+ @Override
+ protected Timer createTimer(ExecutionContext executionContext)
+ {
+ Date dueDate = null;
+ String dueDateExpression = getDueDate();
+ if (dueDateExpression.startsWith("#{"))
+ {
+ Object result = JbpmExpressionEvaluator.evaluate(dueDateExpression, executionContext);
+ if (!(result instanceof Date))
+ {
+ throw new WorkflowException("duedate expression must evaluate to a date");
+ }
+ dueDate = (Date)result;
+ }
+ else
+ {
+ Duration duration = new Duration(getDueDate());
+ dueDate = businessCalendar.add(new Date(), duration);
+ }
+
+ Timer timer = new AlfrescoTimer(executionContext.getToken());
+ timer.setName(getTimerName());
+ timer.setRepeat(getRepeat());
+ timer.setDueDate(dueDate);
+ timer.setAction(getTimerAction());
+ timer.setTransitionName(getTransitionName());
+ timer.setGraphElement(executionContext.getEventSource());
+ timer.setTaskInstance(executionContext.getTaskInstance());
+
+ // if this action was executed for a graph element
+ if ((getEvent() != null) && (getEvent().getGraphElement() != null))
+ {
+ GraphElement graphElement = getEvent().getGraphElement();
+ try
+ {
+ executionContext.setTimer(timer);
+ // fire the create timer event on the same graph element
+ graphElement.fireEvent("timer-create", executionContext);
+ }
+ finally
+ {
+ executionContext.setTimer(null);
+ }
+ }
+
+ return timer;
+ }
+
+}
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/AlfrescoJavaScript.java b/source/java/org/alfresco/repo/workflow/jbpm/AlfrescoJavaScript.java
index 7cd8a9ae89..2a89f38a14 100644
--- a/source/java/org/alfresco/repo/workflow/jbpm/AlfrescoJavaScript.java
+++ b/source/java/org/alfresco/repo/workflow/jbpm/AlfrescoJavaScript.java
@@ -101,7 +101,7 @@ public class AlfrescoJavaScript extends JBPMSpringActionHandler
while (iter.hasNext())
{
Element element = iter.next();
- if (element.getNodeType() == Element.ELEMENT_NODE)
+ if (element.getNodeType() == org.dom4j.Node.ELEMENT_NODE)
{
isTextOnly = false;
}
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/AlfrescoJbpmConfigurationFactoryBean.java b/source/java/org/alfresco/repo/workflow/jbpm/AlfrescoJbpmConfigurationFactoryBean.java
new file mode 100644
index 0000000000..f488c134ab
--- /dev/null
+++ b/source/java/org/alfresco/repo/workflow/jbpm/AlfrescoJbpmConfigurationFactoryBean.java
@@ -0,0 +1,194 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program 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 General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.workflow.jbpm;
+
+import java.io.InputStream;
+
+import org.hibernate.SessionFactory;
+import org.jbpm.JbpmConfiguration;
+import org.jbpm.JbpmContext;
+import org.jbpm.configuration.ObjectFactory;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.BeanFactory;
+import org.springframework.beans.factory.BeanFactoryAware;
+import org.springframework.beans.factory.BeanNameAware;
+import org.springframework.beans.factory.FactoryBean;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.core.io.Resource;
+import org.springmodules.workflow.jbpm31.JbpmFactoryLocator;
+
+/**
+ * Implementation of Spring Module's JbpmConfigurationFactoryBean for
+ * Jbpm 3.2.
+ *
+ * @author Costin Leau
+ * @author davidc
+ */
+public class AlfrescoJbpmConfigurationFactoryBean implements InitializingBean, FactoryBean, BeanFactoryAware, BeanNameAware
+{
+ private JbpmConfiguration jbpmConfiguration;
+ private ObjectFactory objectFactory;
+ private Resource configuration;
+ private SessionFactory sessionFactory;
+ private String contextName = JbpmContext.DEFAULT_JBPM_CONTEXT_NAME;
+
+ /**
+ * FactoryLocator
+ */
+ private JbpmFactoryLocator factoryLocator = new JbpmFactoryLocator();
+
+
+ /* (non-Javadoc)
+ * @see org.springframework.beans.factory.BeanFactoryAware#setBeanFactory(org.springframework.beans.factory.BeanFactory)
+ */
+ public void setBeanFactory(BeanFactory beanFactory) throws BeansException
+ {
+ factoryLocator.setBeanFactory(beanFactory);
+ }
+
+ /* (non-Javadoc)
+ * @see org.springframework.beans.factory.BeanNameAware#setBeanName(java.lang.String)
+ */
+ public void setBeanName(String name)
+ {
+ factoryLocator.setBeanName(name);
+ }
+
+ /* (non-Javadoc)
+ * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
+ */
+ public void afterPropertiesSet() throws Exception
+ {
+ if (configuration == null)
+ throw new IllegalArgumentException("configuration or objectFactory property need to be not null");
+
+ // 1. Construct Jbpm Configuration
+ // NOTE: Jbpm 3.2 adds a JbpmConfiguration value to its context
+ InputStream stream = configuration.getInputStream();
+ jbpmConfiguration = JbpmConfiguration.parseInputStream(stream);
+
+ // 2. inject the HB session factory if it is the case
+ if (sessionFactory != null)
+ {
+ JbpmContext context = jbpmConfiguration.createJbpmContext(contextName);
+ try
+ {
+ context.setSessionFactory(sessionFactory);
+ } finally
+ {
+ context.close();
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.springframework.beans.factory.FactoryBean#getObject()
+ */
+ public Object getObject() throws Exception
+ {
+ return jbpmConfiguration;
+ }
+
+ /* (non-Javadoc)
+ * @see org.springframework.beans.factory.FactoryBean#getObjectType()
+ */
+ public Class getObjectType()
+ {
+ return JbpmConfiguration.class;
+ }
+
+ /* (non-Javadoc)
+ * @see org.springframework.beans.factory.FactoryBean#isSingleton()
+ */
+ public boolean isSingleton()
+ {
+ return true;
+ }
+
+ /**
+ * @return Returns the configuration.
+ */
+ public Resource getConfiguration()
+ {
+ return configuration;
+ }
+
+ /**
+ * @param configuration The configuration to set
+ */
+ public void setConfiguration(Resource configuration)
+ {
+ this.configuration = configuration;
+ }
+
+ /**
+ * @return Returns the objectFactory.
+ */
+ public ObjectFactory getObjectFactory()
+ {
+ return objectFactory;
+ }
+
+ /**
+ * @param objectFactory The objectFactory to set
+ */
+ public void setObjectFactory(ObjectFactory objectFactory)
+ {
+ this.objectFactory = objectFactory;
+ }
+
+ /**
+ * @return Returns the contextName.
+ */
+ public String getContextName()
+ {
+ return contextName;
+ }
+
+ /**
+ * @param contextName The contextName to set
+ */
+ public void setContextName(String contextName)
+ {
+ this.contextName = contextName;
+ }
+
+ /**
+ * @return Returns the sessionFactory.
+ */
+ public SessionFactory getSessionFactory()
+ {
+ return sessionFactory;
+ }
+
+ /**
+ * @param sessionFactory The sessionFactory to set
+ */
+ public void setSessionFactory(SessionFactory sessionFactory)
+ {
+ this.sessionFactory = sessionFactory;
+ }
+
+}
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/AlfrescoTimer.java b/source/java/org/alfresco/repo/workflow/jbpm/AlfrescoTimer.java
new file mode 100644
index 0000000000..c6b17d7abb
--- /dev/null
+++ b/source/java/org/alfresco/repo/workflow/jbpm/AlfrescoTimer.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program 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 General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.workflow.jbpm;
+
+import org.alfresco.repo.security.authentication.AuthenticationUtil;
+import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
+import org.jbpm.JbpmContext;
+import org.jbpm.graph.exe.Token;
+import org.jbpm.job.Timer;
+import org.jbpm.taskmgmt.exe.TaskInstance;
+
+/**
+ * Extended JBPM Timer that provides Alfresco context.
+ *
+ * NOTE: The action triggered by the timer is executed as the user assigned
+ * to the task associated with the timer. If not associated with a
+ * task, the timer is executed unauthenticated.
+ *
+ * @author davidc
+ */
+public class AlfrescoTimer extends Timer
+{
+ private static final long serialVersionUID = -6618486175822866286L;
+
+ /**
+ * Construct
+ */
+ public AlfrescoTimer()
+ {
+ super();
+ }
+
+ /**
+ * Construct
+ *
+ * @param token
+ */
+ public AlfrescoTimer(Token token)
+ {
+ super(token);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jbpm.job.Job#execute(org.jbpm.JbpmContext)
+ */
+ @Override
+ public boolean execute(final JbpmContext jbpmContext)
+ throws Exception
+ {
+ boolean executeResult = false;
+
+ // establish authentication context
+ String username = null;
+ TaskInstance taskInstance = getTaskInstance();
+ if (taskInstance != null)
+ {
+ String actorId = taskInstance.getActorId();
+ if (actorId != null && actorId.length() > 0)
+ {
+ username = actorId;
+ }
+ }
+
+ // execute timer
+ if (username == null)
+ {
+ executeResult = super.execute(jbpmContext);
+ }
+ else
+ {
+ executeResult = AuthenticationUtil.runAs(new RunAsWork()
+ {
+ @SuppressWarnings("synthetic-access")
+ public Boolean doWork() throws Exception
+ {
+ return AlfrescoTimer.super.execute(jbpmContext);
+ }
+ }, username);
+ }
+
+ return executeResult;
+ }
+
+}
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/JBPMDeleteProcessTest.java b/source/java/org/alfresco/repo/workflow/jbpm/JBPMDeleteProcessTest.java
index 338373bc95..90900e594b 100644
--- a/source/java/org/alfresco/repo/workflow/jbpm/JBPMDeleteProcessTest.java
+++ b/source/java/org/alfresco/repo/workflow/jbpm/JBPMDeleteProcessTest.java
@@ -57,8 +57,8 @@ public class JBPMDeleteProcessTest extends TestCase {
jbpmConfiguration = JbpmConfiguration.parseXmlString(
"" +
" " +
- " " +
+ " " +
+ " " +
" " +
" " +
@@ -164,7 +164,7 @@ public class JBPMDeleteProcessTest extends TestCase {
//
// Uncomment the following line to force constraint violation
//
- // taskInstance.setVariableLocally("var1", "var1TaskValue");
+ taskInstance.setVariableLocally("var1", "var1TaskValue");
taskInstance.setVariableLocally("var2", "var2UpdatedValue");
taskInstance.end();
@@ -185,7 +185,7 @@ public class JBPMDeleteProcessTest extends TestCase {
GraphSession graphSession = jbpmContext.getGraphSession();
ProcessInstance processInstance = graphSession.loadProcessInstance(processId);
- graphSession.deleteProcessInstance(processInstance, true, true, true);
+ graphSession.deleteProcessInstance(processInstance, true, true);
} finally {
jbpmContext.close();
}
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/JBPMEngine.java b/source/java/org/alfresco/repo/workflow/jbpm/JBPMEngine.java
index 4993349107..9006c121e7 100644
--- a/source/java/org/alfresco/repo/workflow/jbpm/JBPMEngine.java
+++ b/source/java/org/alfresco/repo/workflow/jbpm/JBPMEngine.java
@@ -89,7 +89,6 @@ import org.jbpm.graph.def.Transition;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.graph.exe.Token;
import org.jbpm.jpdl.par.ProcessArchive;
-import org.jbpm.jpdl.xml.JpdlXmlReader;
import org.jbpm.jpdl.xml.Problem;
import org.jbpm.taskmgmt.def.Task;
import org.jbpm.taskmgmt.exe.PooledActor;
@@ -97,7 +96,6 @@ import org.jbpm.taskmgmt.exe.TaskInstance;
import org.springframework.util.StringUtils;
import org.springmodules.workflow.jbpm31.JbpmCallback;
import org.springmodules.workflow.jbpm31.JbpmTemplate;
-import org.xml.sax.InputSource;
/**
@@ -437,7 +435,7 @@ public class JBPMEngine extends BPMEngine
* @param workflowDefinitionId workflow definition id
* @return process definition
*/
- private ProcessDefinition getProcessDefinition(GraphSession graphSession, String workflowDefinitionId)
+ protected ProcessDefinition getProcessDefinition(GraphSession graphSession, String workflowDefinitionId)
{
ProcessDefinition processDefinition = graphSession.getProcessDefinition(getJbpmId(workflowDefinitionId));
if (processDefinition == null)
@@ -576,7 +574,7 @@ public class JBPMEngine extends BPMEngine
* @param workflowId workflow id
* @return process instance
*/
- private ProcessInstance getProcessInstance(GraphSession graphSession, String workflowId)
+ protected ProcessInstance getProcessInstance(GraphSession graphSession, String workflowId)
{
ProcessInstance processInstance = graphSession.getProcessInstance(getJbpmId(workflowId));
if (processInstance == null)
@@ -646,7 +644,7 @@ public class JBPMEngine extends BPMEngine
WorkflowInstance workflowInstance = createWorkflowInstance(processInstance);
// delete the process instance
- graphSession.deleteProcessInstance(processInstance, true, true, true);
+ graphSession.deleteProcessInstance(processInstance, true, true);
return workflowInstance;
}
});
@@ -675,7 +673,7 @@ public class JBPMEngine extends BPMEngine
WorkflowInstance workflowInstance = createWorkflowInstance(processInstance);
// delete the process instance
- graphSession.deleteProcessInstance(processInstance, true, true, true);
+ graphSession.deleteProcessInstance(processInstance, true, true);
workflowInstance.active = false;
workflowInstance.endDate = new Date();
return workflowInstance;
@@ -877,7 +875,7 @@ public class JBPMEngine extends BPMEngine
* @param taskId task id
* @return task instance
*/
- private TaskInstance getTaskInstance(TaskMgmtSession taskSession, String taskId)
+ protected TaskInstance getTaskInstance(TaskMgmtSession taskSession, String taskId)
{
TaskInstance taskInstance = taskSession.getTaskInstance(getJbpmId(taskId));
if (taskInstance == null)
@@ -1114,32 +1112,8 @@ public class JBPMEngine extends BPMEngine
protected ProcessDefinition def;
protected String[] problems;
}
-
- /**
- * JpdlXmlReader with access to problems encountered during compile.
- *
- * @author davidc
- */
- private static class JBPMEngineJpdlXmlReader extends JpdlXmlReader
- {
- private static final long serialVersionUID = -753730152120696221L;
-
- public JBPMEngineJpdlXmlReader(InputStream inputStream)
- {
- super(new InputSource(inputStream));
- }
-
- /**
- * Gets the problems
- *
- * @return problems
- */
- public List getProblems()
- {
- return problems;
- }
- }
+
/**
* Construct a Process Definition from the provided Process Definition stream
*
@@ -1184,7 +1158,7 @@ public class JBPMEngine extends BPMEngine
{
try
{
- JBPMEngineJpdlXmlReader jpdlReader = new JBPMEngineJpdlXmlReader(definitionStream);
+ JBPMJpdlXmlReader jpdlReader = new JBPMJpdlXmlReader(definitionStream);
ProcessDefinition def = jpdlReader.readProcessDefinition();
compiledDef = new CompiledProcessDefinition(def, jpdlReader.getProblems());
}
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/JBPMEngineTest.java b/source/java/org/alfresco/repo/workflow/jbpm/JBPMEngineTest.java
index 9f67b7525e..f99d35c044 100644
--- a/source/java/org/alfresco/repo/workflow/jbpm/JBPMEngineTest.java
+++ b/source/java/org/alfresco/repo/workflow/jbpm/JBPMEngineTest.java
@@ -87,10 +87,10 @@ public class JBPMEngineTest extends BaseSpringTest
packageComponent = (WorkflowPackageComponent)applicationContext.getBean("workflowPackageImpl");
// deploy test process messages
- I18NUtil.registerResourceBundle("org/alfresco/repo/workflow/jbpm/test-messages");
+ I18NUtil.registerResourceBundle("jbpmresources/test-messages");
// deploy test process definition
- ClassPathResource processDef = new ClassPathResource("org/alfresco/repo/workflow/jbpm/test_processdefinition.xml");
+ ClassPathResource processDef = new ClassPathResource("jbpmresources/test_processdefinition.xml");
assertFalse(workflowComponent.isDefinitionDeployed(processDef.getInputStream(), MimetypeMap.MIMETYPE_XML));
WorkflowDeployment deployment = workflowComponent.deployDefinition(processDef.getInputStream(), MimetypeMap.MIMETYPE_XML);
testWorkflowDef = deployment.definition;
@@ -123,7 +123,7 @@ public class JBPMEngineTest extends BaseSpringTest
public void testDeployWorkflow() throws Exception
{
- ClassPathResource processDef = new ClassPathResource("org/alfresco/repo/workflow/jbpm/test_processdefinition.xml");
+ ClassPathResource processDef = new ClassPathResource("jbpmresources/test_processdefinition.xml");
WorkflowDeployment deployment = workflowComponent.deployDefinition(processDef.getInputStream(), MimetypeMap.MIMETYPE_XML);
testWorkflowDef = deployment.definition;
assertNotNull(testWorkflowDef);
@@ -472,7 +472,7 @@ public class JBPMEngineTest extends BaseSpringTest
throws IOException
{
// deploy test script definition
- ClassPathResource processDef = new ClassPathResource("org/alfresco/repo/workflow/jbpm/test_script.xml");
+ ClassPathResource processDef = new ClassPathResource("jbpmresources/test_script.xml");
assertFalse(workflowComponent.isDefinitionDeployed(processDef.getInputStream(), MimetypeMap.MIMETYPE_XML));
WorkflowDeployment deployment = workflowComponent.deployDefinition(processDef.getInputStream(), MimetypeMap.MIMETYPE_XML);
assertNotNull(deployment);
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/JBPMJpdlArchiveParser.java b/source/java/org/alfresco/repo/workflow/jbpm/JBPMJpdlArchiveParser.java
new file mode 100644
index 0000000000..c8bd09229a
--- /dev/null
+++ b/source/java/org/alfresco/repo/workflow/jbpm/JBPMJpdlArchiveParser.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program 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 General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.workflow.jbpm;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.jpdl.JpdlException;
+import org.jbpm.jpdl.par.ProcessArchive;
+import org.jbpm.jpdl.par.ProcessArchiveParser;
+import org.jbpm.jpdl.xml.JpdlXmlReader;
+import org.xml.sax.InputSource;
+
+
+/**
+ * Alfresco specific process archive parser to allow for extensions
+ * to jPDL.
+ *
+ * @author davidc
+ */
+public class JBPMJpdlArchiveParser implements ProcessArchiveParser
+{
+
+ private static final long serialVersionUID = 1L;
+
+ /* (non-Javadoc)
+ * @see org.jbpm.jpdl.par.ProcessArchiveParser#readFromArchive(org.jbpm.jpdl.par.ProcessArchive, org.jbpm.graph.def.ProcessDefinition)
+ */
+ public ProcessDefinition readFromArchive(ProcessArchive processArchive, ProcessDefinition processDefinition)
+ throws JpdlException
+ {
+ // NOTE: This method implementation is a copy from the JpdlXmlReader class
+ // with the difference of constructing an AlfrescoCreateTimerAction.
+ // It may need to be updated whenever a jbpm library upgrade is performed.
+
+ try
+ {
+ byte[] processBytes = processArchive.getEntry("processdefinition.xml");
+ if (processBytes == null)
+ {
+ throw new JpdlException("no processdefinition.xml inside process archive");
+ }
+
+ // creating the JpdlXmlReader
+ InputStream processInputStream = new ByteArrayInputStream(processBytes);
+ InputSource processInputSource = new InputSource(processInputStream);
+ JpdlXmlReader jpdlXmlReader = new JBPMJpdlXmlReader(processInputSource, processArchive);
+ processDefinition = jpdlXmlReader.readProcessDefinition();
+
+ // close all the streams
+ jpdlXmlReader.close();
+ processInputStream.close();
+ }
+ catch (IOException e)
+ {
+ throw new JpdlException("io problem while reading processdefinition.xml: " + e.getMessage(), e);
+ }
+
+ return processDefinition;
+ }
+}
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/JBPMJpdlXmlReader.java b/source/java/org/alfresco/repo/workflow/jbpm/JBPMJpdlXmlReader.java
new file mode 100644
index 0000000000..d142b1d7a6
--- /dev/null
+++ b/source/java/org/alfresco/repo/workflow/jbpm/JBPMJpdlXmlReader.java
@@ -0,0 +1,179 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program 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 General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.workflow.jbpm;
+
+import java.io.InputStream;
+import java.io.Reader;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.dom4j.Element;
+import org.jbpm.graph.def.Action;
+import org.jbpm.graph.def.Event;
+import org.jbpm.graph.def.Node;
+import org.jbpm.instantiation.Delegation;
+import org.jbpm.jpdl.xml.JpdlXmlReader;
+import org.jbpm.jpdl.xml.ProblemListener;
+import org.jbpm.scheduler.def.CancelTimerAction;
+import org.jbpm.scheduler.def.CreateTimerAction;
+import org.jbpm.taskmgmt.def.Task;
+import org.xml.sax.InputSource;
+
+/**
+ * Extended JpdlXmlReader with access to problems encountered during compile.
+ *
+ * Provides extension to Timers (to allow for absolute date).
+ *
+ * @author davidc
+ */
+public class JBPMJpdlXmlReader extends JpdlXmlReader
+{
+ private static final long serialVersionUID = -753730152120696221L;
+
+ /*
+ * Construct
+ */
+ public JBPMJpdlXmlReader(InputStream inputStream)
+ {
+ super(new InputSource(inputStream));
+ }
+
+ /*
+ * Construct
+ */
+ public JBPMJpdlXmlReader(InputSource inputSource, ProblemListener problemListener)
+ {
+ super(inputSource, problemListener);
+ }
+
+ /*
+ * Construct
+ */
+ public JBPMJpdlXmlReader(InputSource inputSource)
+ {
+ super(inputSource);
+ }
+
+ /*
+ * Construct
+ */
+ public JBPMJpdlXmlReader(Reader reader)
+ {
+ super(reader);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jbpm.jpdl.xml.JpdlXmlReader#readNodeTimer(org.dom4j.Element, org.jbpm.graph.def.Node)
+ */
+ protected void readNodeTimer(Element timerElement, Node node)
+ {
+ // NOTE: This method implementation is a copy from the JpdlXmlReader class
+ // with the difference of constructing an AlfrescoCreateTimerAction.
+ // It may need to be updated whenever a jbpm library upgrade is performed.
+
+ String name = timerElement.attributeValue("name", node.getName());
+
+ CreateTimerAction createTimerAction = new AlfrescoCreateTimerAction();
+ createTimerAction.read(timerElement, this);
+ createTimerAction.setTimerName(name);
+ createTimerAction.setTimerAction(readSingleAction(timerElement));
+ addAction(node, Event.EVENTTYPE_NODE_ENTER, createTimerAction);
+
+ CancelTimerAction cancelTimerAction = new CancelTimerAction();
+ cancelTimerAction.setTimerName(name);
+ addAction(node, Event.EVENTTYPE_NODE_LEAVE, cancelTimerAction);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jbpm.jpdl.xml.JpdlXmlReader#readTaskTimer(org.dom4j.Element, org.jbpm.taskmgmt.def.Task)
+ */
+ protected void readTaskTimer(Element timerElement, Task task)
+ {
+ // NOTE: This method implementation is a copy from the JpdlXmlReader class
+ // with the difference of constructing an AlfrescoCreateTimerAction.
+ // It may need to be updated whenever a jbpm library upgrade is performed.
+
+ String name = timerElement.attributeValue("name", task.getName());
+ if (name == null)
+ name = "timer-for-task-" + task.getId();
+
+ CreateTimerAction createTimerAction = new AlfrescoCreateTimerAction();
+ createTimerAction.read(timerElement, this);
+ createTimerAction.setTimerName(name);
+ Action action = null;
+ if ("timer".equals(timerElement.getName()))
+ {
+ action = readSingleAction(timerElement);
+ }
+ else
+ {
+ Delegation delegation = createMailDelegation("task-reminder", null, null, null, null);
+ action = new Action(delegation);
+ }
+ createTimerAction.setTimerAction(action);
+ addAction(task, Event.EVENTTYPE_TASK_CREATE, createTimerAction);
+
+ // read the cancel-event types
+ Collection cancelEventTypes = new ArrayList();
+
+ String cancelEventTypeText = timerElement.attributeValue("cancel-event");
+ if (cancelEventTypeText != null)
+ {
+ // cancel-event is a comma separated list of events
+ StringTokenizer tokenizer = new StringTokenizer(cancelEventTypeText, ",");
+ while (tokenizer.hasMoreTokens())
+ {
+ cancelEventTypes.add(tokenizer.nextToken().trim());
+ }
+ }
+ else
+ {
+ // set the default
+ cancelEventTypes.add(Event.EVENTTYPE_TASK_END);
+ }
+
+ Iterator iter = cancelEventTypes.iterator();
+ while (iter.hasNext())
+ {
+ String cancelEventType = (String) iter.next();
+ CancelTimerAction cancelTimerAction = new CancelTimerAction();
+ cancelTimerAction.setTimerName(name);
+ addAction(task, cancelEventType, cancelTimerAction);
+ }
+ }
+
+ /**
+ * Gets the problems
+ *
+ * @return problems
+ */
+ public List getProblems()
+ {
+ return problems;
+ }
+}
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/JBPMScheduler.java b/source/java/org/alfresco/repo/workflow/jbpm/JBPMScheduler.java
new file mode 100644
index 0000000000..e4388239ba
--- /dev/null
+++ b/source/java/org/alfresco/repo/workflow/jbpm/JBPMScheduler.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2005-2007 Alfresco Software Limited.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program 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 General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ * As a special exception to the terms and conditions of version 2.0 of
+ * the GPL, you may redistribute this Program in connection with Free/Libre
+ * and Open Source Software ("FLOSS") applications as described in Alfresco's
+ * FLOSS exception. You should have recieved a copy of the text describing
+ * the FLOSS exception, and it is also available here:
+ * http://www.alfresco.com/legal/licensing"
+ */
+package org.alfresco.repo.workflow.jbpm;
+
+import org.alfresco.util.AbstractLifecycleBean;
+import org.jbpm.job.executor.JobExecutor;
+import org.springframework.context.ApplicationEvent;
+import org.springmodules.workflow.jbpm31.JbpmTemplate;
+
+
+/**
+ * JBPM Scheduler
+ *
+ * Manages lifecycle of Jbpm Job Executor.
+ *
+ * @author davidc
+ */
+public class JBPMScheduler extends AbstractLifecycleBean
+{
+ private JobExecutor executor = null;
+ private JbpmTemplate jbpmTemplate;
+
+
+ /**
+ * @param jbpmTemplate
+ */
+ public void setJBPMTemplate(JbpmTemplate jbpmTemplate)
+ {
+ this.jbpmTemplate = jbpmTemplate;
+ }
+
+ @Override
+ protected void onBootstrap(ApplicationEvent event)
+ {
+ executor = jbpmTemplate.getJbpmConfiguration().getJobExecutor();
+ executor.start();
+ }
+
+ @Override
+ protected void onShutdown(ApplicationEvent event)
+ {
+ executor.stop();
+ }
+
+}
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/JBPMTransactionTemplate.java b/source/java/org/alfresco/repo/workflow/jbpm/JBPMTransactionTemplate.java
index db6d884bbc..e3ac7a5546 100644
--- a/source/java/org/alfresco/repo/workflow/jbpm/JBPMTransactionTemplate.java
+++ b/source/java/org/alfresco/repo/workflow/jbpm/JBPMTransactionTemplate.java
@@ -84,6 +84,7 @@ public class JBPMTransactionTemplate extends JbpmTemplate
/* (non-Javadoc)
* @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
*/
+ @SuppressWarnings("synthetic-access")
@Override
public void afterPropertiesSet() throws Exception
{
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/jbpm.CreateTimerAction.hbm.xml b/source/java/org/alfresco/repo/workflow/jbpm/jbpm.CreateTimerAction.hbm.xml
new file mode 100644
index 0000000000..38e31695e3
--- /dev/null
+++ b/source/java/org/alfresco/repo/workflow/jbpm/jbpm.CreateTimerAction.hbm.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/Join.hbm.xml b/source/java/org/alfresco/repo/workflow/jbpm/jbpm.Join.hbm.xml
similarity index 100%
rename from source/java/org/alfresco/repo/workflow/jbpm/Join.hbm.xml
rename to source/java/org/alfresco/repo/workflow/jbpm/jbpm.Join.hbm.xml
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/jbpm.Timer.hbm.xml b/source/java/org/alfresco/repo/workflow/jbpm/jbpm.Timer.hbm.xml
new file mode 100644
index 0000000000..efe590b818
--- /dev/null
+++ b/source/java/org/alfresco/repo/workflow/jbpm/jbpm.Timer.hbm.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/jbpm.action.types.xml b/source/java/org/alfresco/repo/workflow/jbpm/jbpm.action.types.xml
new file mode 100644
index 0000000000..217f1686d5
--- /dev/null
+++ b/source/java/org/alfresco/repo/workflow/jbpm/jbpm.action.types.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/jbpm.cfg.xml b/source/java/org/alfresco/repo/workflow/jbpm/jbpm.cfg.xml
index 1bd06e8647..294f651124 100644
--- a/source/java/org/alfresco/repo/workflow/jbpm/jbpm.cfg.xml
+++ b/source/java/org/alfresco/repo/workflow/jbpm/jbpm.cfg.xml
@@ -2,6 +2,7 @@
+
@@ -9,20 +10,31 @@
-
-
+
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/jbpm.node.types.xml b/source/java/org/alfresco/repo/workflow/jbpm/jbpm.node.types.xml
index 644c6f1dc2..02dea216ff 100644
--- a/source/java/org/alfresco/repo/workflow/jbpm/jbpm.node.types.xml
+++ b/source/java/org/alfresco/repo/workflow/jbpm/jbpm.node.types.xml
@@ -13,6 +13,7 @@
+
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/jbpm.parsers.xml b/source/java/org/alfresco/repo/workflow/jbpm/jbpm.parsers.xml
new file mode 100644
index 0000000000..56faf530d2
--- /dev/null
+++ b/source/java/org/alfresco/repo/workflow/jbpm/jbpm.parsers.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/jbpm.varmapping.xml b/source/java/org/alfresco/repo/workflow/jbpm/jbpm.varmapping.xml
index 77e7f26a0d..eba185c2ad 100644
--- a/source/java/org/alfresco/repo/workflow/jbpm/jbpm.varmapping.xml
+++ b/source/java/org/alfresco/repo/workflow/jbpm/jbpm.varmapping.xml
@@ -151,6 +151,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -161,22 +177,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -185,6 +185,14 @@
+
+
+
+
+
+
+
+
diff --git a/source/test-resources/jbpmresources/hibernate.cfg.xml b/source/test-resources/jbpmresources/hibernate.cfg.xml
index 2066e575a9..3729c59b19 100644
--- a/source/test-resources/jbpmresources/hibernate.cfg.xml
+++ b/source/test-resources/jbpmresources/hibernate.cfg.xml
@@ -34,14 +34,23 @@
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -115,13 +124,11 @@
-
-
-
-
-
-
-
+
+
+
+
+
@@ -129,9 +136,6 @@
-
-
-
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/test-messages.properties b/source/test-resources/jbpmresources/test-messages.properties
similarity index 100%
rename from source/java/org/alfresco/repo/workflow/jbpm/test-messages.properties
rename to source/test-resources/jbpmresources/test-messages.properties
diff --git a/source/test-resources/jbpmresources/test_decision.xml b/source/test-resources/jbpmresources/test_decision.xml
new file mode 100644
index 0000000000..63a60de50e
--- /dev/null
+++ b/source/test-resources/jbpmresources/test_decision.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #{bpm_assignee}
+
+
+
+
+
+
+
+
+ #{value == true}
+
+
+ #{value == false}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/test_groups.xml b/source/test-resources/jbpmresources/test_groups.xml
similarity index 100%
rename from source/java/org/alfresco/repo/workflow/jbpm/test_groups.xml
rename to source/test-resources/jbpmresources/test_groups.xml
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/test_pooledtasks.xml b/source/test-resources/jbpmresources/test_pooledtasks.xml
similarity index 100%
rename from source/java/org/alfresco/repo/workflow/jbpm/test_pooledtasks.xml
rename to source/test-resources/jbpmresources/test_pooledtasks.xml
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/test_processdefinition.xml b/source/test-resources/jbpmresources/test_processdefinition.xml
similarity index 100%
rename from source/java/org/alfresco/repo/workflow/jbpm/test_processdefinition.xml
rename to source/test-resources/jbpmresources/test_processdefinition.xml
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/test_processevents.xml b/source/test-resources/jbpmresources/test_processevents.xml
similarity index 100%
rename from source/java/org/alfresco/repo/workflow/jbpm/test_processevents.xml
rename to source/test-resources/jbpmresources/test_processevents.xml
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/test_script.xml b/source/test-resources/jbpmresources/test_script.xml
similarity index 100%
rename from source/java/org/alfresco/repo/workflow/jbpm/test_script.xml
rename to source/test-resources/jbpmresources/test_script.xml
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/test_taskassign.xml b/source/test-resources/jbpmresources/test_taskassign.xml
similarity index 100%
rename from source/java/org/alfresco/repo/workflow/jbpm/test_taskassign.xml
rename to source/test-resources/jbpmresources/test_taskassign.xml
diff --git a/source/test-resources/jbpmresources/test_timers.xml b/source/test-resources/jbpmresources/test_timers.xml
new file mode 100644
index 0000000000..4f0b13cab3
--- /dev/null
+++ b/source/test-resources/jbpmresources/test_timers.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #{bpm_assignee}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source/java/org/alfresco/repo/workflow/jbpm/test_xor.xml b/source/test-resources/jbpmresources/test_xor.xml
similarity index 100%
rename from source/java/org/alfresco/repo/workflow/jbpm/test_xor.xml
rename to source/test-resources/jbpmresources/test_xor.xml