JBoss JBPM SVN: r5126 - in projects/gwt-console/trunk: server/server-core/src/main/java/org/jboss/bpm/console/server and 1 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-06-26 06:11:54 -0400 (Fri, 26 Jun 2009)
New Revision: 5126
Added:
projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/ProcessEnginePlugin.java
Removed:
projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/DeploymentPlugin.java
Modified:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDetailView.java
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/DeploymentFacade.java
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/InfoFacade.java
Log:
Rename deployment plugin
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDetailView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDetailView.java 2009-06-26 08:23:24 UTC (rev 5125)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDetailView.java 2009-06-26 10:11:54 UTC (rev 5126)
@@ -31,7 +31,6 @@
import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
import org.jboss.bpm.console.client.common.PropertyGrid;
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
-import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.ServerPlugins;
/**
@@ -71,7 +70,7 @@
dropBox.addItem("Properties");
// deployment info
- if(ServerPlugins.has("org.jboss.bpm.console.server.plugin.DeploymentPlugin"))
+ if(ServerPlugins.has("org.jboss.bpm.console.server.plugin.ProcessEnginePlugin"))
{
dropBox.addItem("Deployment");
deploymentPanel = new DeploymentPanel();
Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/DeploymentFacade.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/DeploymentFacade.java 2009-06-26 08:23:24 UTC (rev 5125)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/DeploymentFacade.java 2009-06-26 10:11:54 UTC (rev 5126)
@@ -27,7 +27,7 @@
import org.jboss.bpm.console.client.model.DeploymentRef;
import org.jboss.bpm.console.client.model.DeploymentRefWrapper;
import org.jboss.bpm.console.server.gson.GsonFactory;
-import org.jboss.bpm.console.server.plugin.DeploymentPlugin;
+import org.jboss.bpm.console.server.plugin.ProcessEnginePlugin;
import org.jboss.bpm.console.server.plugin.PluginMgr;
import javax.ws.rs.*;
@@ -44,16 +44,16 @@
{
private static final Log log = LogFactory.getLog(DeploymentFacade.class);
- private DeploymentPlugin deploymentPlugin;
+ private ProcessEnginePlugin processEnginePlugin;
- private DeploymentPlugin getDeploymentPlugin()
+ private ProcessEnginePlugin getDeploymentPlugin()
{
- if(null==this.deploymentPlugin)
+ if(null==this.processEnginePlugin)
{
- this.deploymentPlugin = PluginMgr.load(DeploymentPlugin.class);
+ this.processEnginePlugin = PluginMgr.load(ProcessEnginePlugin.class);
}
- return this.deploymentPlugin;
+ return this.processEnginePlugin;
}
@GET
@@ -62,8 +62,8 @@
public Response getDeployments()
{
- DeploymentPlugin dplPlugin = getDeploymentPlugin();
- if(deploymentPlugin!=null)
+ ProcessEnginePlugin dplPlugin = getDeploymentPlugin();
+ if(processEnginePlugin !=null)
{
List<DeploymentRef> dpls = dplPlugin.getDeployments();
return createJsonResponse(
@@ -72,7 +72,7 @@
}
else
{
- log.error("DeploymentPlugin not available");
+ log.error("ProcessEnginePlugin not available");
return Response.serverError().build();
}
@@ -102,15 +102,15 @@
private Response doSuspend(String id, boolean suspended)
{
- DeploymentPlugin dplPlugin = getDeploymentPlugin();
- if(deploymentPlugin!=null)
+ ProcessEnginePlugin dplPlugin = getDeploymentPlugin();
+ if(processEnginePlugin !=null)
{
- deploymentPlugin.setSuspended(id, suspended);
+ processEnginePlugin.suspendDeployment(id, suspended);
return Response.ok().build();
}
else
{
- log.error("DeploymentPlugin not available");
+ log.error("ProcessEnginePlugin not available");
return Response.serverError().build();
}
}
@@ -124,15 +124,15 @@
)
{
- DeploymentPlugin dplPlugin = getDeploymentPlugin();
- if(deploymentPlugin!=null)
+ ProcessEnginePlugin dplPlugin = getDeploymentPlugin();
+ if(processEnginePlugin !=null)
{
- deploymentPlugin.deleteDeployment(id);
+ processEnginePlugin.deleteDeployment(id);
return Response.ok().build();
}
else
{
- log.error("DeploymentPlugin not available");
+ log.error("ProcessEnginePlugin not available");
return Response.serverError().build();
}
Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/InfoFacade.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/InfoFacade.java 2009-06-26 08:23:24 UTC (rev 5125)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/InfoFacade.java 2009-06-26 10:11:54 UTC (rev 5126)
@@ -24,7 +24,7 @@
import org.jboss.bpm.console.server.plugin.TaskDispatcherPlugin;
import org.jboss.bpm.console.server.plugin.PluginMgr;
import org.jboss.bpm.console.server.plugin.GraphViewerPlugin;
-import org.jboss.bpm.console.server.plugin.DeploymentPlugin;
+import org.jboss.bpm.console.server.plugin.ProcessEnginePlugin;
import org.jboss.bpm.console.server.gson.GsonFactory;
import org.jboss.bpm.console.client.model.ServerStatus;
import org.jboss.bpm.console.client.model.PluginInfo;
@@ -46,7 +46,7 @@
private Class[] pluginInterfaces = {
TaskDispatcherPlugin.class,
GraphViewerPlugin.class,
- DeploymentPlugin.class
+ ProcessEnginePlugin.class
};
private ServerStatus status = null;
Deleted: projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/DeploymentPlugin.java
===================================================================
--- projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/DeploymentPlugin.java 2009-06-26 08:23:24 UTC (rev 5125)
+++ projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/DeploymentPlugin.java 2009-06-26 10:11:54 UTC (rev 5126)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jboss.bpm.console.server.plugin;
-
-import org.jboss.bpm.console.client.model.DeploymentRef;
-
-import java.util.List;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public interface DeploymentPlugin
-{
- List<DeploymentRef> getDeployments();
-
- void deleteDeployment(String id);
-
- void setSuspended(String id, boolean isSuspended);
-}
Copied: projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/ProcessEnginePlugin.java (from rev 5125, projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/DeploymentPlugin.java)
===================================================================
--- projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/ProcessEnginePlugin.java (rev 0)
+++ projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/ProcessEnginePlugin.java 2009-06-26 10:11:54 UTC (rev 5126)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jboss.bpm.console.server.plugin;
+
+import org.jboss.bpm.console.client.model.DeploymentRef;
+
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public interface ProcessEnginePlugin
+{
+ List<DeploymentRef> getDeployments();
+
+ void deleteDeployment(String id);
+
+ void suspendDeployment(String id, boolean isSuspended);
+}
16 years, 10 months
JBoss JBPM SVN: r5125 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/api/activity and 22 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-06-26 04:23:24 -0400 (Fri, 26 Jun 2009)
New Revision: 5125
Added:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Activity.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElement.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ObservableElement.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/OpenProcessDefinition.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Transition.java
Removed:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Activity.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/CompositeElement.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/ObservableElement.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenProcessDefinition.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Transition.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Deployment.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Execution.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/ActivityExecution.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/listener/EventListenerExecution.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenExecution.java
jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/WaitState.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/eventlistener/EventListenerTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/eventlistener/LogListener.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/eventlistener/process.jpdl.xml
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java
jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionConditionActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionExpressionActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionHandlerActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/EndActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ForkActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/GroupActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JoinActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlAutomaticActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/StateActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TransitionParsingTest.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/client/ClientProcessDefinition.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByKeyCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionByIdCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetOutcomes.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElementImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ObservableElementImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessModificationsImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/TransitionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListener.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/LifeCycle.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/DisplaySource.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/BuilderTest.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/EventListenerTest.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/AutomaticActivity.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ContinuationTest.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/WaitState.java
jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/EventTest.java
jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/FunctionalActivityTest.java
jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ScopeVariableDeclarationTest.java
jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionEventsTest.java
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Jpdl.xml
Log:
JBPM-2307 pruning the api to the minimal
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Deployment.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Deployment.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Deployment.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -35,6 +35,9 @@
* to have a kind of undoable delete operation. */
String STATE_SUSPENDED = "suspended";
+ /** unique identification of this deployment */
+ String getId();
+
long getDbid();
/** typically correspond to the file name or url or some other
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Execution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Execution.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Execution.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -26,8 +26,6 @@
import java.util.Map;
import java.util.Set;
-import org.jbpm.api.model.ObservableElement;
-
/** a runtime path of execution.
*
* <h3 id="state">State of an execution</h3>
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/ActivityExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/ActivityExecution.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/ActivityExecution.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -23,10 +23,7 @@
import org.jbpm.api.Execution;
import org.jbpm.api.JbpmException;
-import org.jbpm.api.model.Activity;
-import org.jbpm.api.model.ObservableElement;
import org.jbpm.api.model.OpenExecution;
-import org.jbpm.api.model.Transition;
/** view upon an {@link Execution path of execution} exposed to
@@ -40,9 +37,6 @@
* name of the current activity. */
String getActivityName();
- /** the current activity. */
- Activity getActivity();
-
// wait state behaviour /////////////////////////////////////////////////////
@@ -76,7 +70,7 @@
* will decide how to interpret the signal.</p>
*
* <p>Transitions will be looked up recursively starting from the
- * {@link #getActivity() current activity} and then up the {@link Activity#getParent() activity-parent-hierarchy} </p>
+ * {@link #getActivityName() current activity} and then up the activity-parent-hierarchy</p>
*
* @param transitionName is the name of the transition to take. A null value will
* match the first unnamed transition.
@@ -85,25 +79,6 @@
* or in case this method is called from inside an {@link ActivityBehaviour}.*/
void take(String transitionName);
- /** takes the given outgoing transition.
- *
- * <p>This method can only be called
- * from inside {@link ExternalActivityBehaviour} implementations and in rare occasions also from
- * outside of the execution (from an external client while the process is in a wait state).
- * For external clients, it is more normal to use the {@link #signal(String)}
- * method as in that case, it's the current activity (hence the process language)that
- * will decide how to interpret the signal.</p>
- *
- * <p>CAUTION: It's up to the client to make sure
- * that this transition makes sense as there is no check whether the given transition
- * is an outgoing transition of the current activity. The motivation for that is
- * that in case of groups, that check can become too 'expensive'. </p> */
- void take(Transition transition);
-
- /** let's the given execution take the transition.
- * @throws JbpmException if the execution is not part of this process instance. */
- void take(Transition transition, Execution execution);
-
// execute a child activity /////////////////////////////////////////////////////
/** executes the given nested activity.
@@ -118,25 +93,6 @@
* will decide how to interpret the signal.</p> */
void execute(String activityName);
- /** executes the given activity.
- *
- * <p>This method can only be called
- * from inside {@link ExternalActivityBehaviour} implementations and in rare occasions also from
- * outside of the execution (from an external client while the process is in a wait state).
- * For external clients, it is more normal to use the {@link #signal(String)}
- * method as in that case, it's the current activity (hence the process language)that
- * will decide how to interpret the signal.</p>
- */
- void execute(Activity activity);
-
- // reposition the execution in another activity /////////////////////////////////
-
- /** position this execution in the destination activity. */
- void setActivity(Activity destination);
-
- /** position the given execution in the destination activity */
- void setActivity(Activity destination, Execution execution);
-
// ending an execution //////////////////////////////////////////////////////
/** ends this execution and all of its child executions.
@@ -157,27 +113,8 @@
* <p>The execution will be removed from it's parent.</p> */
void end(String state);
- /** ends the given execution and all it's child executions. */
- void end(OpenExecution executionToEnd);
-
- /** ends the given execution and all it's child executions with a user defined
- * status. */
- void end(OpenExecution executionToEnd, String state);
-
- // firing events ////////////////////////////////////////////////////////////
-
- /** fires the event on the given eventSource and then propagates the event
- * up to the eventSource's parent chain. All the actions will see the given
- * eventSource in {@link #getEventSource()}, event if the events are
- * registered to parent's of the given eventSource. */
- void fire(String eventName, ObservableElement eventSource);
-
// extra state information methods //////////////////////////////////////////
- /** the current transition indicating the position in the process definition graph.
- * Can be null in case this execution is not taking a transition. */
- Transition getTransition();
-
/** setter for the priority. The default priority is 0, which means
* NORMAL. Other recognized named priorities are HIGHEST (2), HIGH (1),
* LOW (-1) and LOWEST (-2). For the rest, the user can set any other
@@ -185,24 +122,4 @@
* an integer and not the named value.*/
void setPriority(int priority);
- // history methods //////////////////////////////////////////////////////////
-
- /** record history event that specifies for a decision activity which transition
- * has been taken. */
- void historyDecision(String transitionName);
-
- /** records the end of an automatic event. This should be called at the end of
- * the activity. Before the activity's execute method is invoked, the start time
- * is automatically recorded. And invocation of this historyAutomatic will
- * capture the end time. */
- void historyAutomatic();
-
- /** marks the start of an activity for history purposes. */
- void historyActivityStart();
-
- /** marks the end of an activity for history purposes. */
- void historyActivityEnd();
-
- /** marks the end of an activity with a specific transitionName for history purposes. */
- void historyActivityEnd(String transitionName);
}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/listener/EventListenerExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/listener/EventListenerExecution.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/listener/EventListenerExecution.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -22,11 +22,7 @@
package org.jbpm.api.listener;
import org.jbpm.api.Execution;
-import org.jbpm.api.activity.ActivityBehaviour;
-import org.jbpm.api.model.Event;
-import org.jbpm.api.model.ObservableElement;
import org.jbpm.api.model.OpenExecution;
-import org.jbpm.api.model.Transition;
/** view upon an {@link Execution path of execution} exposed to
@@ -36,29 +32,6 @@
*/
public interface EventListenerExecution extends OpenExecution {
-
- /** the original object that fired the event, part of the current position in the
- * process graph. Can be null in case no event is being fired. This is mostly the
- * object that is listened to with an {@link ActivityBehaviour}, but the eventSource can also
- * be a child of the object to which is listened in case of event propagation. */
- ObservableElement getEventSource();
-
- /** the event that is being fired, part of the current position in the process
- * graph. Can be null in case no event is being fired. */
- Event getEvent();
-
- // extra state information methods //////////////////////////////////////////
-
- /** the current transition indicating the position in the process definition graph.
- * Can be null in case this execution is not taking a transition. */
- Transition getTransition();
-
- /** fires the event on the given eventSource and then propagates the event
- * up to the eventSource's parent chain. All the actions will see the given
- * eventSource in {@link #getEventSource()}, event if the events are
- * registered to parent's of the given eventSource. */
- void fire(String eventName, ObservableElement eventSource);
-
/** setter for the priority. The default priority is 0, which means
* NORMAL. Other recognized named priorities are HIGHEST (2), HIGH (1),
* LOW (-1) and LOWEST (-2). For the rest, the user can set any other
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Activity.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Activity.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Activity.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -1,111 +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.api.model;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * a activity in a {@link OpenProcessDefinition} graph.
- *
- * <p>The activity supports both graph based process models as well as
- * block structured (tree based) process models. First we describe
- * tranisions that can be used to form graph based process structures
- * and then we'll describe activity composition to form block structured
- * process models. Both models can be combined as well.
- * </p>
- *
- * <p>Activities have {@link #getIncomingTransitions() incoming}
- * and {@link #getOutgoingTransitions() outgoing transitions}.
- * These are lists of transitions.
- * </p>
- *
- * <p>Optionally, transitions can have names. In that case the
- * transition {@link #getOutgoingTransition(String) names are associated
- * to activity's outgoing transitions}. The {@link #getOutgoingTransitionsMap() map
- * of outgoing transitions} provides easy access to the named transitions.
- * </p>
- *
- * <p>One of the outgoing transitions can optionally be marked as
- * {@link #getDefaultOutgoingTransition() the default transition}.
- * </p>
- *
- * <p>Block structured process languages have composite activities that can be
- * modeled with the {@link #getParent() parent}-{@link #getActivities() child}
- * relation.
- * </p>
- *
- * @author Tom Baeyens
- */
-public interface Activity extends CompositeElement {
-
- /** the list of outgoing transitions.
- * Caution: the actual member is returned. No copy is made. */
- List<Transition> getOutgoingTransitions();
-
- /** the default outgoing transition. */
- Transition getDefaultOutgoingTransition();
-
- /** the first leaving transition with the given name or null of no
- * such leaving transition exists. If the multiple transitions have
- * the given transition name, the first (in order of {@link #getOutgoingTransitions()})
- * will be returned.
- *
- * @param transitionName is the name of the transition to take. A null value will
- * match the first unnamed transition. */
- Transition getOutgoingTransition(String transitionName);
-
- /** indicates if a leaving transition with the given transitionName exists.
- * A null value matches an unnamed transition. */
- boolean hasOutgoingTransition(String transitionName);
-
- /** indicates if this activity has leaving transitions */
- boolean hasOutgoingTransitions();
-
- /** the leaving transitions, keyed by transition name. If a transition with
- * the same name occurs mutltiple times, the first one is returned.
- * Leaving transitions with a null value for their name are not included
- * in the map.
- * Beware: the actual member is returned. No copy is made. In fact, the
- * returned map is maintained as a cache. So updates to the map will
- * influence subsequent retrievals of outgoing transitions by name. */
- Map<String, Transition> getOutgoingTransitionsMap();
-
- /** searches for the given transitionName in this activity and then up the
- * parent chain. Returns null if no such transition is found. */
- Transition findOutgoingTransition(String transitionName);
-
- /** the list of arriving transitions.
- * Beware: the actual member is returned. No copy is made. */
- List<Transition> getIncomingTransitions();
-
- /** indicates if this activity has arriving transitions */
- boolean hasIncomingTransitions();
-
- /** retrieve the parent activity in the composite activity structure. This is
- * different from {@link ObservableElement#getParent()} in that it is restricted
- * to the parent activities. It doesn't take into account the process definition. */
- Activity getParentActivity();
-
- /** the type of this activity which corresponds to the xml tag */
- String getType();
-}
\ No newline at end of file
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/CompositeElement.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/CompositeElement.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/CompositeElement.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -1,67 +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.api.model;
-
-import java.util.List;
-import java.util.Map;
-
-
-
-/** activity container base class for {@link OpenProcessDefinition} and {@link Activity}.
- *
- * @author Tom Baeyens
- */
-public interface CompositeElement extends ObservableElement {
-
- /** indicates if this processDefinition has activities. */
- boolean hasActivities();
-
- /** the list of direct composite activities. Recursively contained
- * activities are not included in the list.
- * Beware: the actual member is returned. No copy is made. */
- List<Activity> getActivities();
-
- /** indicates if an activity with the given name exists directly in
- * this element. Only the direct contained activities are
- * searched. No recursive search is made. */
- boolean hasActivity(String activityName);
-
- /** the first composite activity with the given name or null of no
- * such activity exists. Only the direct contained activities are
- * searched. No recursive search is made. */
- Activity getActivity(String activityName);
-
- /** searches for the given activity in this element recursively,
- * including this activity and all child activities. The search
- * is done depth-first. A null value for activityName matches a activity
- * without a name. */
- Activity findActivity(String activityName);
-
- /** the composite activities, keyed by activity name. If an activity
- * with the same name occurs mutltiple times, the first in the list
- * is included in the map. Activities with a null value for their name
- * are not included in the map.
- * Beware: the actual member is returned. No copy is made. In fact, the
- * returned map is maintained as a cache. So updates to the map will
- * influence subsequent retrievals of activities by name.*/
- Map<String, Activity> getActivitiesMap();
-}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/ObservableElement.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/ObservableElement.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/ObservableElement.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -1,65 +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.api.model;
-
-import java.util.Set;
-
-
-/** a super class for process elements that have events.
- *
- * @author Tom Baeyens
- */
-public interface ObservableElement {
-
- /** the meaningless database primary key */
- long getDbid();
-
- /** the short display name given to this element. */
- String getName();
-
- /** the process definition to which this process element belongs */
- OpenProcessDefinition getProcessDefinition();
-
- /** the property value for the given key or null if no such
- * configuration key is present.
- *
- * This is extra static configuration information that can be
- * associated to a process element. Process languages can use this
- * to store configuration properties for extensions in it. That way,
- * these extensions can be added without changing the process model
- * or the database schema. Examples of extensions that may use these
- * configuration properties are simulation, predictive scheduling,
- * graphical information,... */
- Object getProperty(String key);
-
- /** the set of available property keys or an empty set in case
- * there are no keys. */
- Set<String> getPropertyKeys();
-
- /** indicates if the given event is defined no this element.
- * This method only looks in this observable element and it will not
- * search the parent hierarchy for the given event. */
- boolean hasEvent(String eventName);
-
- /** the enclosing activity or the process definition */
- ObservableElement getParent();
-}
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenExecution.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenExecution.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -44,9 +44,6 @@
*/
public interface OpenExecution extends Execution, Discussable {
- /** the process definition for this execution.*/
- OpenProcessDefinition getProcessDefinition();
-
/** update the state */
void setState(String state);
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenProcessDefinition.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenProcessDefinition.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenProcessDefinition.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -1,59 +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.api.model;
-
-import org.jbpm.api.ProcessDefinition;
-
-
-
-/**
- * a graph (or tree) structure that can be executed.
- *
- * <h2>Purpose</h2>
- * <p>ProcessDefinition is a base implementation that can be leveraged to build
- * graph based execution languages. While the ProcessDefinition class is concrete and
- * can be used as-is (e.g. by aggregation), most likely processDefinition languages
- * will inherit from this ProcessDefinition and create more specialized implementations.
- * </p>
- *
- * <p>The specialized processDefinition language classes can extend this ProcessDefinition
- * with new datastructures relevant for that perticular processDefinition language.
- * </p>
- *
- * <h2>Structure</h2>
- * <p>A processDefinition contains a set of activities. Activities can be connected with
- * transitions or activities can have nested activities. But the transitions and
- * nested activities can be combined.
- * </p>
- *
- * <h2>Execution</h2>
- * <p>To create a new execution for a given processDefinition, see {@link #startExecution()}.
- * </p>
- *
- * @author Tom Baeyens
- */
-public interface OpenProcessDefinition extends ProcessDefinition, CompositeElement {
-
- /** the initial activity of this process definition */
- Activity getInitial();
-
-}
\ No newline at end of file
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Transition.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Transition.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Transition.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -1,65 +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.api.model;
-
-/**
- * a transition in a {@link OpenProcessDefinition} graph.
- *
- * <h3 id="guardconditions">Guard conditions</h3>
- * <p>TODO</p>
- *
- * <h3 id="transitionsaswaitstates">Transitions as wait states</h3>
- * <p>A wait condition indicates wether a transition is to be taken synchronously
- * or wether the transition will behave as a wait state.
- * </p>
- *
- * <p>Transitions that are wait states can occur when an analyst has
- * an actual state (e.g. 'making loss') and a desired state (e.g. 'making profit')
- * and models a transition between those states. In that case the transition
- * might take a long time and hence it results into a wait state for the system.
- * </p>
- *
- * <p>If the wait condition is null or if it returns false, then the transition
- * will be taking synchronously. Otherwise the transition will behave as
- * a wait state and wait for a signal on the execution.
- * </p>
- *
- * <p>Transitions as wait states has every thing to do with matching the
- * process graph to transactions on the server. If the transition is taken
- * in one (the current) transaction, then the async condition should be empty
- * or evaluate to false. If the arrival of the execution in the destination
- * activity should occur in a separate execution
- *
- * @author Tom Baeyens
- */
-public interface Transition extends ObservableElement {
-
- /** the activity from which this transition leaves. */
- Activity getSource();
-
- /** the activity in which this transition arrives. */
- Activity getDestination();
-
- /** the general purpose condition that can be used in various ways by the
- * activities. */
- Condition getCondition();
-}
\ No newline at end of file
Modified: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/WaitState.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/WaitState.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/WaitState.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -25,8 +25,8 @@
import org.jbpm.api.activity.ActivityExecution;
import org.jbpm.api.activity.ExternalActivityBehaviour;
-import org.jbpm.api.model.Activity;
-import org.jbpm.api.model.Transition;
+import org.jbpm.pvm.internal.model.Activity;
+import org.jbpm.pvm.internal.model.Transition;
/**
* @author Alejandro Guizar
@@ -45,13 +45,13 @@
execution.setVariables(parameters);
}
- Activity activity = execution.getActivity();
- execution.fire(signalName, activity);
-
- Transition transition = activity.findOutgoingTransition(signalName);
- if (transition != null) {
- execution.take(transition);
- }
+// Activity activity = execution.getActivity();
+// execution.fire(signalName, activity);
+//
+// Transition transition = activity.findOutgoingTransition(signalName);
+// if (transition != null) {
+// execution.take(transition);
+// }
else {
execution.waitForSignal();
}
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/eventlistener/EventListenerTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/eventlistener/EventListenerTest.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/eventlistener/EventListenerTest.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -33,10 +33,10 @@
executionService.signalExecutionById(execution.getId());
List<String> expectedLogs = new ArrayList<String>();
- expectedLogs.add("event(start) on process(EventListener)");
- expectedLogs.add("event(start) on activity(wait)");
- expectedLogs.add("event(end) on activity(wait)");
- expectedLogs.add("event(take) on (wait)-->(park)");
+ expectedLogs.add("start on process definition");
+ expectedLogs.add("start on activity wait");
+ expectedLogs.add("end on activity wait");
+ expectedLogs.add("take transition");
List<String> logs = (List<String>) executionService.getVariable(processInstance.getId(), "logs");
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/eventlistener/LogListener.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/eventlistener/LogListener.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/eventlistener/LogListener.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -11,14 +11,18 @@
private static final long serialVersionUID = 1L;
+ // value gets injected from process definition
+ String msg;
+
public void notify(EventListenerExecution execution) {
List<String> logs = (List<String>) execution.getVariable("logs");
if (logs==null) {
logs = new ArrayList<String>();
execution.setVariable("logs", logs);
}
- logs.add(execution.getEvent()+" on "+execution.getEventSource());
+ logs.add(msg);
+
execution.setVariable("logs", logs);
}
}
Modified: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/eventlistener/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/eventlistener/process.jpdl.xml 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/eventlistener/process.jpdl.xml 2009-06-26 08:23:24 UTC (rev 5125)
@@ -3,27 +3,30 @@
<process name="EventListener" xmlns="http://jbpm.org/4.0/jpdl">
<on event="start">
- <event-listener class="org.jbpm.examples.eventlistener.LogListener"/>
+ <event-listener class="org.jbpm.examples.eventlistener.LogListener">
+ <field name="msg"><string value="start on process definition"/></field>
+ </event-listener>
</on>
- <on event="end">
- <event-listener class="org.jbpm.examples.eventlistener.LogListener"/>
- </on>
-
-
<start g="17,19,48,48">
<transition to="wait"/>
</start>
<state name="wait" g="96,16,104,52">
<on event="start">
- <event-listener class="org.jbpm.examples.eventlistener.LogListener"/>
+ <event-listener class="org.jbpm.examples.eventlistener.LogListener">
+ <field name="msg"><string value="start on activity wait"/></field>
+ </event-listener>
</on>
<on event="end">
- <event-listener class="org.jbpm.examples.eventlistener.LogListener"/>
+ <event-listener class="org.jbpm.examples.eventlistener.LogListener">
+ <field name="msg"><string value="end on activity wait"/></field>
+ </event-listener>
</on>
<transition to="park">
- <event-listener class="org.jbpm.examples.eventlistener.LogListener"/>
+ <event-listener class="org.jbpm.examples.eventlistener.LogListener">
+ <field name="msg"><string value="take transition"/></field>
+ </event-listener>
</transition>
</state>
Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -24,11 +24,11 @@
import org.jboss.bpm.console.client.model.*;
import org.jbpm.api.Deployment;
import org.jbpm.api.ProcessDefinition;
-import org.jbpm.api.model.Transition;
import org.jbpm.api.task.Participation;
import org.jbpm.api.task.Task;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+import org.jbpm.pvm.internal.model.Transition;
import org.jbpm.pvm.internal.repository.DeploymentImpl;
import org.jbpm.pvm.internal.task.TaskImpl;
Modified: jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -47,13 +47,13 @@
import org.jbpm.api.ProcessEngine;
import org.jbpm.api.RepositoryService;
import org.jbpm.api.TaskService;
-import org.jbpm.api.model.Transition;
import org.jbpm.api.task.Task;
import org.jbpm.integration.spi.mgmt.ServerConfig;
import org.jbpm.integration.spi.mgmt.ServerConfigFactory;
import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.Transition;
import org.jbpm.pvm.internal.task.TaskImpl;
import freemarker.template.DefaultObjectWrapper;
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionConditionActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionConditionActivity.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionConditionActivity.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -25,9 +25,10 @@
import org.jbpm.api.JbpmException;
import org.jbpm.api.activity.ActivityExecution;
-import org.jbpm.api.model.Activity;
import org.jbpm.api.model.Condition;
-import org.jbpm.api.model.Transition;
+import org.jbpm.pvm.internal.model.Activity;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.Transition;
/**
@@ -38,6 +39,10 @@
private static final long serialVersionUID = 1L;
public void execute(ActivityExecution execution) {
+ execute((ExecutionImpl) execution);
+ }
+
+ public void execute(ExecutionImpl execution) {
Transition transition = findTransition(execution);
if (transition==null) {
throw new JbpmException("no outgoing transition condition evaluated to true for decision "+execution.getActivity());
@@ -48,7 +53,7 @@
execution.take(transition);
}
- private Transition findTransition(ActivityExecution execution) {
+ private Transition findTransition(ExecutionImpl execution) {
Activity activity = execution.getActivity();
List<Transition> outgoingTransitions = activity.getOutgoingTransitions();
for (Transition transition : outgoingTransitions) {
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionExpressionActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionExpressionActivity.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionExpressionActivity.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -23,9 +23,10 @@
import org.jbpm.api.JbpmException;
import org.jbpm.api.activity.ActivityExecution;
-import org.jbpm.api.model.Activity;
-import org.jbpm.api.model.Transition;
import org.jbpm.pvm.internal.env.EnvironmentDefaults;
+import org.jbpm.pvm.internal.model.Activity;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.Transition;
import org.jbpm.pvm.internal.script.ScriptManager;
/**
@@ -38,7 +39,11 @@
protected String expr;
protected String lang;
- public void execute(ActivityExecution execution) throws Exception {
+ public void execute(ActivityExecution execution) {
+ execute((ExecutionImpl) execution);
+ }
+
+ public void execute(ExecutionImpl execution) {
Activity activity = execution.getActivity();
String transitionName = null;
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionHandlerActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionHandlerActivity.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionHandlerActivity.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -24,9 +24,10 @@
import org.jbpm.api.JbpmException;
import org.jbpm.api.activity.ActivityExecution;
import org.jbpm.api.jpdl.DecisionHandler;
-import org.jbpm.api.model.Activity;
-import org.jbpm.api.model.Transition;
import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.model.Activity;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.Transition;
import org.jbpm.pvm.internal.wire.Descriptor;
import org.jbpm.pvm.internal.wire.WireContext;
@@ -40,7 +41,11 @@
protected String decisionHandlerName;
protected Descriptor decisionHandlerDescriptor;
- public void execute(ActivityExecution execution) throws Exception {
+ public void execute(ActivityExecution execution) {
+ execute((ExecutionImpl) execution);
+ }
+
+ public void execute(ExecutionImpl execution) {
Activity activity = execution.getActivity();
String transitionName = null;
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/EndActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/EndActivity.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/EndActivity.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -24,11 +24,11 @@
import java.util.List;
import org.jbpm.api.activity.ActivityExecution;
-import org.jbpm.api.model.Activity;
import org.jbpm.api.model.OpenExecution;
-import org.jbpm.api.model.Transition;
+import org.jbpm.pvm.internal.model.Activity;
import org.jbpm.pvm.internal.model.ActivityImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.Transition;
/**
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ForkActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ForkActivity.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ForkActivity.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -26,10 +26,10 @@
import org.jbpm.api.Execution;
import org.jbpm.api.activity.ActivityExecution;
-import org.jbpm.api.model.Activity;
import org.jbpm.api.model.Condition;
-import org.jbpm.api.model.Transition;
+import org.jbpm.pvm.internal.model.Activity;
import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.Transition;
/**
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/GroupActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/GroupActivity.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/GroupActivity.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -28,10 +28,10 @@
import org.jbpm.api.Execution;
import org.jbpm.api.JbpmException;
import org.jbpm.api.activity.ActivityExecution;
-import org.jbpm.api.model.Activity;
-import org.jbpm.api.model.Transition;
+import org.jbpm.pvm.internal.model.Activity;
import org.jbpm.pvm.internal.model.ActivityImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.Transition;
/**
@@ -41,10 +41,11 @@
private static final long serialVersionUID = 1L;
- public void execute(ActivityExecution execution) throws Exception {
+ public void execute(ActivityExecution execution) {
execute((ExecutionImpl)execution);
}
- public void execute(ExecutionImpl execution) throws Exception {
+
+ public void execute(ExecutionImpl execution) {
// find the start activity
Activity activity = execution.getActivity();
List<Activity> startActivities = findStartActivities(activity);
@@ -84,6 +85,10 @@
}
public void signal(ActivityExecution execution, String signalName, Map<String, ?> parameters) throws Exception {
+ signal((ExecutionImpl)execution, signalName, parameters);
+ }
+
+ public void signal(ExecutionImpl execution, String signalName, Map<String, ?> parameters) throws Exception {
Transition transition = null;
Activity activity = execution.getActivity();
List<Transition> outgoingTransitions = activity.getOutgoingTransitions();
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JoinActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JoinActivity.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JoinActivity.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -29,10 +29,10 @@
import org.jbpm.api.Execution;
import org.jbpm.api.JbpmException;
import org.jbpm.api.activity.ActivityExecution;
-import org.jbpm.api.model.Activity;
-import org.jbpm.api.model.Transition;
import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.model.Activity;
import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.Transition;
/**
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlAutomaticActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlAutomaticActivity.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlAutomaticActivity.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -4,6 +4,7 @@
import org.jbpm.api.listener.EventListener;
import org.jbpm.api.listener.EventListenerExecution;
import org.jbpm.api.model.OpenExecution;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
public abstract class JpdlAutomaticActivity extends JpdlActivity implements EventListener {
@@ -12,7 +13,7 @@
public void execute(ActivityExecution execution) throws Exception {
perform(execution);
- execution.historyAutomatic();
+ ((ExecutionImpl)execution).historyAutomatic();
}
public void notify(EventListenerExecution execution) throws Exception {
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/StateActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/StateActivity.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/StateActivity.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -24,8 +24,9 @@
import java.util.Map;
import org.jbpm.api.activity.ActivityExecution;
-import org.jbpm.api.model.Activity;
-import org.jbpm.api.model.Transition;
+import org.jbpm.pvm.internal.model.Activity;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.Transition;
/**
* @author Tom Baeyens
@@ -35,12 +36,20 @@
private static final long serialVersionUID = 1L;
public void execute(ActivityExecution execution) {
+ execute((ExecutionImpl)execution);
+ }
+
+ public void execute(ExecutionImpl execution) {
execution.historyActivityStart();
execution.waitForSignal();
}
- public void signal(ActivityExecution execution, String signalName, Map<String, ?> parameters) {
+ public void signal(ActivityExecution execution, String signalName, Map<String, ?> parameters) throws Exception {
+ signal((ExecutionImpl)execution, signalName, parameters);
+ }
+
+ public void signal(ExecutionImpl execution, String signalName, Map<String, ?> parameters) throws Exception {
Activity activity = execution.getActivity();
if (parameters!=null) {
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -25,11 +25,11 @@
import java.util.Map;
import org.jbpm.api.activity.ActivityExecution;
-import org.jbpm.api.model.Activity;
import org.jbpm.pvm.internal.client.ClientProcessDefinition;
import org.jbpm.pvm.internal.env.Context;
import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.env.ExecutionContext;
+import org.jbpm.pvm.internal.model.Activity;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.script.ScriptManager;
import org.jbpm.pvm.internal.session.RepositorySession;
@@ -85,7 +85,11 @@
execution.waitForSignal();
}
- public void signal(ActivityExecution execution, String signalName, Map<String, ?> parameters) {
+ public void signal(ActivityExecution execution, String signalName, Map<String, ?> parameters) throws Exception {
+ signal((ExecutionImpl)execution, signalName, parameters);
+ }
+
+ public void signal(ExecutionImpl execution, String signalName, Map<String, ?> parameters) throws Exception {
ExecutionImpl executionImpl = (ExecutionImpl) execution;
ExecutionImpl subProcessInstance = executionImpl.getSubProcessInstance();
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -25,12 +25,12 @@
import java.util.Map;
import org.jbpm.api.activity.ActivityExecution;
-import org.jbpm.api.model.Activity;
-import org.jbpm.api.model.Transition;
import org.jbpm.api.task.Task;
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.model.Activity;
import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.Transition;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
import org.jbpm.pvm.internal.task.TaskHandler;
@@ -60,7 +60,11 @@
}
}
- public void signal(ActivityExecution execution, String signalName, Map<String, ?> parameters) {
+ public void signal(ActivityExecution execution, String signalName, Map<String, ?> parameters) throws Exception {
+ signal((ExecutionImpl)execution, signalName, parameters);
+ }
+
+ public void signal(ExecutionImpl execution, String signalName, Map<String, ?> parameters) throws Exception {
Activity activity = execution.getActivity();
if (parameters!=null) {
Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TransitionParsingTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TransitionParsingTest.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TransitionParsingTest.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -24,9 +24,9 @@
import java.util.List;
import org.jbpm.api.Problem;
-import org.jbpm.api.model.Activity;
-import org.jbpm.api.model.Transition;
import org.jbpm.pvm.internal.client.ClientProcessDefinition;
+import org.jbpm.pvm.internal.model.Activity;
+import org.jbpm.pvm.internal.model.Transition;
/**
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/client/ClientProcessDefinition.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/client/ClientProcessDefinition.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/client/ClientProcessDefinition.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -23,7 +23,7 @@
import org.jbpm.api.Execution;
import org.jbpm.api.model.OpenExecution;
-import org.jbpm.api.model.OpenProcessDefinition;
+import org.jbpm.pvm.internal.model.OpenProcessDefinition;
/** adds factory methods for creating and beginning new process instances.
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByKeyCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByKeyCmd.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByKeyCmd.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -22,8 +22,8 @@
package org.jbpm.pvm.internal.cmd;
import org.jbpm.api.ProcessDefinition;
-import org.jbpm.api.model.OpenProcessDefinition;
import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.model.OpenProcessDefinition;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionByIdCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionByIdCmd.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionByIdCmd.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -21,8 +21,8 @@
*/
package org.jbpm.pvm.internal.cmd;
-import org.jbpm.api.model.OpenProcessDefinition;
import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.model.OpenProcessDefinition;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetOutcomes.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetOutcomes.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetOutcomes.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -26,11 +26,11 @@
import java.util.Set;
import org.jbpm.api.JbpmException;
-import org.jbpm.api.model.Transition;
import org.jbpm.api.task.Task;
import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.model.ActivityImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.Transition;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.task.TaskImpl;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -26,7 +26,6 @@
import org.jbpm.api.JbpmException;
import org.jbpm.api.job.Timer;
-import org.jbpm.api.model.ObservableElement;
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.cal.BusinessCalendar;
import org.jbpm.pvm.internal.cal.Duration;
@@ -34,6 +33,7 @@
import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.jobexecutor.JobAddedNotification;
import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
+import org.jbpm.pvm.internal.model.ObservableElement;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.session.TimerSession;
import org.jbpm.pvm.internal.util.Clock;
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Activity.java (from rev 5108, jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Activity.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Activity.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Activity.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -0,0 +1,111 @@
+/*
+ * 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.model;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * a activity in a {@link OpenProcessDefinition} graph.
+ *
+ * <p>The activity supports both graph based process models as well as
+ * block structured (tree based) process models. First we describe
+ * tranisions that can be used to form graph based process structures
+ * and then we'll describe activity composition to form block structured
+ * process models. Both models can be combined as well.
+ * </p>
+ *
+ * <p>Activities have {@link #getIncomingTransitions() incoming}
+ * and {@link #getOutgoingTransitions() outgoing transitions}.
+ * These are lists of transitions.
+ * </p>
+ *
+ * <p>Optionally, transitions can have names. In that case the
+ * transition {@link #getOutgoingTransition(String) names are associated
+ * to activity's outgoing transitions}. The {@link #getOutgoingTransitionsMap() map
+ * of outgoing transitions} provides easy access to the named transitions.
+ * </p>
+ *
+ * <p>One of the outgoing transitions can optionally be marked as
+ * {@link #getDefaultOutgoingTransition() the default transition}.
+ * </p>
+ *
+ * <p>Block structured process languages have composite activities that can be
+ * modeled with the {@link #getParent() parent}-{@link #getActivities() child}
+ * relation.
+ * </p>
+ *
+ * @author Tom Baeyens
+ */
+public interface Activity extends CompositeElement {
+
+ /** the list of outgoing transitions.
+ * Caution: the actual member is returned. No copy is made. */
+ List<Transition> getOutgoingTransitions();
+
+ /** the default outgoing transition. */
+ Transition getDefaultOutgoingTransition();
+
+ /** the first leaving transition with the given name or null of no
+ * such leaving transition exists. If the multiple transitions have
+ * the given transition name, the first (in order of {@link #getOutgoingTransitions()})
+ * will be returned.
+ *
+ * @param transitionName is the name of the transition to take. A null value will
+ * match the first unnamed transition. */
+ Transition getOutgoingTransition(String transitionName);
+
+ /** indicates if a leaving transition with the given transitionName exists.
+ * A null value matches an unnamed transition. */
+ boolean hasOutgoingTransition(String transitionName);
+
+ /** indicates if this activity has leaving transitions */
+ boolean hasOutgoingTransitions();
+
+ /** the leaving transitions, keyed by transition name. If a transition with
+ * the same name occurs mutltiple times, the first one is returned.
+ * Leaving transitions with a null value for their name are not included
+ * in the map.
+ * Beware: the actual member is returned. No copy is made. In fact, the
+ * returned map is maintained as a cache. So updates to the map will
+ * influence subsequent retrievals of outgoing transitions by name. */
+ Map<String, Transition> getOutgoingTransitionsMap();
+
+ /** searches for the given transitionName in this activity and then up the
+ * parent chain. Returns null if no such transition is found. */
+ Transition findOutgoingTransition(String transitionName);
+
+ /** the list of arriving transitions.
+ * Beware: the actual member is returned. No copy is made. */
+ List<Transition> getIncomingTransitions();
+
+ /** indicates if this activity has arriving transitions */
+ boolean hasIncomingTransitions();
+
+ /** retrieve the parent activity in the composite activity structure. This is
+ * different from {@link ObservableElement#getParent()} in that it is restricted
+ * to the parent activities. It doesn't take into account the process definition. */
+ Activity getParentActivity();
+
+ /** the type of this activity which corresponds to the xml tag */
+ String getType();
+}
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Activity.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/model/ActivityImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -28,8 +28,6 @@
import org.jbpm.api.JbpmException;
import org.jbpm.api.activity.ActivityBehaviour;
-import org.jbpm.api.model.Activity;
-import org.jbpm.api.model.Transition;
import org.jbpm.pvm.internal.wire.Descriptor;
/**
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElement.java (from rev 5108, jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/CompositeElement.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElement.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElement.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -0,0 +1,67 @@
+/*
+ * 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.model;
+
+import java.util.List;
+import java.util.Map;
+
+
+
+/** activity container base class for {@link OpenProcessDefinition} and {@link Activity}.
+ *
+ * @author Tom Baeyens
+ */
+public interface CompositeElement extends ObservableElement {
+
+ /** indicates if this processDefinition has activities. */
+ boolean hasActivities();
+
+ /** the list of direct composite activities. Recursively contained
+ * activities are not included in the list.
+ * Beware: the actual member is returned. No copy is made. */
+ List<Activity> getActivities();
+
+ /** indicates if an activity with the given name exists directly in
+ * this element. Only the direct contained activities are
+ * searched. No recursive search is made. */
+ boolean hasActivity(String activityName);
+
+ /** the first composite activity with the given name or null of no
+ * such activity exists. Only the direct contained activities are
+ * searched. No recursive search is made. */
+ Activity getActivity(String activityName);
+
+ /** searches for the given activity in this element recursively,
+ * including this activity and all child activities. The search
+ * is done depth-first. A null value for activityName matches a activity
+ * without a name. */
+ Activity findActivity(String activityName);
+
+ /** the composite activities, keyed by activity name. If an activity
+ * with the same name occurs mutltiple times, the first in the list
+ * is included in the map. Activities with a null value for their name
+ * are not included in the map.
+ * Beware: the actual member is returned. No copy is made. In fact, the
+ * returned map is maintained as a cache. So updates to the map will
+ * influence subsequent retrievals of activities by name.*/
+ Map<String, Activity> getActivitiesMap();
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElement.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElementImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElementImpl.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElementImpl.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -25,8 +25,6 @@
import java.util.List;
import java.util.Map;
-import org.jbpm.api.model.Activity;
-import org.jbpm.api.model.CompositeElement;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -28,7 +28,6 @@
import org.jbpm.api.JbpmException;
import org.jbpm.api.listener.EventListener;
-import org.jbpm.api.model.OpenProcessDefinition;
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.cmd.CommandService;
import org.jbpm.pvm.internal.env.Environment;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -42,12 +42,9 @@
import org.jbpm.api.job.Job;
import org.jbpm.api.job.Timer;
import org.jbpm.api.listener.EventListenerExecution;
-import org.jbpm.api.model.Activity;
import org.jbpm.api.model.Comment;
import org.jbpm.api.model.Event;
-import org.jbpm.api.model.ObservableElement;
import org.jbpm.api.model.OpenExecution;
-import org.jbpm.api.model.Transition;
import org.jbpm.api.task.Assignable;
import org.jbpm.api.task.AssignmentHandler;
import org.jbpm.internal.log.Log;
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ObservableElement.java (from rev 5108, jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/ObservableElement.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ObservableElement.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ObservableElement.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -0,0 +1,65 @@
+/*
+ * 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.model;
+
+import java.util.Set;
+
+
+/** a super class for process elements that have events.
+ *
+ * @author Tom Baeyens
+ */
+public interface ObservableElement {
+
+ /** the meaningless database primary key */
+ long getDbid();
+
+ /** the short display name given to this element. */
+ String getName();
+
+ /** the process definition to which this process element belongs */
+ OpenProcessDefinition getProcessDefinition();
+
+ /** the property value for the given key or null if no such
+ * configuration key is present.
+ *
+ * This is extra static configuration information that can be
+ * associated to a process element. Process languages can use this
+ * to store configuration properties for extensions in it. That way,
+ * these extensions can be added without changing the process model
+ * or the database schema. Examples of extensions that may use these
+ * configuration properties are simulation, predictive scheduling,
+ * graphical information,... */
+ Object getProperty(String key);
+
+ /** the set of available property keys or an empty set in case
+ * there are no keys. */
+ Set<String> getPropertyKeys();
+
+ /** indicates if the given event is defined no this element.
+ * This method only looks in this observable element and it will not
+ * search the parent hierarchy for the given event. */
+ boolean hasEvent(String eventName);
+
+ /** the enclosing activity or the process definition */
+ ObservableElement getParent();
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ObservableElement.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ObservableElementImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ObservableElementImpl.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ObservableElementImpl.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -25,7 +25,6 @@
import java.util.Map;
import org.jbpm.api.model.Event;
-import org.jbpm.api.model.ObservableElement;
/** observable and visible process elements.
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/OpenProcessDefinition.java (from rev 5108, jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenProcessDefinition.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/OpenProcessDefinition.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/OpenProcessDefinition.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -0,0 +1,59 @@
+/*
+ * 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.model;
+
+import org.jbpm.api.ProcessDefinition;
+
+
+
+/**
+ * a graph (or tree) structure that can be executed.
+ *
+ * <h2>Purpose</h2>
+ * <p>ProcessDefinition is a base implementation that can be leveraged to build
+ * graph based execution languages. While the ProcessDefinition class is concrete and
+ * can be used as-is (e.g. by aggregation), most likely processDefinition languages
+ * will inherit from this ProcessDefinition and create more specialized implementations.
+ * </p>
+ *
+ * <p>The specialized processDefinition language classes can extend this ProcessDefinition
+ * with new datastructures relevant for that perticular processDefinition language.
+ * </p>
+ *
+ * <h2>Structure</h2>
+ * <p>A processDefinition contains a set of activities. Activities can be connected with
+ * transitions or activities can have nested activities. But the transitions and
+ * nested activities can be combined.
+ * </p>
+ *
+ * <h2>Execution</h2>
+ * <p>To create a new execution for a given processDefinition, see {@link #startExecution()}.
+ * </p>
+ *
+ * @author Tom Baeyens
+ */
+public interface OpenProcessDefinition extends ProcessDefinition, CompositeElement {
+
+ /** the initial activity of this process definition */
+ Activity getInitial();
+
+}
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/OpenProcessDefinition.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/model/ProcessDefinitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -27,7 +27,6 @@
import org.jbpm.api.Execution;
import org.jbpm.api.JbpmException;
-import org.jbpm.api.model.OpenProcessDefinition;
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.client.ClientProcessDefinition;
import org.jbpm.pvm.internal.client.ClientProcessInstance;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessModificationsImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessModificationsImpl.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessModificationsImpl.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -24,7 +24,6 @@
import java.io.Serializable;
import java.util.List;
-import org.jbpm.api.model.Activity;
/**
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Transition.java (from rev 5108, jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Transition.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Transition.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Transition.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -0,0 +1,67 @@
+/*
+ * 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.model;
+
+import org.jbpm.api.model.Condition;
+
+/**
+ * a transition in a {@link OpenProcessDefinition} graph.
+ *
+ * <h3 id="guardconditions">Guard conditions</h3>
+ * <p>TODO</p>
+ *
+ * <h3 id="transitionsaswaitstates">Transitions as wait states</h3>
+ * <p>A wait condition indicates wether a transition is to be taken synchronously
+ * or wether the transition will behave as a wait state.
+ * </p>
+ *
+ * <p>Transitions that are wait states can occur when an analyst has
+ * an actual state (e.g. 'making loss') and a desired state (e.g. 'making profit')
+ * and models a transition between those states. In that case the transition
+ * might take a long time and hence it results into a wait state for the system.
+ * </p>
+ *
+ * <p>If the wait condition is null or if it returns false, then the transition
+ * will be taking synchronously. Otherwise the transition will behave as
+ * a wait state and wait for a signal on the execution.
+ * </p>
+ *
+ * <p>Transitions as wait states has every thing to do with matching the
+ * process graph to transactions on the server. If the transition is taken
+ * in one (the current) transaction, then the async condition should be empty
+ * or evaluate to false. If the arrival of the execution in the destination
+ * activity should occur in a separate execution
+ *
+ * @author Tom Baeyens
+ */
+public interface Transition extends ObservableElement {
+
+ /** the activity from which this transition leaves. */
+ Activity getSource();
+
+ /** the activity in which this transition arrives. */
+ Activity getDestination();
+
+ /** the general purpose condition that can be used in various ways by the
+ * activities. */
+ Condition getCondition();
+}
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Transition.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/TransitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/TransitionImpl.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/TransitionImpl.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -25,7 +25,6 @@
import org.jbpm.api.model.Condition;
import org.jbpm.api.model.Event;
-import org.jbpm.api.model.Transition;
import org.jbpm.pvm.internal.wire.Descriptor;
import org.jbpm.pvm.internal.wire.WireContext;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListener.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListener.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListener.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -24,12 +24,12 @@
import java.util.List;
import org.jbpm.api.listener.EventListener;
-import org.jbpm.api.model.ObservableElement;
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.job.MessageImpl;
import org.jbpm.pvm.internal.model.EventImpl;
import org.jbpm.pvm.internal.model.EventListenerReference;
import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.ObservableElement;
import org.jbpm.pvm.internal.model.ObservableElementImpl;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -281,6 +281,14 @@
return this;
}
+ // customized getters and setters ///////////////////////////////////////////
+
+ public String getId() {
+ return Long.toString(dbid);
+ }
+
+ // getters and setters //////////////////////////////////////////////////////
+
public long getDbid() {
return dbid;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/LifeCycle.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/LifeCycle.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/LifeCycle.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -25,7 +25,7 @@
import java.util.Map;
import org.jbpm.api.JbpmException;
-import org.jbpm.api.model.Activity;
+import org.jbpm.pvm.internal.model.Activity;
import org.jbpm.pvm.internal.model.ActivityImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.model.IdGenerator;
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/DisplaySource.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/DisplaySource.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/DisplaySource.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -23,12 +23,13 @@
import org.jbpm.api.listener.EventListener;
import org.jbpm.api.listener.EventListenerExecution;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
public class DisplaySource implements EventListener {
private static final long serialVersionUID = 1L;
public void notify(EventListenerExecution execution) {
- System.out.println("leaving "+execution.getEventSource());
+ System.out.println("leaving "+((ExecutionImpl)execution).getEventSource());
}
}
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/BuilderTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/BuilderTest.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/BuilderTest.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -24,10 +24,10 @@
import java.util.List;
import java.util.Map;
-import org.jbpm.api.model.Transition;
import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
import org.jbpm.pvm.internal.client.ClientProcessDefinition;
import org.jbpm.pvm.internal.model.ActivityImpl;
+import org.jbpm.pvm.internal.model.Transition;
import org.jbpm.test.BaseJbpmTestCase;
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/EventListenerTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/EventListenerTest.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/EventListenerTest.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -127,7 +127,6 @@
public static class TransitionListener implements EventListener {
private static final long serialVersionUID = 1L;
public void notify(EventListenerExecution execution) {
- assertNotNull(execution.getTransition());
execution.setVariable("isInvoked", "true");
}
}
Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/AutomaticActivity.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/AutomaticActivity.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/AutomaticActivity.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -23,6 +23,7 @@
import org.jbpm.api.activity.ActivityBehaviour;
import org.jbpm.api.activity.ActivityExecution;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
/** a activity behaviour implementation that records its execution and then
* just proceeds.
@@ -37,6 +38,6 @@
}
public void execute(ActivityExecution execution) throws Exception {
- ContinuationTest.recorder.record(execution.getId(), "execute("+execution.getActivity().getName()+")");
+ ContinuationTest.recorder.record(execution.getId(), "execute("+((ExecutionImpl)execution).getActivity().getName()+")");
}
}
\ No newline at end of file
Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ContinuationTest.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ContinuationTest.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ContinuationTest.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -25,10 +25,10 @@
import java.util.List;
import org.hibernate.Session;
-import org.jbpm.api.model.OpenProcessDefinition;
import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.model.OpenProcessDefinition;
/**
* @author Tom Baeyens
Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/WaitState.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/WaitState.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/WaitState.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -25,6 +25,7 @@
import org.jbpm.api.activity.ActivityExecution;
import org.jbpm.api.activity.ExternalActivityBehaviour;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
/**
* @author Tom Baeyens
@@ -36,7 +37,10 @@
public WaitState() {
}
- public void execute(ActivityExecution execution) throws Exception {
+ public void execute(ActivityExecution execution) {
+ execute((ExecutionImpl)execution);
+ }
+ public void execute(ExecutionImpl execution) {
ContinuationTest.recorder.record(execution.getId(), "execute("+execution.getActivity().getName()+")");
}
Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/EventTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/EventTest.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/EventTest.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -23,18 +23,18 @@
import java.util.Map;
-import org.apache.tools.ant.taskdefs.Exec;
import org.jbpm.api.activity.ActivityBehaviour;
import org.jbpm.api.activity.ActivityExecution;
import org.jbpm.api.activity.ExternalActivityBehaviour;
import org.jbpm.api.listener.EventListener;
import org.jbpm.api.listener.EventListenerExecution;
-import org.jbpm.api.model.Activity;
import org.jbpm.api.model.Event;
import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
import org.jbpm.pvm.internal.client.ClientExecution;
import org.jbpm.pvm.internal.client.ClientProcessDefinition;
import org.jbpm.pvm.internal.client.ClientProcessInstance;
+import org.jbpm.pvm.internal.model.Activity;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.test.BaseJbpmTestCase;
/** shows how actions are listeners to following processDefinition events:
@@ -54,6 +54,9 @@
public static class ActivityEndAction implements EventListener {
private static final long serialVersionUID = 1L;
public void notify(EventListenerExecution execution) {
+ notify((ExecutionImpl)execution);
+ }
+ public void notify(ExecutionImpl execution) {
execution.setVariable("msg", "Kilroy was here");
assertTrue(execution.isActive("initial"));
@@ -90,7 +93,10 @@
public static class TransitionAction implements EventListener {
private static final long serialVersionUID = 1L;
- public void notify(EventListenerExecution execution) throws Exception {
+ public void notify(EventListenerExecution execution) {
+ notify((ExecutionImpl)execution);
+ }
+ public void notify(ExecutionImpl execution) {
execution.setVariable("msg", "Kilroy was here");
assertEquals("t", execution.getEventSource().getName());
@@ -126,7 +132,10 @@
public static class ActivityStartAction implements EventListener {
private static final long serialVersionUID = 1L;
- public void notify(EventListenerExecution execution) throws Exception {
+ public void notify(EventListenerExecution execution) {
+ notify((ExecutionImpl)execution);
+ }
+ public void notify(ExecutionImpl execution) {
execution.setVariable("msg", "Kilroy was here");
assertTrue(execution.isActive("end"));
@@ -167,6 +176,9 @@
execution.waitForSignal();
}
public void signal(ActivityExecution execution, String signal, Map<String, ?> parameters) throws Exception {
+ signal((ExecutionImpl)execution, signal, parameters);
+ }
+ public void signal(ExecutionImpl execution, String signal, Map<String, ?> parameters) throws Exception {
Activity activity = execution.getActivity();
if ( (signal!=null)
&& (activity!=null)
@@ -180,7 +192,10 @@
public static class CheckRivetsAction implements EventListener {
private static final long serialVersionUID = 1L;
- public void notify(EventListenerExecution execution) throws Exception {
+ public void notify(EventListenerExecution execution) {
+ notify((ExecutionImpl)execution);
+ }
+ public void notify(ExecutionImpl execution) {
execution.setVariable("msg", "Kilroy was here");
assertTrue(execution.isActive("initial"));
Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/FunctionalActivityTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/FunctionalActivityTest.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/FunctionalActivityTest.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -30,11 +30,12 @@
import org.jbpm.api.activity.ExternalActivityBehaviour;
import org.jbpm.api.listener.EventListener;
import org.jbpm.api.listener.EventListenerExecution;
-import org.jbpm.api.model.Activity;
import org.jbpm.api.model.OpenExecution;
import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
import org.jbpm.pvm.internal.client.ClientProcessDefinition;
import org.jbpm.pvm.internal.client.ClientProcessInstance;
+import org.jbpm.pvm.internal.model.Activity;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.test.BaseJbpmTestCase;
@@ -137,6 +138,9 @@
public static class Composite implements ExternalActivityBehaviour {
private static final long serialVersionUID = 1L;
public void execute(ActivityExecution execution) {
+ execute((ExecutionImpl)execution);
+ }
+ public void execute(ExecutionImpl execution) {
Activity nestedActivity = execution.getActivity().getActivities().get(0);
execution.execute(nestedActivity);
}
Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ScopeVariableDeclarationTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ScopeVariableDeclarationTest.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ScopeVariableDeclarationTest.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -26,11 +26,12 @@
import org.jbpm.api.activity.ActivityExecution;
import org.jbpm.api.activity.ExternalActivityBehaviour;
-import org.jbpm.api.model.Activity;
import org.jbpm.api.model.OpenExecution;
import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
import org.jbpm.pvm.internal.client.ClientExecution;
import org.jbpm.pvm.internal.client.ClientProcessDefinition;
+import org.jbpm.pvm.internal.model.Activity;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.wire.descriptor.StringDescriptor;
import org.jbpm.test.BaseJbpmTestCase;
@@ -53,6 +54,9 @@
public static class Composite implements ExternalActivityBehaviour {
private static final long serialVersionUID = 1L;
public void execute(ActivityExecution execution) {
+ execute((ExecutionImpl)execution);
+ }
+ public void execute(ExecutionImpl execution) {
Activity child = execution.getActivity().getActivities().get(0);
execution.execute(child);
}
Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionEventsTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionEventsTest.java 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionEventsTest.java 2009-06-26 08:23:24 UTC (rev 5125)
@@ -31,6 +31,7 @@
import org.jbpm.pvm.internal.client.ClientExecution;
import org.jbpm.pvm.internal.client.ClientProcessDefinition;
import org.jbpm.pvm.internal.client.ClientProcessInstance;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.test.BaseJbpmTestCase;
/**
@@ -42,6 +43,9 @@
private static final long serialVersionUID = 1L;
public List<Object> events = new ArrayList<Object>();
public void notify(EventListenerExecution execution) {
+ notify((ExecutionImpl)execution);
+ }
+ public void notify(ExecutionImpl execution) {
events.add(execution.getEvent()+" on "+execution.getEventSource());
}
}
Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Jpdl.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Jpdl.xml 2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Jpdl.xml 2009-06-26 08:23:24 UTC (rev 5125)
@@ -2461,38 +2461,44 @@
</figure>
<programlisting><process name="EventListener" xmlns="http://jbpm.org/4.0/jpdl">
- <emphasis role="bold"><on event="start">
- <event-listener class="org.jbpm.examples.eventlistener.LogListener"/>
+ <on event="start">
+ <event-listener class="org.jbpm.examples.eventlistener.LogListener">
+ <field name="msg"><string value="start on process definition"/></field>
+ </event-listener>
</on>
- <on event="end">
- <event-listener class="org.jbpm.examples.eventlistener.LogListener"/>
- </on></emphasis>
-
-
- <start >
+ <start>
<transition to="wait"/>
</start>
- <state name="wait" >
- <emphasis role="bold"><on event="start">
- <event-listener class="org.jbpm.examples.eventlistener.LogListener"/>
+ <state name="wait">
+ <on event="start">
+ <event-listener class="org.jbpm.examples.eventlistener.LogListener">
+ <field name="msg"><string value="start on activity wait"/></field>
+ </event-listener>
</on>
<on event="end">
- <event-listener class="org.jbpm.examples.eventlistener.LogListener"/>
- </on></emphasis>
+ <event-listener class="org.jbpm.examples.eventlistener.LogListener">
+ <field name="msg"><string value="end on activity wait"/></field>
+ </event-listener>
+ </on>
<transition to="park">
- <emphasis role="bold"><event-listener class="org.jbpm.examples.eventlistener.LogListener"/></emphasis>
+ <event-listener class="org.jbpm.examples.eventlistener.LogListener">
+ <field name="msg"><string value="take transition"/></field>
+ </event-listener>
</transition>
</state>
- <state name="park" />
+ <state name="park"/>
</process></programlisting>
<para><literal>LogListener</literal> will maintain a list of logs in a static member
field:</para>
<programlisting>public class <emphasis role="bold">LogListener</emphasis> implements EventListener {
+ // value gets injected from process definition
+ String msg;
+
public void notify(EventListenerExecution execution) {
List<String> logs = (List<String>) execution.getVariable("logs");
if (logs==null) {
@@ -2500,7 +2506,7 @@
execution.setVariable("logs", logs);
}
- logs.add(execution.getEvent()+" on "+execution.getEventSource());
+ logs.add(msg);
execution.setVariable("logs", logs);
}
@@ -2512,10 +2518,10 @@
<programlisting>Execution execution = processInstance.findActiveExecutionIn("wait");
executionService.signalExecutionById(execution.getId());</programlisting>
<para>The list of log messages will now look like this:</para>
- <programlisting>[event(start) on process(EventListener),
- event(start) on activity(wait),
- event(end) on activity(wait),
- event(take) on (wait)-->(park)]</programlisting>
+ <programlisting>[start on process definition,
+ start on activity wait,
+ end on activity wait,
+ take transition]</programlisting>
</section>
<section id="asynchronouscontinuations">
16 years, 10 months
JBoss JBPM SVN: r5124 - in jbpm3/branches/jbpm-3.2-soa/modules/distribution/src/main/resources: installer and 1 other directory.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-06-25 19:03:16 -0400 (Thu, 25 Jun 2009)
New Revision: 5124
Added:
jbpm3/branches/jbpm-3.2-soa/modules/distribution/src/main/resources/destination/jbpm-jbm-service.xml
jbpm3/branches/jbpm-3.2-soa/modules/distribution/src/main/resources/destination/jbpm-mq-service.xml
Removed:
jbpm3/branches/jbpm-3.2-soa/modules/distribution/src/main/resources/destination/jbpm-destinations-service.xml
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/distribution/src/main/resources/installer/install-definition.xml
Log:
JBPM-2288: Queue configuration for JBM missing (OPEN)
incorporate JBM queues descriptor, install MQ descriptor under JBoss 4.0.5-4.2.3 and JBM descriptor under 5.0.1
Deleted: jbpm3/branches/jbpm-3.2-soa/modules/distribution/src/main/resources/destination/jbpm-destinations-service.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/distribution/src/main/resources/destination/jbpm-destinations-service.xml 2009-06-25 20:12:49 UTC (rev 5123)
+++ jbpm3/branches/jbpm-3.2-soa/modules/distribution/src/main/resources/destination/jbpm-destinations-service.xml 2009-06-25 23:03:16 UTC (rev 5124)
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- $Id: jbossmq-destinations-service.xml 25907 2004-11-16 04:32:39Z ejort $ -->
-
-<!--
- This file defines the default Queues and Topics that jBPM ships with.
- The default Queues and Topics are used by the Command Listener Bean
- and the producer-consumer pair formed by the JMS Message Service and
- the Job Listener Bean.
-
- You can add other destinations to this file, or you can create other
- *-service.xml files to contain your application's destinations.
- -->
-
-<server>
- <!--
- Destinations without a configured SecurityManager or without a
- SecurityConf will default to role guest with read=true, write=true,
- create=false.
- -->
-
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.mq.destination:service=Queue,name=JbpmJobQueue">
- <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
- </mbean>
-
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.mq.destination:service=Queue,name=JbpmCommandQueue">
- <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
- </mbean>
-
-</server>
Added: jbpm3/branches/jbpm-3.2-soa/modules/distribution/src/main/resources/destination/jbpm-jbm-service.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/distribution/src/main/resources/destination/jbpm-jbm-service.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/distribution/src/main/resources/destination/jbpm-jbm-service.xml 2009-06-25 23:03:16 UTC (rev 5124)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ This file defines the default Queues and Topics that jBPM ships with.
+ The default Queues and Topics are used by the Command Listener Bean
+ and the producer-consumer pair formed by the JMS Message Service and
+ the Job Listener Bean.
+
+ You can add other destinations to this file, or you can create other
+ *-service.xml files to contain your application's destinations.
+-->
+
+<server>
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=JbpmJobQueue"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=JbpmCommandQueue"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+</server>
\ No newline at end of file
Copied: jbpm3/branches/jbpm-3.2-soa/modules/distribution/src/main/resources/destination/jbpm-mq-service.xml (from rev 5012, jbpm3/branches/jbpm-3.2-soa/modules/distribution/src/main/resources/destination/jbpm-destinations-service.xml)
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/distribution/src/main/resources/destination/jbpm-mq-service.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/distribution/src/main/resources/destination/jbpm-mq-service.xml 2009-06-25 23:03:16 UTC (rev 5124)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ This file defines the default Queues and Topics that jBPM ships with.
+ The default Queues and Topics are used by the Command Listener Bean
+ and the producer-consumer pair formed by the JMS Message Service and
+ the Job Listener Bean.
+
+ You can add other destinations to this file, or you can create other
+ *-service.xml files to contain your application's destinations.
+-->
+
+<server>
+ <!--
+ Destinations without a configured SecurityManager or without a
+ SecurityConf will default to role guest with read=true, write=true,
+ create=false.
+ -->
+
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.mq.destination:service=Queue,name=JbpmJobQueue">
+ <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+ </mbean>
+
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.mq.destination:service=Queue,name=JbpmCommandQueue">
+ <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+ </mbean>
+
+</server>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/distribution/src/main/resources/installer/install-definition.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/distribution/src/main/resources/installer/install-definition.xml 2009-06-25 20:12:49 UTC (rev 5123)
+++ jbpm3/branches/jbpm-3.2-soa/modules/distribution/src/main/resources/installer/install-definition.xml 2009-06-25 23:03:16 UTC (rev 5124)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<installation version="1.0">
- <!--
+ <!--
Ant properties in this file can be referenced with @{},
otherwise use variables below in installer files with ${}
-->
@@ -18,7 +18,7 @@
<jar src="@{deploy.artifacts.dir}/lib/ant.jar" stage="both" />
<jar src="@{deploy.artifacts.dir}/lib/ant-launcher.jar" stage="both" />
- <!-- Setup the Ant Action Listener -->
+ <!-- Setup the Ant Action Listener -->
<listeners>
<listener installer="AntActionInstallerListener" />
</listeners>
@@ -103,7 +103,7 @@
<!-- Packs -->
<packs>
- <!--
+ <!--
********************************
* jBPM Standalone *
********************************
@@ -112,8 +112,10 @@
<description>The jBPM3 Standalone Components</description>
<!-- jbpm3/ -->
- <file src="@{deploy.artifacts.dir}/etc/release.notes.html" targetdir="$INSTALL_PATH" override="true" />
- <file src="@{deploy.artifacts.dir}/etc/JBossORG-EULA.txt" targetdir="$INSTALL_PATH" override="true" />
+ <file src="@{deploy.artifacts.dir}/etc/release.notes.html" targetdir="$INSTALL_PATH"
+ override="true" />
+ <file src="@{deploy.artifacts.dir}/etc/JBossORG-EULA.txt" targetdir="$INSTALL_PATH"
+ override="true" />
<!-- jbpm3/config -->
<file src="@{deploy.artifacts.dir}/lib/jbpm-jpdl-config.jar" targetdir="$INSTALL_PATH/config"
@@ -126,18 +128,22 @@
unpack="true" override="true" />
<!-- jbpm3/designer -->
- <fileset dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/designer" override="true">
+ <fileset dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/designer"
+ override="true">
<include name="jbpm-jpdl-designer-site.zip" />
</fileset>
<file src="@{deploy.artifacts.dir}/etc/version.info.xml" targetdir="$INSTALL_PATH/src/resources/gpd"
override="true" />
<!-- jbpm3/examples -->
- <fileset dir="@{deploy.artifacts.dir}/resources/jbpm-examples-dist" targetdir="$INSTALL_PATH/examples" override="true" />
+ <fileset dir="@{deploy.artifacts.dir}/resources/jbpm-examples-dist" targetdir="$INSTALL_PATH/examples"
+ override="true" />
<!-- jbpm3/docs -->
- <file src="@{deploy.artifacts.dir}/lib/jbpm-userguide.jdocbook" targetdir="$INSTALL_PATH/docs/userguide" unpack="true" override="true" />
- <fileset dir="@{deploy.artifacts.dir}/javadoc" targetdir="$INSTALL_PATH/docs" override="true"/>
+ <file src="@{deploy.artifacts.dir}/lib/jbpm-userguide.jdocbook" targetdir="$INSTALL_PATH/docs/userguide"
+ unpack="true" override="true" />
+ <fileset dir="@{deploy.artifacts.dir}/javadoc" targetdir="$INSTALL_PATH/docs"
+ override="true" />
<!-- jbpm3/lib -->
<fileset dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/lib" override="true">
@@ -167,7 +173,7 @@
</fileset>
</pack>
- <!--
+ <!--
********************************
* JBoss Integration *
********************************
@@ -176,11 +182,15 @@
<description>The jBPM3 JBoss Integration</description>
<!-- jbpm/jbpm-service.sar -->
- <fileset dir="@{deploy.artifacts.dir}/resources/jbpm-enterprise-config" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-service.sar" override="true">
+ <fileset dir="@{deploy.artifacts.dir}/resources/jbpm-enterprise-config"
+ targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-service.sar"
+ override="true">
<include name="jbpm.cfg.xml" />
<include name="hibernate.extra.hbm.xml" />
</fileset>
- <fileset dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-service.sar" override="true">
+ <fileset dir="@{deploy.artifacts.dir}/lib"
+ targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-service.sar"
+ override="true">
<include name="jbpm-jpdl.jar" />
<include name="jbpm-identity.jar" />
</fileset>
@@ -188,73 +198,100 @@
unpack="true" override="true" />
<!-- jbpm/jbpm-enterprise.jar -->
- <file src="@{deploy.artifacts.dir}/lib/jbpm-enterprise.jar" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-enterprise.jar"
+ <file src="@{deploy.artifacts.dir}/lib/jbpm-enterprise.jar"
+ targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-enterprise.jar"
unpack="true" override="true" />
<!-- jbpm/jbpm-userguide.war -->
- <file src="@{deploy.artifacts.dir}/lib/jbpm-userguide.jdocbook" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-userguide.war"
+ <file src="@{deploy.artifacts.dir}/lib/jbpm-userguide.jdocbook"
+ targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-userguide.war"
unpack="true" override="true" />
- <!-- jbpm-destinations-service -->
- <file src="@{resources.dir}/destination/jbpm-destinations-service.xml" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm" />
+ <!-- jbpm-mq-service -->
+ <file src="@{resources.dir}/destination/jbpm-mq-service.xml" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm"
+ condition="isJBoss405" />
+ <file src="@{resources.dir}/destination/jbpm-mq-service.xml" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm"
+ condition="isJBoss423" />
+ <!-- jbpm-jbm-service -->
+ <file src="@{resources.dir}/destination/jbpm-jbm-service.xml" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm"
+ condition="isJBoss501" />
+
<!-- Database configs to docs/examples/jbpm -->
- <fileset dir="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config" targetdir="${jbossInstallPath}/docs/examples/jbpm" override="true">
- <include name="hibernate.cfg.hsqldb.xml"/>
- <include name="hibernate.cfg.mysql.xml"/>
- <include name="hibernate.cfg.postgresql.xml"/>
- <include name="hibernate.cfg.sybase.xml"/>
- <include name="hibernate.cfg.oracle.xml"/>
- <include name="hibernate.cfg.db2.xml"/>
- <include name="jbpm-hsqldb-ds.xml"/>
- <include name="jbpm-mysql-ds.xml"/>
- <include name="jbpm-postgresql-ds.xml"/>
- <include name="jbpm-sybase-ds.xml"/>
- <include name="jbpm-oracle-ds.xml"/>
- <include name="jbpm-db2-ds.xml"/>
+ <fileset dir="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config" targetdir="${jbossInstallPath}/docs/examples/jbpm"
+ override="true">
+ <include name="hibernate.cfg.hsqldb.xml" />
+ <include name="hibernate.cfg.mysql.xml" />
+ <include name="hibernate.cfg.postgresql.xml" />
+ <include name="hibernate.cfg.sybase.xml" />
+ <include name="hibernate.cfg.oracle.xml" />
+ <include name="hibernate.cfg.db2.xml" />
+ <include name="jbpm-hsqldb-ds.xml" />
+ <include name="jbpm-mysql-ds.xml" />
+ <include name="jbpm-postgresql-ds.xml" />
+ <include name="jbpm-sybase-ds.xml" />
+ <include name="jbpm-oracle-ds.xml" />
+ <include name="jbpm-db2-ds.xml" />
</fileset>
<!-- Database Hypersonic -->
- <file src="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config/jbpm-hsqldb-ds.xml" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm" condition="isHypersonic"/>
- <singlefile src="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config/hibernate.cfg.hsqldb.xml" condition="isHypersonic"
+ <file src="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config/jbpm-hsqldb-ds.xml"
+ targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm" condition="isHypersonic" />
+ <singlefile src="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config/hibernate.cfg.hsqldb.xml"
+ condition="isHypersonic"
target="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-service.sar/hibernate.cfg.xml" />
- <fileset dir="@{resources.dir}/database" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/data" condition="isHypersonic">
+ <fileset dir="@{resources.dir}/database" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/data"
+ condition="isHypersonic">
<include name="hypersonic/jbpmDB.*" />
</fileset>
<!-- Database MySQL -->
- <file src="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config/jbpm-mysql-ds.xml" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm" condition="isMySQL"/>
- <singlefile src="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config/hibernate.cfg.mysql.xml" condition="isMySQL"
+ <file src="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config/jbpm-mysql-ds.xml"
+ targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm" condition="isMySQL" />
+ <singlefile src="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config/hibernate.cfg.mysql.xml"
+ condition="isMySQL"
target="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-service.sar/hibernate.cfg.xml" />
- <fileset dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-service.sar" override="true" condition="isMySQL">
+ <fileset dir="@{deploy.artifacts.dir}/lib"
+ targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-service.sar"
+ override="true" condition="isMySQL">
<include name="mysql-connector-java.jar" />
</fileset>
<!-- Database PostgreSQL -->
- <file src="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config/jbpm-postgresql-ds.xml" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm" condition="isPostgreSQL"/>
- <singlefile src="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config/hibernate.cfg.postgresql.xml" condition="isPostgreSQL"
+ <file src="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config/jbpm-postgresql-ds.xml"
+ targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm" condition="isPostgreSQL" />
+ <singlefile src="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config/hibernate.cfg.postgresql.xml"
+ condition="isPostgreSQL"
target="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-service.sar/hibernate.cfg.xml" />
- <fileset dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-service.sar" override="true" condition="isPostgreSQL">
+ <fileset dir="@{deploy.artifacts.dir}/lib"
+ targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-service.sar"
+ override="true" condition="isPostgreSQL">
<include name="postgresql.jar" />
</fileset>
<!-- Database Sybase -->
- <file src="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config/jbpm-sybase-ds.xml" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm" condition="isSybase"/>
- <singlefile src="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config/hibernate.cfg.sybase.xml" condition="isSybase"
+ <file src="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config/jbpm-sybase-ds.xml"
+ targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm" condition="isSybase" />
+ <singlefile src="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config/hibernate.cfg.sybase.xml"
+ condition="isSybase"
target="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-service.sar/hibernate.cfg.xml" />
<!-- Database Oracle -->
- <file src="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config/jbpm-oracle-ds.xml" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm" condition="isOracle"/>
- <singlefile src="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config/hibernate.cfg.oracle.xml" condition="isOracle"
+ <file src="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config/jbpm-oracle-ds.xml"
+ targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm" condition="isOracle" />
+ <singlefile src="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config/hibernate.cfg.oracle.xml"
+ condition="isOracle"
target="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-service.sar/hibernate.cfg.xml" />
<!-- Database DB2 -->
- <file src="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config/jbpm-db2-ds.xml" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm" condition="isDB2"/>
- <singlefile src="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config/hibernate.cfg.db2.xml" condition="isDB2"
+ <file src="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config/jbpm-db2-ds.xml" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm"
+ condition="isDB2" />
+ <singlefile src="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config/hibernate.cfg.db2.xml"
+ condition="isDB2"
target="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-service.sar/hibernate.cfg.xml" />
</pack>
- <!--
+ <!--
********************************
* JSF Console *
********************************
@@ -266,7 +303,7 @@
unpack="true" override="true" />
</pack>
- <!--
+ <!--
********************************
* Optional Components *
********************************
@@ -279,14 +316,14 @@
<pack name="Download JBoss-5.0.1" required="no" parent="Optional Components" preselected="no">
<description>Download and Install JBoss-5.0.1</description>
<!-- http://jira.codehaus.org/browse/IZPACK-158 -->
- <file src="@{resources.dir}/installer/download-helper.xml" targetdir="$INSTALL_PATH/Uninstaller"/>
+ <file src="@{resources.dir}/installer/download-helper.xml" targetdir="$INSTALL_PATH/Uninstaller" />
</pack>
<!-- Eclipse-3.4.2 -->
<pack name="Download Eclipse-3.4.2" required="no" parent="Optional Components" preselected="no">
<description>Download and Install Eclipse-3.4.2</description>
<!-- http://jira.codehaus.org/browse/IZPACK-158 -->
- <file src="@{resources.dir}/installer/download-helper.xml" targetdir="$INSTALL_PATH/Uninstaller"/>
+ <file src="@{resources.dir}/installer/download-helper.xml" targetdir="$INSTALL_PATH/Uninstaller" />
</pack>
</packs>
16 years, 10 months
JBoss JBPM SVN: r5123 - jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor.
by do-not-reply@jboss.org
Author: ainze
Date: 2009-06-25 16:12:49 -0400 (Thu, 25 Jun 2009)
New Revision: 5123
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTimerSession.java
Log:
the transaction is not required, fixed nullpointer
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTimerSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTimerSession.java 2009-06-25 13:49:50 UTC (rev 5122)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTimerSession.java 2009-06-25 20:12:49 UTC (rev 5123)
@@ -60,7 +60,11 @@
&& (jobExecutor!=null)
) {
jobExecutorNotificationScheduled = true;
- transaction.registerSynchronization(new JobAddedNotification(jobExecutor));
+
+ //a transaction is not required (can be null)
+ if (transaction != null) {
+ transaction.registerSynchronization(new JobAddedNotification(jobExecutor));
+ }
}
}
16 years, 10 months
JBoss JBPM SVN: r5122 - jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx.
by do-not-reply@jboss.org
Author: ainze
Date: 2009-06-25 09:49:50 -0400 (Thu, 25 Jun 2009)
New Revision: 5122
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionInterceptor.java
Log:
timer support
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionInterceptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionInterceptor.java 2009-06-25 13:22:08 UTC (rev 5121)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionInterceptor.java 2009-06-25 13:49:50 UTC (rev 5122)
@@ -67,8 +67,11 @@
try {
DefaultTransactionDefinition definition = new DefaultTransactionDefinition();
+
if (useCurrent) {
definition.setPropagationBehavior(TransactionDefinition.PROPAGATION_MANDATORY);
+ } else {
+ definition.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
}
TransactionTemplate template = new TransactionTemplate(platformTransactionManager, definition);
@@ -76,7 +79,10 @@
T t = (T) template.execute(transactionCallback);
Session session = environment.get(Session.class);
- session.flush();
+
+ if (session.isOpen()) {
+ session.flush();
+ }
return t;
} catch (RuntimeException e) {
if (standardTransaction != null) {
16 years, 10 months
JBoss JBPM SVN: r5121 - jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-06-25 09:22:08 -0400 (Thu, 25 Jun 2009)
New Revision: 5121
Modified:
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/DeploymentPluginImpl.java
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java
Log:
Process definition state in console model
Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/DeploymentPluginImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/DeploymentPluginImpl.java 2009-06-25 12:55:05 UTC (rev 5120)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/DeploymentPluginImpl.java 2009-06-25 13:22:08 UTC (rev 5121)
@@ -70,7 +70,6 @@
}
// suspended processes
- /* TODO: Uncomment when JBPM-2355 is done
ProcessDefinitionQuery pdQuery2 = repositoryService.createProcessDefinitionQuery();
pdQuery2.deploymentDbid(dpl.getDbid());
pdQuery2.suspended();
@@ -81,7 +80,6 @@
ref.getDefinitions().add(p.getId());
}
- */
results.add(ref);
}
Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java 2009-06-25 12:55:05 UTC (rev 5120)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java 2009-06-25 13:22:08 UTC (rev 5121)
@@ -55,8 +55,7 @@
//def.setDescription(processDefinition.getDescription());
def.setPackageName(cast.getPackageName());
- def.setDeploymentId(String.valueOf(cast.getDeploymentDbid()));
-
+ def.setDeploymentId(String.valueOf(cast.getDeploymentDbid()));
return def;
}
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-06-25 12:55:05 UTC (rev 5120)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java 2009-06-25 13:22:08 UTC (rev 5121)
@@ -57,16 +57,29 @@
List<ProcessDefinitionRef> results = new ArrayList<ProcessDefinitionRef>();
RepositoryService repositoryService = this.processEngine.getRepositoryService();
- List<ProcessDefinition> definitions = repositoryService.createProcessDefinitionQuery()
+
+ // active processes
+ List<ProcessDefinition> activePds = repositoryService.createProcessDefinitionQuery()
.orderAsc(ProcessDefinitionQuery.PROPERTY_NAME)
.list();
-
- // adopt ProcessDefinition to console model
- for(ProcessDefinition processDefinition : definitions)
+
+ for(ProcessDefinition processDefinition : activePds)
{
results.add( ModelAdaptor.adoptDefinition(processDefinition) );
}
+ // suspended processes
+ ProcessDefinitionQuery pdQuery2 = repositoryService.createProcessDefinitionQuery();
+ pdQuery2.suspended();
+ List<ProcessDefinition> suspendedPds = pdQuery2.list();
+
+ for(ProcessDefinition p : suspendedPds)
+ {
+ ProcessDefinitionRef pref = ModelAdaptor.adoptDefinition(p);
+ pref.setSuspended(true);
+ results.add(pref);
+ }
+
return results;
}
finally
16 years, 10 months
JBoss JBPM SVN: r5120 - in projects/gwt-console/trunk/gui/war/src/main: java/org/jboss/bpm/console/client/process and 1 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-06-25 08:55:05 -0400 (Thu, 25 Jun 2009)
New Revision: 5120
Modified:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeploymentListView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java
projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/console.css
Log:
Add filter to deployment and process list views
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeploymentListView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeploymentListView.java 2009-06-25 11:45:04 UTC (rev 5119)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeploymentListView.java 2009-06-25 12:55:05 UTC (rev 5120)
@@ -61,6 +61,13 @@
private SimpleDateFormat dateFormat = new SimpleDateFormat();
+ private int FILTER_NONE = 10;
+ private int FILTER_ACTIVE = 20;
+ private int FILTER_SUSPENDED = 30;
+ private int currentFilter = FILTER_NONE;
+
+ private List<DeploymentRef> deployments = null;
+
public DeploymentListView()
{
super();
@@ -69,6 +76,7 @@
setIcon(icons.deploymentIcon());
listBox = createListBox();
+
}
private ListBox createListBox()
@@ -143,8 +151,8 @@
final LayoutPanel toolBox = new LayoutPanel();
toolBox.setPadding(0);
- toolBox.setWidgetSpacing(5);
- //toolBox.setLayout(new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ toolBox.setWidgetSpacing(0);
+ toolBox.setLayout(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
final ToolBar toolBar = new ToolBar();
toolBar.add(
@@ -164,26 +172,26 @@
toolBar.add(
new ToolButton("Delete", new ClickListener() {
public void onClick(Widget sender) {
-
+
DeploymentRef deploymentRef = getSelection();
if(deploymentRef!=null)
{
MessageBox.confirm("Delete deployment",
- "Do you want to delete this deployment? Any related data will be removed.",
- new MessageBox.ConfirmationCallback() {
- public void onResult(boolean doIt)
- {
- if(doIt)
+ "Do you want to delete this deployment? Any related data will be removed.",
+ new MessageBox.ConfirmationCallback() {
+ public void onResult(boolean doIt)
{
- controller.handleEvent(
- new Event(
- DeleteDeploymentAction.ID,
- getSelection().getId()
- )
- );
+ if(doIt)
+ {
+ controller.handleEvent(
+ new Event(
+ DeleteDeploymentAction.ID,
+ getSelection().getId()
+ )
+ );
+ }
}
- }
- });
+ });
}
else
{
@@ -196,6 +204,39 @@
toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+ // filter
+ LayoutPanel filterPanel = new LayoutPanel();
+ filterPanel.setStyleName("bpm-filter-panel");
+ final com.google.gwt.user.client.ui.ListBox dropBox = new com.google.gwt.user.client.ui.ListBox(false);
+ dropBox.setStyleName("bpm-operation-ui");
+ dropBox.addItem("All");
+ dropBox.addItem("Active");
+ dropBox.addItem("Suspended");
+
+ dropBox.addChangeListener(new ChangeListener() {
+ public void onChange(Widget sender) {
+ switch (dropBox.getSelectedIndex())
+ {
+ case 0:
+ currentFilter = FILTER_NONE;
+ break;
+ case 1:
+ currentFilter = FILTER_ACTIVE;
+ break;
+ case 2:
+ currentFilter = FILTER_SUSPENDED;
+ break;
+ default:
+ throw new IllegalArgumentException("No such index");
+ }
+
+ renderFiltered();
+ }
+ });
+ filterPanel.add(dropBox);
+
+ toolBox.add(filterPanel, new BoxLayoutData(BoxLayoutData.FillStyle.VERTICAL));
+
this.deploymentList.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
this.deploymentList.add(listBox, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
@@ -226,20 +267,42 @@
public void update(List<DeploymentRef> deployments)
{
- final DefaultListModel<DeploymentRef> model =
- (DefaultListModel<DeploymentRef>) listBox.getModel();
+ this.deployments = deployments;
- model.clear();
+ renderFiltered();
+ }
- for(DeploymentRef dpl : deployments)
+ private void renderFiltered()
+ {
+ if(this.deployments!=null)
{
- model.add(dpl);
+ final DefaultListModel<DeploymentRef> model =
+ (DefaultListModel<DeploymentRef>) listBox.getModel();
+
+ model.clear();
+
+ for(DeploymentRef dpl : deployments)
+ {
+ if(FILTER_NONE==currentFilter)
+ {
+ model.add(dpl);
+ }
+ else
+ {
+ boolean showSuspended = (FILTER_SUSPENDED==currentFilter);
+ if(dpl.isSuspended()==showSuspended)
+ model.add(dpl);
+ }
+ }
+
+ if(listBox.getSelectedIndex()!=-1)
+ listBox.setItemSelected(listBox.getSelectedIndex(), false);
+
+ // clear details
+ controller.handleEvent(
+ new Event(UpdateDeploymentDetailAction.ID, null)
+ );
}
-
- // clear details
- controller.handleEvent(
- new Event(UpdateDeploymentDetailAction.ID, null)
- );
}
public void select(String deploymentId)
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java 2009-06-25 11:45:04 UTC (rev 5119)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java 2009-06-25 12:55:05 UTC (rev 5120)
@@ -28,7 +28,6 @@
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
import org.gwt.mosaic.ui.client.ListBox;
-import org.gwt.mosaic.ui.client.MessageBox;
import org.gwt.mosaic.ui.client.ToolBar;
import org.gwt.mosaic.ui.client.ToolButton;
import org.gwt.mosaic.ui.client.layout.*;
@@ -37,6 +36,7 @@
import org.jboss.bpm.console.client.common.AbstractView;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+import org.jboss.bpm.console.client.ServerPlugins;
import java.util.List;
@@ -55,6 +55,13 @@
private boolean isInitialized;
+ private int FILTER_NONE = 10;
+ private int FILTER_ACTIVE = 20;
+ private int FILTER_SUSPENDED = 30;
+ private int currentFilter = FILTER_NONE;
+
+ private List<ProcessDefinitionRef> definitions = null;
+
public DefinitionListView()
{
super();
@@ -63,7 +70,7 @@
setIcon(icons.processIcon());
listBox = createListBox();
-
+
}
public boolean isInitialized()
@@ -83,9 +90,10 @@
final LayoutPanel toolBox = new LayoutPanel();
toolBox.setPadding(0);
- toolBox.setWidgetSpacing(5);
- //toolBox.setLayout(new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ toolBox.setWidgetSpacing(0);
+ toolBox.setLayout(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
+ // toolbar
final ToolBar toolBar = new ToolBar();
toolBar.add(
new ToolButton("Refresh", new ClickListener() {
@@ -98,9 +106,41 @@
}
)
);
-
toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+ // filter
+ LayoutPanel filterPanel = new LayoutPanel();
+ filterPanel.setStyleName("bpm-filter-panel");
+ final com.google.gwt.user.client.ui.ListBox dropBox = new com.google.gwt.user.client.ui.ListBox(false);
+ dropBox.setStyleName("bpm-operation-ui");
+ dropBox.addItem("All");
+ dropBox.addItem("Active");
+ dropBox.addItem("Suspended");
+
+ dropBox.addChangeListener(new ChangeListener() {
+ public void onChange(Widget sender) {
+ switch (dropBox.getSelectedIndex())
+ {
+ case 0:
+ currentFilter = FILTER_NONE;
+ break;
+ case 1:
+ currentFilter = FILTER_ACTIVE;
+ break;
+ case 2:
+ currentFilter = FILTER_SUSPENDED;
+ break;
+ default:
+ throw new IllegalArgumentException("No such index");
+ }
+
+ renderFiltered();
+ }
+ });
+ filterPanel.add(dropBox);
+
+ toolBox.add(filterPanel, new BoxLayoutData(BoxLayoutData.FillStyle.VERTICAL));
+
this.definitionList.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
this.definitionList.add(listBox, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
@@ -142,7 +182,7 @@
case 2:
listBox.setText(row, column, item.getName());
break;
- case 3:
+ case 3:
listBox.setText(row, column, String.valueOf(item.isSuspended()));
break;
default:
@@ -176,6 +216,8 @@
}
});
+ ListModel<ProcessDefinitionRef> origModel = listBox.getModel();
+
return listBox;
}
@@ -186,21 +228,43 @@
}
public void update(List<ProcessDefinitionRef> definitions)
- {
- final DefaultListModel<ProcessDefinitionRef> model =
- (DefaultListModel<ProcessDefinitionRef>) listBox.getModel();
+ {
+ this.definitions = definitions;
- model.clear();
+ renderFiltered();
+ }
- for(ProcessDefinitionRef def : definitions)
+ private void renderFiltered()
+ {
+ if(this.definitions!=null)
{
- model.add(def);
+ final DefaultListModel<ProcessDefinitionRef> model =
+ (DefaultListModel<ProcessDefinitionRef>) listBox.getModel();
+
+ model.clear();
+
+ for(ProcessDefinitionRef def : definitions)
+ {
+ if(FILTER_NONE==currentFilter)
+ {
+ model.add(def);
+ }
+ else
+ {
+ boolean showSuspended = (FILTER_SUSPENDED==currentFilter);
+ if(def.isSuspended()==showSuspended)
+ model.add(def);
+ }
+ }
+
+ if(listBox.getSelectedIndex()!=-1)
+ listBox.setItemSelected(listBox.getSelectedIndex(), false);
+
+ // clear details
+ controller.handleEvent(
+ new Event(UpdateProcessDetailAction.ID, null)
+ );
}
-
- // clear details
- controller.handleEvent(
- new Event(UpdateProcessDetailAction.ID, null)
- );
}
public ProcessDefinitionRef getSelection()
@@ -210,5 +274,5 @@
selection = listBox.getItem( listBox.getSelectedIndex());
return selection;
}
-
+
}
Modified: projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/console.css
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/console.css 2009-06-25 11:45:04 UTC (rev 5119)
+++ projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/public/console.css 2009-06-25 12:55:05 UTC (rev 5120)
@@ -41,6 +41,13 @@
padding-top:10px;
}
+.bpm-filter-panel {
+ padding-top:5px;
+ padding-right:2px;
+ background-color:#dfe8f6;
+ border-bottom: 1px solid #bbbbbb;
+}
+
.bpm-editor-info {
font-family: sans-serif;
font-size:18px;
16 years, 10 months
JBoss JBPM SVN: r5119 - in projects/gwt-console/trunk: gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model and 1 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-06-25 07:45:04 -0400 (Thu, 25 Jun 2009)
New Revision: 5119
Modified:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDetailView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateDefinitionsAction.java
projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java
Log:
Add definition status
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java 2009-06-25 10:12:15 UTC (rev 5118)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java 2009-06-25 11:45:04 UTC (rev 5119)
@@ -99,31 +99,6 @@
)
);
- /*
- drools currently doesn't use it and jbpm uses the DeploymentEditor
-
- toolBar.addSeparator();
-
- toolBar.add(
- new ToolButton("Delete", new ClickListener() {
- public void onClick(Widget sender) {
- // force loading
- ProcessDefinitionRef definitionRef = getSelection();
- if(definitionRef!=null)
- {
- controller.handleEvent(
- new Event(DeleteDefinitionAction.ID, definitionRef)
- );
- }
- else
- {
- MessageBox.alert("Missing selection", "Please select a process definition");
- }
- }
- }
- )
- ); */
-
toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
this.definitionList.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
@@ -150,7 +125,7 @@
final ListBox<ProcessDefinitionRef> listBox =
new ListBox<ProcessDefinitionRef>(
new String[] {
- "Process ID", "Version", "Name"}
+ "Process ID", "Version", "Name", "Suspended"}
);
@@ -167,6 +142,9 @@
case 2:
listBox.setText(row, column, item.getName());
break;
+ case 3:
+ listBox.setText(row, column, String.valueOf(item.isSuspended()));
+ break;
default:
throw new RuntimeException("Unexpected column size");
}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDetailView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDetailView.java 2009-06-25 10:12:15 UTC (rev 5118)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDetailView.java 2009-06-25 11:45:04 UTC (rev 5119)
@@ -32,6 +32,7 @@
import org.jboss.bpm.console.client.common.PropertyGrid;
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.ServerPlugins;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -48,13 +49,15 @@
private DeploymentPanel deploymentPanel;
+ private boolean showDeployment;
+
public ProcessDetailView()
{
super("Process details");
- super.setStyleName("bpm-detail-panel");
-
+ super.setStyleName("bpm-detail-panel");
+
grid = new PropertyGrid(
- new String[] {"ID:", "Key:", "Name:", "Package:", "Description:"}
+ new String[] {"ID:", "Key:", "Name:", "Suspended:", "Package:", "Description:"}
);
@@ -62,16 +65,19 @@
final DeckLayoutPanel deck = new DeckLayoutPanel();
deck.add(grid);
- // deployment info
- deploymentPanel = new DeploymentPanel();
-
- deck.add(deploymentPanel);
-
// selection
final com.google.gwt.user.client.ui.ListBox dropBox = new com.google.gwt.user.client.ui.ListBox(false);
dropBox.setStyleName("bpm-operation-ui");
dropBox.addItem("Properties");
- dropBox.addItem("Deployment");
+
+ // deployment info
+ if(ServerPlugins.has("org.jboss.bpm.console.server.plugin.DeploymentPlugin"))
+ {
+ dropBox.addItem("Deployment");
+ deploymentPanel = new DeploymentPanel();
+ deck.add(deploymentPanel);
+ }
+
dropBox.addChangeListener(new ChangeListener() {
public void onChange(Widget sender) {
deck.showWidget(dropBox.getSelectedIndex());
@@ -102,6 +108,7 @@
process.getId(),
process.getKey(),
process.getName(),
+ String.valueOf(process.isSuspended()),
process.getPackageName(),
process.getDescription()
};
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateDefinitionsAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateDefinitionsAction.java 2009-06-25 10:12:15 UTC (rev 5118)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateDefinitionsAction.java 2009-06-25 11:45:04 UTC (rev 5119)
@@ -66,13 +66,15 @@
public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
{
- JSONValue json = JSONParser.parse(response.getText());
- List<ProcessDefinitionRef> definitions = DTOParser.parseProcessDefinitions(json);
-
DefinitionListView view = (DefinitionListView) controller.getView(DefinitionListView.ID);
- view.update(definitions);
+ if(view!=null) // may not be initialized (lazy)
+ {
+ JSONValue json = JSONParser.parse(response.getText());
+ List<ProcessDefinitionRef> definitions = DTOParser.parseProcessDefinitions(json);
- ConsoleLog.info("Loaded " + definitions.size() + " process definitions");
+ view.update(definitions);
+ ConsoleLog.info("Loaded " + definitions.size() + " process definitions");
+ }
}
}
Modified: projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
===================================================================
--- projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2009-06-25 10:12:15 UTC (rev 5118)
+++ projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2009-06-25 11:45:04 UTC (rev 5119)
@@ -53,10 +53,12 @@
String id = JSONWalk.on(root).next("id").asString();
Long version = JSONWalk.on(root).next("version").asLong();
String name = JSONWalk.on(root).next("name").asString();
+ boolean isSuspended = JSONWalk.on(root).next("suspended").asBool();
String dplId = JSONWalk.on(root).next("deploymentId").asString();
ProcessDefinitionRef ref = new ProcessDefinitionRef(id, name, version);
ref.setDeploymentId(dplId);
+ ref.setSuspended(isSuspended);
return ref;
}
Modified: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java 2009-06-25 10:12:15 UTC (rev 5118)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java 2009-06-25 11:45:04 UTC (rev 5119)
@@ -39,7 +39,8 @@
private String packageName;
private String deploymentId;
-
+ private boolean suspended;
+
public ProcessDefinitionRef()
{
}
@@ -128,6 +129,16 @@
this.deploymentId = deploymentId;
}
+ public boolean isSuspended()
+ {
+ return suspended;
+ }
+
+ public void setSuspended(boolean suspended)
+ {
+ this.suspended = suspended;
+ }
+
public boolean equals(Object o)
{
if (this == o) return true;
16 years, 10 months
JBoss JBPM SVN: r5118 - jbpm4/branches/jimma/modules/migration/src/test/resources.
by do-not-reply@jboss.org
Author: jim.ma
Date: 2009-06-25 06:12:15 -0400 (Thu, 25 Jun 2009)
New Revision: 5118
Added:
jbpm4/branches/jimma/modules/migration/src/test/resources/exception-handler.xml
Removed:
jbpm4/branches/jimma/modules/migration/src/test/resources/tmp-output.xml
Log:
Added the missing file in previous commit
Added: jbpm4/branches/jimma/modules/migration/src/test/resources/exception-handler.xml
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/test/resources/exception-handler.xml (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/test/resources/exception-handler.xml 2009-06-25 10:12:15 UTC (rev 5118)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition xmlns="urn:jbpm.org:jpdl-3.2"
+ name="simple">
+ <start-state name="start">
+ <transition name="to_state" to="first">
+ <action name="action" class="com.sample.action.MessageActionHandler">
+ <message>Going to the first state!</message>
+ </action>
+ </transition>
+ </start-state>
+ <state name="first">
+ <event type="node-enter">
+ <action class="org.jbpm.AnotherTest" />
+ </event>
+ <transition name="to_end" to="end">
+ <action name="action" class="com.sample.action.MessageActionHandler">
+ <message>About to finish!</message>
+ </action>
+ </transition>
+ </state>
+ <end-state name="end">
+ <exception-handler exception-class="a">
+ <action class="b"/>
+ </exception-handler>
+ </end-state>
+
+ <exception-handler exception-class="a">
+ <action class="b"/>
+ </exception-handler>
+</process-definition>
\ No newline at end of file
Deleted: jbpm4/branches/jimma/modules/migration/src/test/resources/tmp-output.xml
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/test/resources/tmp-output.xml 2009-06-25 10:01:29 UTC (rev 5117)
+++ jbpm4/branches/jimma/modules/migration/src/test/resources/tmp-output.xml 2009-06-25 10:12:15 UTC (rev 5118)
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<process xmlns="http://jbpm.org/4.0/jpdl" name="hire">
- <start>
- <transition to="initial interview" />
- </start>
- <sub-process name="initial interview">
- <parameter-in var="a" subvar="aa" />
- <parameter-in var="b" subvar="bb" />
- <transition to="end" />
- </sub-process>
- <end name="end" />
-</process>
16 years, 10 months
JBoss JBPM SVN: r5117 - in jbpm4/branches/jimma/modules/migration/src: main/java/org/jbpm/jpdl/internal/convert/action and 4 other directories.
by do-not-reply@jboss.org
Author: jim.ma
Date: 2009-06-25 06:01:29 -0400 (Thu, 25 Jun 2009)
New Revision: 5117
Added:
jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Access.java
jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/VariableAccess.java
jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/ProcessState.java
jbpm4/branches/jimma/modules/migration/src/test/resources/process-state.xml
jbpm4/branches/jimma/modules/migration/src/test/resources/script.xml
jbpm4/branches/jimma/modules/migration/src/test/resources/test-transition-resolve.xml
jbpm4/branches/jimma/modules/migration/src/test/resources/tmp-output.xml
Modified:
jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReader.java
jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/Action.java
jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/Script.java
jbpm4/branches/jimma/modules/migration/src/main/resources/node.converter.types.xml
jbpm4/branches/jimma/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReaderTest.java
jbpm4/branches/jimma/modules/migration/src/test/resources/simple.xml
Log:
Added more tests and sub-process element conversion support
Added: jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Access.java
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Access.java (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Access.java 2009-06-25 10:01:29 UTC (rev 5117)
@@ -0,0 +1,84 @@
+/*
+ * 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.jpdl.internal.convert;
+
+import java.io.Serializable;
+
+public class Access implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ String access = "read,write";
+
+ public Access() {
+ }
+
+ public Access(String access) {
+ if (access!=null) {
+ if ("".equals(access)) {
+ this.access = " ";
+ } else {
+ this.access = access;
+ }
+ }
+ }
+
+ public boolean isReadable() {
+ return hasAccess("read");
+ }
+
+ public boolean isWritable() {
+ return hasAccess("write");
+ }
+
+ public boolean isRequired() {
+ return hasAccess("required");
+ }
+
+ public boolean isLock() {
+ return hasAccess("lock");
+ }
+
+ /**
+ * verifies if the given accessLiteral is included in the access text.
+ */
+ public boolean hasAccess(String accessLiteral) {
+ if (access==null) return false;
+ return (access.indexOf(accessLiteral.toLowerCase())!=-1);
+ }
+
+ public String toString() {
+ return access;
+ }
+
+ public boolean equals(Object object) {
+ if (object instanceof Access) {
+ Access other = (Access) object;
+ return (isReadable()==other.isReadable())
+ && (isWritable()==other.isWritable())
+ && (isRequired()==other.isRequired())
+ && (isLock()==other.isLock());
+ } else {
+ return false;
+ }
+ }
+}
Modified: jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReader.java
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReader.java 2009-06-25 09:51:41 UTC (rev 5116)
+++ jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReader.java 2009-06-25 10:01:29 UTC (rev 5117)
@@ -180,7 +180,8 @@
// second pass processing
resolveTransitionDestinations();
- resolveActionReferences();
+ //TODO: Resolve action reference
+ //resolveActionReferences();
verifySwimlaneAssignments();
}
@@ -261,6 +262,10 @@
Element nodeElement = (Element)nodeElementIter.next();
String nodeName = nodeElement.getName();
// get the node type
+
+ if ("super-state".equalsIgnoreCase(nodeName) || "mail-node".equalsIgnoreCase(nodeName)) {
+ this.addError("Unsupported " + nodeName + " conversion : <" + nodeName + " name=\"" + element.attributeValue("name") + "\"");
+ }
Class<?> nodeType = NodeConverterTypes.getNodeType(nodeName);
if (nodeType != null)
{
@@ -380,7 +385,7 @@
if (duedateText != null) {
//TODO: Unsupported duedateText
- addWarning("Unsupported duedateText attribute converstion for task : " + taskElement.asXML());
+ addWarning("Unsupported duedateDate attribute converstion for task : " + taskElement.asXML());
}
@@ -477,14 +482,14 @@
protected void readAssignmentDelegation(Element assignmentElement, Element task4)
{
- //TODO:Ask question about this, How to convert the ExpressionAssignmentHandler
+
String expression = assignmentElement.attributeValue("expression");
String actorId = assignmentElement.attributeValue("actor-id");
String pooledActors = assignmentElement.attributeValue("pooled-actors");
if (expression != null)
{
- //How to convert default assignmenthandler
+ //TODO:How to convert default assignmenthandler
//assignmentDelegation.setClassName("org.jbpm.identity.assignment.ExpressionAssignmentHandler");
//assignmentDelegation.setConfiguration("<expression>" + expression + "</expression>");
@@ -492,7 +497,7 @@
else if ((actorId != null) || (pooledActors != null))
{
//TODO:Ask question
- task4.addComment("Please Update the Assignment handler to jpdl4");
+ task4.addComment("Please Update the AssignmentHandler and implement org.jbpm.api.task.AssignmentHandler to create your own AssignmentHandler");
Element assignmentHandler = task4.addElement("assignment-handler");
assignmentHandler.addAttribute("class", "org.jbpm.taskmgmt.assignment.ActorAssignmentHandler");
@@ -516,21 +521,29 @@
}
}
- /*
- protected TaskController readTaskController(Element taskControllerElement)
- {
- return null;
- }
public List<VariableAccess> readVariableAccesses(Element element)
{
- return null;
- }
+ List<VariableAccess> variableAccesses = new ArrayList<VariableAccess>();
+ Iterator<?> iter = element.elementIterator("variable");
+ while (iter.hasNext())
+ {
+ Element variableElement = (Element)iter.next();
- public void readStartStateTask(Element startTaskElement, StartState startState)
- {
+ String variableName = variableElement.attributeValue("name");
+ if (variableName == null)
+ {
+ addProblem(new Problem(Problem.LEVEL_WARNING, "the name attribute of a variable element is required: " + variableElement.asXML()));
+ }
+ String access = variableElement.attributeValue("access", "read,write");
+ String mappedName = variableElement.attributeValue("mapped-name");
+
+ variableAccesses.add(new VariableAccess(variableName, access, mappedName));
+ }
+ return variableAccesses;
}
-*/
+
+
public void readNode(Element nodeElement, Element jpdl4Element)
{
@@ -592,10 +605,7 @@
createTimerAction.createConvertedElement(timerElement, onElement);
createTimerAction.read(timerElement, this);
- //TODO: investigate if there is equivalent cancel timer action in jpdl4...
- /*CancelTimerAction cancelTimerAction = instantiateCancelTimerAction();
- cancelTimerAction.setTimerName(name);
- addAction(node, Event.EVENTTYPE_NODE_LEAVE, cancelTimerAction);*/
+ //TODO: if there is equivalent cancel timer action in jpdl4...
}
private String generateTimerName()
@@ -659,35 +669,8 @@
}
- //TODO: handle createTimerAction and cancelTimerAction
- /*createTimerAction.setTimerAction(action);
- addAction(task, Event.EVENTTYPE_TASK_CREATE, createTimerAction);
-
- // read the cancel-event types
- Collection<String> cancelEventTypes = new ArrayList<String>();
-
- 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);
- }
-
- for (String cancelEventType : cancelEventTypes)
- {
- CancelTimerAction cancelTimerAction = instantiateCancelTimerAction();
- cancelTimerAction.setTimerName(name);
- addAction(task, cancelEventType, cancelTimerAction);
- }*/
+ //TODO: Revist if we need to handle cancelTimerAction
+
}
public void readEvents(Element parentElement, Element jpdl4Element)
@@ -715,9 +698,14 @@
{
Element actionElement = (Element)nodeElementIter.next();
String actionName = actionElement.getName();
+
+ if("cancel-timer".equalsIgnoreCase(actionName) || "mail".equalsIgnoreCase(actionName)) {
+ this.addWarning("Unsupported " + actionName + " conversion on Element : " + actionElement.asXML());
+ }
+
if (ActionConverterTypes.hasActionName(actionName))
{
- Element action4 = createAction(actionElement, jpdl4Element);
+ createAction(actionElement, jpdl4Element);
}
}
@@ -744,7 +732,7 @@
{
// create a new instance of the action
Action action = null;
- String actionName = actionElement.getName();
+ String actionName = actionElement.getName();
Class<? extends Action> actionType = ActionConverterTypes.getActionType(actionName);
try
{
@@ -763,16 +751,15 @@
protected void readExceptionHandlers(Element graphElement, Element jpdl4Element)
{
- this.addWarning("Unsupported exception handler conversion for element : <" + graphElement.getName()
- + "name=" + graphElement.attributeValue("name") + "/>" );
+ Iterator<?> iter = graphElement.elementIterator("exception-handler");
+ if (iter.hasNext()) {
+ addWarning("Unsupported exception handler conversion for element : <"
+ + graphElement.getName()
+ + " name=\""
+ + graphElement.attributeValue("name") + "\"/>");
+ }
}
-/*
- protected void readExceptionHandler(Element exceptionHandlerElement, GraphElement graphElement)
- {
- // create the exception handler
-
- }
-*/
+
// transition destinations are parsed in a second pass //////////////////////
public void addUnresolvedTransitionDestination(Element nodeElement, Element jpdl4Element)
Added: jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/VariableAccess.java
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/VariableAccess.java (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/VariableAccess.java 2009-06-25 10:01:29 UTC (rev 5117)
@@ -0,0 +1,93 @@
+/*
+ * 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.jpdl.internal.convert;
+
+import java.io.Serializable;
+
+/**
+ * This is orignally from jbpm3 codebase.
+ * specifies access to a variable.
+ * Variable access is used in 3 situations:
+ * 1) process-state
+ * 2) script
+ * 3) task controllers
+ */
+public class VariableAccess implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ long id = 0;
+ protected String variableName = null;
+ protected Access access = null;
+ protected String mappedName = null;
+
+ // constructors /////////////////////////////////////////////////////////////
+
+ public VariableAccess() {
+ }
+
+ public VariableAccess(String variableName, String access, String mappedName) {
+ this.variableName = variableName;
+ if (access!=null) access = access.toLowerCase();
+ this.access = new Access(access);
+ this.mappedName = mappedName;
+ }
+
+ // getters and setters //////////////////////////////////////////////////////
+
+ /**
+ * the mapped name. The mappedName defaults to the variableName in case
+ * no mapped name is specified.
+ */
+ public String getMappedName() {
+ if (mappedName==null) {
+ return variableName;
+ }
+ return mappedName;
+ }
+
+ /**
+ * specifies a comma separated list of access literals {read, write, required}.
+ */
+ public Access getAccess() {
+ return access;
+ }
+ public String getVariableName() {
+ return variableName;
+ }
+
+ public boolean isReadable() {
+ return access.isReadable();
+ }
+
+ public boolean isWritable() {
+ return access.isWritable();
+ }
+
+ public boolean isRequired() {
+ return access.isRequired();
+ }
+
+ public boolean isLock() {
+ return access.isLock();
+ }
+}
Modified: jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/Action.java
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/Action.java 2009-06-25 09:51:41 UTC (rev 5116)
+++ jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/Action.java 2009-06-25 10:01:29 UTC (rev 5117)
@@ -58,8 +58,9 @@
convertedElement.addAttribute("lang", "juel");
} else if (actionElement.attribute("ref-name")!=null) {
- //TODO: action reference ...
- //jpdlReader.addUnresolvedActionReference(actionElement, this);
+ //TODO: Unsupported ref-name
+ //jpdlReader.addUnresolvedActionReference(actionElement, this);
+ jpdlReader.addWarning("Unsupported ref-name attribute conversion in element " + actionElement.asXML());
} else if (actionElement.attribute("class")!=null) {
convertedElement.addAttribute("class", actionElement.attributeValue("class"));
convertedElement.addAttribute("method", "execute");
@@ -74,13 +75,12 @@
|| "off".equalsIgnoreCase(acceptPropagatedEvents)) {
isPropagationAllowed = false;
}
- //TODO:Async
+
String asyncText = actionElement.attributeValue("async");
if ("true".equalsIgnoreCase(asyncText)) {
- isAsync = true;
+ convertedElement.addAttribute("async", "true");
} else if ("exclusive".equalsIgnoreCase(asyncText)) {
- isAsync = true;
- isAsyncExclusive = true;
+ convertedElement.addAttribute("async", "exclusive");
}
}
Modified: jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/Script.java
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/Script.java 2009-06-25 09:51:41 UTC (rev 5116)
+++ jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/action/Script.java 2009-06-25 10:01:29 UTC (rev 5117)
@@ -26,5 +26,21 @@
public class Script extends Action {
-
+ public Element createConvertedElement(Element actionElement, Element jpdl4Doc) {
+ convertedElement = jpdl4Doc.addElement("script");
+ return convertedElement;
+ }
+
+ public void read(Element actionElement, Jpdl3ConverterReader jpdlReader) {
+ String expression = null;
+ if (actionElement.isTextOnly()) {
+ expression = actionElement.getText();
+ } else {
+ //TODO:Unsupported variable conversion
+ //List<VariableAccess> vias = jpdlReader.readVariableAccesses(actionElement);
+ expression = actionElement.element("expression").getText();
+ }
+ convertedElement.addAttribute("expr", expression);
+ convertedElement.addAttribute("lang", "juel");
+ }
}
Added: jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/ProcessState.java
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/ProcessState.java (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/main/java/org/jbpm/jpdl/internal/convert/node/ProcessState.java 2009-06-25 10:01:29 UTC (rev 5117)
@@ -0,0 +1,41 @@
+package org.jbpm.jpdl.internal.convert.node;
+
+import java.util.List;
+
+import org.dom4j.Element;
+import org.jbpm.jpdl.internal.convert.Jpdl3ConverterReader;
+import org.jbpm.jpdl.internal.convert.VariableAccess;
+
+public class ProcessState extends Node {
+ public Element createConvertedElement(Element jpdl4Doc) {
+ convertedElement = jpdl4Doc.addElement("sub-process");
+ return convertedElement;
+ }
+
+ public void read(Jpdl3ConverterReader reader) {
+
+ String name = nodeElement.attributeValue("name");
+
+ convertedElement.attributeValue("name", name);
+
+ Element subProcessElement = nodeElement.element("sub-process");
+ if (subProcessElement!=null) {
+ String subProcessName = subProcessElement.attributeValue("name");
+ //String subProcessVersion = subProcessElement.attributeValue("version");
+ convertedElement.attributeValue("sub-process-id", subProcessName);
+ }
+
+ List<VariableAccess> readVariableAccesses = reader.readVariableAccesses(nodeElement);
+ for (VariableAccess via : readVariableAccesses) {
+ Element para = null;
+ if (via.isReadable()) {
+ para = convertedElement.addElement("parameter-in");
+ } else {
+ para = convertedElement.addElement("parameter-out");
+ }
+ para.addAttribute("var", via.getVariableName());
+ para.addAttribute("subvar", via.getMappedName());
+ }
+
+ }
+}
Modified: jbpm4/branches/jimma/modules/migration/src/main/resources/node.converter.types.xml
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/main/resources/node.converter.types.xml 2009-06-25 09:51:41 UTC (rev 5116)
+++ jbpm4/branches/jimma/modules/migration/src/main/resources/node.converter.types.xml 2009-06-25 10:01:29 UTC (rev 5117)
@@ -8,9 +8,9 @@
<node-type element="join" class="org.jbpm.jpdl.internal.convert.node.Join" />
<node-type element="decision" class="org.jbpm.jpdl.internal.convert.node.Decision" />
<node-type element="process-state" class="org.jbpm.jpdl.internal.convert.node.ProcessState" />
- <node-type element="super-state" class="org.jbpm.jpdl.internal.convert.node.SuperState" />
+ <!--node-type element="super-state" class="org.jbpm.jpdl.internal.convert.node.SuperState" />
<node-type element="mail-node" class="org.jbpm.jpdl.internal.convert.node.MailNode" />
- <!--node-type element="merge" class="org.jbpm.jpdl.internal.convert.node.Merge" />
+ <node-type element="merge" class="org.jbpm.jpdl.internal.convert.node.Merge" />
<node-type element="milestone-node" class="oorg.jbpm.jpdl.internal.convert.node.MilestoneNode" />
<node-type element="interleave-start" class="org.jbpm.jpdl.internal.convert.node.InterleaveStart" />
<node-type element="interleave-end" class="org.jbpm.jpdl.internal.convert.node.InterleaveEnd"/>
Modified: jbpm4/branches/jimma/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReaderTest.java
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReaderTest.java 2009-06-25 09:51:41 UTC (rev 5116)
+++ jbpm4/branches/jimma/modules/migration/src/test/java/org/jbpm/jpdl/internal/convert/Jpdl3ConverterReaderTest.java 2009-06-25 10:01:29 UTC (rev 5117)
@@ -34,22 +34,22 @@
import org.junit.Test;
import org.xml.sax.InputSource;
-public class Jpdl3ConverterReaderTest {
+public class Jpdl3ConverterReaderTest {
@Test
public void testSimpleProcesss() throws Exception {
testConvert("simple.xml");
}
-
+
@Ignore
public void testBusinessTrip() throws Exception {
testConvert("businesstrip.xml");
}
-
+
@Test
public void testAssignment() throws Exception {
testConvert("assignment.xml");
}
-
+
@Test
public void testEvent() throws Exception {
setUpScriptManager();
@@ -60,48 +60,108 @@
public void testDescision() throws Exception {
testConvert("testDecision.xml");
}
+
+ @Test
+ public void testProcessState() throws Exception {
+ testConvert("process-state.xml");
+ }
+
+ @Test
+ public void testScript() throws Exception {
+ setUpScriptManager();
+ testConvert("script.xml");
+ }
+
+ @Test
+ // Unsupported exception handler conversion test
+ public void testExceptionHandler() throws Exception {
+ InputStream inputStream = getClass().getClassLoader()
+ .getResourceAsStream("exception-handler.xml");
+ // Convert to process file to jpdl4
+ InputSource ins = new InputSource(inputStream);
+ Jpdl3ConverterReader converter = new Jpdl3ConverterReader(ins);
+ Document doc = converter.readAndConvert();
+ Assert.assertEquals(converter.problems.size(), 2);
+ Assert.assertTrue(converter.problems.get(0).toString().indexOf("[WARNING] Unsupported exception handler conversion for element") > -1);
+ Assert.assertTrue(converter.problems.get(1).toString().indexOf("[WARNING] Unsupported exception handler conversion for element") > -1);
+ }
+
+ @Test
+ //Unsupported super-sate and mail node conversion
+ public void testSuperStateAndMailNode() {
+ InputStream inputStream = getClass().getClassLoader()
+ .getResourceAsStream("superstate-mail.xml");
+ // Convert to process file to jpdl4
+ InputSource ins = new InputSource(inputStream);
+ Jpdl3ConverterReader converter = new Jpdl3ConverterReader(ins);
+ try {
+ Document doc = converter.readAndConvert();
+ Assert.fail("The unsupported exception does not throw");
+ } catch (java.lang.Throwable e) {
+ }
+ }
@Test
+ public void testTransitionResolved() {
+ InputStream inputStream = getClass().getClassLoader()
+ .getResourceAsStream("test-transition-resolve.xml");
+ // Convert to process file to jpdl4
+ InputSource ins = new InputSource(inputStream);
+ Jpdl3ConverterReader converter = new Jpdl3ConverterReader(ins);
+ Document doc = converter.readAndConvert();
+ Assert.assertEquals(converter.problems.size(), 2);
+ for (org.jbpm.jpdl.internal.convert.Problem pb : converter.problems) {
+ System.out.println(pb);
+ }
+ Assert.assertTrue(converter.problems.get(0).toString().startsWith(
+ "[WARNING] transition to='first2'"));
+ Assert.assertTrue(converter.problems.get(1).toString().startsWith(
+ "[WARNING] transition to='end2'"));
+
+ }
+
+ @Test
public void testTimer() throws Exception {
String xml = convert("timer.xml");
- List<Problem> problems = new JpdlParser().createParse().setString(xml).execute().getProblems();
- Assert.assertEquals(2, problems.size());
- Assert.assertTrue(problems.get(0).getMsg().startsWith("unrecognized event listener"));
- Assert.assertTrue(problems.get(1).getMsg().startsWith("unrecognized event listener"));
+ List<Problem> problems = new JpdlParser().createParse().setString(xml)
+ .execute().getProblems();
+ Assert.assertEquals(2, problems.size());
+ Assert.assertTrue(problems.get(0).getMsg().startsWith(
+ "unrecognized event listener"));
+ Assert.assertTrue(problems.get(1).getMsg().startsWith(
+ "unrecognized event listener"));
}
-
+
private void testConvert(String resourcefile) throws Exception {
- String xml = convert(resourcefile);
- List<Problem> problems = new JpdlParser().createParse().setString(xml).execute().getProblems();
+ String xml = convert(resourcefile);
+ List<Problem> problems = new JpdlParser().createParse().setString(xml)
+ .execute().getProblems();
Assert.assertEquals(problems.toString(), 0, problems.size());
}
-
-
+
private String convert(String resouceFile) throws Exception {
- InputStream inputStream = getClass().getClassLoader().getResourceAsStream(resouceFile);
- //Convert to process file to jpdl4
+ InputStream inputStream = getClass().getClassLoader()
+ .getResourceAsStream(resouceFile);
+ // Convert to process file to jpdl4
InputSource ins = new InputSource(inputStream);
Jpdl3ConverterReader converter = new Jpdl3ConverterReader(ins);
Document doc = converter.readAndConvert();
- return doc.asXML();
+ // System.out.println(doc.asXML());
+ return doc.asXML();
}
-
-
- private String format(String test) {
-
- }
private void setUpScriptManager() throws Exception {
- EnvironmentFactory environmentFactory = JbpmConfiguration.parseXmlString("<jbpm-configuration>"
- + " <process-engine-context>"
- + " <script-manager default-expression-language='juel'"
- + " default-script-language='juel'"
- + " read-contexts='execution, environment, process-engine' "
- + " write-context='execution'>"
- + " <script-language name='juel' factory='com.sun.script.juel.JuelScriptEngineFactory' />"
- + " </script-manager>"
- + " </process-engine-context> </jbpm-configuration>");
-
- environmentFactory.openEnvironment();
+ EnvironmentFactory environmentFactory = JbpmConfiguration
+ .parseXmlString("<jbpm-configuration>"
+ + " <process-engine-context>"
+ + " <script-manager default-expression-language='juel'"
+ + " default-script-language='juel'"
+ + " read-contexts='execution, environment, process-engine' "
+ + " write-context='execution'>"
+ + " <script-language name='juel' factory='com.sun.script.juel.JuelScriptEngineFactory' />"
+ + " </script-manager>"
+ + " </process-engine-context> </jbpm-configuration>");
+
+ environmentFactory.openEnvironment();
}
}
Added: jbpm4/branches/jimma/modules/migration/src/test/resources/process-state.xml
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/test/resources/process-state.xml (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/test/resources/process-state.xml 2009-06-25 10:01:29 UTC (rev 5117)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="hire">
+ <start-state>
+ <transition to="initial interview" />
+ </start-state>
+ <process-state name="initial interview">
+ <sub-process name="interview" />
+ <variable name="a" access="read,write" mapped-name="aa" />
+ <variable name="b" access="read" mapped-name="bb" />
+ <transition to="end" />
+ </process-state>
+ <end-state name="end"></end-state>
+</process-definition>
+
Added: jbpm4/branches/jimma/modules/migration/src/test/resources/script.xml
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/test/resources/script.xml (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/test/resources/script.xml 2009-06-25 10:01:29 UTC (rev 5117)
@@ -0,0 +1,36 @@
+<process-definition
+ xmlns="urn:jbpm.org:jpdl-3.2"
+ name="action process">
+
+ <event type="node-enter">
+ <script>
+ <variable name="var1" />
+ <variable name="var2" />
+ <expression>
+ System.out.println("blabla");
+ </expression>
+ </script>
+ <script>
+ System.out.println("blabla");
+ </script>
+ </event>
+
+ <start-state name="start">
+ <transition name="to_state" to="first">
+ <action name="action" class="com.sample.action.MessageActionHandler">
+ <message>Going to the first state!</message>
+ </action>
+ </transition>
+ </start-state>
+ <state name="first">
+ <event type="node-enter">
+ <action class="org.jbpm.AnotherTest"/>
+ </event>
+ <transition name="to_end" to="end">
+ <action name="action" class="com.sample.action.MessageActionHandler">
+ <message>About to finish!</message>
+ </action>
+ </transition>
+ </state>
+ <end-state name="end"></end-state>
+</process-definition>
\ No newline at end of file
Modified: jbpm4/branches/jimma/modules/migration/src/test/resources/simple.xml
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/test/resources/simple.xml 2009-06-25 09:51:41 UTC (rev 5116)
+++ jbpm4/branches/jimma/modules/migration/src/test/resources/simple.xml 2009-06-25 10:01:29 UTC (rev 5117)
@@ -11,6 +11,9 @@
</transition>
</start-state>
<state name="first">
+ <event type="node-enter">
+ <action class="org.jbpm.AnotherTest"/>
+ </event>
<transition name="to_end" to="end">
<action name="action" class="com.sample.action.MessageActionHandler">
<message>About to finish!</message>
Added: jbpm4/branches/jimma/modules/migration/src/test/resources/test-transition-resolve.xml
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/test/resources/test-transition-resolve.xml (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/test/resources/test-transition-resolve.xml 2009-06-25 10:01:29 UTC (rev 5117)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition
+ xmlns="urn:jbpm.org:jpdl-3.2"
+ name="simple">
+ <start-state name="start">
+ <transition name="to_state" to="first2">
+ <action name="action" class="com.sample.action.MessageActionHandler">
+ <message>Going to the first state!</message>
+ </action>
+ </transition>
+ </start-state>
+ <state name="first">
+ <event type="node-enter">
+ <action class="org.jbpm.AnotherTest"/>
+ </event>
+ <transition name="to_end" to="end2">
+ <action name="action" class="com.sample.action.MessageActionHandler">
+ <message>About to finish!</message>
+ </action>
+ </transition>
+ </state>
+ <end-state name="end"></end-state>
+</process-definition>
\ No newline at end of file
Added: jbpm4/branches/jimma/modules/migration/src/test/resources/tmp-output.xml
===================================================================
--- jbpm4/branches/jimma/modules/migration/src/test/resources/tmp-output.xml (rev 0)
+++ jbpm4/branches/jimma/modules/migration/src/test/resources/tmp-output.xml 2009-06-25 10:01:29 UTC (rev 5117)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<process xmlns="http://jbpm.org/4.0/jpdl" name="hire">
+ <start>
+ <transition to="initial interview" />
+ </start>
+ <sub-process name="initial interview">
+ <parameter-in var="a" subvar="aa" />
+ <parameter-in var="b" subvar="bb" />
+ <transition to="end" />
+ </sub-process>
+ <end name="end" />
+</process>
16 years, 10 months