JBoss JBPM SVN: r1952 - in jbpm3/trunk/modules/gwt-console/war/src/main: resources/org/jboss/bpm/console/public/images and 1 other directory.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-08-21 05:39:39 -0400 (Thu, 21 Aug 2008)
New Revision: 1952
Modified:
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java
jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/processSample.jpg
Log:
cleanup instance view
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java 2008-08-21 09:20:29 UTC (rev 1951)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java 2008-08-21 09:39:39 UTC (rev 1952)
@@ -32,6 +32,7 @@
import org.jboss.bpm.console.client.widgets.EditorView;
import org.jboss.bpm.console.client.widgets.TeaserPanel;
import org.jboss.bpm.console.client.widgets.HelpPanel;
+import org.jboss.bpm.console.client.widgets.UIConstants;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -62,7 +63,7 @@
// ----------------------------------
this.setPaddings(15);
- this.setWidth(800);
+ this.setWidth(UIConstants.EDITOR_PANE_WIDTH);
this.setLayout( new ColumnLayout() );
this.setBorder(false);
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/processSample.jpg
===================================================================
(Binary files differ)
17 years, 8 months
JBoss JBPM SVN: r1951 - in jbpm3/trunk/modules/gwt-console/war/src/main: java/org/jboss/bpm/console/client/widgets and 2 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-08-21 05:20:29 -0400 (Thu, 21 Aug 2008)
New Revision: 1951
Added:
jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/icons/27.png
Modified:
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/TeaserPanel.java
jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/console.css
Log:
cleanup instance view
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java 2008-08-21 08:42:58 UTC (rev 1950)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java 2008-08-21 09:20:29 UTC (rev 1951)
@@ -21,14 +21,17 @@
*/
package org.jboss.bpm.console.client.process;
-import com.gwtext.client.widgets.PaddedPanel;
-import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.*;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
import com.gwtext.client.widgets.layout.ColumnLayout;
import com.gwtext.client.widgets.layout.ColumnLayoutData;
+import com.gwtext.client.core.EventObject;
import org.jboss.bpm.console.client.ConsoleView;
import org.jboss.bpm.console.client.model.ProcessDefinition;
import org.jboss.bpm.console.client.model.ProcessInstance;
import org.jboss.bpm.console.client.widgets.EditorView;
+import org.jboss.bpm.console.client.widgets.TeaserPanel;
+import org.jboss.bpm.console.client.widgets.HelpPanel;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -44,6 +47,8 @@
private ProcessInstance processInstance;
private ConsoleView view;
+
+ private Panel teaserPanel;
public ProcessInstanceEditor(ProcessDefinition proc, ProcessInstance instance, ConsoleView view)
{
@@ -66,13 +71,57 @@
// ----------------------------------
PaddedPanel rightPanel = new PaddedPanel(new ProcessImageView(instance), 5, 5, 0, 5);
- PaddedPanel leftPanel = new PaddedPanel( new Panel("Tasks", 200, 150) , 5, 5, 0, 5);
- leftPanel.add( new PaddedPanel(new Panel("Comments" , 200, 150), 5, 0, 0, 5) );
+
+ // ----------------------------------
+ teaserPanel = new TeaserPanel();
+
// ----------------------------------
+
+ HelpPanel taskPanel = new HelpPanel(200, 180, "Associated Tasks");
+ taskPanel.setIconCls("bpm-task-icon");
+ taskPanel.setContent("Process instances can have user tasks associated with them. " +
+ "These tasks will cross referenced here.");
+
+ Toolbar bottomToolbar = new Toolbar();
+ bottomToolbar.addFill();
+ bottomToolbar.addButton(
+ new ToolbarButton("View tasks", new ButtonListenerAdapter()
+ {
+ public void onClick(Button button, EventObject e)
+ {
+ }
+ })
+ );
+
+ taskPanel.setBottomToolbar(bottomToolbar);
+ teaserPanel.add(taskPanel);
+
+ // ----------------------------------
+
+ HelpPanel commentPanel = new HelpPanel(200, 180, "Leave a comment");
+ commentPanel.setIconCls("bpm-comment-icon");
+ commentPanel.setContent("Users can leave comments about processes and process instances" +
+ " in particular. This teaser will launch the comment form/list view");
+
+ Toolbar bottomToolbar2 = new Toolbar();
+ bottomToolbar2.addFill();
+ bottomToolbar2.addButton(
+ new ToolbarButton("View/Add comments", new ButtonListenerAdapter()
+ {
+ public void onClick(Button button, EventObject e)
+ {
+ }
+ })
+ );
+
+ commentPanel.setBottomToolbar(bottomToolbar2);
+ teaserPanel.add(commentPanel);
+ // ----------------------------------
+
this.add(rightPanel, new ColumnLayoutData(0.7) );
- this.add(leftPanel , new ColumnLayoutData(0.3) );
+ this.add(teaserPanel, new ColumnLayoutData(0.3) );
}
public String getEditorId()
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/TeaserPanel.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/TeaserPanel.java 2008-08-21 08:42:58 UTC (rev 1950)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/TeaserPanel.java 2008-08-21 09:20:29 UTC (rev 1951)
@@ -35,7 +35,7 @@
super();
setPaddings(10,0,0,5);
- setLayout(new VerticalLayout(10));
+ setLayout(new VerticalLayout(20));
setHideBorders(true);
setFrame(false);
setBorder(false);
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/console.css
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/console.css 2008-08-21 08:42:58 UTC (rev 1950)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/console.css 2008-08-21 09:20:29 UTC (rev 1951)
@@ -57,6 +57,7 @@
.bpm-help-panel {
background-color:#F0F0F0;
font-family: sans-serif;
+ font-size: small;
}
.bpm-help-icon {
@@ -87,3 +88,7 @@
background-image: url( images/icons/13.png)
}
+.bpm-comment-icon {
+ background-image: url( images/icons/27.png)
+}
+
Added: jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/icons/27.png
===================================================================
(Binary files differ)
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/icons/27.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 8 months
JBoss JBPM SVN: r1950 - in jbpm3/trunk/modules/gwt-console/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: 2008-08-21 04:42:58 -0400 (Thu, 21 Aug 2008)
New Revision: 1950
Modified:
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricView.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/BarChart.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/ListView.java
Log:
Process instances details form added
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricView.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricView.java 2008-08-21 08:28:04 UTC (rev 1949)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricView.java 2008-08-21 08:42:58 UTC (rev 1950)
@@ -25,7 +25,7 @@
import com.gwtext.client.widgets.form.FieldSet;
import com.gwtext.client.widgets.form.FormPanel;
import com.gwtext.client.widgets.form.TextField;
-import com.googlecode.gchart.client.GChart;
+import com.gwtext.client.core.Position;
import org.jboss.bpm.console.client.ConsoleView;
import org.jboss.bpm.console.client.model.DAOFactory;
import org.jboss.bpm.console.client.model.ProcessDefinition;
@@ -81,18 +81,20 @@
//create the form
FormPanel formPanel = new FormPanel();
+ formPanel.setLabelAlign(Position.LEFT);
+ formPanel.setWidth(UIConstants.MAIN_EDITOR_PANEL_WIDTH);
formPanel.setHeader(false);
formPanel.setFrame(false);
formPanel.setPaddings(5, 5, 5, 0);
- formPanel.setWidth(450);
- formPanel.setLabelWidth(120);
+ formPanel.setLabelWidth(120);
//create first collapsible fieldset with checkbox
FieldSet fieldSet = new FieldSet();
fieldSet.setCheckboxToggle(false);
- fieldSet.setFrame(true);
fieldSet.setTitle("Process metrics");
fieldSet.setCollapsed(false);
+ fieldSet.setAutoHeight(true);
+ fieldSet.setBorder(false);
//add fields to the User FieldSet
TextField name = new TextField("Process Definition Name", "name", 210);
@@ -134,7 +136,7 @@
private double[] deriveFixture(ProcessInstancePerformance perf)
{
double avg = -1;
- double min= 0;
+ double min= -1;
double max = -1;
double sum = -1;
@@ -145,10 +147,11 @@
{
Long k = (Long)keys.next();
Double v = (Double)metrics.get(k);
+
+ if(min==-1) min = v.longValue();
if(v.longValue()>max) max = v.longValue();
else if(v.longValue()<=min) min = v.longValue();
- else if(min==-1) min = v.longValue();
sum += v.longValue();
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java 2008-08-21 08:28:04 UTC (rev 1949)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java 2008-08-21 08:42:58 UTC (rev 1950)
@@ -24,6 +24,19 @@
import org.jboss.bpm.console.client.ConsoleView;
import org.jboss.bpm.console.client.model.ProcessDefinition;
import org.jboss.bpm.console.client.widgets.EditorView;
+import org.jboss.bpm.console.client.widgets.UIConstants;
+import com.gwtext.client.widgets.form.FieldSet;
+import com.gwtext.client.widgets.form.TextField;
+import com.gwtext.client.widgets.form.DateField;
+import com.gwtext.client.widgets.form.FormPanel;
+import com.gwtext.client.widgets.PaddedPanel;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.grid.RowSelectionModel;
+import com.gwtext.client.widgets.grid.event.RowSelectionListenerAdapter;
+import com.gwtext.client.widgets.layout.ColumnLayoutData;
+import com.gwtext.client.core.Position;
+import com.gwtext.client.core.Function;
+import com.gwtext.client.data.Record;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -41,10 +54,78 @@
this.setId(ProcessInstanceEditor.ID+"."+proc.getName());
parent = proc;
+
+ // ---------------
+
ProcessInstanceList list = new ProcessInstanceList(
proc, "Process Instances", view
);
- this.add( list );
+
+ this.add(list);
+
+ // ---------------
+
+ Panel panel = new Panel();
+ panel.setBorder(false);
+ panel.setFrame(false);
+ panel.setPaddings(10);
+
+ // ---------------
+
+ final FormPanel formPanel = new FormPanel();
+ formPanel.setLabelAlign(Position.LEFT);
+ formPanel.setWidth(UIConstants.MAIN_EDITOR_PANEL_WIDTH);
+ formPanel.setHeader(false);
+ formPanel.setFrame(false);
+ formPanel.setPaddings(5, 5, 5, 0);
+ formPanel.setLabelWidth(120);
+
+ // ---------------
+
+ FieldSet fieldSet = new FieldSet();
+ fieldSet.setLabelWidth(90);
+ fieldSet.setTitle("Process Instance Details");
+ fieldSet.setAutoHeight(true);
+ fieldSet.setBorder(false);
+
+ // ---------------
+ //the field names must match the data field values from the Store
+ fieldSet.add(new TextField("Id", "instanceId", 230));
+ fieldSet.add(new TextField("Key", "key", 230));
+ fieldSet.add(new TextField("Status", "status", 230));
+ fieldSet.add(new DateField("Start Date", "start", 230));
+ fieldSet.add(new DateField("End Date", "end", 230));
+ Panel inner = new PaddedPanel(fieldSet, 0, 10, 0, 0);
+
+ formPanel.add(inner);
+
+ // ----------------
+
+ final RowSelectionModel sm = new RowSelectionModel(true);
+ sm.addListener(
+ new RowSelectionListenerAdapter()
+ {
+ public void onRowSelect(RowSelectionModel sm, int rowIndex, Record record)
+ {
+ formPanel.getForm().loadRecord(record);
+ }
+ }
+ );
+ list.getGrid().setSelectionModel(sm);
+
+ //select the first row after a little delay so that the rows are rendered
+ list.getGrid().doOnRender(
+ new Function()
+ {
+ public void execute() {
+ sm.selectFirstRow();
+ }
+ }, 10);
+
+
+ panel.add(formPanel);
+ this.add(panel);
+
}
@@ -64,3 +145,4 @@
return "bpm-instance-icon";
}
}
+
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/BarChart.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/BarChart.java 2008-08-21 08:28:04 UTC (rev 1949)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/BarChart.java 2008-08-21 08:42:58 UTC (rev 1950)
@@ -59,7 +59,7 @@
labels[iCurve] + " value=${y}"
);
- getCurve().getSymbol().setModelWidth(1.02);
+ getCurve().getSymbol().setModelWidth(0.8);
getCurve().getSymbol().setBorderColor("black");
getCurve().getSymbol().setBorderWidth(1);
for (int jGroup=0; jGroup < groupLabels.length; jGroup++)
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/ListView.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/ListView.java 2008-08-21 08:28:04 UTC (rev 1949)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/ListView.java 2008-08-21 08:42:58 UTC (rev 1950)
@@ -129,5 +129,10 @@
protected abstract void onExamine(final Integer row);
protected abstract void onDelete(final Integer row);
-
+
+
+ public GridPanel getGrid()
+ {
+ return grid;
+ }
}
17 years, 8 months
JBoss JBPM SVN: r1949 - in jbossbpm/spec/trunk/modules: ri/src/main/java/org/jboss/bpm/ri/client and 3 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-08-21 04:28:04 -0400 (Thu, 21 Aug 2008)
New Revision: 1949
Removed:
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/client/RunnableToken.java
jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/cts/process/ProcessStartTest.java
Modified:
jbossbpm/spec/trunk/modules/dialects/api10/src/test/java/org/jboss/bpm/dialect/api10/include/ProcessIncludeTest.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/client/ExecutionManagerImpl.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/InclusiveGatewayImpl.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/ParallelGatewayImpl.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/TokenExecutorImpl.java
jbossbpm/spec/trunk/modules/ri/src/test/java/org/jboss/bpm/runtime/ExecutionManagerTest.java
Log:
Fix parallel token creation
Modified: jbossbpm/spec/trunk/modules/dialects/api10/src/test/java/org/jboss/bpm/dialect/api10/include/ProcessIncludeTest.java
===================================================================
--- jbossbpm/spec/trunk/modules/dialects/api10/src/test/java/org/jboss/bpm/dialect/api10/include/ProcessIncludeTest.java 2008-08-21 07:28:15 UTC (rev 1948)
+++ jbossbpm/spec/trunk/modules/dialects/api10/src/test/java/org/jboss/bpm/dialect/api10/include/ProcessIncludeTest.java 2008-08-21 08:28:04 UTC (rev 1949)
@@ -23,9 +23,10 @@
// $Id$
-import org.jboss.bpm.ProcessTimeoutException;
import org.jboss.bpm.client.ProcessManager;
+import org.jboss.bpm.model.Message;
import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.Property;
import org.jboss.bpm.test.DefaultEngineTestCase;
/**
@@ -36,21 +37,18 @@
*/
public class ProcessIncludeTest extends DefaultEngineTestCase
{
-
+ /**
+ * Test the the process contains the message definition from the include
+ */
public void testInclude() throws Exception
{
ProcessManager pm = ProcessManager.locateProcessManager();
Process proc = pm.createProcess(getResourceURL("include/proc-api10.xml"));
- proc.startProcess();
- try
- {
- proc.waitForEnd(500);
- fail("ProcessTimeoutException expected");
- }
- catch (ProcessTimeoutException ex)
- {
- // expected
- }
+ Message procMsg = proc.getMessage("FooMsg");
+ assertNotNull(procMsg);
+
+ Property prop = procMsg.getProperty("foo");
+ assertEquals("bar", prop.getValue());
}
}
Modified: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/client/ExecutionManagerImpl.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/client/ExecutionManagerImpl.java 2008-08-21 07:28:15 UTC (rev 1948)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/client/ExecutionManagerImpl.java 2008-08-21 08:28:04 UTC (rev 1949)
@@ -74,17 +74,26 @@
@Override
public void startProcess(Process proc, Attachments att)
{
+ // Prepare the process for start
+ startProcessPrepare(proc);
+
// Get the None Start Event if there is one and start the initial flow
StartEvent start = getNoneStartEvent(proc);
- if (start == null)
- startProcessPrepare(proc);
- else
+ if (start != null)
+ {
+ if (proc.getProcessStatus() == ProcessStatus.Active)
+ throw new IllegalStateException("Cannot start an already active process");
+
startProcessInternal(start, att);
+ }
}
@Override
public void startProcess(StartEvent start, Attachments att)
{
+ // Prepare the process for start
+ startProcessPrepare(start.getProcess());
+
startProcessInternal(start, att);
}
@@ -104,9 +113,6 @@
RuntimeProcess rtProc = getRuntimeProcess(proc, false);
boolean startProcessThread = (rtProc == null);
- // Prepare for start
- startProcessPrepare(proc);
-
// Create initial Token
TokenImpl initialToken = new TokenImpl(att);
InitialFlow initialFlow = new InitialFlow(start);
Deleted: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/client/RunnableToken.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/client/RunnableToken.java 2008-08-21 07:28:15 UTC (rev 1948)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/client/RunnableToken.java 2008-08-21 08:28:04 UTC (rev 1949)
@@ -1,150 +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.jboss.bpm.ri.client;
-
-// $Id$
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.bpm.model.ConnectingObject;
-import org.jboss.bpm.model.FlowObject;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.Process.ProcessStatus;
-import org.jboss.bpm.ri.model.impl.FlowObjectImpl;
-import org.jboss.bpm.ri.model.impl.ProcessImpl;
-import org.jboss.bpm.ri.runtime.DelegatingToken;
-import org.jboss.bpm.ri.runtime.MutableToken;
-import org.jboss.bpm.ri.runtime.RuntimeProcess;
-import org.jboss.bpm.runtime.HandlerSupport;
-import org.jboss.bpm.runtime.SignalHandler;
-import org.jboss.bpm.runtime.Token;
-import org.jboss.bpm.runtime.TokenExecutor;
-import org.jboss.bpm.runtime.Token.TokenStatus;
-
-/**
- * The RunnableToken implements the logic to move the token from one FlowObject to the next.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public class RunnableToken implements Runnable
-{
- // provide logging
- private static final Log log = LogFactory.getLog(RunnableToken.class);
-
- private RuntimeProcess rtProc;
- private MutableToken token;
-
- public RunnableToken(RuntimeProcess rtProc, MutableToken token)
- {
- this.rtProc = rtProc;
- this.token = token;
- }
-
- public Token getToken()
- {
- return token;
- }
-
- public void run()
- {
- TokenExecutor tokenExecutor = rtProc.getTokenExecutor();
- Process proc = rtProc.getProcess();
- try
- {
- ConnectingObject flow = token.getFlow();
- if (flow == null)
- throw new IllegalStateException("Cannot obtain initial flow");
-
- TokenStatus tokStatus = token.getTokenStatus();
- ProcessStatus procStatus = proc.getProcessStatus();
- while (procStatus == ProcessStatus.Active && tokStatus == TokenStatus.Started)
- {
- flow = token.getFlow();
-
- // Get the target and its handlers
- FlowObjectImpl targetFlowObject = (FlowObjectImpl)flow.getTargetRef();
- SignalHandler sigHandler = getSignalHandler(targetFlowObject);
-
- // Synchronize execution on the target FlowObject
- synchronized (targetFlowObject)
- {
- try
- {
- // Execute the FlowObject
- sigHandler.throwEnterSignal();
-
- // Create a Token that includes properties from the current Activity
- DelegatingToken delToken = new DelegatingToken(token);
-
- // Execute the target FlowObject
- targetFlowObject.execute(delToken);
-
- // Transfer the token to the FlowHandler
- targetFlowObject.executeFlowHandler(tokenExecutor, delToken);
- }
- catch (RuntimeException rte)
- {
- log.error("Process error", rte);
- targetFlowObject.reset();
- throw rte;
- }
- finally
- {
- sigHandler.throwExitSignal();
- }
-
- tokStatus = token.getTokenStatus();
- procStatus = proc.getProcessStatus();
- }
- }
- }
- catch (RuntimeException rte)
- {
- log.error("Process aborted: " + proc, rte);
- ((ProcessImpl)proc).setRuntimeException(rte);
- tokenExecutor.destroy(token);
- }
- finally
- {
- if (token.getTokenStatus() != TokenStatus.Suspended)
- tokenExecutor.destroy(token);
- }
- }
-
- private SignalHandler getSignalHandler(FlowObject target)
- {
- HandlerSupport handlerSupport = getHandlerSupport(target);
- SignalHandler handler = handlerSupport.getSignalHandler();
- if (handler == null)
- throw new IllegalStateException("Cannot obtain signal handler from: " + target);
-
- return handler;
- }
-
- private HandlerSupport getHandlerSupport(FlowObject fo)
- {
- if (fo instanceof HandlerSupport == false)
- throw new IllegalStateException("Flow object does not implement handler support: " + fo);
- return (HandlerSupport)fo;
- }
-}
\ No newline at end of file
Modified: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/InclusiveGatewayImpl.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/InclusiveGatewayImpl.java 2008-08-21 07:28:15 UTC (rev 1948)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/InclusiveGatewayImpl.java 2008-08-21 08:28:04 UTC (rev 1949)
@@ -72,32 +72,38 @@
{
FlowObject sourceRef = token.getFlow().getSourceRef();
log.debug("Propagate token comming from: " + sourceRef);
-
+
// Get the applicable gates
List<Gate> applicableGates = getApplicableGates(token);
log.debug("applicableGates: " + applicableGates);
-
- // Destroy the incomming token if there are
+
+ // Destroy the incomming token if there are
// more than one applicable gates
if (applicableGates.size() > 1)
tokenExecutor.destroy(token);
-
- for (Gate aux : applicableGates)
+
+ if (applicableGates.size() == 1)
{
- SequenceFlow outFlow = aux.getOutgoingSequenceFlow();
- if (applicableGates.size() == 1)
+ SequenceFlow outFlow = applicableGates.get(0).getOutgoingSequenceFlow();
+ tokenExecutor.move(token, outFlow);
+ }
+ else
+ {
+ List<Token> outTokens = new ArrayList<Token>();
+ for (Gate aux : applicableGates)
{
- tokenExecutor.move(token, outFlow);
+ SequenceFlow outFlow = aux.getOutgoingSequenceFlow();
+ Token outToken = token.copyToken();
+ tokenExecutor.create(outToken, outFlow);
+ outTokens.add(outToken);
}
- else
+ for (Token outToken : outTokens)
{
- Token outToken = token.copyToken();
- tokenExecutor.create(outToken, outFlow);
tokenExecutor.start(outToken);
}
}
}
-
+
// Get applicable gates which' condition evaluates to TRUE
// Fall back to the default gate if there is one
// Choke if there is no applicable gate
Modified: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/ParallelGatewayImpl.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/ParallelGatewayImpl.java 2008-08-21 07:28:15 UTC (rev 1948)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/ParallelGatewayImpl.java 2008-08-21 08:28:04 UTC (rev 1949)
@@ -23,7 +23,9 @@
//$Id$
+import java.util.ArrayList;
import java.util.HashSet;
+import java.util.List;
import java.util.Set;
import org.apache.commons.logging.Log;
@@ -109,13 +111,18 @@
if (outToken != null)
{
// Start a copy of the outgoing token for every gate
+ List<Token> outTokens = new ArrayList<Token>();
for(Gate gate : getGates())
{
SequenceFlow outFlow = gate.getOutgoingSequenceFlow();
- Token copyToken = outToken.copyToken();
- tokenExecutor.create(copyToken, outFlow);
- tokenExecutor.start(copyToken);
+ outToken = outToken.copyToken();
+ tokenExecutor.create(outToken, outFlow);
+ outTokens.add(outToken);
}
+ for (Token auxToken : outTokens)
+ {
+ tokenExecutor.start(auxToken);
+ }
// Destroy the received tokens
for (Token auxToken : receivedTokens)
Modified: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/TokenExecutorImpl.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/TokenExecutorImpl.java 2008-08-21 07:28:15 UTC (rev 1948)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/TokenExecutorImpl.java 2008-08-21 08:28:04 UTC (rev 1949)
@@ -98,7 +98,7 @@
mutableToken.setFlow(initialFlow);
log.debug("Create Token: " + token);
-
+
RunnableToken rtToken = new RunnableToken(rtProc, mutableToken);
runnableTokens.put(token.getTokenID(), rtToken);
}
@@ -254,40 +254,36 @@
}
// Notify Process on token termination
- terminateToken(proc, false);
+ terminateToken(proc);
}
catch (RuntimeException rte)
{
log.error("Process aborted: " + proc, rte);
((ProcessImpl)proc).setRuntimeException(rte);
+ log.debug("Terminate all suspended tokens");
+ Set<String> keySet = new HashSet<String>(runnableTokens.keySet());
+ for (String tokID : keySet)
+ {
+ RunnableToken rtTok = runnableTokens.get(tokID);
+ Token auxToken = rtTok.getToken();
+ if (auxToken.getTokenStatus() == TokenStatus.Suspended)
+ tokenExecutor.destroy(auxToken);
+ }
+
// Notify Process on token termination
- terminateToken(proc, true);
+ terminateToken(proc);
}
}
- private void terminateToken(Process proc, boolean allTokens)
+ private void terminateToken(Process proc)
{
// Destroy the token if not already done
synchronized (runnableTokens)
{
- if (allTokens)
- {
- log.debug("Terminate all tokens: " + runnableTokens);
- Set<String> keySet = new HashSet<String>(runnableTokens.keySet());
- for (String tokID : keySet)
- {
- RunnableToken rtTok = runnableTokens.get(tokID);
- Token auxToken = rtTok.getToken();
- tokenExecutor.destroy(auxToken);
- }
- }
- else
- {
- TokenStatus status = token.getTokenStatus();
- if (status != TokenStatus.Suspended && status != TokenStatus.Destroyed)
- tokenExecutor.destroy(token);
- }
+ TokenStatus status = token.getTokenStatus();
+ if (status != TokenStatus.Suspended && status != TokenStatus.Destroyed)
+ tokenExecutor.destroy(token);
}
// Notify the runtime process
Modified: jbossbpm/spec/trunk/modules/ri/src/test/java/org/jboss/bpm/runtime/ExecutionManagerTest.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/test/java/org/jboss/bpm/runtime/ExecutionManagerTest.java 2008-08-21 07:28:15 UTC (rev 1948)
+++ jbossbpm/spec/trunk/modules/ri/src/test/java/org/jboss/bpm/runtime/ExecutionManagerTest.java 2008-08-21 08:28:04 UTC (rev 1949)
@@ -26,6 +26,7 @@
import org.jboss.bpm.ProcessTimeoutException;
import org.jboss.bpm.client.ExecutionManager;
import org.jboss.bpm.client.ProcessManager;
+import org.jboss.bpm.client.SignalListener;
import org.jboss.bpm.client.SignalManager;
import org.jboss.bpm.model.EventBuilder;
import org.jboss.bpm.model.Process;
@@ -45,6 +46,9 @@
*/
public class ExecutionManagerTest extends DefaultEngineTestCase
{
+ /**
+ * Test the normal sequence flow
+ */
public void testSequenceFlow() throws Exception
{
ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
@@ -62,6 +66,9 @@
assertNull("Process should be unregistered", pm.getProcessByID(proc.getID()));
}
+ /**
+ * Test restart of the proces after completion
+ */
public void testRestartSequenceFlow() throws Exception
{
ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
@@ -84,11 +91,14 @@
assertNull("Process should be unregistered", pm.getProcessByID(proc.getID()));
}
+ /**
+ * Test process aboertion after RTE in Task
+ */
public void testTaskRuntimeException() throws Exception
{
ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
procBuilder.addProcess(getName()).addStartEvent("Start").addSequenceFlow("Task");
- procBuilder.addTask("Task").addExecutionHandler(TaskHandler.class).addSequenceFlow("End").addEndEvent("End");
+ procBuilder.addTask("Task").addExecutionHandler(ThrowHandler.class).addSequenceFlow("End").addEndEvent("End");
Process proc = procBuilder.getProcess();
ExecutionManager em = ExecutionManager.locateExecutionManager();
@@ -111,6 +121,9 @@
assertNull("Process should be unregistered", pm.getProcessByID(proc.getID()));
}
+ /**
+ * Test proces start from SignalStartEvent
+ */
public void testStartSignal() throws Exception
{
ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
@@ -132,6 +145,9 @@
assertNull("Process should be unregistered", pm.getProcessByID(proc.getID()));
}
+ /**
+ * Test proces timeout with no start signal
+ */
public void testStartSignalTimeout() throws Exception
{
ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
@@ -160,8 +176,45 @@
assertNull("Process should be unregistered", pm.getProcessByID(proc.getID()));
}
+ public void testStartTwice() throws Exception
+ {
+ ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ procBuilder.addProcess(getName()).addStartEvent("Start").addSequenceFlow("TaskA").
+ addTask("TaskA").addSequenceFlow("End").addEndEvent("End");
+ final Process proc = procBuilder.getProcess();
+
+ class TestSignalListener implements SignalListener
+ {
+ RuntimeException signalException;
+
+ public void catchSignal(Signal signal)
+ {
+ if (signal.getSignalType() == SignalType.SYSTEM_TASK_ENTER)
+ {
+ try
+ {
+ proc.startProcess();
+ fail("Cannot start process twice");
+ }
+ catch (RuntimeException rte)
+ {
+ signalException = rte;
+ }
+ }
+ }
+ }
+ TestSignalListener sigListener = new TestSignalListener();
+ SignalManager sm = SignalManager.locateSignalManager();
+ sm.addSignalListener(getName(), sigListener);
+
+ proc.startProcess();
+ proc.waitForEnd();
+
+ assertNotNull("Signal Exception expected", sigListener.signalException);
+ }
+
@SuppressWarnings("serial")
- public static class TaskHandler implements ExecutionHandler
+ public static class ThrowHandler implements ExecutionHandler
{
public void execute(Token token)
{
Deleted: jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/cts/process/ProcessStartTest.java
===================================================================
--- jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/cts/process/ProcessStartTest.java 2008-08-21 07:28:15 UTC (rev 1948)
+++ jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/cts/process/ProcessStartTest.java 2008-08-21 08:28:04 UTC (rev 1949)
@@ -1,110 +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.jboss.bpm.cts.process;
-
-// $Id$
-
-import java.util.List;
-
-import javax.management.ObjectName;
-
-import org.jboss.bpm.client.SignalListener;
-import org.jboss.bpm.client.SignalManager;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.model.Signal.SignalType;
-import org.jboss.bpm.test.DefaultEngineTestCase;
-
-/**
- * Test the process start opertaions
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public class ProcessStartTest extends DefaultEngineTestCase
-{
- private RuntimeException startException;
-
- public void testStartProcessReturn() throws Exception
- {
- Process proc = getProcess();
- ObjectName procID = proc.getID();
- assertEquals(procID, proc.startProcess());
- proc.waitForEnd();
- }
-
- public void testStartTwice() throws Exception
- {
- startException = null;
-
- final Process proc = getProcess();
- SignalListener signalListener = new SignalListener()
- {
- public void catchSignal(Signal signal)
- {
- if (signal.getSignalType() == SignalType.SYSTEM_TASK_ENTER)
- {
- try
- {
- proc.startProcess();
- fail("Cannot start process twice");
- }
- catch (RuntimeException rte)
- {
- startException = rte;
- }
- }
- }
- };
- SignalManager sm = SignalManager.locateSignalManager();
- sm.addSignalListener(getName(), signalListener);
-
- proc.startProcess();
- proc.waitForEnd();
-
- assertNotNull("Start exception expected", startException);
- }
-
- public void testProcessRestart() throws Exception
- {
- Process proc = getProcess();
-
- proc.startProcess();
- proc.waitForEnd();
-
- proc.startProcess();
- proc.waitForEnd();
-
- List<Signal> signals = getSignals(SignalType.SYSTEM_END_EVENT_EXIT);
- assertEquals(2, signals.size());
- }
-
- private Process getProcess()
- {
- ProcessBuilder builder = ProcessBuilderFactory.newInstance().newProcessBuilder();
- Process proc = builder.addProcess(getName()).addStartEvent("Start").addSequenceFlow("TaskA").
- addTask("TaskA").addSequenceFlow("End").addEndEvent("End").getProcess();
- return proc;
- }
-}
17 years, 8 months
JBoss JBPM SVN: r1948 - jbpm3/trunk/modules/enterprise/src/main/java/org/jbpm/scheduler/ejbtimer.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2008-08-21 03:28:15 -0400 (Thu, 21 Aug 2008)
New Revision: 1948
Modified:
jbpm3/trunk/modules/enterprise/src/main/java/org/jbpm/scheduler/ejbtimer/EntitySchedulerService.java
Log:
added session flush after saving job: JBPM-1620
Modified: jbpm3/trunk/modules/enterprise/src/main/java/org/jbpm/scheduler/ejbtimer/EntitySchedulerService.java
===================================================================
--- jbpm3/trunk/modules/enterprise/src/main/java/org/jbpm/scheduler/ejbtimer/EntitySchedulerService.java 2008-08-21 05:15:18 UTC (rev 1947)
+++ jbpm3/trunk/modules/enterprise/src/main/java/org/jbpm/scheduler/ejbtimer/EntitySchedulerService.java 2008-08-21 07:28:15 UTC (rev 1948)
@@ -7,6 +7,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.hibernate.Session;
import org.jbpm.JbpmContext;
import org.jbpm.JbpmException;
import org.jbpm.db.JobSession;
@@ -22,6 +23,7 @@
private static final long serialVersionUID = 1L;
JobSession jobSession;
+ Session session;
LocalTimerEntityHome timerEntityHome;
public EntitySchedulerService(LocalTimerEntityHome timerEntityHome) {
@@ -31,12 +33,14 @@
"instantiation of the EjbSchedulerService requires a current JbpmContext");
}
this.jobSession = jbpmContext.getJobSession();
+ this.session = jbpmContext.getSession();
this.timerEntityHome = timerEntityHome;
}
public void createTimer(Timer timer) {
log.debug("creating timer " + timer);
jobSession.saveJob(timer);
+ session.flush();
try {
LocalTimerEntity timerEntity = timerEntityHome.findByPrimaryKey(new Long(timer.getId()));
timerEntity.createTimer(timer);
17 years, 8 months
JBoss JBPM SVN: r1947 - in jbpm3/trunk/modules/jpdl/core: src/main/java/org/jbpm/db and 3 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2008-08-21 01:15:18 -0400 (Thu, 21 Aug 2008)
New Revision: 1947
Modified:
jbpm3/trunk/modules/jpdl/core/pom.xml
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/db/JobSession.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/job/Timer.java
jbpm3/trunk/modules/jpdl/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml
jbpm3/trunk/modules/jpdl/core/src/test/java/org/jbpm/job/executor/TimerOnTimerDbTest.java
Log:
fixed process end race condition in TimerOnTimerDbTest; removed that test from the test suite exclusions: JBPM-1135
replaced individual timer elimination in JobSession.cancelTimersByName with bulk delete
enabled timer bulk deletes to remove repeating timers immediately instead of having the timer delete itself on the next repetition
Modified: jbpm3/trunk/modules/jpdl/core/pom.xml
===================================================================
--- jbpm3/trunk/modules/jpdl/core/pom.xml 2008-08-20 22:09:12 UTC (rev 1946)
+++ jbpm3/trunk/modules/jpdl/core/pom.xml 2008-08-21 05:15:18 UTC (rev 1947)
@@ -195,7 +195,6 @@
<exclude>org/jbpm/persistence/db/PersistenceConfigurationTest.java</exclude>
<exclude>org/jbpm/scheduler/exe/UnsafeSessionUsageTest.java</exclude>
<exclude>org/jbpm/seam/SeamPageFlowTest.java</exclude>
- <exclude>org/jbpm/job/executor/TimerOnTimerDbTest.java</exclude>
</excludes>
</configuration>
</plugin>
Modified: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/db/JobSession.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/db/JobSession.java 2008-08-20 22:09:12 UTC (rev 1946)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/db/JobSession.java 2008-08-21 05:15:18 UTC (rev 1947)
@@ -153,23 +153,12 @@
public void cancelTimersByName(String name, Token token) {
try {
- // the bulk delete was replaced with a query and session.deletes on
- // the retrieved elements to prevent stale object exceptions.
- // With a bulk delete, the hibernate session is not aware and gives a problem
- // if a later session.delete doesn't return 1.
- Query query = session.getNamedQuery("JobSession.getTimersByName");
+ log.debug("canceling timers by name " + name + " for " + token);
+ Query query = session.getNamedQuery("JobSession.deleteTimersByName");
query.setString("name", name);
query.setParameter("token", token);
- List results = query.list();
- if (results!=null) {
- Iterator iter = results.iterator();
- while (iter.hasNext()) {
- Timer timer = (Timer) iter.next();
- log.debug("deleting "+timer+" for '"+token+"'");
- session.delete(timer);
- }
- }
-
+ int entityCount = query.executeUpdate();
+ log.debug(entityCount+" timers by name " + name + " for " + token + " were deleted");
} catch (Exception e) {
log.error(e);
throw new JbpmException("couldn't cancel timers by name '"+name+"' for '"+token+"'", e);
Modified: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/job/Timer.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/job/Timer.java 2008-08-20 22:09:12 UTC (rev 1946)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/job/Timer.java 2008-08-21 05:15:18 UTC (rev 1947)
@@ -35,11 +35,6 @@
}
public boolean execute(JbpmContext jbpmContext) throws Exception {
- if (processInstance.hasEnded()) {
- // happens when a repeating timer is blocked at the time the process instance ends
- return true;
- }
-
ExecutionContext executionContext = new ExecutionContext(token);
executionContext.setTimer(this);
Modified: jbpm3/trunk/modules/jpdl/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml 2008-08-20 22:09:12 UTC (rev 1946)
+++ jbpm3/trunk/modules/jpdl/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml 2008-08-21 05:15:18 UTC (rev 1947)
@@ -304,14 +304,14 @@
where job.token = :token
]]>
</query>
-
- <query name="JobSession.getTimersByName">
+
+ <query name="JobSession.deleteTimersByName">
<![CDATA[
- select timer
- from org.jbpm.job.Timer timer
+ delete from org.jbpm.job.Timer timer
where timer.token = :token
and timer.name = :name
- and timer.lockOwner is null
+ and (timer.lockOwner is null
+ or timer.repeat is not null)
]]>
</query>
@@ -319,7 +319,8 @@
<![CDATA[
delete from org.jbpm.job.Timer timer
where timer.processInstance = :processInstance
- and timer.lockOwner is null
+ and (timer.lockOwner is null
+ or timer.repeat is not null)
]]>
</query>
Modified: jbpm3/trunk/modules/jpdl/core/src/test/java/org/jbpm/job/executor/TimerOnTimerDbTest.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/test/java/org/jbpm/job/executor/TimerOnTimerDbTest.java 2008-08-20 22:09:12 UTC (rev 1946)
+++ jbpm3/trunk/modules/jpdl/core/src/test/java/org/jbpm/job/executor/TimerOnTimerDbTest.java 2008-08-21 05:15:18 UTC (rev 1947)
@@ -23,6 +23,11 @@
import java.io.Serializable;
+import javax.transaction.Status;
+import javax.transaction.Synchronization;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.jbpm.db.AbstractDbTestCase;
import org.jbpm.graph.def.Event;
import org.jbpm.graph.def.ProcessDefinition;
@@ -41,24 +46,23 @@
ProcessInstance processInstance = jbpmContext.newProcessInstanceForUpdate("timerTest");
processInstance.getContextInstance().setVariable("testCallback", new TestCallback());
processInstance.signal();
- long tokenId = processInstance.getRootToken().getId();
+ assertEquals("firstNode", processInstance.getRootToken().getNode().getName());
commitAndCloseSession();
startJobExecutor();
try {
TestCallback.waitForEvent(Event.EVENTTYPE_NODE_ENTER);
beginSessionTransaction();
- assertEquals("firstNode", jbpmContext.loadToken(tokenId).getNode().getName());
+ long processInstanceId = processInstance.getId();
+ assertEquals("secondNode", jbpmContext.loadProcessInstance(processInstanceId)
+ .getRootToken()
+ .getNode()
+ .getName());
commitAndCloseSession();
- TestCallback.waitForEvent(Event.EVENTTYPE_NODE_ENTER);
- beginSessionTransaction();
- assertEquals("secondNode", jbpmContext.loadToken(tokenId).getNode().getName());
- commitAndCloseSession();
-
TestCallback.waitForEvent(Event.EVENTTYPE_PROCESS_END);
beginSessionTransaction();
- assertTrue(jbpmContext.loadToken(tokenId).hasEnded());
+ assertTrue(jbpmContext.loadProcessInstance(processInstanceId).hasEnded());
}
finally {
stopJobExecutor();
@@ -68,55 +72,63 @@
public static class TestCallback implements Serializable {
private static final long serialVersionUID = 1L;
+ private static final Log log = LogFactory.getLog(TestCallback.class);
public void processStart() {
- synchronized (Event.EVENTTYPE_PROCESS_START) {
- Event.EVENTTYPE_PROCESS_START.notify();
- }
+ registerNotification(Event.EVENTTYPE_PROCESS_START);
}
public void processEnd() {
- synchronized (Event.EVENTTYPE_PROCESS_END) {
- Event.EVENTTYPE_PROCESS_END.notify();
- }
+ registerNotification(Event.EVENTTYPE_PROCESS_END);
}
public void nodeEnter() {
- synchronized (Event.EVENTTYPE_NODE_ENTER) {
- Event.EVENTTYPE_NODE_ENTER.notify();
- }
+ registerNotification(Event.EVENTTYPE_NODE_ENTER);
}
public void nodeLeave() {
- synchronized (Event.EVENTTYPE_NODE_LEAVE) {
- Event.EVENTTYPE_NODE_LEAVE.notify();
- }
+ registerNotification(Event.EVENTTYPE_NODE_LEAVE);
}
public void taskCreate() {
- synchronized (Event.EVENTTYPE_TASK_CREATE) {
- Event.EVENTTYPE_TASK_CREATE.notify();
- }
+ registerNotification(Event.EVENTTYPE_TASK_CREATE);
}
public void taskEnd() {
- synchronized (Event.EVENTTYPE_TASK_END) {
- Event.EVENTTYPE_TASK_END.notify();
- }
+ registerNotification(Event.EVENTTYPE_TASK_END);
}
public void timerCreate() {
- synchronized (Event.EVENTTYPE_TIMER_CREATE) {
- Event.EVENTTYPE_TIMER_CREATE.notify();
- }
+ registerNotification(Event.EVENTTYPE_TIMER_CREATE);
}
public void timer() {
- synchronized (Event.EVENTTYPE_TIMER) {
- Event.EVENTTYPE_TIMER.notify();
- }
+ registerNotification(Event.EVENTTYPE_TIMER);
}
+ private static void registerNotification(final String event) {
+ Synchronization notification = new Synchronization() {
+
+ public void beforeCompletion() {
+ // nothing to do here
+ }
+
+ public void afterCompletion(int status) {
+ if (status == Status.STATUS_COMMITTED) {
+ log.info("delivering " + event + " notification");
+ synchronized (event) {
+ event.notify();
+ }
+ }
+ }
+
+ };
+ jbpmConfiguration.getCurrentJbpmContext()
+ .getSession()
+ .getTransaction()
+ .registerSynchronization(notification);
+ }
+
public static void waitForEvent(String event) {
synchronized (event) {
try {
17 years, 8 months
JBoss JBPM SVN: r1946 - in jbossbpm/spec/trunk/modules: dialects/api10/src/test/resources/include and 5 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-08-20 18:09:12 -0400 (Wed, 20 Aug 2008)
New Revision: 1946
Modified:
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java
jbossbpm/spec/trunk/modules/dialects/api10/src/test/resources/include/proc-api10.xml
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/client/ExecutionManagerImpl.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/ProcessImpl.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/RuntimeProcessImpl.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/SequenceFlowImpl.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/TokenExecutorImpl.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/TokenImpl.java
jbossbpm/spec/trunk/modules/ri/src/test/java/org/jboss/bpm/runtime/ExecutionManagerTest.java
jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/cts/engine/EngineShutdownTest.java
Log:
Fix sync issues
Modified: jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java
===================================================================
--- jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java 2008-08-20 19:39:22 UTC (rev 1945)
+++ jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java 2008-08-20 22:09:12 UTC (rev 1946)
@@ -41,7 +41,6 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.EngineShutdownException;
import org.jboss.bpm.model.Process;
-import org.jboss.bpm.runtime.Attachments;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -157,31 +156,6 @@
procs.remove(proc.getID());
}
- /**
- * Start a Process with a given process id.
- */
- public void startProcess(ObjectName procID, Attachments att)
- {
- if (ProcessEngine.locateProcessEngine().isPrepareForShutdown())
- throw new EngineShutdownException("Cannot start a process while engine is shutting down");
-
- Process proc = getProcessStrict(procID);
- ExecutionManager exm = ExecutionManager.locateExecutionManager();
- exm.startProcess(proc, att);
- }
-
- private Process getProcessStrict(ObjectName procID)
- {
- Process proc = getProcessByID(procID);
- if (proc == null)
- {
- IllegalStateException rte = new IllegalStateException("Cannot obtain process: " + procID);
- log.error(rte);
- throw rte;
- }
- return proc;
- }
-
private String getNamespaceURI(InputStream inStream)
{
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
Modified: jbossbpm/spec/trunk/modules/dialects/api10/src/test/resources/include/proc-api10.xml
===================================================================
--- jbossbpm/spec/trunk/modules/dialects/api10/src/test/resources/include/proc-api10.xml 2008-08-20 19:39:22 UTC (rev 1945)
+++ jbossbpm/spec/trunk/modules/dialects/api10/src/test/resources/include/proc-api10.xml 2008-08-20 22:09:12 UTC (rev 1946)
@@ -1,4 +1,4 @@
-<ns2:process name="testReceiveTaskWithMessageRef" xmlns:ns2="urn:bpm.jboss:pdl-0.1">
+<ns2:process name="ProcessIncludeTest" xmlns:ns2="urn:bpm.jboss:pdl-0.1">
<include namespace="urn:bpm.jboss:pdl-0.1" location="include/proc-include-api10.xml"/>
<start>
<seqflow to="A" />
Modified: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/client/ExecutionManagerImpl.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/client/ExecutionManagerImpl.java 2008-08-20 19:39:22 UTC (rev 1945)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/client/ExecutionManagerImpl.java 2008-08-20 22:09:12 UTC (rev 1946)
@@ -48,7 +48,6 @@
import org.jboss.bpm.ri.model.impl.ProcessImpl;
import org.jboss.bpm.ri.model.impl.RuntimeProcessImpl;
import org.jboss.bpm.ri.model.impl.SequenceFlowImpl;
-import org.jboss.bpm.ri.model.impl.TokenExecutorImpl;
import org.jboss.bpm.ri.runtime.DelegatingToken;
import org.jboss.bpm.ri.runtime.MutableToken;
import org.jboss.bpm.ri.runtime.RuntimeProcess;
@@ -77,7 +76,9 @@
{
// Get the None Start Event if there is one and start the initial flow
StartEvent start = getNoneStartEvent(proc);
- if (start != null)
+ if (start == null)
+ startProcessPrepare(proc);
+ else
startProcessInternal(start, att);
}
@@ -100,27 +101,21 @@
}
Process proc = start.getProcess();
- ProcessImpl procImpl = (ProcessImpl)proc;
RuntimeProcess rtProc = getRuntimeProcess(proc, false);
boolean startProcessThread = (rtProc == null);
+
+ // Prepare for start
+ startProcessPrepare(proc);
- // Reset the process if already terminated
- if (isProcessTerminated(proc))
- procImpl.resetProcess();
+ // Create initial Token
+ TokenImpl initialToken = new TokenImpl(att);
+ InitialFlow initialFlow = new InitialFlow(start);
+ initialToken.setFlow(initialFlow);
- ProcessStatus procStatus = proc.getProcessStatus();
- if (procStatus != ProcessStatus.Ready)
- throw new IllegalStateException("Cannot start process in state: " + procStatus);
-
- // Register the process if needed
- ProcessManager pm = ProcessManager.locateProcessManager();
- if (pm.getProcessByID(proc.getID()) == null)
- pm.registerProcess(proc);
-
+ // Register the initial Token
rtProc = getRuntimeProcess(proc, true);
TokenExecutor tokenExecutor = rtProc.getTokenExecutor();
- TokenImpl initialToken = new TokenImpl(att);
- tokenExecutor.create(initialToken, new InitialFlow(start));
+ tokenExecutor.create(initialToken, initialFlow);
// Start a new process thread
if (startProcessThread)
@@ -152,6 +147,23 @@
tokenExecutor.start(initialToken);
}
+ private void startProcessPrepare(Process proc)
+ {
+ // Reset the process if already terminated
+ ProcessImpl procImpl = (ProcessImpl)proc;
+ if (isProcessTerminated(proc))
+ procImpl.resetProcess();
+
+ ProcessStatus procStatus = proc.getProcessStatus();
+ if (procStatus != ProcessStatus.Ready && procStatus != ProcessStatus.Active)
+ throw new IllegalStateException("Cannot start process in state: " + procStatus);
+
+ // Register the process if needed
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ if (pm.getProcessByID(proc.getID()) == null)
+ pm.registerProcess(proc);
+ }
+
public ProcessStatus waitForEnd(Process proc)
{
return waitForEndInternal(proc, 0);
@@ -219,6 +231,16 @@
{
log.warn(ex);
}
+ finally
+ {
+ // Unregister the process if not done already
+ // this could happen when the Process never received a start signal
+ // and then we get here because of a ProcessTimeoutException
+ ProcessManager procManager = ProcessManager.locateProcessManager();
+ if (procManager.getProcessByID(proc.getID()) != null)
+ procManager.unregisterProcess(proc);
+ }
+
status = proc.getProcessStatus();
return status;
@@ -253,8 +275,7 @@
rtProcess = runtimeProcesses.get(proc.getID());
if (rtProcess == null && createNew)
{
- TokenExecutorImpl tokenExecutor = new TokenExecutorImpl();
- rtProcess = new RuntimeProcessImpl(proc, tokenExecutor);
+ rtProcess = new RuntimeProcessImpl(proc);
runtimeProcesses.put(proc.getID(), rtProcess);
}
}
@@ -333,7 +354,9 @@
}
log.debug("End execution thread [proc=" + procName + ",status=" + proc.getProcessStatus() + "]");
- procImpl.setProcessStatus(ProcessStatus.Completed);
+
+ if (proc.getProcessStatus() == ProcessStatus.Active)
+ procImpl.setProcessStatus(ProcessStatus.Completed);
}
}
finally
@@ -342,13 +365,13 @@
synchronized (proc)
{
+ ProcessManager procManager = ProcessManager.locateProcessManager();
+ procManager.unregisterProcess(proc);
+ runtimeProcesses.remove(procID);
+
// Notify that the process has now ended
log.debug("Notify: " + proc);
proc.notifyAll();
-
- ProcessManager procManager = ProcessManager.locateProcessManager();
- procManager.unregisterProcess(proc);
- runtimeProcesses.remove(procID);
}
}
}
Modified: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/ProcessImpl.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/ProcessImpl.java 2008-08-20 19:39:22 UTC (rev 1945)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/ProcessImpl.java 2008-08-20 22:09:12 UTC (rev 1946)
@@ -31,10 +31,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.bpm.BPMException;
import org.jboss.bpm.InvalidProcessException;
import org.jboss.bpm.NotImplementedException;
-import org.jboss.bpm.ProcessTimeoutException;
+import org.jboss.bpm.client.ExecutionManager;
import org.jboss.bpm.client.ProcessManager;
import org.jboss.bpm.model.Assignment;
import org.jboss.bpm.model.Constants;
@@ -48,7 +47,6 @@
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.Property;
import org.jboss.bpm.model.StartEvent;
-import org.jboss.bpm.ri.client.ProcessManagerImpl;
import org.jboss.bpm.runtime.Attachments;
import org.jboss.util.id.UID;
@@ -199,30 +197,21 @@
public ObjectName startProcess()
{
- return startProcess(null);
+ return startProcessInternal(null);
}
public ObjectName startProcess(Attachments att)
{
- ProcessManager pm = ProcessManager.locateProcessManager();
+ return startProcessInternal(att);
+ }
- if (status == ProcessStatus.Aborted || status == ProcessStatus.Completed)
- resetProcess();
-
- if (status != ProcessStatus.Ready)
- throw new IllegalStateException("Cannot start process in state: " + status);
-
- // Register the process if needed
- if (pm.getProcessByID(getID()) == null)
- {
- ProcessManagerImpl pmImpl = (ProcessManagerImpl)pm;
- pmImpl.registerProcess(this);
- }
-
- pm.startProcess(getID(), att);
+ private ObjectName startProcessInternal(Attachments att)
+ {
+ ExecutionManager em = ExecutionManager.locateExecutionManager();
+ em.startProcess(this, att);
return getID();
}
-
+
public void resetProcess()
{
log.debug("Reset process: " + this);
@@ -252,69 +241,10 @@
*/
private ProcessStatus waitForEndInternal(long timeout)
{
- if (status != ProcessStatus.Ready && status != ProcessStatus.Active)
- throw new IllegalStateException("Cannot wait for process in state: " + status);
-
- // Wait a little for the process to end
- boolean forever = (timeout < 1);
- long now = System.currentTimeMillis();
- long until = now + timeout;
- try
- {
- while (forever || now < until)
- {
- synchronized (this)
- {
- if (isProcessTerminated())
- {
- if (runtimeException != null)
- {
- throw new BPMException("Process aborted", runtimeException);
- }
- else
- {
- break;
- }
- }
-
- // Start waiting to get notified
- long waitTimeout = forever ? 0 : until - now;
- log.debug("Start Waiting: " + waitTimeout + "ms");
- wait(waitTimeout);
- log.debug("Stop Waiting");
- }
- now = System.currentTimeMillis();
- }
-
- // Throw timeout exception if it took too long
- if (isProcessTerminated() == false)
- {
- RuntimeException rte = new ProcessTimeoutException("Process timeout after " + timeout + "ms for: " + getID());
- setRuntimeException(rte);
- log.error(rte);
- throw rte;
- }
- }
- catch (InterruptedException ex)
- {
- log.warn(ex);
- }
- finally
- {
- // Unregister the process
- ProcessManager procManager = ProcessManager.locateProcessManager();
- if (procManager.getProcessByID(getID()) != null)
- procManager.unregisterProcess(this);
- }
-
- return status;
+ ExecutionManager em = ExecutionManager.locateExecutionManager();
+ return em.waitForEnd(this, timeout);
}
- private synchronized boolean isProcessTerminated()
- {
- return status == ProcessStatus.Cancelled || status == ProcessStatus.Completed || status == ProcessStatus.Aborted;
- }
-
public FlowObject getFlowObject(String name)
{
if (name == null)
@@ -461,6 +391,6 @@
public String toString()
{
- return "Process[" + getName() + ",status=" + status + "]";
+ return "Process[" + getName() + ",status=" + getProcessStatus() + "]";
}
}
\ No newline at end of file
Modified: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/RuntimeProcessImpl.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/RuntimeProcessImpl.java 2008-08-20 19:39:22 UTC (rev 1945)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/RuntimeProcessImpl.java 2008-08-20 22:09:12 UTC (rev 1946)
@@ -35,22 +35,27 @@
*/
public class RuntimeProcessImpl implements RuntimeProcess
{
- private Process process;
+ private Process proc;
private TokenExecutor tokenExecutor;
- public RuntimeProcessImpl(Process process, TokenExecutor tokenExecutor)
+ public RuntimeProcessImpl(Process proc)
{
- this.process = process;
- this.tokenExecutor = tokenExecutor;
+ this.proc = proc;
+ this.tokenExecutor = new TokenExecutorImpl(this);
}
public Process getProcess()
{
- return process;
+ return proc;
}
public TokenExecutor getTokenExecutor()
{
return tokenExecutor;
}
+
+ public String toString()
+ {
+ return "RuntimeProcess[" + proc.getName() + ",status=" + proc.getProcessStatus() + "]";
+ }
}
\ No newline at end of file
Modified: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/SequenceFlowImpl.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/SequenceFlowImpl.java 2008-08-20 19:39:22 UTC (rev 1945)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/SequenceFlowImpl.java 2008-08-20 22:09:12 UTC (rev 1946)
@@ -66,8 +66,15 @@
{
FlowObject sourceRef = getSourceRef();
FlowObject targetRef = getTargetRef();
- String srcName = (sourceRef.getName() != null ? sourceRef.getName() : sourceRef.getID().getCanonicalName());
- String tarName = (targetRef.getName() != null ? targetRef.getName() : targetRef.getID().getCanonicalName());
+
+ String srcName = null;
+ if (sourceRef != null)
+ srcName = (sourceRef.getName() != null ? sourceRef.getName() : sourceRef.getID().getCanonicalName());
+
+ String tarName = null;
+ if (targetRef != null)
+ tarName = (targetRef.getName() != null ? targetRef.getName() : targetRef.getID().getCanonicalName());
+
return "SequenceFlow[" + srcName + "->" + tarName + "]";
}
}
\ No newline at end of file
Modified: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/TokenExecutorImpl.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/TokenExecutorImpl.java 2008-08-20 19:39:22 UTC (rev 1945)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/TokenExecutorImpl.java 2008-08-20 22:09:12 UTC (rev 1946)
@@ -60,14 +60,15 @@
// provide logging
private static final Log log = LogFactory.getLog(TokenExecutorImpl.class);
- public interface StartCallback
- {
- void start(Token token);
- }
-
+ private RuntimeProcess rtProc;
private ExecutorService executor = Executors.newCachedThreadPool();
private Map<String, RunnableToken> runnableTokens = new HashMap<String, RunnableToken>();
+ public TokenExecutorImpl(RuntimeProcess rtProc)
+ {
+ this.rtProc = rtProc;
+ }
+
public Set<Token> getRunnableTokens()
{
synchronized (runnableTokens)
@@ -93,9 +94,11 @@
synchronized (runnableTokens)
{
MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setTokenStatus(TokenStatus.Created);
mutableToken.setFlow(initialFlow);
- Process proc = initialFlow.getTargetRef().getProcess();
- RuntimeProcess rtProc = new RuntimeProcessImpl(proc, this);
+
+ log.debug("Create Token: " + token);
+
RunnableToken rtToken = new RunnableToken(rtProc, mutableToken);
runnableTokens.put(token.getTokenID(), rtToken);
}
@@ -109,6 +112,10 @@
if (procStatus != ProcessStatus.Ready && procStatus != ProcessStatus.Active)
throw new IllegalStateException("Cannot start token to process in state: " + procStatus);
+ log.debug("Sart Token: " + token);
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setTokenStatus(TokenStatus.Started);
+
RunnableToken rtToken = runnableTokens.get(token.getTokenID());
executor.submit(rtToken);
}
@@ -190,10 +197,12 @@
class RunnableToken implements Runnable
{
private RuntimeProcess rtProc;
+ private TokenExecutor tokenExecutor;
private MutableToken token;
public RunnableToken(RuntimeProcess rtProc, MutableToken token)
{
+ this.tokenExecutor = rtProc.getTokenExecutor();
this.rtProc = rtProc;
this.token = token;
}
@@ -206,7 +215,6 @@
public void run()
{
Process proc = rtProc.getProcess();
- TokenExecutor tokenExecutor = rtProc.getTokenExecutor();
try
{
ConnectingObject flow = token.getFlow();
@@ -244,24 +252,45 @@
procStatus = proc.getProcessStatus();
}
}
-
+
// Notify Process on token termination
- terminateToken(proc, tokenExecutor);
+ terminateToken(proc, false);
}
catch (RuntimeException rte)
{
log.error("Process aborted: " + proc, rte);
((ProcessImpl)proc).setRuntimeException(rte);
-
+
// Notify Process on token termination
- terminateToken(proc, tokenExecutor);
+ terminateToken(proc, true);
}
}
- // Remove the token from the list of runnable tokens then notify the process
- private void terminateToken(Process proc, TokenExecutor tokenExecutor)
+ private void terminateToken(Process proc, boolean allTokens)
{
- tokenExecutor.destroy(token);
+ // Destroy the token if not already done
+ synchronized (runnableTokens)
+ {
+ if (allTokens)
+ {
+ log.debug("Terminate all tokens: " + runnableTokens);
+ Set<String> keySet = new HashSet<String>(runnableTokens.keySet());
+ for (String tokID : keySet)
+ {
+ RunnableToken rtTok = runnableTokens.get(tokID);
+ Token auxToken = rtTok.getToken();
+ tokenExecutor.destroy(auxToken);
+ }
+ }
+ else
+ {
+ TokenStatus status = token.getTokenStatus();
+ if (status != TokenStatus.Suspended && status != TokenStatus.Destroyed)
+ tokenExecutor.destroy(token);
+ }
+ }
+
+ // Notify the runtime process
synchronized (rtProc)
{
log.debug("Notify: " + rtProc);
@@ -285,5 +314,11 @@
throw new IllegalStateException("Flow object does not implement handler support: " + fo);
return (HandlerSupport)fo;
}
+
+ @Override
+ public String toString()
+ {
+ return token.toString();
+ }
}
}
\ No newline at end of file
Modified: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/TokenImpl.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/TokenImpl.java 2008-08-20 19:39:22 UTC (rev 1945)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/TokenImpl.java 2008-08-20 22:09:12 UTC (rev 1946)
@@ -23,7 +23,6 @@
//$Id$
-import org.jboss.bpm.model.FlowObject;
import org.jboss.bpm.model.InputSet;
import org.jboss.bpm.model.OutputSet;
import org.jboss.bpm.model.SequenceFlow;
@@ -143,7 +142,6 @@
public String toString()
{
- FlowObject fo = getFlow().getTargetRef();
- return "[fo=" + fo + ",ctx=" + getExecutionContext() + "]";
+ return "[sf=" + getFlow() + ",status=" + getTokenStatus() + ",ctx=" + getExecutionContext() + "]";
}
}
\ No newline at end of file
Modified: jbossbpm/spec/trunk/modules/ri/src/test/java/org/jboss/bpm/runtime/ExecutionManagerTest.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/test/java/org/jboss/bpm/runtime/ExecutionManagerTest.java 2008-08-20 19:39:22 UTC (rev 1945)
+++ jbossbpm/spec/trunk/modules/ri/src/test/java/org/jboss/bpm/runtime/ExecutionManagerTest.java 2008-08-20 22:09:12 UTC (rev 1946)
@@ -23,11 +23,18 @@
// $Id$
+import org.jboss.bpm.ProcessTimeoutException;
import org.jboss.bpm.client.ExecutionManager;
+import org.jboss.bpm.client.ProcessManager;
+import org.jboss.bpm.client.SignalManager;
+import org.jboss.bpm.model.EventBuilder;
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.ProcessBuilder;
import org.jboss.bpm.model.ProcessBuilderFactory;
+import org.jboss.bpm.model.Signal;
+import org.jboss.bpm.model.EventDetail.EventDetailType;
import org.jboss.bpm.model.Process.ProcessStatus;
+import org.jboss.bpm.model.Signal.SignalType;
import org.jboss.bpm.test.DefaultEngineTestCase;
/**
@@ -47,11 +54,14 @@
ExecutionManager em = ExecutionManager.locateExecutionManager();
em.startProcess(proc, null);
-
+
ProcessStatus status = em.waitForEnd(proc);
assertEquals(ProcessStatus.Completed, status);
+
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ assertNull("Process should be unregistered", pm.getProcessByID(proc.getID()));
}
-
+
public void testRestartSequenceFlow() throws Exception
{
ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
@@ -61,13 +71,101 @@
ExecutionManager em = ExecutionManager.locateExecutionManager();
em.startProcess(proc, null);
-
+
ProcessStatus status = em.waitForEnd(proc);
assertEquals(ProcessStatus.Completed, status);
+
+ em.startProcess(proc, null);
+
+ status = em.waitForEnd(proc);
+ assertEquals(ProcessStatus.Completed, status);
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ assertNull("Process should be unregistered", pm.getProcessByID(proc.getID()));
+ }
+
+ public void testTaskRuntimeException() throws Exception
+ {
+ ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ procBuilder.addProcess(getName()).addStartEvent("Start").addSequenceFlow("Task");
+ procBuilder.addTask("Task").addExecutionHandler(TaskHandler.class).addSequenceFlow("End").addEndEvent("End");
+ Process proc = procBuilder.getProcess();
+
+ ExecutionManager em = ExecutionManager.locateExecutionManager();
em.startProcess(proc, null);
+
+ try
+ {
+ em.waitForEnd(proc);
+ fail("RuntimeException expected");
+ }
+ catch (RuntimeException rte)
+ {
+ // expected
+ }
+
+ ProcessStatus status = proc.getProcessStatus();
+ assertEquals(ProcessStatus.Aborted, status);
- status = em.waitForEnd(proc);
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ assertNull("Process should be unregistered", pm.getProcessByID(proc.getID()));
+ }
+
+ public void testStartSignal() throws Exception
+ {
+ ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ EventBuilder eventBuilder = procBuilder.addProcess(getName()).addStartEvent("Start");
+ eventBuilder.addEventDetail(EventDetailType.Signal).addSignalRef(SignalType.USER_SIGNAL, "A");
+ procBuilder.addSequenceFlow("Task").addTask("Task").addSequenceFlow("End").addEndEvent("End");
+ Process proc = procBuilder.getProcess();
+
+ ExecutionManager em = ExecutionManager.locateExecutionManager();
+ em.startProcess(proc, null);
+
+ SignalManager sm = SignalManager.locateSignalManager();
+ sm.throwSignal(getName(), new Signal(getName(), SignalType.USER_SIGNAL, "A"));
+
+ ProcessStatus status = em.waitForEnd(proc);
assertEquals(ProcessStatus.Completed, status);
+
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ assertNull("Process should be unregistered", pm.getProcessByID(proc.getID()));
}
+
+ public void testStartSignalTimeout() throws Exception
+ {
+ ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ EventBuilder eventBuilder = procBuilder.addProcess(getName()).addStartEvent("Start");
+ eventBuilder.addEventDetail(EventDetailType.Signal).addSignalRef(SignalType.USER_SIGNAL, "A");
+ procBuilder.addSequenceFlow("Task").addTask("Task").addSequenceFlow("End").addEndEvent("End");
+ Process proc = procBuilder.getProcess();
+
+ ExecutionManager em = ExecutionManager.locateExecutionManager();
+ em.startProcess(proc, null);
+
+ try
+ {
+ em.waitForEnd(proc, 500);
+ fail("ProcessTimeoutException expected");
+ }
+ catch (ProcessTimeoutException rte)
+ {
+ // expected
+ }
+
+ ProcessStatus status = proc.getProcessStatus();
+ assertEquals(ProcessStatus.Aborted, status);
+
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ assertNull("Process should be unregistered", pm.getProcessByID(proc.getID()));
+ }
+
+ @SuppressWarnings("serial")
+ public static class TaskHandler implements ExecutionHandler
+ {
+ public void execute(Token token)
+ {
+ throw new RuntimeException("test");
+ }
+ };
}
Modified: jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/cts/engine/EngineShutdownTest.java
===================================================================
--- jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/cts/engine/EngineShutdownTest.java 2008-08-20 19:39:22 UTC (rev 1945)
+++ jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/cts/engine/EngineShutdownTest.java 2008-08-20 22:09:12 UTC (rev 1946)
@@ -99,11 +99,11 @@
Process proc = pm.createProcess(procXML);
assertNotNull("Process expected", proc);
- // Try to create a Process during shutdown
+ // Try to start a Process during shutdown
try
{
engine.prepareForShutdown();
- pm.startProcess(proc.getID(), null);
+ proc.startProcess(null);
fail("EngineShutdownException expected");
}
catch (EngineShutdownException ex)
17 years, 8 months
JBoss JBPM SVN: r1945 - in jbossbpm/spec/trunk/modules: api/src/main/java/org/jboss/bpm/model and 6 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-08-20 15:39:22 -0400 (Wed, 20 Aug 2008)
New Revision: 1945
Added:
jbossbpm/spec/trunk/modules/ri/src/test/java/org/jboss/bpm/runtime/
jbossbpm/spec/trunk/modules/ri/src/test/java/org/jboss/bpm/runtime/ExecutionManagerTest.java
jbossbpm/spec/trunk/modules/ri/src/test/resources/
jbossbpm/spec/trunk/modules/ri/src/test/resources/jbpm-beans.xml
jbossbpm/spec/trunk/modules/ri/src/test/resources/log4j.xml
Modified:
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/client/ExecutionManagerImpl.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/ProcessImpl.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/RuntimeProcessImpl.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/TokenExecutorImpl.java
Log:
WIP
Modified: jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java
===================================================================
--- jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java 2008-08-20 19:01:24 UTC (rev 1944)
+++ jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java 2008-08-20 19:39:22 UTC (rev 1945)
@@ -28,6 +28,7 @@
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.StartEvent;
+import org.jboss.bpm.model.Process.ProcessStatus;
import org.jboss.bpm.runtime.Attachments;
/**
@@ -38,8 +39,7 @@
*/
public abstract class ExecutionManager
{
- private int maxProcessThreads = 10;
- private ExecutorService procExecutor = Executors.newFixedThreadPool(maxProcessThreads);
+ private ExecutorService procExecutor = Executors.newCachedThreadPool();
// Hide public constructor
protected ExecutionManager()
@@ -78,4 +78,20 @@
* @param att The Attachments in the ExecutionContext
*/
public abstract void startProcess(StartEvent start, Attachments att);
+
+ /**
+ * All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event.
+ * The Process will be in a running state until all Tokens are consumed.
+ * <p/>
+ * This method until the process ends without timeout.
+ */
+ public abstract ProcessStatus waitForEnd(Process proc);
+
+ /**
+ * All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event.
+ * The Process will be in a running state until all Tokens are consumed.
+ * <p/>
+ * This method until the process ends with a given timeout.
+ */
+ public abstract ProcessStatus waitForEnd(Process proc, long timeout);
}
Modified: jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java
===================================================================
--- jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java 2008-08-20 19:01:24 UTC (rev 1944)
+++ jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java 2008-08-20 19:39:22 UTC (rev 1945)
@@ -61,12 +61,12 @@
/**
* Get the process state
*/
- Process.ProcessStatus getProcessStatus();
+ ProcessStatus getProcessStatus();
/**
* Get the process type
*/
- Process.ProcessType getProcessType();
+ ProcessType getProcessType();
/**
* Get the list of flow objects
@@ -86,7 +86,7 @@
/**
* One or more Performers MAY be entered. The Performers attribute defines the resource that will be responsible for
- * the Process. The Performers entry could be in the form of a specific individual, a group, an organization role or
+ * the The Performers entry could be in the form of a specific individual, a group, an organization role or
* position, or an organization.
*/
List<String> getPerformers();
@@ -98,17 +98,17 @@
List<Assignment> getAssignments();
/**
- * The InputSets attribute defines the data requirements for input to the Process. Zero or more InputSets MAY be
+ * The InputSets attribute defines the data requirements for input to the Zero or more InputSets MAY be
* defined. Each Input set is sufficient to allow the Process to be performed (if it has first been instantiated by
* the appropriate signal arriving from an incoming Sequence Flow)
*/
List<InputSet> getInputSets();
/**
- * The OutputSets attribute defines the data requirements for output from the Process. Zero or more OutputSets MAY be
+ * The OutputSets attribute defines the data requirements for output from the Zero or more OutputSets MAY be
* defined. At the completion of the Process, only one of the OutputSets may be produced--It is up to the
* implementation of the Process to determine which set will be produced. However, the IORules attribute MAY indicate
- * a relationship between an OutputSet and an InputSet that started the Process.
+ * a relationship between an OutputSet and an InputSet that started the
*/
List<OutputSet> getOutputSets();
Modified: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/client/ExecutionManagerImpl.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/client/ExecutionManagerImpl.java 2008-08-20 19:01:24 UTC (rev 1944)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/client/ExecutionManagerImpl.java 2008-08-20 19:39:22 UTC (rev 1945)
@@ -25,13 +25,14 @@
import java.util.HashMap;
import java.util.Map;
-import java.util.concurrent.ExecutorService;
import javax.management.ObjectName;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.bpm.BPMException;
import org.jboss.bpm.InvalidProcessException;
+import org.jboss.bpm.ProcessTimeoutException;
import org.jboss.bpm.client.ExecutionManager;
import org.jboss.bpm.client.ProcessManager;
import org.jboss.bpm.client.SignalManager;
@@ -48,7 +49,6 @@
import org.jboss.bpm.ri.model.impl.RuntimeProcessImpl;
import org.jboss.bpm.ri.model.impl.SequenceFlowImpl;
import org.jboss.bpm.ri.model.impl.TokenExecutorImpl;
-import org.jboss.bpm.ri.model.impl.TokenExecutorImpl.StartCallback;
import org.jboss.bpm.ri.runtime.DelegatingToken;
import org.jboss.bpm.ri.runtime.MutableToken;
import org.jboss.bpm.ri.runtime.RuntimeProcess;
@@ -73,69 +73,163 @@
private Map<ObjectName, RuntimeProcess> runtimeProcesses = new HashMap<ObjectName, RuntimeProcess>();
@Override
- public void startProcess(final Process proc, final Attachments att)
+ public void startProcess(Process proc, Attachments att)
{
- // Setup the StartCallback that will be called from the Token Executor
- final RuntimeProcessImpl rtProc = new RuntimeProcessImpl(proc);
- final RunnableProcess runnableProcess = new RunnableProcess(rtProc);
- runtimeProcesses.put(proc.getID(), rtProc);
+ // Get the None Start Event if there is one and start the initial flow
+ StartEvent start = getNoneStartEvent(proc);
+ if (start != null)
+ startProcessInternal(start, att);
+ }
+
+ @Override
+ public void startProcess(StartEvent start, Attachments att)
+ {
+ startProcessInternal(start, att);
+ }
+
+ private synchronized void startProcessInternal(StartEvent start, Attachments att)
+ {
+ @SuppressWarnings("serial")
+ class InitialFlow extends SequenceFlowImpl
+ {
+ InitialFlow(StartEvent start)
+ {
+ super(start.getName());
+ setTargetRef(start);
+ }
+ }
- StartCallback startCallback = new StartCallback()
+ Process proc = start.getProcess();
+ ProcessImpl procImpl = (ProcessImpl)proc;
+ RuntimeProcess rtProc = getRuntimeProcess(proc, false);
+ boolean startProcessThread = (rtProc == null);
+
+ // Reset the process if already terminated
+ if (isProcessTerminated(proc))
+ procImpl.resetProcess();
+
+ ProcessStatus procStatus = proc.getProcessStatus();
+ if (procStatus != ProcessStatus.Ready)
+ throw new IllegalStateException("Cannot start process in state: " + procStatus);
+
+ // Register the process if needed
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ if (pm.getProcessByID(proc.getID()) == null)
+ pm.registerProcess(proc);
+
+ rtProc = getRuntimeProcess(proc, true);
+ TokenExecutor tokenExecutor = rtProc.getTokenExecutor();
+ TokenImpl initialToken = new TokenImpl(att);
+ tokenExecutor.create(initialToken, new InitialFlow(start));
+
+ // Start a new process thread
+ if (startProcessThread)
{
- public void start(Token token)
+ RunnableProcess runnable = new RunnableProcess(rtProc);
+ getProcessExecutor().execute(runnable);
+ synchronized (proc)
{
- // Process start time assignments
- startTimeAssignments(proc, token);
+ while (proc.getProcessStatus() != ProcessStatus.Active)
+ {
+ try
+ {
+ log.debug("Wait to become Active " + proc);
+ proc.wait();
+ log.debug("Notified " + proc);
+ }
+ catch (InterruptedException ex)
+ {
+ log.error(ex);
+ }
+ }
+ }
+ }
+
+ // Do the start time assignments
+ startTimeAssignments(proc, initialToken);
+
+ // Start the initial token
+ tokenExecutor.start(initialToken);
+ }
- // Execute the Process through the ExecutorService
- ExecutorService processExecutor = getProcessExecutor();
- log.debug("Execute runnableProcess");
- processExecutor.execute(runnableProcess);
- //new Thread(runnableProcess).start();
+ public ProcessStatus waitForEnd(Process proc)
+ {
+ return waitForEndInternal(proc, 0);
+ }
+ public ProcessStatus waitForEnd(Process proc, long timeout)
+ {
+ return waitForEndInternal(proc, timeout);
+ }
+
+ /**
+ * Wait for the Process to end. All Tokens that are generated at the Start Event for that Process must eventually
+ * arrive at an End Event. The Process will be in a running state until all Tokens are consumed. If the process was
+ * aborted this method throws the causing RuntimeException if avaialable.
+ */
+ private ProcessStatus waitForEndInternal(Process proc, long timeout)
+ {
+ ProcessImpl procImpl = (ProcessImpl)proc;
+
+ ProcessStatus status = proc.getProcessStatus();
+ if (status == ProcessStatus.None)
+ throw new IllegalStateException("Cannot wait for process in state: " + status);
+
+ // Wait a little for the process to end
+ boolean forever = (timeout < 1);
+ long now = System.currentTimeMillis();
+ long until = now + timeout;
+ try
+ {
+ while (forever || now < until)
+ {
synchronized (proc)
{
- // Wait for the process to become active
- while (proc.getProcessStatus() == ProcessStatus.Ready)
+ if (isProcessTerminated(proc))
{
- try
+ if (procImpl.getRuntimeException() != null)
{
- log.debug("Wait for process to become active");
- proc.wait();
- log.debug("Notified: " + proc);
+ throw new BPMException("Process aborted", procImpl.getRuntimeException());
}
- catch (InterruptedException ex)
+ else
{
- log.error(ex);
+ break;
}
}
+
+ // Start waiting to get notified
+ long waitTimeout = forever ? 0 : until - now;
+ log.debug("Wait for " + waitTimeout + "ms on " + proc);
+ proc.wait(waitTimeout);
+ log.debug("Notified " + proc);
}
+ now = System.currentTimeMillis();
}
- };
- rtProc.setTokenExecutor(new TokenExecutorImpl(rtProc, startCallback));
-
- // Get the None Start Event if there is one and start the initial flow
- StartEvent start = getNoneStartEvent(proc);
- if (start != null)
- startProcessInternal(start, att);
+
+ // Throw timeout exception if it took too long
+ if (isProcessTerminated(proc) == false)
+ {
+ RuntimeException rte = new ProcessTimeoutException("Process timeout after " + timeout + "ms for: " + proc.getID());
+ procImpl.setRuntimeException(rte);
+ log.error(rte);
+ throw rte;
+ }
+ }
+ catch (InterruptedException ex)
+ {
+ log.warn(ex);
+ }
+
+ status = proc.getProcessStatus();
+ return status;
}
-
- @Override
- public void startProcess(StartEvent start, Attachments att)
+
+ private boolean isProcessTerminated(Process proc)
{
- startProcessInternal(start, att);
+ ProcessStatus status = proc.getProcessStatus();
+ return status == ProcessStatus.Cancelled || status == ProcessStatus.Completed || status == ProcessStatus.Aborted;
}
-
- private synchronized void startProcessInternal(StartEvent start, Attachments att)
- {
- ObjectName procID = start.getProcess().getID();
- RuntimeProcess rtProc = runtimeProcesses.get(procID);
- TokenExecutor tokenExecutor = rtProc.getTokenExecutor();
- TokenImpl token = new TokenImpl(att);
- tokenExecutor.create(token, new InitialFlow(start));
- tokenExecutor.start(token);
- }
-
+
private StartEvent getNoneStartEvent(Process proc)
{
StartEvent start = null;
@@ -151,6 +245,22 @@
return start;
}
+ private RuntimeProcess getRuntimeProcess(Process proc, boolean createNew)
+ {
+ RuntimeProcess rtProcess;
+ synchronized (runtimeProcesses)
+ {
+ rtProcess = runtimeProcesses.get(proc.getID());
+ if (rtProcess == null && createNew)
+ {
+ TokenExecutorImpl tokenExecutor = new TokenExecutorImpl();
+ rtProcess = new RuntimeProcessImpl(proc, tokenExecutor);
+ runtimeProcesses.put(proc.getID(), rtProcess);
+ }
+ }
+ return rtProcess;
+ }
+
// Evaluate the Start time assignments
private void startTimeAssignments(Process proc, Token token)
{
@@ -169,20 +279,7 @@
}
}
- /**
- * The initial flow to the StartEvent
- */
- @SuppressWarnings("serial")
- class InitialFlow extends SequenceFlowImpl
- {
- InitialFlow(StartEvent start)
- {
- super(start.getName());
- setTargetRef(start);
- }
- }
-
- /**
+ /***************************************************************
* The runnable Process
*/
class RunnableProcess implements Runnable
@@ -213,24 +310,30 @@
procImpl.setProcessStatus(ProcessStatus.Active);
signalManager.throwSignal(proc.getName(), new Signal(proc.getName(), SignalType.SYSTEM_PROCESS_ENTER));
- // Notify that the Process is Active
+ // Notify that the process is now Active
+ log.debug("Notify: " + proc);
proc.notifyAll();
-
+ }
+
+ synchronized (rtProc)
+ {
// Wait until there are no more runnable tokens
while (tokenExecutor.hasRunnableTokens())
{
try
{
- log.debug("Start Waiting");
- proc.wait();
- log.debug("Stop Waiting");
+ log.debug("Wait: " + rtProc);
+ rtProc.wait();
+ log.debug("Notified: " + rtProc);
}
catch (InterruptedException ex)
{
- log.error("Executor thread interrupted");
+ log.error(ex);
}
}
+
log.debug("End execution thread [proc=" + procName + ",status=" + proc.getProcessStatus() + "]");
+ procImpl.setProcessStatus(ProcessStatus.Completed);
}
}
finally
@@ -239,16 +342,13 @@
synchronized (proc)
{
- if (proc.getProcessStatus() == ProcessStatus.Active)
- procImpl.setProcessStatus(ProcessStatus.Completed);
-
+ // Notify that the process has now ended
+ log.debug("Notify: " + proc);
+ proc.notifyAll();
+
ProcessManager procManager = ProcessManager.locateProcessManager();
procManager.unregisterProcess(proc);
runtimeProcesses.remove(procID);
-
- // Notify the Process
- log.debug("Notify Process");
- proc.notifyAll();
}
}
}
Modified: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/ProcessImpl.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/ProcessImpl.java 2008-08-20 19:01:24 UTC (rev 1944)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/ProcessImpl.java 2008-08-20 19:39:22 UTC (rev 1945)
@@ -223,7 +223,7 @@
return getID();
}
- private void resetProcess()
+ public void resetProcess()
{
log.debug("Reset process: " + this);
for (FlowObject fo : flowObjects)
Modified: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/RuntimeProcessImpl.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/RuntimeProcessImpl.java 2008-08-20 19:01:24 UTC (rev 1944)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/RuntimeProcessImpl.java 2008-08-20 19:39:22 UTC (rev 1945)
@@ -38,9 +38,10 @@
private Process process;
private TokenExecutor tokenExecutor;
- public RuntimeProcessImpl(Process process)
+ public RuntimeProcessImpl(Process process, TokenExecutor tokenExecutor)
{
this.process = process;
+ this.tokenExecutor = tokenExecutor;
}
public Process getProcess()
@@ -52,9 +53,4 @@
{
return tokenExecutor;
}
-
- public void setTokenExecutor(TokenExecutor tokenExecutor)
- {
- this.tokenExecutor = tokenExecutor;
- }
}
\ No newline at end of file
Modified: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/TokenExecutorImpl.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/TokenExecutorImpl.java 2008-08-20 19:01:24 UTC (rev 1944)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/impl/TokenExecutorImpl.java 2008-08-20 19:39:22 UTC (rev 1945)
@@ -34,13 +34,16 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.model.ConnectingObject;
+import org.jboss.bpm.model.FlowObject;
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.SequenceFlow;
import org.jboss.bpm.model.Process.ProcessStatus;
-import org.jboss.bpm.ri.client.RunnableToken;
+import org.jboss.bpm.ri.runtime.DelegatingToken;
import org.jboss.bpm.ri.runtime.MutableToken;
import org.jboss.bpm.ri.runtime.RuntimeProcess;
import org.jboss.bpm.runtime.FlowHandler;
+import org.jboss.bpm.runtime.HandlerSupport;
+import org.jboss.bpm.runtime.SignalHandler;
import org.jboss.bpm.runtime.Token;
import org.jboss.bpm.runtime.TokenExecutor;
import org.jboss.bpm.runtime.Token.TokenStatus;
@@ -61,109 +64,226 @@
{
void start(Token token);
}
-
- private RuntimeProcess rtProc;
+
private ExecutorService executor = Executors.newCachedThreadPool();
private Map<String, RunnableToken> runnableTokens = new HashMap<String, RunnableToken>();
- private StartCallback startCallback;
- public TokenExecutorImpl(RuntimeProcess rtProc, StartCallback startCallback)
- {
- this.rtProc = rtProc;
- this.startCallback = startCallback;
- }
-
public Set<Token> getRunnableTokens()
{
- Set<Token> tokenSet = new HashSet<Token>();
- for (RunnableToken rt : runnableTokens.values())
- tokenSet.add(rt.getToken());
+ synchronized (runnableTokens)
+ {
+ Set<Token> tokenSet = new HashSet<Token>();
+ for (RunnableToken rt : runnableTokens.values())
+ tokenSet.add(rt.getToken());
- return Collections.unmodifiableSet(tokenSet);
+ return Collections.unmodifiableSet(tokenSet);
+ }
}
public boolean hasRunnableTokens()
{
- return runnableTokens.size() > 0;
+ synchronized (runnableTokens)
+ {
+ return runnableTokens.size() > 0;
+ }
}
public void create(Token token, SequenceFlow initialFlow)
{
- MutableToken mutableToken = (MutableToken)token;
- mutableToken.setFlow(initialFlow);
- RunnableToken rtToken = new RunnableToken(rtProc, mutableToken);
- runnableTokens.put(token.getTokenID(), rtToken);
+ synchronized (runnableTokens)
+ {
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setFlow(initialFlow);
+ Process proc = initialFlow.getTargetRef().getProcess();
+ RuntimeProcess rtProc = new RuntimeProcessImpl(proc, this);
+ RunnableToken rtToken = new RunnableToken(rtProc, mutableToken);
+ runnableTokens.put(token.getTokenID(), rtToken);
+ }
}
public void start(Token token)
{
- Process proc = rtProc.getProcess();
- ProcessStatus procStatus = proc.getProcessStatus();
- if (procStatus != ProcessStatus.Ready && procStatus != ProcessStatus.Active)
- throw new IllegalStateException("Cannot start token to process in state: " + procStatus);
+ synchronized (runnableTokens)
+ {
+ ProcessStatus procStatus = getProcess(token).getProcessStatus();
+ if (procStatus != ProcessStatus.Ready && procStatus != ProcessStatus.Active)
+ throw new IllegalStateException("Cannot start token to process in state: " + procStatus);
- log.debug("Start Token: " + token);
- MutableToken mutableToken = (MutableToken)token;
- mutableToken.setTokenStatus(TokenStatus.Started);
-
- if (startCallback != null)
- {
- log.debug("Call start callback: " + token);
- startCallback.start(token);
- startCallback = null;
+ RunnableToken rtToken = runnableTokens.get(token.getTokenID());
+ executor.submit(rtToken);
}
-
- RunnableToken rtToken = runnableTokens.get(token.getTokenID());
- executor.submit(rtToken);
}
public void move(Token token, SequenceFlow flow)
{
- if (flow == null)
- throw new IllegalArgumentException("Flow cannot be null");
+ synchronized (runnableTokens)
+ {
+ if (flow == null)
+ throw new IllegalArgumentException("Flow cannot be null");
- MutableToken mutableToken = (MutableToken)token;
- mutableToken.setFlow(flow);
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setFlow(flow);
+ }
}
public void stop(Token token)
{
- log.debug("Stop Token: " + token);
- MutableToken mutableToken = (MutableToken)token;
- mutableToken.setTokenStatus(TokenStatus.Stoped);
+ synchronized (runnableTokens)
+ {
+ log.debug("Stop Token: " + token);
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setTokenStatus(TokenStatus.Stoped);
+ }
}
public void destroy(Token token)
{
- log.debug("Destroy Token: " + token);
- MutableToken mutableToken = (MutableToken)token;
- mutableToken.setTokenStatus(TokenStatus.Destroyed);
- runnableTokens.remove(token.getTokenID());
+ synchronized (runnableTokens)
+ {
+ log.debug("Destroy Token: " + token);
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setTokenStatus(TokenStatus.Destroyed);
+ runnableTokens.remove(token.getTokenID());
+ }
}
public String suspend(Token token)
{
- log.debug("Suspend Token: " + token);
- MutableToken mutableToken = (MutableToken)token;
- mutableToken.setTokenStatus(TokenStatus.Suspended);
- return token.getTokenID();
+ synchronized (runnableTokens)
+ {
+ log.debug("Suspend Token: " + token);
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setTokenStatus(TokenStatus.Suspended);
+ return token.getTokenID();
+ }
}
public Token activate(String tokenID)
{
- RunnableToken rtToken = runnableTokens.get(tokenID);
- if (rtToken == null)
- throw new IllegalStateException("Not a runnable token: " + tokenID);
+ synchronized (runnableTokens)
+ {
+ RunnableToken rtToken = runnableTokens.get(tokenID);
+ if (rtToken == null)
+ throw new IllegalStateException("Not a runnable token: " + tokenID);
- Token token = rtToken.getToken();
- if (token.getTokenStatus() != TokenStatus.Suspended)
- throw new IllegalStateException("Activate token in state: " + token.getTokenStatus());
+ Token token = rtToken.getToken();
+ if (token.getTokenStatus() != TokenStatus.Suspended)
+ throw new IllegalStateException("Activate token in state: " + token.getTokenStatus());
- log.debug("Activate Token: " + token);
- MutableToken mutableToken = (MutableToken)token;
- mutableToken.setTokenStatus(TokenStatus.Started);
+ log.debug("Activate Token: " + token);
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setTokenStatus(TokenStatus.Started);
- executor.submit(rtToken);
- return token;
+ executor.submit(rtToken);
+ return token;
+ }
}
+
+ private Process getProcess(Token token)
+ {
+ return token.getFlow().getTargetRef().getProcess();
+ }
+
+ /****************************************************
+ * The runnable Token
+ */
+ class RunnableToken implements Runnable
+ {
+ private RuntimeProcess rtProc;
+ private MutableToken token;
+
+ public RunnableToken(RuntimeProcess rtProc, MutableToken token)
+ {
+ this.rtProc = rtProc;
+ this.token = token;
+ }
+
+ public Token getToken()
+ {
+ return token;
+ }
+
+ public void run()
+ {
+ Process proc = rtProc.getProcess();
+ TokenExecutor tokenExecutor = rtProc.getTokenExecutor();
+ try
+ {
+ ConnectingObject flow = token.getFlow();
+ if (flow == null)
+ throw new IllegalStateException("Cannot obtain initial flow");
+
+ TokenStatus tokStatus = token.getTokenStatus();
+ ProcessStatus procStatus = proc.getProcessStatus();
+ while (procStatus == ProcessStatus.Active && tokStatus == TokenStatus.Started)
+ {
+ // Get the target and its handlers
+ FlowObject flowObject = token.getFlow().getTargetRef();
+ FlowObjectImpl flowObjectImpl = (FlowObjectImpl)flowObject;
+ SignalHandler sigHandler = getSignalHandler(flowObject);
+
+ // Synchronize execution on the target FlowObject
+ synchronized (flowObject)
+ {
+ // Throw the Enter Signal
+ sigHandler.throwEnterSignal();
+
+ // Create a Token that includes properties from the current Activity
+ DelegatingToken delegatingToken = new DelegatingToken(token);
+
+ // Execute the target FlowObject
+ flowObjectImpl.execute(delegatingToken);
+
+ // Transfer the token to the FlowHandler
+ flowObjectImpl.executeFlowHandler(tokenExecutor, delegatingToken);
+
+ // Throw the Exit Signal
+ sigHandler.throwExitSignal();
+
+ tokStatus = token.getTokenStatus();
+ procStatus = proc.getProcessStatus();
+ }
+ }
+
+ // Notify Process on token termination
+ terminateToken(proc, tokenExecutor);
+ }
+ catch (RuntimeException rte)
+ {
+ log.error("Process aborted: " + proc, rte);
+ ((ProcessImpl)proc).setRuntimeException(rte);
+
+ // Notify Process on token termination
+ terminateToken(proc, tokenExecutor);
+ }
+ }
+
+ // Remove the token from the list of runnable tokens then notify the process
+ private void terminateToken(Process proc, TokenExecutor tokenExecutor)
+ {
+ tokenExecutor.destroy(token);
+ synchronized (rtProc)
+ {
+ log.debug("Notify: " + rtProc);
+ rtProc.notifyAll();
+ }
+ }
+
+ private SignalHandler getSignalHandler(FlowObject target)
+ {
+ HandlerSupport handlerSupport = getHandlerSupport(target);
+ SignalHandler handler = handlerSupport.getSignalHandler();
+ if (handler == null)
+ throw new IllegalStateException("Cannot obtain signal handler from: " + target);
+
+ return handler;
+ }
+
+ private HandlerSupport getHandlerSupport(FlowObject fo)
+ {
+ if (fo instanceof HandlerSupport == false)
+ throw new IllegalStateException("Flow object does not implement handler support: " + fo);
+ return (HandlerSupport)fo;
+ }
+ }
}
\ No newline at end of file
Added: jbossbpm/spec/trunk/modules/ri/src/test/java/org/jboss/bpm/runtime/ExecutionManagerTest.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/test/java/org/jboss/bpm/runtime/ExecutionManagerTest.java (rev 0)
+++ jbossbpm/spec/trunk/modules/ri/src/test/java/org/jboss/bpm/runtime/ExecutionManagerTest.java 2008-08-20 19:39:22 UTC (rev 1945)
@@ -0,0 +1,73 @@
+/*
+ * 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.jboss.bpm.runtime;
+
+// $Id$
+
+import org.jboss.bpm.client.ExecutionManager;
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.ProcessBuilder;
+import org.jboss.bpm.model.ProcessBuilderFactory;
+import org.jboss.bpm.model.Process.ProcessStatus;
+import org.jboss.bpm.test.DefaultEngineTestCase;
+
+/**
+ * Test the ExecutionManager
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class ExecutionManagerTest extends DefaultEngineTestCase
+{
+ public void testSequenceFlow() throws Exception
+ {
+ ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ procBuilder.addProcess(getName()).addStartEvent("Start").addSequenceFlow("Task");
+ procBuilder.addTask("Task").addSequenceFlow("End").addEndEvent("End");
+ Process proc = procBuilder.getProcess();
+
+ ExecutionManager em = ExecutionManager.locateExecutionManager();
+ em.startProcess(proc, null);
+
+ ProcessStatus status = em.waitForEnd(proc);
+ assertEquals(ProcessStatus.Completed, status);
+ }
+
+ public void testRestartSequenceFlow() throws Exception
+ {
+ ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ procBuilder.addProcess(getName()).addStartEvent("Start").addSequenceFlow("Task");
+ procBuilder.addTask("Task").addSequenceFlow("End").addEndEvent("End");
+ Process proc = procBuilder.getProcess();
+
+ ExecutionManager em = ExecutionManager.locateExecutionManager();
+ em.startProcess(proc, null);
+
+ ProcessStatus status = em.waitForEnd(proc);
+ assertEquals(ProcessStatus.Completed, status);
+
+ em.startProcess(proc, null);
+
+ status = em.waitForEnd(proc);
+ assertEquals(ProcessStatus.Completed, status);
+ }
+}
Property changes on: jbossbpm/spec/trunk/modules/ri/src/test/java/org/jboss/bpm/runtime/ExecutionManagerTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbossbpm/spec/trunk/modules/ri/src/test/resources/jbpm-beans.xml
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/test/resources/jbpm-beans.xml (rev 0)
+++ jbossbpm/spec/trunk/modules/ri/src/test/resources/jbpm-beans.xml 2008-08-20 19:39:22 UTC (rev 1945)
@@ -0,0 +1,45 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!-- The KernelLocator -->
+ <bean name="KernelLocator" class="org.jboss.kernel.plugins.util.KernelLocator"/>
+
+ <!-- The Builder Factories -->
+ <bean name="jBPMProcessBuilderFactory" class="org.jboss.bpm.ri.model.impl.ProcessBuilderFactoryImpl"/>
+ <bean name="jBPMMessageBuilderFactory" class="org.jboss.bpm.ri.model.impl.MessageBuilderFactoryImpl"/>
+ <bean name="jBPMPropertyBuilderFactory" class="org.jboss.bpm.ri.model.impl.PropertyBuilderFactoryImpl"/>
+
+ <!-- The ProcessEngine -->
+ <bean name="jBPMProcessEngine" class="org.jboss.bpm.ri.client.ProcessEngineImpl">
+ <property name="processManager"><inject bean="jBPMProcessManager"/></property>
+ <property name="executionManager"><inject bean="jBPMExecutionManager"/></property>
+ <property name="signalManager"><inject bean="jBPMSignalManager"/></property>
+ <property name="messageManager"><inject bean="jBPMMessageManager"/></property>
+ </bean>
+
+ <!-- The Managers -->
+ <bean name="jBPMExecutionManager" class="org.jboss.bpm.ri.client.ExecutionManagerImpl"/>
+ <bean name="jBPMSignalManager" class="org.jboss.bpm.ri.client.SignalManagerImpl"/>
+ <bean name="jBPMMessageManager" class="org.jboss.bpm.ri.client.MessageManagerImpl"/>
+
+ <!-- The ProcessManager -->
+ <bean name="jBPMProcessManager" class="org.jboss.bpm.ri.client.ProcessManagerImpl">
+ <property name="dialectRegistry"><inject bean="jBPMDialectRegistry"/></property>
+ <property name="dialectHandlers">
+ <map keyClass="java.lang.String" valueClass="org.jboss.bpm.client.DialectHandler">
+ </map>
+ </property>
+ </bean>
+
+ <!-- The DialectRegistry -->
+ <bean name="jBPMDialectRegistry" class="org.jboss.bpm.client.DialectRegistry">
+ <property name="registry">
+ <map keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry><key>urn:bpm.jboss:pdl-0.1</key><value>api10</value></entry>
+ <entry><key>urn:jbpm.org:jpdl-3.2</key><value>jpdl32</value></entry>
+ <entry><key>http://stp.eclipse.org/bpmn</key><value>stp</value></entry>
+ <entry><key>http://www.wfmc.org/2008/XPDL2.1</key><value>xpdl21</value></entry>
+ </map>
+ </property>
+ </bean>
+
+</deployment>
\ No newline at end of file
Property changes on: jbossbpm/spec/trunk/modules/ri/src/test/resources/jbpm-beans.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbossbpm/spec/trunk/modules/ri/src/test/resources/log4j.xml
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/test/resources/log4j.xml (rev 0)
+++ jbossbpm/spec/trunk/modules/ri/src/test/resources/log4j.xml 2008-08-20 19:39:22 UTC (rev 1945)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <appender name="FILE" class="org.apache.log4j.FileAppender">
+ <param name="File" value="${log4j.output.dir}/test.log"/>
+ <param name="Append" value="false"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d %-5p [%c:%L] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <param name="Threshold" value="INFO" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{HH:mm:ss,SSS} [%t] %-5p %C{1} : %m%n" />
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <category name="org.jbpm">
+ <priority value="DEBUG" />
+ </category>
+
+ <category name="org.hibernate">
+ <priority value="INFO" />
+ </category>
+
+ <!-- hide optimistic locking failures -->
+ <category name="org.hibernate.event.def.AbstractFlushingEventListener">
+ <priority value="FATAL" />
+ </category>
+
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <!--appender-ref ref="CONSOLE"/-->
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Property changes on: jbossbpm/spec/trunk/modules/ri/src/test/resources/log4j.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 8 months
JBoss JBPM SVN: r1943 - in jbpm3/trunk/modules/gwt-console/war/src/main: java/org/jboss/bpm/console/client/model and 4 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-08-20 12:55:52 -0400 (Wed, 20 Aug 2008)
New Revision: 1943
Added:
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MetricsDAO.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessInstancePerformance.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockHelpDAO.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockMetricsDAO.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockProcessDefinitionDAO.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockProcessInstanceDAO.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/LineChart.java
Removed:
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockHelpDAO.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockProcessDefinitionDAO.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockProcessInstanceDAO.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/GChartExample.java
Modified:
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricEditor.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricView.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverview.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverviewEditor.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/DAOFactory.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinition.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionDAO.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/BarChart.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/UIConstants.java
jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/processSample.jpg
Log:
More metrics added
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricEditor.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricEditor.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricEditor.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -22,8 +22,21 @@
package org.jboss.bpm.console.client.metric;
import org.jboss.bpm.console.client.widgets.EditorView;
+import org.jboss.bpm.console.client.widgets.UIConstants;
+import org.jboss.bpm.console.client.widgets.TeaserPanel;
+import org.jboss.bpm.console.client.widgets.HelpPanel;
import org.jboss.bpm.console.client.model.ProcessDefinition;
import org.jboss.bpm.console.client.ConsoleView;
+import org.jboss.bpm.console.client.process.ProcessInstanceEditor;
+import org.jboss.bpm.console.client.process.ProcessInstanceListEditor;
+import com.gwtext.client.widgets.layout.ColumnLayout;
+import com.gwtext.client.widgets.layout.ColumnLayoutData;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.Toolbar;
+import com.gwtext.client.widgets.ToolbarButton;
+import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+import com.gwtext.client.core.EventObject;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -33,17 +46,55 @@
private ProcessDefinition parent;
private ConsoleView view;
+ private Panel teaserPanel;
-
- public DefinitionMetricEditor(ConsoleView view, ProcessDefinition processDefinition)
+ public DefinitionMetricEditor(final ConsoleView view, final ProcessDefinition proc)
{
super();
this.view = view;
- this.parent = processDefinition;
+ this.parent = proc;
- this.setId(MetricOverviewEditor.ID+"."+processDefinition.getName());
+ this.setId(MetricOverviewEditor.ID+"."+proc.getName());
// -----------------------------------------------
+
+ this.setLayout( new ColumnLayout() );
+ this.setWidth(UIConstants.EDITOR_PANE_WIDTH);
+
+ // -----------------------------------------------
+
+ teaserPanel = new TeaserPanel();
+
+ HelpPanel instancePanel = new HelpPanel(UIConstants.TEASER_PANEL_WIDTH, 180, "Process instances");
+ instancePanel.setIconCls("bpm-process-icon");
+
+ instancePanel.setContent(
+ "You can manage running instances through the process management editor."
+ );
+
+ Toolbar bottomToolbar = new Toolbar();
+ bottomToolbar.addFill();
+ bottomToolbar.addButton(
+ new ToolbarButton("View instances", new ButtonListenerAdapter() {
+ public void onClick(Button button, EventObject e)
+ {
+ String editorId = ProcessInstanceEditor.ID+"."+proc.getName();
+
+ if(view.hasEditorView(editorId))
+ view.showEditor(editorId);
+ else
+ view.addEditorView( new ProcessInstanceListEditor(proc, view) );
+ }
+ })
+ );
+
+ instancePanel.setBottomToolbar(bottomToolbar);
+ teaserPanel.add(instancePanel);
+
+ // -----------------------------------------------
+
+ this.add( new DefinitionMetricView(view, proc), new ColumnLayoutData(0.7));
+ this.add( teaserPanel, new ColumnLayoutData(0.3));
}
public String getEditorId()
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricView.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricView.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricView.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -22,9 +22,20 @@
package org.jboss.bpm.console.client.metric;
import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.form.FieldSet;
+import com.gwtext.client.widgets.form.FormPanel;
+import com.gwtext.client.widgets.form.TextField;
+import com.googlecode.gchart.client.GChart;
+import org.jboss.bpm.console.client.ConsoleView;
+import org.jboss.bpm.console.client.model.DAOFactory;
import org.jboss.bpm.console.client.model.ProcessDefinition;
-import org.jboss.bpm.console.client.ConsoleView;
+import org.jboss.bpm.console.client.model.ProcessInstancePerformance;
+import org.jboss.bpm.console.client.widgets.LineChart;
+import org.jboss.bpm.console.client.widgets.UIConstants;
+import java.util.Iterator;
+import java.util.Map;
+
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
@@ -33,7 +44,7 @@
private ProcessDefinition parent;
private ConsoleView view;
-
+
public DefinitionMetricView(ConsoleView view, ProcessDefinition parent)
{
super();
@@ -43,6 +54,108 @@
this.setHeader(false);
this.setBorder(false);
+ // ----------------------------------------
+
+ ProcessInstancePerformance perf =
+ DAOFactory.createMetricsDAO().getProcessInstancePerformance(parent.getId());
+
+ LineChart chart = new LineChart(
+ parent.getName() + " performance", 380, 260, perf.getInstanceMetrics(), "Instance", "t"
+ );
+
+ double[] fixture = deriveFixture(perf);
+
+ Panel chartPanel = new Panel();
+ chartPanel.setPaddings(10);
+ chartPanel.setHeader(false);
+ chartPanel.setBorder(false);
+ chartPanel.setWidth(UIConstants.EDITOR_PANE_WIDTH);
+ chartPanel.add(chart);
+
+ // ----------------------------------------
+
+ Panel panel = new Panel();
+ panel.setBorder(false);
+ panel.setFrame(false);
+ panel.setPaddings(10);
+
+ //create the form
+ FormPanel formPanel = new FormPanel();
+ formPanel.setHeader(false);
+ formPanel.setFrame(false);
+ formPanel.setPaddings(5, 5, 5, 0);
+ formPanel.setWidth(450);
+ formPanel.setLabelWidth(120);
+
+ //create first collapsible fieldset with checkbox
+ FieldSet fieldSet = new FieldSet();
+ fieldSet.setCheckboxToggle(false);
+ fieldSet.setFrame(true);
+ fieldSet.setTitle("Process metrics");
+ fieldSet.setCollapsed(false);
+
+ //add fields to the User FieldSet
+ TextField name = new TextField("Process Definition Name", "name", 210);
+ name.setAllowBlank(false);
+ name.setValue( parent.getName() );
+ fieldSet.add(name);
+
+ TextField execs = new TextField("Number of executions", "numexec", 210);
+ execs.setAllowBlank(false);
+ execs.setValue( perf.getInstanceMetrics().size() +"" );
+ fieldSet.add(execs);
+
+ TextField average = new TextField("Average execution time", "average", 210);
+ average.setValue(""+fixture[0]);
+ fieldSet.add(average);
+
+ TextField max = new TextField("Min execution time", "min", 210);
+ max.setValue(""+ fixture[1]);
+ fieldSet.add(max);
+
+ TextField min = new TextField("Max execution time", "max", 210);
+ min.setValue("" + fixture[2]);
+ fieldSet.add(min);
+ formPanel.add(fieldSet);
+
+ panel.add(formPanel);
+
+
+ // ----------------------------------------
+ this.add(chartPanel);
+ this.add(panel);
+
+ // gchart hack
+ chart.update();
+
}
+
+ private double[] deriveFixture(ProcessInstancePerformance perf)
+ {
+ double avg = -1;
+ double min= 0;
+ double max = -1;
+ double sum = -1;
+
+ Map metrics = perf.getInstanceMetrics();
+ Iterator keys = metrics.keySet().iterator();
+
+ while(keys.hasNext())
+ {
+ Long k = (Long)keys.next();
+ Double v = (Double)metrics.get(k);
+
+ if(v.longValue()>max) max = v.longValue();
+ else if(v.longValue()<=min) min = v.longValue();
+ else if(min==-1) min = v.longValue();
+
+ sum += v.longValue();
+
+ }
+
+ avg = Math.floor( sum/metrics.size());
+
+ return new double[] {avg, min, max};
+ }
}
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverview.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverview.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverview.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -21,22 +21,23 @@
*/
package org.jboss.bpm.console.client.metric;
+import com.gwtext.client.core.EventObject;
import com.gwtext.client.data.Record;
import com.gwtext.client.data.SimpleStore;
import com.gwtext.client.data.Store;
-import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.Button;
import com.gwtext.client.widgets.MessageBox;
+import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-import com.gwtext.client.widgets.form.*;
+import com.gwtext.client.widgets.form.ComboBox;
+import com.gwtext.client.widgets.form.FormPanel;
import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
-import com.gwtext.client.core.EventObject;
+import org.jboss.bpm.console.client.ConsoleView;
import org.jboss.bpm.console.client.model.DAOFactory;
import org.jboss.bpm.console.client.model.ProcessDefinition;
import org.jboss.bpm.console.client.model.ProcessDefinitionDAO;
import org.jboss.bpm.console.client.widgets.BarChart;
import org.jboss.bpm.console.client.widgets.UIConstants;
-import org.jboss.bpm.console.client.ConsoleView;
import java.util.HashMap;
import java.util.Iterator;
@@ -73,11 +74,10 @@
barValues.put("Expense report review", new Double(10.00));
BarChart chart = new BarChart(360,250, "Most used processes", "Process Name", barValues );
- chart.setLegendVisible(false);
- chart.setFontFamily("sans-serif");
+ chart.setLegendVisible(false);
- Panel chartPanel = new Panel("Most active process definitions");
- chartPanel.setPaddings(15);
+ Panel chartPanel = new Panel();
+ chartPanel.setPaddings(10);
chartPanel.setHeader(false);
chartPanel.setBorder(false);
chartPanel.setWidth(UIConstants.EDITOR_PANE_WIDTH);
@@ -91,11 +91,11 @@
final FormPanel formPanel = new FormPanel();
formPanel.setFrame(true);
- formPanel.setTitle("Simple Form");
+ formPanel.setTitle("View process details");
- formPanel.setWidth(450);
+ formPanel.setWidth(UIConstants.MAIN_EDITOR_PANEL_WIDTH);
formPanel.setLabelWidth(75);
- //formPanel.setUrl("save-form.php");
+ //formPanel.setUrl("save-form.php");
//create a Store using local array data
final Store store = new SimpleStore(
@@ -115,7 +115,7 @@
cb.setLoadingText("Searching...");
cb.setTypeAhead(true);
cb.setSelectOnFocus(true);
- cb.setWidth(200);
+ cb.setWidth(300);
cb.setHideTrigger(false);
@@ -159,8 +159,8 @@
Button button = new Button("View details", listener);
formPanel.add(cb);
- formPanel.add(button);
-
+ formPanel.addButton(button);
+
panel.add(formPanel);
this.add(chartPanel);
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverviewEditor.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverviewEditor.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverviewEditor.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -56,8 +56,8 @@
// -------------------------------------
- HelpPanel help = new HelpPanel(200, 180, "Process workload explained");
- help.setContent( DAOFactory.getHelpDAO().getHelpByReference(HelpDAO.REF_PROCESS_METRIC));
+ HelpPanel help = new HelpPanel(UIConstants.TEASER_PANEL_WIDTH, 180, "Process workload explained");
+ help.setContent( DAOFactory.createHelpDAO().getHelpByReference(HelpDAO.REF_PROCESS_METRIC));
// -------------------------------------
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/DAOFactory.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/DAOFactory.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/DAOFactory.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -21,6 +21,11 @@
*/
package org.jboss.bpm.console.client.model;
+import org.jboss.bpm.console.client.model.internal.MockHelpDAO;
+import org.jboss.bpm.console.client.model.internal.MockProcessDefinitionDAO;
+import org.jboss.bpm.console.client.model.internal.MockMetricsDAO;
+import org.jboss.bpm.console.client.model.internal.MockProcessInstanceDAO;
+
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
@@ -36,8 +41,13 @@
return new MockProcessInstanceDAO();
}
- public static HelpDAO getHelpDAO()
+ public static HelpDAO createHelpDAO()
{
return new MockHelpDAO();
}
+
+ public static MetricsDAO createMetricsDAO()
+ {
+ return new MockMetricsDAO();
+ }
}
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MetricsDAO.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MetricsDAO.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MetricsDAO.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -0,0 +1,31 @@
+/*
+ * 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.client.model;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public interface MetricsDAO
+{
+
+ ProcessInstancePerformance getProcessInstancePerformance(long processId);
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MetricsDAO.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockHelpDAO.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockHelpDAO.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockHelpDAO.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -1,57 +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.client.model;
-
-import java.util.Map;
-import java.util.HashMap;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class MockHelpDAO implements HelpDAO
-{
-
- private static Map ref2text = new HashMap();
-
- static {
- ref2text.put(
- new Integer(HelpDAO.REF_PROCESS_DEFINITIONS),
- "Process definitions are the base classs for any process instance. " +
- "They act as an execution template for BPM engine"
- );
-
- ref2text.put(
- new Integer(HelpDAO.REF_PROCESS_METRIC),
- "The chart on the left displays the most used process definitions. " +
- "Usage is defined by the number of instances that have been created for a particular definition."
- );
- }
-
- public String getHelpByReference(int ref)
- {
- String text = (String)ref2text.get(new Integer(ref));
- if(text!=null)
- return text;
- else
- return "No help entry for ref: " + ref;
- }
-}
Deleted: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockProcessDefinitionDAO.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockProcessDefinitionDAO.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockProcessDefinitionDAO.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -1,55 +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.client.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class MockProcessDefinitionDAO implements ProcessDefinitionDAO
-{
- public final static List defs = new ArrayList();
- static
- {
- defs.add( new ProcessDefinition(1, "OrderProcess", "1"));
- defs.add( new ProcessDefinition(2, "VacationManagement", "1"));
- defs.add( new ProcessDefinition(3, "New Employee walkthrough", "1"));
- defs.add( new ProcessDefinition(4, "Source code review", "2"));
- defs.add( new ProcessDefinition(5, "Loan application", "1"));
- defs.add( new ProcessDefinition(6, "Expense report review", "4"));
- defs.add( new ProcessDefinition(7, "Expense claim", "4"));
- defs.add( new ProcessDefinition(8, "Credit approval", "4"));
-
- }
-
- public List getAllProcessDefinitions()
- {
- return defs;
- }
-
- public List getMostActiveProcesses()
- {
- return defs;
- }
-}
Deleted: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockProcessInstanceDAO.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockProcessInstanceDAO.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/MockProcessInstanceDAO.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -1,50 +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.client.model;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class MockProcessInstanceDAO implements ProcessInstanceDAO
-{
-
- final static List instances = new ArrayList();
- static
- {
- instances.add( new ProcessInstance(2, -1, "Running", new Date(), null));
- instances.add( new ProcessInstance(3, -1, "Stopped", new Date(System.currentTimeMillis()-(1000*60*120)), new Date(System.currentTimeMillis()-(1000*60*12))));
- instances.add( new ProcessInstance(4, -1, "Ended", new Date(System.currentTimeMillis()-(1000*60*60)), new Date(System.currentTimeMillis()-(1000*60*24))));
- instances.add( new ProcessInstance(5, -1, "Suspended", new Date(System.currentTimeMillis()-(1000*60*90)), new Date(System.currentTimeMillis()-(1000*60*17))));
- instances.add( new ProcessInstance(6, -1, "Running", new Date(), null));
- instances.add( new ProcessInstance(7, -1, "Running", new Date(), null));
- }
-
-
- public List getInstanceByProcessDefinitionId(long id)
- {
- return instances;
- }
-}
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinition.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinition.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinition.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -30,7 +30,6 @@
private String name;
private String version;
-
public ProcessDefinition()
{
}
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionDAO.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionDAO.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionDAO.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -29,4 +29,6 @@
public interface ProcessDefinitionDAO
{
List getAllProcessDefinitions();
+
+ ProcessDefinition getProcessDefinitionById(long id);
}
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessInstancePerformance.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessInstancePerformance.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessInstancePerformance.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -0,0 +1,58 @@
+/*
+ * 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.client.model;
+
+import java.util.Map;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public final class ProcessInstancePerformance
+{
+ private long id;
+ private String processName;
+
+ Map instanceMetrics; // Map<instanceId,averageExectime>
+
+ public ProcessInstancePerformance(long processId, String processName, Map instanceMetrics)
+ {
+ this.id = processId;
+ this.processName = processName;
+ this.instanceMetrics = instanceMetrics;
+ }
+
+
+ public long getId()
+ {
+ return id;
+ }
+
+ public String getProcessName()
+ {
+ return processName;
+ }
+
+ public Map getInstanceMetrics()
+ {
+ return instanceMetrics;
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessInstancePerformance.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockHelpDAO.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockHelpDAO.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockHelpDAO.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -0,0 +1,59 @@
+/*
+ * 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.client.model.internal;
+
+import org.jboss.bpm.console.client.model.HelpDAO;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class MockHelpDAO implements HelpDAO
+{
+
+ private static Map ref2text = new HashMap();
+
+ static {
+ ref2text.put(
+ new Integer(HelpDAO.REF_PROCESS_DEFINITIONS),
+ "Process definitions are the base classs for any process instance. " +
+ "They act as an execution template for BPM engine"
+ );
+
+ ref2text.put(
+ new Integer(HelpDAO.REF_PROCESS_METRIC),
+ "The chart on the left displays the most used process definitions. " +
+ "Usage is defined by the number of instances that have been created for a particular definition."
+ );
+ }
+
+ public String getHelpByReference(int ref)
+ {
+ String text = (String)ref2text.get(new Integer(ref));
+ if(text!=null)
+ return text;
+ else
+ return "No help entry for ref: " + ref;
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockHelpDAO.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockMetricsDAO.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockMetricsDAO.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockMetricsDAO.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -0,0 +1,65 @@
+/*
+ * 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.client.model.internal;
+
+import org.jboss.bpm.console.client.model.*;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class MockMetricsDAO implements MetricsDAO
+{
+
+ public final static double MAX_EXEC_TIME = 3600.00;
+
+ public ProcessInstancePerformance getProcessInstancePerformance(long processId)
+ {
+ ProcessDefinition pd = DAOFactory.createProcessDefinitionDAO().getProcessDefinitionById(processId);
+
+ ProcessInstancePerformance performance = new ProcessInstancePerformance(
+ pd.getId(), pd.getName(), generateInstanceMetrics(processId)
+ );
+
+ return performance;
+ }
+
+ private Map generateInstanceMetrics(long processId)
+ {
+ List instances = DAOFactory.createProcessInstanceDAO().getInstanceByProcessDefinitionId(processId);
+
+ Map metrics = new HashMap();
+ for(int i=0; i<instances.size(); i++)
+ {
+ ProcessInstance pi = (ProcessInstance)instances.get(i);
+ metrics.put( new Long(pi.getId()) , new Double(Math.random()* MAX_EXEC_TIME) );
+ }
+
+ return metrics;
+ }
+
+
+
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockMetricsDAO.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockProcessDefinitionDAO.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockProcessDefinitionDAO.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockProcessDefinitionDAO.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -0,0 +1,68 @@
+/*
+ * 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.client.model.internal;
+
+import org.jboss.bpm.console.client.model.ProcessDefinitionDAO;
+import org.jboss.bpm.console.client.model.ProcessDefinition;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class MockProcessDefinitionDAO implements ProcessDefinitionDAO
+{
+ public final static List defs = new ArrayList();
+ static
+ {
+ defs.add( new ProcessDefinition(1, "OrderProcess", "1"));
+ defs.add( new ProcessDefinition(2, "VacationManagement", "1"));
+ defs.add( new ProcessDefinition(3, "New Employee walkthrough", "1"));
+ defs.add( new ProcessDefinition(4, "Source code review", "2"));
+ defs.add( new ProcessDefinition(5, "Loan application", "1"));
+ defs.add( new ProcessDefinition(6, "Expense report review", "4"));
+ defs.add( new ProcessDefinition(7, "Expense claim", "4"));
+ defs.add( new ProcessDefinition(8, "Credit approval", "4"));
+
+ }
+
+ public List getAllProcessDefinitions()
+ {
+ return defs;
+ }
+
+ public ProcessDefinition getProcessDefinitionById(long id)
+ {
+ ProcessDefinition result = null;
+ for(int i=0; i<defs.size(); i++)
+ {
+ ProcessDefinition pd = (ProcessDefinition)defs.get(i);
+ if(pd.getId() == id)
+ {
+ result = pd;
+ break;
+ }
+ }
+ return result;
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockProcessDefinitionDAO.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockProcessInstanceDAO.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockProcessInstanceDAO.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockProcessInstanceDAO.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -0,0 +1,53 @@
+/*
+ * 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.client.model.internal;
+
+import org.jboss.bpm.console.client.model.ProcessInstanceDAO;
+import org.jboss.bpm.console.client.model.ProcessInstance;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class MockProcessInstanceDAO implements ProcessInstanceDAO
+{
+
+ final static List instances = new ArrayList();
+ static
+ {
+ instances.add( new ProcessInstance(2, -1, "Running", new Date(), null));
+ instances.add( new ProcessInstance(3, -1, "Stopped", new Date(System.currentTimeMillis()-(1000*60*120)), new Date(System.currentTimeMillis()-(1000*60*12))));
+ instances.add( new ProcessInstance(4, -1, "Ended", new Date(System.currentTimeMillis()-(1000*60*60)), new Date(System.currentTimeMillis()-(1000*60*24))));
+ instances.add( new ProcessInstance(5, -1, "Suspended", new Date(System.currentTimeMillis()-(1000*60*90)), new Date(System.currentTimeMillis()-(1000*60*17))));
+ instances.add( new ProcessInstance(6, -1, "Running", new Date(), null));
+ instances.add( new ProcessInstance(7, -1, "Running", new Date(), null));
+ }
+
+
+ public List getInstanceByProcessDefinitionId(long id)
+ {
+ return instances;
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockProcessInstanceDAO.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/GChartExample.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/GChartExample.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/GChartExample.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -1,109 +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.client.process;
-
-import com.google.gwt.user.client.ui.Widget;
-import com.google.gwt.user.client.ui.ClickListener;
-import com.google.gwt.user.client.ui.Button;
-import com.googlecode.gchart.client.GChart;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class GChartExample extends GChart
-{
- final String[] groupLabels = { "O Seven", "Owe Ate", "Oh Nein!"};
-
- final String[] barLabels = { "Q1", "Q2", "Q3", "Q4"};
-
- final String[] barColors = { "red", "blue", "green", "silver"};
-
- final int MAX_REVENUE = 1000;
- final int WIDTH = 300;
- final int HEIGHT = 200;
-
- //Button updateButton = new Button( "Update");
-
- public GChartExample() {
- setChartSize(WIDTH, HEIGHT);
- setChartTitle("<b><big><big>" + "Simulated Quarterly Revenues" +"</big></big><br> </b>");
-
- /*updateButton.addClickListener(
- new ClickListener()
- {
- public void onClick(Widget w) {
- for (int iCurve=0; iCurve < getNCurves(); iCurve++)
- {
- for (int iPoint=0; iPoint < getCurve(iCurve).getNPoints(); iPoint++)
- {
- getCurve(iCurve).getPoint(iPoint).setY( Math.random()*MAX_REVENUE);
- }
- }
- update();
- updateButton.setFocus(true);
- }
- }
- );
-
- setChartFootnotes(updateButton);*/
-
- for (int iCurve=0; iCurve < barLabels.length; iCurve++)
- {
- addCurve(); // one curve per quarter
- getCurve().getSymbol().setSymbolType(SymbolType.VBAR_SOUTHWEST);
- getCurve().getSymbol().setBackgroundColor(barColors[iCurve]);
- getCurve().setLegendLabel(barLabels[iCurve]);
- getCurve().getSymbol().setHovertextTemplate(
- barLabels[iCurve] + " revenue=${y}");
- getCurve().getSymbol().setModelWidth(1.02);
- getCurve().getSymbol().setBorderColor("black");
- getCurve().getSymbol().setBorderWidth(1);
- for (int jGroup=0; jGroup < groupLabels.length; jGroup++) {
- // the '+1' creates a bar-sized gap between groups
- getCurve().addPoint(1+iCurve+jGroup*(barLabels.length+1),
- Math.random()*MAX_REVENUE);
- getCurve().getPoint().setAnnotationText(barLabels[iCurve]);
- getCurve().getPoint().setAnnotationLocation(
- AnnotationLocation.NORTH);
- }
- }
-
- for (int i = 0; i < groupLabels.length; i++)
- {
- // formula centers tick-label horizontally on each group
- getXAxis().addTick(
- barLabels.length/2. + i*(barLabels.length+1),
- groupLabels[i]
- );
- getXAxis().setTickLabelFontSize(20);
- }
- getXAxis().setTickLength(6); // small tick-like gap...
- getXAxis().setTickThickness(0); // but with invisible ticks
- getXAxis().setAxisMin(0); // keeps first bar on chart
-
- getYAxis().setAxisMin(0); // Based on sim revenue range
- getYAxis().setAxisMax(MAX_REVENUE); // of 0 to MAX_REVENUE.
- getYAxis().setTickCount(11);
- getYAxis().setHasGridlines(true);
- getYAxis().setTickLabelFormat("$#,###");
- }
-}
\ No newline at end of file
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -24,7 +24,6 @@
import com.gwtext.client.widgets.layout.ColumnLayout;
import com.gwtext.client.widgets.layout.ColumnLayoutData;
import com.gwtext.client.widgets.layout.VerticalLayout;
-import com.gwtext.client.widgets.layout.HorizontalLayout;
import com.gwtext.client.widgets.*;
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
import com.gwtext.client.core.EventObject;
@@ -120,8 +119,8 @@
// ----------------------------------
- HelpPanel help = new HelpPanel(200, 180, "About process definitions");
- help.setContent( DAOFactory.getHelpDAO().getHelpByReference(HelpDAO.REF_PROCESS_DEFINITIONS));
+ HelpPanel help = new HelpPanel(UIConstants.TEASER_PANEL_WIDTH, 180, "About process definitions");
+ help.setContent( DAOFactory.createHelpDAO().getHelpByReference(HelpDAO.REF_PROCESS_DEFINITIONS));
// ----------------------------------
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/BarChart.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/BarChart.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/BarChart.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -44,6 +44,7 @@
setChartSize(width, height);
setChartTitle(title);
+ setFontFamily("sans-serif");
String[] labels = (String[])barValues.keySet().toArray( new String[]{} );
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/LineChart.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/LineChart.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/LineChart.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -0,0 +1,80 @@
+/*
+ * 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.client.widgets;
+
+import com.googlecode.gchart.client.GChart;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.Iterator;
+
+import org.jboss.bpm.console.client.model.internal.MockMetricsDAO;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class LineChart extends GChart
+{
+ /**
+ *
+ * @param metrics Long->Double
+ */
+ public LineChart(String title, int width, int height, Map metrics, String xLabel, String yLabel)
+ {
+ setChartTitle(title);
+ setChartSize(width, height);
+ setFontFamily("sans-serif");
+ addCurve();
+
+ // 2 pixel square connecting dots, spaced 5 pixels apart:
+ getCurve().getSymbol().setFillThickness(2);
+ getCurve().getSymbol().setFillSpacing(5);
+ getCurve().getSymbol().setBackgroundColor("#66CC66");
+ getCurve().getSymbol().setBorderColor("#66CC66");
+
+ Iterator keys = metrics.keySet().iterator();
+ int i=0;
+ while(keys.hasNext())
+ {
+ Long k = (Long)keys.next();
+ Double v = (Double)metrics.get(k);
+ getCurve().addPoint(i, v.doubleValue() );
+
+ getCurve().getPoint().setAnnotationVisible(true);
+ getCurve().getPoint().setAnnotationText("ID " + k);
+ getCurve().getPoint().setAnnotationLocation( GChart.AnnotationLocation.NORTH);
+ i++;
+ }
+
+
+ getXAxis().setTickCount(metrics.size());
+ getXAxis().setTickLength(6); // small tick-like gap...
+ getXAxis().setTickThickness(0); // but with invisible ticks
+ getXAxis().setAxisMin(0); // keeps first bar on chart
+
+ getXAxis().setAxisLabel(xLabel);
+ getYAxis().setAxisLabel(yLabel);
+ getYAxis().setAxisMin(0); // Based on sim revenue range
+ getYAxis().setAxisMax(MockMetricsDAO.MAX_EXEC_TIME); // TODO: Fixme
+ getYAxis().setTickCount(11);
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/LineChart.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/UIConstants.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/UIConstants.java 2008-08-20 14:10:41 UTC (rev 1942)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/UIConstants.java 2008-08-20 16:55:52 UTC (rev 1943)
@@ -30,4 +30,6 @@
public static final int MAIN_MENU_MIN = 175;
public static final int MAIN_MENU_MAX = 400;
public static final int EDITOR_PANE_WIDTH = 680;
+ public static final int TEASER_PANEL_WIDTH = 200;
+ public static final int MAIN_EDITOR_PANEL_WIDTH = 450;
}
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/resources/org/jboss/bpm/console/public/images/processSample.jpg
===================================================================
(Binary files differ)
17 years, 8 months
JBoss JBPM SVN: r1942 - in jbpm4/pvm/trunk/modules/core/src: main/java/org/jbpm/pvm/internal/util and 4 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-08-20 10:10:41 -0400 (Wed, 20 Aug 2008)
New Revision: 1942
Added:
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/util/DefaultObservable.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/util/FilterListener.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/util/Listener.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/util/Observable.java
Removed:
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/util/
Modified:
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/Descriptor.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/AbstractDescriptor.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateSessionFactoryDescriptor.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JobExecutorDescriptor.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/operation/MethodInvokerListener.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/operation/SubscribeOperation.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/wire/MethodSubscriptionTest.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/wire/ObjectSubscriptionTest.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/wire/SubscriptionTestCase.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/wire/WireEventsSubscriptionTest.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/wire/WireObservableTest.java
Log:
moved util classes to internal: JBPM-1418
Copied: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/util/DefaultObservable.java (from rev 1887, jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/util/DefaultObservable.java)
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/util/DefaultObservable.java (rev 0)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/util/DefaultObservable.java 2008-08-20 14:10:41 UTC (rev 1942)
@@ -0,0 +1,74 @@
+package org.jbpm.pvm.internal.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jbpm.pvm.PvmException;
+
+/** default implementation of the {@link Observable} interface.
+ *
+ * @author Tom Baeyens
+ */
+public class DefaultObservable implements Observable {
+
+ protected List<Listener> listeners = null;
+
+ public void addListener(Listener listener) {
+ if (listener==null) {
+ throw new PvmException("listener is null");
+ }
+ if (listeners==null) {
+ listeners = new ArrayList<Listener>();
+ }
+ listeners.add(listener);
+ }
+
+ public void removeListener(Listener listener) {
+ if (listener==null) {
+ throw new PvmException("listener is null");
+ }
+ if (listeners!=null) {
+ listeners.remove(listener);
+ }
+ }
+
+ public Listener addListener(Listener listener, String eventName) {
+ if (eventName==null) {
+ throw new PvmException("eventName is null");
+ }
+
+ List<String> eventNames = new ArrayList<String>();
+ eventNames.add(eventName);
+
+ return addListener(listener, eventNames);
+ }
+
+
+ public Listener addListener(Listener listener, List<String> eventNames) {
+ if (listener==null) {
+ throw new PvmException("listener is null");
+ }
+ if (eventNames==null) {
+ throw new PvmException("eventNames is null");
+ }
+ FilterListener filterListener = new FilterListener(listener, eventNames);
+ addListener(filterListener);
+ return filterListener;
+ }
+
+ public void fire(String eventName) {
+ fire(eventName, null);
+ }
+
+ public void fire(String eventName, Object info) {
+ if (listeners!=null) {
+ for (Listener listener: listeners) {
+ listener.event(this, eventName, info);
+ }
+ }
+ }
+
+ public List<Listener> getListeners() {
+ return listeners;
+ }
+}
Property changes on: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/util/DefaultObservable.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/util/FilterListener.java (from rev 1887, jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/util/FilterListener.java)
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/util/FilterListener.java (rev 0)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/util/FilterListener.java 2008-08-20 14:10:41 UTC (rev 1942)
@@ -0,0 +1,56 @@
+package org.jbpm.pvm.internal.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jbpm.pvm.PvmException;
+
+/** listener that only delegates events to a given listener if
+ * they pass the filter based on event names. */
+public class FilterListener implements Listener {
+
+ protected Listener listener;
+ protected List<String> eventNames;
+
+ public FilterListener(Listener listener, String eventName) {
+ if (listener==null) throw new PvmException("listener is null");
+ this.listener = listener;
+ if (eventName==null) throw new PvmException("eventName is null");
+ this.eventNames = new ArrayList<String>();
+ this.eventNames.add(eventName);
+ }
+
+ public FilterListener(Listener listener, List<String> eventNames) {
+ if (listener==null) throw new PvmException("listener is null");
+ this.listener = listener;
+ if (eventNames==null) throw new PvmException("eventNames is null");
+ this.eventNames = eventNames;
+ }
+
+ public void event(Object source, String name, Object info) {
+ if (! isFiltered(name)) {
+ listener.event(source, name, info);
+ }
+ }
+
+ public boolean isFiltered(String eventName) {
+ if (eventNames.contains(eventName)) {
+ return false;
+ }
+ return true;
+ }
+
+ public boolean equals(Object object) {
+ if (object==null) return false;
+ if (object==this) return true;
+ if ( (object instanceof Listener)
+ && (listener.equals(object))
+ ) {
+ return true;
+ }
+ return false;
+ }
+ public int hashCode() {
+ return 17+listener.hashCode();
+ }
+}
\ No newline at end of file
Property changes on: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/util/FilterListener.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/util/Listener.java (from rev 1887, jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/util/Listener.java)
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/util/Listener.java (rev 0)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/util/Listener.java 2008-08-20 14:10:41 UTC (rev 1942)
@@ -0,0 +1,17 @@
+package org.jbpm.pvm.internal.util;
+
+/** listener to events that are produced by an {@link Observable}.
+ *
+ * @author Tom Baeyens
+ * @author Guillaume Porcher (documentation)
+ */
+public interface Listener {
+
+ /** is called by the {@link Observable} when an event is fired.
+ * @param source {@link Observable} that fired the event.
+ * @param eventName name of the event.
+ * @param info more information about the fired event. See the concrete
+ * observable docs for more information about what information is provided.
+ */
+ public void event(Object source, String eventName, Object info);
+}
Property changes on: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/util/Listener.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/util/Observable.java (from rev 1887, jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/util/Observable.java)
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/util/Observable.java (rev 0)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/util/Observable.java 2008-08-20 14:10:41 UTC (rev 1942)
@@ -0,0 +1,52 @@
+package org.jbpm.pvm.internal.util;
+
+import java.util.List;
+
+
+/** dispatches events to which {@link Listener listeners} can subscribe.
+ * Aka publish-subscribe.
+ *
+ * @see DefaultObservable a default implementation of this interface
+ * @author Tom Baeyens
+ */
+public interface Observable {
+
+ /** subscribes a listener to every event
+ * @param listener is the object that will be notified on {@link #fire(String, Object) firing} of events.
+ */
+ void addListener(Listener listener);
+
+ /** removes a listener that was subscribed for every event
+ */
+ void removeListener(Listener listener);
+
+ /** subscribes the listener to receive event notifications only of the given eventName. Events with
+ * different eventNames will not be dispatched to the given listener.
+ * @param listener is the object that will be notified on {@link #fire(String, Object) firing} of events.
+ * @param eventName is the type of events the listener is interested in and this is mandatory.
+ * @return the {@link FilterListener} that is created as a wrapper for the given listener. That handle
+ * might be necessary to remove the listener later on.
+ * @throws NullPointerException in case listener or eventName is null. */
+ Listener addListener(Listener listener, String eventName);
+
+ /** subscribes the listener to receive event notifications only if event matches one of the
+ * given eventNames. Events with different eventNames will not be dispatched to the given listener.
+ * @param listener is the object that will be notified on {@link #fire(String, Object) firing} of events.
+ * @param eventNames is the type of events the listener is interested in and this is mandatory.
+ * @return the {@link FilterListener} that is created as a wrapper for the given listener. That handle
+ * might be necessary to remove the listener later on.
+ * @throws NullPointerException in case listener or eventName is null. */
+ Listener addListener(Listener listener, List<String> eventNames);
+
+ /** dispatches an event to the listeners.
+ * @param eventName identifies the type of event and is allowed to be null.
+ */
+ void fire(String eventName);
+
+ /** dispatches an event to the listeners.
+ * @param eventName identifies the type of event and is allowed to be null.
+ * @param info is the optional information that the observable wants to pass to it's listeners.
+ * Each observable should indicate which type of info it's passing for each event.
+ */
+ void fire(String eventName, Object info);
+}
Property changes on: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/util/Observable.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Modified: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/Descriptor.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/Descriptor.java 2008-08-20 14:07:10 UTC (rev 1941)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/Descriptor.java 2008-08-20 14:10:41 UTC (rev 1942)
@@ -23,7 +23,7 @@
import java.io.Serializable;
-import org.jbpm.pvm.util.Observable;
+import org.jbpm.pvm.internal.util.Observable;
/**
* knows how an object can be created.
Modified: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java 2008-08-20 14:07:10 UTC (rev 1941)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java 2008-08-20 14:10:41 UTC (rev 1942)
@@ -37,6 +37,8 @@
import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.model.ProcessElementImpl;
import org.jbpm.pvm.internal.util.Closable;
+import org.jbpm.pvm.internal.util.DefaultObservable;
+import org.jbpm.pvm.internal.util.Observable;
import org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.internal.wire.operation.FieldOperation;
@@ -45,8 +47,6 @@
import org.jbpm.pvm.internal.wire.operation.PropertyOperation;
import org.jbpm.pvm.internal.wire.operation.SubscribeOperation;
import org.jbpm.pvm.internal.wire.xml.WireParser;
-import org.jbpm.pvm.util.DefaultObservable;
-import org.jbpm.pvm.util.Observable;
/**
* object factory that creates, initializes, wires and caches objects
Modified: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/AbstractDescriptor.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/AbstractDescriptor.java 2008-08-20 14:07:10 UTC (rev 1941)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/AbstractDescriptor.java 2008-08-20 14:10:41 UTC (rev 1942)
@@ -23,10 +23,10 @@
import java.io.Serializable;
+import org.jbpm.pvm.internal.util.DefaultObservable;
import org.jbpm.pvm.internal.wire.Descriptor;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.WireDefinition;
-import org.jbpm.pvm.util.DefaultObservable;
/**
* base class for {@link Descriptor}s.
Modified: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateSessionFactoryDescriptor.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateSessionFactoryDescriptor.java 2008-08-20 14:07:10 UTC (rev 1941)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateSessionFactoryDescriptor.java 2008-08-20 14:10:41 UTC (rev 1942)
@@ -22,11 +22,11 @@
package org.jbpm.pvm.internal.wire.descriptor;
import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.pvm.internal.util.Listener;
import org.jbpm.pvm.internal.wire.Descriptor;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.WireDefinition;
import org.jbpm.pvm.internal.wire.WireException;
-import org.jbpm.pvm.util.Listener;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
Modified: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JobExecutorDescriptor.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JobExecutorDescriptor.java 2008-08-20 14:07:10 UTC (rev 1941)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JobExecutorDescriptor.java 2008-08-20 14:10:41 UTC (rev 1942)
@@ -16,8 +16,8 @@
import org.jbpm.pvm.PvmException;
import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.pvm.internal.util.Listener;
import org.jbpm.pvm.internal.wire.WireContext;
-import org.jbpm.pvm.util.Listener;
/**
* @author Pascal Verdage
Modified: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/operation/MethodInvokerListener.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/operation/MethodInvokerListener.java 2008-08-20 14:07:10 UTC (rev 1941)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/operation/MethodInvokerListener.java 2008-08-20 14:10:41 UTC (rev 1942)
@@ -5,13 +5,13 @@
import java.util.List;
import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.pvm.internal.util.Listener;
+import org.jbpm.pvm.internal.util.Observable;
import org.jbpm.pvm.internal.util.ReflectUtil;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.WireException;
import org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-import org.jbpm.pvm.util.Listener;
-import org.jbpm.pvm.util.Observable;
/**
Modified: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/operation/SubscribeOperation.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/operation/SubscribeOperation.java 2008-08-20 14:07:10 UTC (rev 1941)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/operation/SubscribeOperation.java 2008-08-20 14:10:41 UTC (rev 1942)
@@ -7,14 +7,14 @@
import org.jbpm.pvm.env.Context;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.internal.log.Log;
+import org.jbpm.pvm.internal.util.FilterListener;
+import org.jbpm.pvm.internal.util.Listener;
+import org.jbpm.pvm.internal.util.Observable;
import org.jbpm.pvm.internal.wire.Descriptor;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.WireDefinition;
import org.jbpm.pvm.internal.wire.WireException;
import org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor;
-import org.jbpm.pvm.util.FilterListener;
-import org.jbpm.pvm.util.Listener;
-import org.jbpm.pvm.util.Observable;
/**
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/wire/MethodSubscriptionTest.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/wire/MethodSubscriptionTest.java 2008-08-20 14:07:10 UTC (rev 1941)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/wire/MethodSubscriptionTest.java 2008-08-20 14:10:41 UTC (rev 1942)
@@ -3,9 +3,9 @@
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.env.EnvironmentFactory;
import org.jbpm.pvm.env.PvmEnvironmentFactory;
+import org.jbpm.pvm.internal.util.DefaultObservable;
+import org.jbpm.pvm.internal.util.Observable;
import org.jbpm.pvm.internal.wire.WireException;
-import org.jbpm.pvm.util.DefaultObservable;
-import org.jbpm.pvm.util.Observable;
/**
* Test subscription using a specified method.
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/wire/ObjectSubscriptionTest.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/wire/ObjectSubscriptionTest.java 2008-08-20 14:07:10 UTC (rev 1941)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/wire/ObjectSubscriptionTest.java 2008-08-20 14:10:41 UTC (rev 1942)
@@ -24,9 +24,9 @@
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.env.EnvironmentFactory;
import org.jbpm.pvm.env.PvmEnvironmentFactory;
+import org.jbpm.pvm.internal.util.DefaultObservable;
+import org.jbpm.pvm.internal.util.Observable;
import org.jbpm.pvm.internal.wire.WireException;
-import org.jbpm.pvm.util.DefaultObservable;
-import org.jbpm.pvm.util.Observable;
/**
* @author Tom Baeyens
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/wire/SubscriptionTestCase.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/wire/SubscriptionTestCase.java 2008-08-20 14:07:10 UTC (rev 1941)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/wire/SubscriptionTestCase.java 2008-08-20 14:10:41 UTC (rev 1942)
@@ -24,8 +24,8 @@
import java.util.ArrayList;
import java.util.List;
+import org.jbpm.pvm.internal.util.Listener;
import org.jbpm.pvm.test.base.JbpmTestCase;
-import org.jbpm.pvm.util.Listener;
/**
* @author Tom Baeyens
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/wire/WireEventsSubscriptionTest.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/wire/WireEventsSubscriptionTest.java 2008-08-20 14:07:10 UTC (rev 1941)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/wire/WireEventsSubscriptionTest.java 2008-08-20 14:10:41 UTC (rev 1942)
@@ -24,10 +24,10 @@
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.env.EnvironmentFactory;
import org.jbpm.pvm.env.PvmEnvironmentFactory;
+import org.jbpm.pvm.internal.util.DefaultObservable;
+import org.jbpm.pvm.internal.util.Observable;
import org.jbpm.pvm.internal.wire.WireObjectEventInfo;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-import org.jbpm.pvm.util.DefaultObservable;
-import org.jbpm.pvm.util.Observable;
/**
* @author Tom Baeyens
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/wire/WireObservableTest.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/wire/WireObservableTest.java 2008-08-20 14:07:10 UTC (rev 1941)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/wire/WireObservableTest.java 2008-08-20 14:10:41 UTC (rev 1942)
@@ -24,11 +24,11 @@
import java.util.List;
import org.jbpm.pvm.test.base.JbpmTestCase;
-import org.jbpm.pvm.util.Listener;
import org.jbpm.pvm.env.Context;
import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.env.EnvironmentFactory;
import org.jbpm.pvm.env.PvmEnvironmentFactory;
+import org.jbpm.pvm.internal.util.Listener;
import org.jbpm.pvm.internal.wire.WireContext;
/**
17 years, 8 months