JBoss JBPM SVN: r3839 - jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-02-11 13:28:51 -0500 (Wed, 11 Feb 2009)
New Revision: 3839
Modified:
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ModelAdaptor.java
Log:
compilation fix
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ModelAdaptor.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ModelAdaptor.java 2009-02-11 17:47:18 UTC (rev 3838)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ModelAdaptor.java 2009-02-11 18:28:51 UTC (rev 3839)
@@ -57,7 +57,7 @@
ProcessInstanceRef ref = new ProcessInstanceRef();
ref.setInstanceId( e0.getDbid() );
ref.setKey(e0.getKey());
- ref.setDefinitionId(e0.getProcessDefinition().getDbid());
+ // ref.setDefinitionId(e0.getProcessDefinition().getDbid());
ref.setState( ProcessInstanceRef.STATE.RUNNING); // TODO: FIXME
17 years, 2 months
JBoss JBPM SVN: r3838 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/listener and 7 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-02-11 12:47:18 -0500 (Wed, 11 Feb 2009)
New Revision: 3838
Added:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistoryEvent.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionChain.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionFilter.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceStart.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryActivityInstance.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstance.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskInstance.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/package.html
Removed:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/LogSessionChain.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/LogSessionFilter.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLog.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogImpl.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogProperty.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogXmlSerializer.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/package.html
jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/LogSession.java
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/listener/EventListenerExecution.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
Log:
history kickoff
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java 2009-02-11 16:32:49 UTC (rev 3837)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java 2009-02-11 17:47:18 UTC (rev 3838)
@@ -30,7 +30,6 @@
import org.jbpm.model.ObservableElement;
import org.jbpm.model.OpenExecution;
import org.jbpm.model.Transition;
-import org.jbpm.processlog.ProcessLog;
import org.jbpm.session.PvmDbSession;
@@ -227,11 +226,6 @@
* registered to parent's of the given eventSource. */
void fire(String eventName, ObservableElement eventSource);
- // logs /////////////////////////////////////////////////////////////////////
-
- /** adds a <a href="package-summary.html#logs">log</a> to this execution. */
- void addLog(ProcessLog processLog);
-
// extra state information methods //////////////////////////////////////////
/** the current transition indicating the position in the process definition graph.
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/listener/EventListenerExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/listener/EventListenerExecution.java 2009-02-11 16:32:49 UTC (rev 3837)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/listener/EventListenerExecution.java 2009-02-11 17:47:18 UTC (rev 3838)
@@ -27,7 +27,6 @@
import org.jbpm.model.ObservableElement;
import org.jbpm.model.OpenExecution;
import org.jbpm.model.Transition;
-import org.jbpm.processlog.ProcessLog;
/** view upon an {@link Execution path of execution} exposed to
@@ -48,13 +47,6 @@
* graph. Can be null in case no event is being fired. */
Event getEvent();
- // candidates to be moved to OpenExecution:
-
- // logs /////////////////////////////////////////////////////////////////////
-
- /** adds a <a href="package-summary.html#logs">log</a> to this execution. */
- void addLog(ProcessLog processLog);
-
// extra state information methods //////////////////////////////////////////
/** the current transition indicating the position in the process definition graph.
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/LogSessionChain.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/LogSessionChain.java 2009-02-11 16:32:49 UTC (rev 3837)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/LogSessionChain.java 2009-02-11 17:47:18 UTC (rev 3838)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.processlog;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jbpm.session.LogSession;
-
-
-/** log session that delegates to a delegate list of log sessions.
- *
- * @author Tom Baeyens
- */
-public class LogSessionChain implements LogSession {
-
- protected List<LogSession> delegates = new ArrayList<LogSession>();
-
- public void add(ProcessLog processLog) {
- for (LogSession delegate: delegates) {
- delegate.add(processLog);
- }
- }
-
- public void addLogSession(LogSession logSession) {
- delegates.add(logSession);
- }
-}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/LogSessionFilter.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/LogSessionFilter.java 2009-02-11 16:32:49 UTC (rev 3837)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/LogSessionFilter.java 2009-02-11 17:47:18 UTC (rev 3838)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.processlog;
-
-import org.jbpm.session.LogSession;
-
-
-/** filtering log session.
- *
- * @author Tom Baeyens
- */
-public class LogSessionFilter implements LogSession {
-
- protected LogSession delegate;
- protected String type;
-
- public void add(ProcessLog processLog) {
- if (passes(processLog)){
- delegate.add(processLog);
- }
- }
-
- /** can be overwritten in case filtering needs to be more
- * sophisticated then just type matching. */
- protected boolean passes(ProcessLog processLog) {
- return ((type==null) || (type.equals(processLog.getType())));
- }
-
- public void setDelegate(LogSession delegate) {
- this.delegate = delegate;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLog.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLog.java 2009-02-11 16:32:49 UTC (rev 3837)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLog.java 2009-02-11 17:47:18 UTC (rev 3838)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.processlog;
-
-import java.util.Date;
-import java.util.List;
-
-import org.jbpm.Execution;
-
-/**
- * @author Tom Baeyens
- */
-public interface ProcessLog {
-
- long getDbid();
-
- Execution getExecution();
-
- Execution getProcessInstance();
-
- /** text id of the type of this process log used for
- * XML serialization. */
- String getType();
-
- /** xml representation of the process log properties
- * used for XML serialization. Properties time, execution
- * and processInstance should not be included. This method
- * is made abstract to remind and encourage
- * implementors to provide XML serialization capabilities to
- * the fixed process log XML schema. But it is allowed to
- * return null if XML serialisation if you're sure that
- * XML serialization will never be necessary. */
- List<ProcessLogProperty> getProperties();
-
- /** provides a text description for this update
- * which can be used e.g. in the admin web console.
- * This texts hould not contain time, execution
- * nor processInstance.
- * The default implementation will include the
- * {@link #getType() type} and then append all the top
- * level properties. */
- String toString();
-
- Date getTime();
-
- void setExecution(Execution execution);
-
- void setTime(Date currentTime);
-}
\ No newline at end of file
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogImpl.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogImpl.java 2009-02-11 16:32:49 UTC (rev 3837)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogImpl.java 2009-02-11 17:47:18 UTC (rev 3838)
@@ -1,124 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.processlog;
-
-import java.io.Serializable;
-import java.util.Date;
-import java.util.List;
-
-import org.jbpm.Execution;
-import org.jbpm.model.OpenExecution;
-import org.jbpm.session.LogSession;
-
-/** base class for process logs. Process logs are dispatched to the
- * {@link LogSession} that is configured in the environment.
- *
- * <p>ProcessLogs that are send to a LogSession is the probe mechanism
- * provided to listen into the process execution progress and details.
- * It is the mechanism to collect process history and process statistics.
- * </p>
- *
- * @author Tom Baeyens
- */
-public abstract class ProcessLogImpl implements Serializable, ProcessLog {
-
- private static final long serialVersionUID = 1L;
-
- protected long dbid;
- protected int index = -1;
- protected Date time;
- protected Execution execution;
- protected Execution processInstance;
-
- public ProcessLogImpl() {
- }
-
- public void setExecution(OpenExecution execution) {
- this.execution = execution;
- this.processInstance = (execution!=null ? execution.getProcessInstance() : null);
- }
-
- /** text id of the type of this process log used for
- * XML serialization. */
- public abstract String getType();
-
- /** xml representation of the process log properties
- * used for XML serialization. Properties time, execution
- * and processInstance should not be included. This method
- * is made abstract to remind and encourage
- * implementors to provide XML serialization capabilities to
- * the fixed process log XML schema. But it is allowed to
- * return null if XML serialisation if you're sure that
- * XML serialization will never be necessary. */
- public abstract List<ProcessLogProperty> getProperties();
-
- /** provides a text description for this update
- * which can be used e.g. in the admin web console.
- * This texts hould not contain time, execution
- * nor processInstance.
- * The default implementation will include the
- * {@link #getType() type} and then append all the top
- * level properties. */
- public String toString() {
- StringBuffer text = new StringBuffer();
- text.append(getType());
- text.append('[');
- List<ProcessLogProperty> properties = getProperties();
- if (properties!=null) {
- for (int i=0; i<properties.size(); i++) {
- ProcessLogProperty property = properties.get(i);
- text.append(property.name);
- if (property.value!=null) {
- text.append('=');
- text.append(property.value);
- }
- if (i < (properties.size()-1)) {
- text.append('|');
- }
- }
- }
- text.append(']');
- return text.toString();
- }
-
- public long getDbid() {
- return dbid;
- }
- public Date getTime() {
- return time;
- }
- public void setTime(Date date) {
- this.time = date;
- }
- public Execution getExecution() {
- return execution;
- }
- public int getIndex() {
- return index;
- }
- public Execution getProcessInstance() {
- return processInstance;
- }
- public void setIndex(int index) {
- this.index = index;
- }
-}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogProperty.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogProperty.java 2009-02-11 16:32:49 UTC (rev 3837)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogProperty.java 2009-02-11 17:47:18 UTC (rev 3838)
@@ -1,80 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.processlog;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Tom Baeyens
- */
-public class ProcessLogProperty {
-
- protected String name;
- protected String value;
- protected List<ProcessLogProperty> properties;
-
- public ProcessLogProperty(String name) {
- this.name = name;
- }
-
- public ProcessLogProperty(String name, String value) {
- this.name = name;
- this.value = value;
- }
-
- public ProcessLogProperty createProperty(String name) {
- return createProperty(name, null);
- }
-
- public ProcessLogProperty createProperty(String name, String value) {
- ProcessLogProperty property = new ProcessLogProperty(name, value);
- addProperty(property);
- return property;
- }
-
- public void addProperty(ProcessLogProperty property) {
- if (properties==null) {
- properties = new ArrayList<ProcessLogProperty>();
- }
- properties.add(property);
- }
-
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public String getValue() {
- return value;
- }
- public void setValue(String value) {
- this.value = value;
- }
- public List<ProcessLogProperty> getProperties() {
- return properties;
- }
- public void setProperties(List<ProcessLogProperty> properties) {
- this.properties = properties;
- }
-}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogXmlSerializer.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogXmlSerializer.java 2009-02-11 16:32:49 UTC (rev 3837)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogXmlSerializer.java 2009-02-11 17:47:18 UTC (rev 3838)
@@ -1,105 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.processlog;
-
-import java.text.SimpleDateFormat;
-import java.util.List;
-
-import org.jbpm.Execution;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-
-/**
- * @author Tom Baeyens
- */
-public class ProcessLogXmlSerializer {
-
- public static final SimpleDateFormat dateFormatter = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss,SSS");
-
- protected List<ProcessLogProperty> properties;
-
- public void appendLog(Document document, Element parent, ProcessLog processLog) {
- String logType = getEventType(processLog);
- String time = getTime(processLog);
- String executionDbid = getExecutionDbid(processLog);
- String processInstanceDbid = getProcessInstanceDbid(processLog);
- String processInstanceKey = getProcessInstanceKey(processLog);
-
- Element logElement = document.createElement("log");
- parent.appendChild(logElement);
-
- logElement.setAttribute("type", logType);
- logElement.setAttribute("time", time);
- if (executionDbid!=null) {
- logElement.setAttribute("execution", executionDbid);
- }
- if (processInstanceDbid!=null) {
- logElement.setAttribute("instance", processInstanceDbid);
- }
- if (processInstanceKey!=null) {
- logElement.setAttribute("key", processInstanceKey);
- }
-
- appendProperties(document, logElement, processLog.getProperties());
- }
-
- protected void appendProperties(Document document, Element parent, List<ProcessLogProperty> properties) {
- if (properties!=null) {
- for (ProcessLogProperty property: properties) {
- Element propertyElement = document.createElement("property");
- parent.appendChild(propertyElement);
-
- if (property.name!=null) {
- propertyElement.setAttribute("name", property.name);
- }
- if (property.value!=null) {
- propertyElement.setAttribute("value", property.value);
- }
- appendProperties(document, propertyElement, property.getProperties());
- }
- }
- }
-
- protected String getEventType(ProcessLog processLog) {
- return processLog.getType();
- }
-
- protected String getTime(ProcessLog processLog) {
- return dateFormatter.format(processLog.getTime());
- }
-
- protected String getExecutionDbid(ProcessLog processLog) {
- Execution execution = processLog.getExecution();
- return (execution!=null ? Long.toString(execution.getDbid()) : null);
- }
-
- protected String getProcessInstanceDbid(ProcessLog processLog) {
- Execution processInstance = processLog.getProcessInstance();
- return (processInstance!=null ? Long.toString(processInstance.getDbid()) : null);
- }
-
- protected String getProcessInstanceKey(ProcessLog processLog) {
- Execution processInstance = processLog.getProcessInstance();
- return (processInstance!=null ? processInstance.getKey() : null);
- }
-}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/package.html
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/package.html 2009-02-11 16:32:49 UTC (rev 3837)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/package.html 2009-02-11 17:47:18 UTC (rev 3838)
@@ -1,4 +0,0 @@
-<body>infrastructure for listening to process event logs that
-can be used to build up historic information about process
-executions.
-</body>
\ No newline at end of file
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/LogSession.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/LogSession.java 2009-02-11 16:32:49 UTC (rev 3837)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/LogSession.java 2009-02-11 17:47:18 UTC (rev 3838)
@@ -1,30 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.session;
-
-import org.jbpm.processlog.ProcessLog;
-
-public interface LogSession {
-
- void add(ProcessLog processLog);
-
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistoryEvent.java (from rev 3816, jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/ProcessLogImpl.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistoryEvent.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistoryEvent.java 2009-02-11 17:47:18 UTC (rev 3838)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history;
+
+import java.io.Serializable;
+
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+
+/** base class for process logs. Process logs are dispatched to the
+ * {@link HistorySession} that is configured in the environment.
+ *
+ * <p>ProcessLogs that are send to a LogSession is the probe mechanism
+ * provided to listen into the process execution progress and details.
+ * It is the mechanism to collect process history and process statistics.
+ * </p>
+ *
+ * @author Tom Baeyens
+ */
+public abstract class HistoryEvent implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ protected ExecutionImpl execution;
+
+ public void setExecution(ExecutionImpl execution) {
+ this.execution = execution;
+ }
+
+ public abstract void process();
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistoryEvent.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySession.java (from rev 3816, jbpm4/trunk/modules/api/src/main/java/org/jbpm/session/LogSession.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySession.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySession.java 2009-02-11 17:47:18 UTC (rev 3838)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history;
+
+
+public interface HistorySession {
+
+ void process(HistoryEvent historyEvent);
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySession.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionChain.java (from rev 3816, jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/LogSessionChain.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionChain.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionChain.java 2009-02-11 17:47:18 UTC (rev 3838)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+
+/** log session that delegates to a delegate list of log sessions.
+ *
+ * @author Tom Baeyens
+ */
+public class HistorySessionChain implements HistorySession {
+
+ protected List<HistorySession> delegates = new ArrayList<HistorySession>();
+
+ public void process(HistoryEvent historyEvent) {
+ for (HistorySession delegate: delegates) {
+ delegate.process(historyEvent);
+ }
+ }
+
+ public void addLogSession(HistorySession historySession) {
+ delegates.add(historySession);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionChain.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionFilter.java (from rev 3816, jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/LogSessionFilter.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionFilter.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionFilter.java 2009-02-11 17:47:18 UTC (rev 3838)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history;
+
+
+
+/** filtering log session.
+ *
+ * @author Tom Baeyens
+ */
+public class HistorySessionFilter implements HistorySession {
+
+ protected HistorySession delegate;
+ protected String type;
+
+ public void process(HistoryEvent historyEvent) {
+ if (passes(historyEvent)){
+ delegate.process(historyEvent);
+ }
+ }
+
+ /** can be overwritten in case filtering needs to be more
+ * sophisticated then just type matching. */
+ protected boolean passes(HistoryEvent historyEvent) {
+ return true;
+ }
+
+ public void setDelegate(HistorySession delegate) {
+ this.delegate = delegate;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistorySessionFilter.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java 2009-02-11 17:47:18 UTC (rev 3838)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.events;
+
+import org.hibernate.Session;
+import org.jbpm.env.Environment;
+import org.jbpm.pvm.internal.history.HistoryEvent;
+import org.jbpm.pvm.internal.history.model.HistoryProcessInstance;
+import org.jbpm.pvm.internal.util.Clock;
+
+/**
+ * @author Tom Baeyens
+ */
+public class ProcessInstanceEnd extends HistoryEvent {
+
+ private static final long serialVersionUID = 1L;
+
+ public void process() {
+ long dbid = execution.getDbid();
+ Session session = Environment.getFromCurrent(Session.class);
+ HistoryProcessInstance historyProcessInstance = (HistoryProcessInstance) session.load(HistoryProcessInstance.class, dbid);
+ historyProcessInstance.setEndTime(Clock.getCurrentTime());
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceStart.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceStart.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceStart.java 2009-02-11 17:47:18 UTC (rev 3838)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.events;
+
+import java.io.Serializable;
+
+import org.hibernate.Session;
+import org.jbpm.env.Environment;
+import org.jbpm.pvm.internal.history.HistoryEvent;
+import org.jbpm.pvm.internal.history.model.HistoryProcessInstance;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ProcessInstanceStart extends HistoryEvent implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ public void process() {
+ HistoryProcessInstance historyProcessInstance = new HistoryProcessInstance(execution);
+
+ Session session = Environment.getFromCurrent(Session.class);
+ session.save(historyProcessInstance);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceStart.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryActivityInstance.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryActivityInstance.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryActivityInstance.java 2009-02-11 17:47:18 UTC (rev 3838)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.model;
+
+import java.util.Date;
+
+import org.jbpm.pvm.internal.model.ActivityImpl;
+import org.jbpm.pvm.internal.util.Clock;
+
+/**
+ * @author Tom Baeyens
+ */
+public class HistoryActivityInstance {
+
+ protected long dbid;
+ protected int dbversion;
+
+ protected ActivityImpl activity;
+ protected String activityName;
+
+ protected Date createTime;
+ protected Date endTime;
+ protected long duration;
+
+ public HistoryActivityInstance() {
+ }
+
+ public HistoryActivityInstance(ActivityImpl activity) {
+ this.activity = activity;
+ this.createTime = Clock.getCurrentTime();
+ }
+
+ public void setEndTime(Date endTime) {
+ this.endTime = endTime;
+ this.duration = endTime.getTime() - createTime.getTime();
+ }
+
+
+ public long getDbid() {
+ return dbid;
+ }
+ public ActivityImpl getActivity() {
+ return activity;
+ }
+ public String getActivityName() {
+ return activityName;
+ }
+ public Date getCreateTime() {
+ return createTime;
+ }
+ public Date getEndTime() {
+ return endTime;
+ }
+ public long getDuration() {
+ return duration;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryActivityInstance.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstance.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstance.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstance.java 2009-02-11 17:47:18 UTC (rev 3838)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.model;
+
+import java.util.Date;
+
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+import org.jbpm.pvm.internal.util.Clock;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HistoryProcessInstance {
+
+ protected long dbid;
+ protected int dbversion;
+
+ protected ProcessDefinitionImpl processDefinition;
+ protected String id;
+ protected String key;
+ protected Date startTime;
+ protected Date endTime;
+ protected long duration;
+
+ public HistoryProcessInstance() {
+ }
+
+ public HistoryProcessInstance(ExecutionImpl processInstance) {
+ this.processDefinition = processInstance.getProcessDefinition();
+ this.dbid = processInstance.getDbid();
+ this.id = processInstance.getId();
+ this.key = processInstance.getKey();
+ this.startTime = Clock.getCurrentTime();
+ }
+
+ public void setEndTime(Date endTime) {
+ this.endTime = endTime;
+ this.duration = endTime.getTime() - startTime.getTime();
+ }
+
+ public Date getEndTime() {
+ return endTime;
+ }
+ public long getDbid() {
+ return dbid;
+ }
+ public ProcessDefinitionImpl getProcessDefinition() {
+ return processDefinition;
+ }
+ public Date getStartTime() {
+ return startTime;
+ }
+ public long getDuration() {
+ return duration;
+ }
+ public String getId() {
+ return id;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryProcessInstance.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskInstance.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskInstance.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskInstance.java 2009-02-11 17:47:18 UTC (rev 3838)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.history.model;
+
+import org.jbpm.pvm.internal.model.ActivityImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HistoryTaskInstance extends HistoryActivityInstance {
+
+ protected String assignee;
+
+ public HistoryTaskInstance() {
+ }
+
+ public HistoryTaskInstance(ActivityImpl activity, String assignee) {
+ super(activity);
+ this.assignee = assignee;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryTaskInstance.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/package.html (from rev 3816, jbpm4/trunk/modules/api/src/main/java/org/jbpm/processlog/package.html)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/package.html (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/package.html 2009-02-11 17:47:18 UTC (rev 3838)
@@ -0,0 +1,4 @@
+<body>infrastructure for listening to process event logs that
+can be used to build up historic information about process
+executions.
+</body>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/package.html
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-02-11 16:32:49 UTC (rev 3837)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-02-11 17:47:18 UTC (rev 3838)
@@ -25,9 +25,7 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.Date;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
@@ -43,20 +41,20 @@
import org.jbpm.client.ClientProcessInstance;
import org.jbpm.env.Environment;
import org.jbpm.env.Transaction;
-import org.jbpm.job.Timer;
import org.jbpm.listener.EventListener;
import org.jbpm.listener.EventListenerExecution;
import org.jbpm.log.Log;
+import org.jbpm.model.Activity;
import org.jbpm.model.Comment;
import org.jbpm.model.Event;
import org.jbpm.model.IdGenerator;
-import org.jbpm.model.Activity;
import org.jbpm.model.ObservableElement;
import org.jbpm.model.OpenExecution;
import org.jbpm.model.Transition;
-import org.jbpm.processlog.ProcessLog;
+import org.jbpm.pvm.internal.history.HistoryEvent;
+import org.jbpm.pvm.internal.history.HistorySession;
+import org.jbpm.pvm.internal.history.events.ProcessInstanceStart;
import org.jbpm.pvm.internal.job.MessageImpl;
-import org.jbpm.pvm.internal.job.TimerImpl;
import org.jbpm.pvm.internal.model.op.AtomicOperation;
import org.jbpm.pvm.internal.model.op.ExecuteActivity;
import org.jbpm.pvm.internal.model.op.MoveToChildActivity;
@@ -64,18 +62,9 @@
import org.jbpm.pvm.internal.model.op.ProceedToDestination;
import org.jbpm.pvm.internal.model.op.Signal;
import org.jbpm.pvm.internal.model.op.TakeTransition;
-import org.jbpm.pvm.internal.type.Converter;
-import org.jbpm.pvm.internal.type.Type;
-import org.jbpm.pvm.internal.type.Variable;
-import org.jbpm.pvm.internal.type.TypeSet;
-import org.jbpm.pvm.internal.type.variable.NullVariable;
-import org.jbpm.pvm.internal.type.variable.UnpersistableVariable;
-import org.jbpm.pvm.internal.util.Clock;
import org.jbpm.pvm.internal.util.EqualsUtil;
import org.jbpm.pvm.internal.util.Priority;
-import org.jbpm.session.LogSession;
import org.jbpm.session.MessageSession;
-import org.jbpm.session.TimerSession;
/**
* @author Tom Baeyens
@@ -203,6 +192,9 @@
}
this.state = STATE_ACTIVE;
ExecutionImpl scopedExecution = initializeScopes();
+
+
+ fireHistoryEvent(new ProcessInstanceStart());
fire(Event.START, processDefinition);
if (activity!=null) {
scopedExecution.performAtomicOperation(EXECUTE_ACTIVITY);
@@ -930,14 +922,13 @@
////////////////////////////////////////////////////////////////////////////////
- public void addLog(ProcessLog processLog) {
+ public void fireHistoryEvent(HistoryEvent historyEvent) {
Environment environment = Environment.getCurrent();
if (environment!=null) {
- LogSession logSession = environment.get(LogSession.class);
- if (logSession!=null) {
- processLog.setExecution(this);
- processLog.setTime(Clock.getCurrentTime());
- logSession.add(processLog);
+ HistorySession historySession = environment.get(HistorySession.class);
+ if (historySession!=null) {
+ historyEvent.setExecution(this);
+ historySession.process(historyEvent);
}
}
}
17 years, 2 months
JBoss JBPM SVN: r3837 - jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-02-11 11:32:49 -0500 (Wed, 11 Feb 2009)
New Revision: 3837
Modified:
jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessClassLoaderTest.java
Log:
[JBPM-1976] Bad usage of ClassLoader.loadClass() under JDK 6
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessClassLoaderTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessClassLoaderTest.java 2009-02-11 16:01:39 UTC (rev 3836)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessClassLoaderTest.java 2009-02-11 16:32:49 UTC (rev 3837)
@@ -19,35 +19,51 @@
* @author Tom Baeyens, bernd.ruecker(a)camunda.com
*
*/
-public class ProcessClassLoaderTest extends AbstractJbpmTestCase {
-
- public static class TestContextClassLoader extends ClassLoader {
- public TestContextClassLoader(ClassLoader parent) {
+public class ProcessClassLoaderTest extends AbstractJbpmTestCase
+{
+ public static class TestContextClassLoader extends ClassLoader
+ {
+ public TestContextClassLoader(ClassLoader parent)
+ {
super(parent);
}
- protected Class< ? > findClass(String name) throws ClassNotFoundException {
- if ("TestContextClassLoader-knows-where-to-find-ContextLoadedAction".equals(name)) {
- return Class.forName(ContextLoadedAction.class.getName(), false, getParent());
- }
- else if ("TestContextClassLoader-knows-where-to-find-ContextLoadedExceptionAction".equals(name)) {
- return Class.forName(ContextLoadedExceptionAction.class.getName(), false, getParent());
- }
- return null;
+
+ protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
+ {
+ //System.out.println("loadClass: " + name + ",resolve=" + resolve);
+ return super.loadClass(name, resolve);
}
+
+ @Override
+ public Class<?> loadClass(String name) throws ClassNotFoundException
+ {
+ //System.out.println("loadClass: " + name);
+ return super.loadClass(name);
+ }
+
+ protected Class<?> findClass(String name) throws ClassNotFoundException
+ {
+ //System.out.println("findClass: " + name);
+ return super.findClass(name);
+ }
}
static int contextLoadedActionInvocations = 0;
- static ClassLoader originalClassLoader = null;
-
- protected void setUp() throws Exception {
+ static ClassLoader originalClassLoader = null;
+
+ protected void setUp() throws Exception
+ {
super.setUp();
contextLoadedActionInvocations = 0;
originalClassLoader = Thread.currentThread().getContextClassLoader();
}
- public static class DefaultLoadedAction implements ActionHandler {
+ public static class DefaultLoadedAction implements ActionHandler
+ {
+ private static final long serialVersionUID = 1L;
- public void execute(ExecutionContext executionContext) throws Exception {
+ public void execute(ExecutionContext executionContext) throws Exception
+ {
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
assertSame(ProcessClassLoader.class, contextClassLoader.getClass());
@@ -57,35 +73,37 @@
contextLoadedActionInvocations++;
}
}
-
- /** DOES NOT configure usage of the context classloader. So this tests the default (backwards compatible) behaviour.
- * so the classloading hierarchy of DefaultLoadedAction should be
- * ProcessClassloader -> jbpm-lib classloader */
- public void testDefaultClassLoader() {
- ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
- "<process-definition>" +
- " <start-state name='start'>" +
- " <transition to='state'>" +
- " <action class='org.jbpm.jpdl.par.ProcessClassLoaderTest$DefaultLoadedAction' />" +
- " </transition>" +
- " </start-state>" +
- " <state name='state'>" +
- " <transition to='end'/>" +
- " </state>" +
- "</process-definition>"
- );
+ /*
+ * DOES NOT configure usage of the context classloader. So this tests the default (backwards compatible) behaviour. so the classloading hierarchy of
+ * DefaultLoadedAction should be ProcessClassloader -> jbpm-lib classloader
+ */
+ public void testDefaultClassLoader()
+ {
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlString("<process-definition>"
+ + " <start-state name='start'>"
+ + " <transition to='state'>"
+ + " <action class='" + DefaultLoadedAction.class.getName() + "' />"
+ + " </transition>"
+ + " </start-state>"
+ + " <state name='state'>"
+ + " <transition to='end'/>"
+ + " </state>"
+ + "</process-definition>");
+
// create the process instance
ProcessInstance processInstance = new ProcessInstance(processDefinition);
processInstance.signal();
-
- assertEquals(1, contextLoadedActionInvocations);
+
+ assertEquals(1, contextLoadedActionInvocations);
}
-
- public static class ContextLoadedAction implements ActionHandler {
+ public static class ContextLoadedAction implements ActionHandler
+ {
+ private static final long serialVersionUID = 1L;
- public void execute(ExecutionContext executionContext) throws Exception {
+ public void execute(ExecutionContext executionContext) throws Exception
+ {
ClassLoader processClassLoader = Thread.currentThread().getContextClassLoader();
assertSame(ProcessClassLoader.class, processClassLoader.getClass());
@@ -98,106 +116,112 @@
}
}
- /** configures usage of the context classloader
- * so the classloading hierarchy of ContextLoadedAction should be
- * ProcessClassloader -> TestContextClassLoader -> Thread.currentContextClassLoader */
- public void testContextClassLoader() {
-
- JbpmConfiguration jbpmConfiguration = JbpmConfiguration.parseXmlString(
- "<jbpm-configuration>" +
- " <string name='jbpm.classLoader' value='context' />" +
- "</jbpm-configuration>"
- );
-
+ /*
+ * configures usage of the context classloader so the classloading hierarchy of ContextLoadedAction should be ProcessClassloader -> TestContextClassLoader ->
+ * Thread.currentContextClassLoader
+ */
+ public void testContextClassLoader()
+ {
+
+ JbpmConfiguration jbpmConfiguration = JbpmConfiguration.parseXmlString("<jbpm-configuration>"
+ + " <string name='jbpm.classLoader' value='context' />"
+ + "</jbpm-configuration>");
+
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
- try {
+ try
+ {
TestContextClassLoader testContextClassLoader = new TestContextClassLoader(originalClassLoader);
Thread.currentThread().setContextClassLoader(testContextClassLoader);
-
- ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
- "<process-definition>" +
- " <start-state name='start'>" +
- " <transition to='state'>" +
- " <action class='TestContextClassLoader-knows-where-to-find-ContextLoadedAction' />" +
- " </transition>" +
- " </start-state>" +
- " <state name='state'>" +
- " <transition to='end'/>" +
- " </state>" +
- "</process-definition>"
- );
-
+
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlString("<process-definition>"
+ + " <start-state name='start'>"
+ + " <transition to='state'>"
+ + " <action class='" + ContextLoadedAction.class.getName() + "' />"
+ + " </transition>"
+ + " </start-state>"
+ + " <state name='state'>"
+ + " <transition to='end'/>"
+ + " </state>"
+ + "</process-definition>");
+
// create the process instance
ProcessInstance processInstance = new ProcessInstance(processDefinition);
processInstance.signal();
-
+
assertEquals(1, contextLoadedActionInvocations);
assertSame(testContextClassLoader, Thread.currentThread().getContextClassLoader());
-
- } finally {
+
+ }
+ finally
+ {
Thread.currentThread().setContextClassLoader(originalClassLoader);
jbpmContext.close();
}
}
- /**
- * a third test should set the testcontextClassLoader in the test and then
- * let the action throw an exception. Then it should be verified that the
- * original classloader is still restored correctly. Easiest is to start
- * from a copy of the testContextClassLoader
+ /*
+ * a third test should set the testcontextClassLoader in the test and then let the action throw an exception. Then it should be verified that the original classloader
+ * is still restored correctly. Easiest is to start from a copy of the testContextClassLoader
*/
- public static class ContextLoadedExceptionAction implements ActionHandler {
- public void execute(ExecutionContext executionContext) throws Exception {
+ public static class ContextLoadedExceptionAction implements ActionHandler
+ {
+ private static final long serialVersionUID = 1L;
+
+ public void execute(ExecutionContext executionContext) throws Exception
+ {
ClassLoader processClassLoader = Thread.currentThread().getContextClassLoader();
assertSame(ProcessClassLoader.class, processClassLoader.getClass());
-
+
ClassLoader testContextClassLoader = processClassLoader.getParent();
assertSame(TestContextClassLoader.class, testContextClassLoader.getClass());
-
+
assertSame(originalClassLoader, testContextClassLoader.getParent());
-
+
contextLoadedActionInvocations++;
-
+
throw new Exception("simulate exception");
}
}
- public void testContextClassLoaderException() {
- JbpmConfiguration jbpmConfiguration = JbpmConfiguration.parseXmlString(
- "<jbpm-configuration>" +
- " <string name='jbpm.classLoader' value='context' />" +
- "</jbpm-configuration>"
- );
-
+
+ public void testContextClassLoaderException()
+ {
+ JbpmConfiguration jbpmConfiguration = JbpmConfiguration.parseXmlString("<jbpm-configuration>"
+ + " <string name='jbpm.classLoader' value='context' />"
+ + "</jbpm-configuration>");
+
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
TestContextClassLoader testContextClassLoader = new TestContextClassLoader(originalClassLoader);
- try {
+ try
+ {
Thread.currentThread().setContextClassLoader(testContextClassLoader);
-
- ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
- "<process-definition>" +
- " <start-state name='start'>" +
- " <transition to='state'>" +
- " <action class='TestContextClassLoader-knows-where-to-find-ContextLoadedExceptionAction' />" +
- " </transition>" +
- " </start-state>" +
- " <state name='state'>" +
- " <transition to='end'/>" +
- " </state>" +
- "</process-definition>"
- );
-
+
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlString("<process-definition>"
+ + " <start-state name='start'>"
+ + " <transition to='state'>"
+ + " <action class='" + ContextLoadedExceptionAction.class.getName() + "' />"
+ + " </transition>"
+ + " </start-state>"
+ + " <state name='state'>"
+ + " <transition to='end'/>"
+ + " </state>"
+ + "</process-definition>");
+
// create the process instance
ProcessInstance processInstance = new ProcessInstance(processDefinition);
processInstance.signal();
-
- } catch(Exception ex) {
+
+ }
+ catch (Exception ex)
+ {
assertEquals(1, contextLoadedActionInvocations);
assertEquals("simulate exception", ex.getMessage());
assertSame(testContextClassLoader, Thread.currentThread().getContextClassLoader());
-
- } finally {
+
+ }
+ finally
+ {
Thread.currentThread().setContextClassLoader(originalClassLoader);
jbpmContext.close();
}
- }
+ }
}
17 years, 2 months
JBoss JBPM SVN: r3836 - in jbpm3/trunk/modules: core/src/main/java/org/jbpm/db/hibernate and 11 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-02-11 11:01:39 -0500 (Wed, 11 Feb 2009)
New Revision: 3836
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/configuration/BeanInfo.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/configuration/ConstructorInfo.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/configuration/JbpmTypeObjectInfo.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/configuration/ObjectFactoryImpl.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/hibernate/Converters.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/action/ActionTypes.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/ExceptionHandler.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/ProcessDefinition.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/NodeTypes.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/instantiation/Delegation.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/instantiation/FieldInstantiator.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/jpdl/par/ProcessArchive.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/security/authentication/SubjectAuthenticationService.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/ClassLoaderUtil.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/EqualsUtil.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/SerializabilityTest.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/context/exe/CustomSessionFactoryFactory.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessArchiveClassLoadingDbTest.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessClassLoaderTest.java
jbpm3/trunk/modules/identity/src/main/java/org/jbpm/identity/hibernate/PermissionUserType.java
Log:
[JBPM-1976] Bad usage of ClassLoader.loadClass() under JDK 6
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/configuration/BeanInfo.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/configuration/BeanInfo.java 2009-02-11 15:06:23 UTC (rev 3835)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/configuration/BeanInfo.java 2009-02-11 16:01:39 UTC (rev 3836)
@@ -82,7 +82,7 @@
if (constructorInfo==null) {
if (className==null) throw new JbpmException("bean '"+getName()+"' doesn't have a class or constructor specified");
try {
- Class clazz = objectFactory.loadClass(className);
+ Class clazz = objectFactory.classForName(className);
object = clazz.newInstance();
} catch (Exception e) {
throw new JbpmException("couldn't instantiate bean '"+getName()+"' of type '"+className+"'", e);
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/configuration/ConstructorInfo.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/configuration/ConstructorInfo.java 2009-02-11 15:06:23 UTC (rev 3835)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/configuration/ConstructorInfo.java 2009-02-11 16:01:39 UTC (rev 3836)
@@ -106,7 +106,7 @@
factory = objectFactory.getObject(factoryRefName);
factoryClass = factory.getClass();
} else {
- factoryClass = ClassLoaderUtil.loadClass(factoryClassName);
+ factoryClass = ClassLoaderUtil.classForName(factoryClassName);
}
try {
@@ -118,7 +118,7 @@
} else {
String className = (this.className!=null ? this.className : beanInfo.getClassName());
- Class clazz = objectFactory.loadClass(className);
+ Class clazz = objectFactory.classForName(className);
try {
Constructor constructor = clazz.getDeclaredConstructor(parameterTypes);
@@ -136,7 +136,7 @@
int nbrOfParameters = (parameterClassNames!=null ? parameterClassNames.length : 0);
Class[] parameterTypes = new Class[nbrOfParameters];
for (int i=0; i<nbrOfParameters; i++) {
- parameterTypes[i] = objectFactory.loadClass(parameterClassNames[i]);
+ parameterTypes[i] = objectFactory.classForName(parameterClassNames[i]);
}
return parameterTypes;
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/configuration/JbpmTypeObjectInfo.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/configuration/JbpmTypeObjectInfo.java 2009-02-11 15:06:23 UTC (rev 3835)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/configuration/JbpmTypeObjectInfo.java 2009-02-11 16:01:39 UTC (rev 3836)
@@ -65,7 +65,7 @@
throw new ConfigurationException("class is a required attribute in element variable-instance: "+XmlUtil.toString(jbpmTypeElement));
}
String variableInstanceClassName = variableInstanceElement.getAttribute("class");
- variableInstanceClass = ClassLoaderUtil.loadClass(variableInstanceClassName);
+ variableInstanceClass = ClassLoaderUtil.classForName(variableInstanceClassName);
if (! VariableInstance.class.isAssignableFrom(variableInstanceClass)) {
throw new ConfigurationException("variable instance class '"+variableInstanceClassName+"' is not a VariableInstance");
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/configuration/ObjectFactoryImpl.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/configuration/ObjectFactoryImpl.java 2009-02-11 15:06:23 UTC (rev 3835)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/configuration/ObjectFactoryImpl.java 2009-02-11 16:01:39 UTC (rev 3836)
@@ -157,7 +157,7 @@
return object;
}
- Class loadClass(String className) {
+ Class classForName(String className) {
// "lazy load" classloader, shouldn't be loaded too early
// because if jbpm.cfg.xml is not yet parsed, the correct class loader
// may not be initialized yet.
@@ -165,7 +165,7 @@
classLoader = ClassLoaderUtil.getClassLoader();
}
try {
- return classLoader.loadClass(className);
+ return Class.forName(className, false, classLoader);
} catch (ClassNotFoundException e) {
throw new JbpmException("couldn't load class '"+className+"'", e);
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/hibernate/Converters.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/hibernate/Converters.java 2009-02-11 15:06:23 UTC (rev 3835)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/hibernate/Converters.java 2009-02-11 16:01:39 UTC (rev 3836)
@@ -116,7 +116,7 @@
if (convertersByDatabaseId.containsKey(converterDatabaseId)) throw new JbpmException("duplicate converter id : '"+converterDatabaseId+"'");
String converterClassName = converterProperties.getProperty(converterDatabaseId);
try {
- Class converterClass = ClassLoaderUtil.loadClass(converterClassName);
+ Class converterClass = ClassLoaderUtil.classForName(converterClassName);
Converter converter = (Converter) converterClass.newInstance();
log.debug("adding converter '"+converterDatabaseId+"', '"+converterClassName+"'");
convertersByClassNames.put(converterClassName, converter);
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/action/ActionTypes.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/action/ActionTypes.java 2009-02-11 15:06:23 UTC (rev 3835)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/action/ActionTypes.java 2009-02-11 16:01:39 UTC (rev 3836)
@@ -76,7 +76,7 @@
String elementTag = actionTypeElement.getAttribute("element");
String className = actionTypeElement.getAttribute("class");
try {
- Class<?> actionClass = ClassLoaderUtil.getClassLoader().loadClass(className);
+ Class<?> actionClass = ClassLoaderUtil.classForName(className);
types.put(elementTag, actionClass.asSubclass(Action.class));
} catch (Exception e) {
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/ExceptionHandler.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/ExceptionHandler.java 2009-02-11 15:06:23 UTC (rev 3835)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/ExceptionHandler.java 2009-02-11 16:01:39 UTC (rev 3836)
@@ -43,7 +43,7 @@
public boolean matches( Throwable exception ) {
boolean matches = true;
if (exceptionClassName!=null) {
- Class<?> clazz = ClassLoaderUtil.loadClass(exceptionClassName);
+ Class<?> clazz = ClassLoaderUtil.classForName(exceptionClassName);
if (! clazz.isAssignableFrom(exception.getClass())) {
matches = false;
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/ProcessDefinition.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/ProcessDefinition.java 2009-02-11 15:06:23 UTC (rev 3835)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/ProcessDefinition.java 2009-02-11 16:01:39 UTC (rev 3836)
@@ -100,7 +100,7 @@
for (Object key : defaultModulesProperties.keySet()) {
String moduleClassName = (String) key;
try {
- ModuleDefinition moduleDefinition = (ModuleDefinition) ClassLoaderUtil.loadClass(moduleClassName).newInstance();
+ ModuleDefinition moduleDefinition = (ModuleDefinition) ClassLoaderUtil.classForName(moduleClassName).newInstance();
processDefinition.addDefinition(moduleDefinition);
} catch (Exception e) {
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/NodeTypes.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/NodeTypes.java 2009-02-11 15:06:23 UTC (rev 3835)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/NodeTypes.java 2009-02-11 16:01:39 UTC (rev 3836)
@@ -71,7 +71,7 @@
String elementTag = nodeTypeElement.getAttribute("element");
String className = nodeTypeElement.getAttribute("class");
try {
- Class<?> nodeClass = ClassLoaderUtil.getClassLoader().loadClass(className);
+ Class<?> nodeClass = ClassLoaderUtil.classForName(className);
types.put(elementTag, nodeClass.asSubclass(Node.class));
} catch (Exception e) {
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/instantiation/Delegation.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/instantiation/Delegation.java 2009-02-11 15:06:23 UTC (rev 3835)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/instantiation/Delegation.java 2009-02-11 16:01:39 UTC (rev 3836)
@@ -137,7 +137,7 @@
// load the class that needs to be instantiated
Class<?> delegationClass = null;
try {
- delegationClass = classLoader.loadClass(className);
+ delegationClass = Class.forName(className, false, classLoader);
}
catch (ClassNotFoundException e) {
throw new DelegationException("could not load delegation class '" + className + "'", e);
@@ -149,7 +149,7 @@
Class<?> instantiatorClass = null;
try {
// load the instantiator class
- instantiatorClass = classLoader.loadClass(configType);
+ instantiatorClass = Class.forName(configType, false, classLoader);
// create the instantiator with the default constructor
instantiator = (Instantiator) instantiatorClass.newInstance();
instantiatorCache.put(configType, instantiator);
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/instantiation/FieldInstantiator.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/instantiation/FieldInstantiator.java 2009-02-11 15:06:23 UTC (rev 3835)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/instantiation/FieldInstantiator.java 2009-02-11 16:01:39 UTC (rev 3836)
@@ -214,7 +214,7 @@
Class<?> type = String.class;
String attributeValue = element.attributeValue(attributeName);
if (attributeValue != null) {
- type = ClassLoaderUtil.loadClass(attributeValue);
+ type = ClassLoaderUtil.classForName(attributeValue);
}
return type;
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/jpdl/par/ProcessArchive.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/jpdl/par/ProcessArchive.java 2009-02-11 15:06:23 UTC (rev 3835)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/jpdl/par/ProcessArchive.java 2009-02-11 16:01:39 UTC (rev 3836)
@@ -153,7 +153,7 @@
{
Element element = (Element)iter.next();
String className = element.getAttribute("class");
- ProcessArchiveParser processArchiveParser = (ProcessArchiveParser)ClassLoaderUtil.loadClass(className).newInstance();
+ ProcessArchiveParser processArchiveParser = (ProcessArchiveParser)ClassLoaderUtil.classForName(className).newInstance();
if (processArchiveParser instanceof ConfigurableParser)
{
((ConfigurableParser)processArchiveParser).configure(element);
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/security/authentication/SubjectAuthenticationService.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/security/authentication/SubjectAuthenticationService.java 2009-02-11 15:06:23 UTC (rev 3835)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/security/authentication/SubjectAuthenticationService.java 2009-02-11 16:01:39 UTC (rev 3836)
@@ -86,7 +86,7 @@
}
protected void initPrincipalClass(String principalClassName) {
- this.principalClass = ClassLoaderUtil.loadClass(principalClassName);
+ this.principalClass = ClassLoaderUtil.classForName(principalClassName);
}
public String getActorId() {
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/ClassLoaderUtil.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/ClassLoaderUtil.java 2009-02-11 15:06:23 UTC (rev 3835)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/ClassLoaderUtil.java 2009-02-11 16:01:39 UTC (rev 3836)
@@ -39,6 +39,12 @@
// hide default constructor to prevent instantiation
}
+ /**
+ * Bad usage of ClassLoader.loadClass() under JDK 6
+ * https://jira.jboss.org/jira/browse/JBPM-1976
+ *
+ * @deprecated Use ClassLoaderUtil.classForName
+ */
public static Class<?> loadClass(String className)
{
try
@@ -51,6 +57,18 @@
}
}
+ public static Class<?> classForName(String className)
+ {
+ try
+ {
+ return Class.forName(className, false, getClassLoader());
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new JbpmException("class not found '" + className + "'", e);
+ }
+ }
+
/**
* returns the {@link ClassLoader} which is used in jbpm. Can be configured in jbpm.cfg.xml by the
* property <code>jbpm.classLoader</code>.
@@ -95,11 +113,9 @@
"'jbpm.classloader' property set to 'custom' but 'jbpm.customClassLoader.className' is null!");
}
- Class<?> clazz = ClassLoaderUtil.class.getClassLoader()
- .loadClass(classloaderClassname);
+ Class<?> clazz = Class.forName(classloaderClassname, false, ClassLoaderUtil.class.getClassLoader());
if (clazz == null) {
- clazz = Thread.currentThread().getContextClassLoader()
- .loadClass(classloaderClassname);
+ clazz = Class.forName(classloaderClassname, false, Thread.currentThread().getContextClassLoader());
}
return (ClassLoader) clazz.newInstance();
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/EqualsUtil.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/EqualsUtil.java 2009-02-11 15:06:23 UTC (rev 3835)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/EqualsUtil.java 2009-02-11 16:01:39 UTC (rev 3836)
@@ -53,8 +53,8 @@
static synchronized void initializeHibernateProxyClass() {
try {
- hibernateProxyClass = ClassLoaderUtil.getClassLoader().loadClass("org.hibernate.proxy.HibernateProxy");
- } catch (ClassNotFoundException e) {
+ hibernateProxyClass = ClassLoaderUtil.classForName("org.hibernate.proxy.HibernateProxy");
+ } catch (RuntimeException e) {
isHibernateInClasspth = false;
}
isInitialized = true;
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/SerializabilityTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/SerializabilityTest.java 2009-02-11 15:06:23 UTC (rev 3835)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/SerializabilityTest.java 2009-02-11 16:01:39 UTC (rev 3836)
@@ -135,7 +135,7 @@
}
private void assertSerializabilityOfClass(String className) {
- Class<?> clazz = ClassLoaderUtil.loadClass(className);
+ Class<?> clazz = ClassLoaderUtil.classForName(className);
if ( ! ( Serializable.class.isAssignableFrom(clazz)
|| Modifier.isAbstract(clazz.getModifiers())
|| isExcused(className)
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/context/exe/CustomSessionFactoryFactory.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/context/exe/CustomSessionFactoryFactory.java 2009-02-11 15:06:23 UTC (rev 3835)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/context/exe/CustomSessionFactoryFactory.java 2009-02-11 16:01:39 UTC (rev 3836)
@@ -32,7 +32,7 @@
public static SessionFactory createSessionFactory(String extraClassMapping) {
Configuration configuration = HibernateHelper.createConfiguration(null, null);
- Class clazz = ClassLoaderUtil.loadClass(extraClassMapping);
+ Class clazz = ClassLoaderUtil.classForName(extraClassMapping);
configuration.addClass(clazz);
return HibernateHelper.createSessionFactory(configuration, false);
}
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessArchiveClassLoadingDbTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessArchiveClassLoadingDbTest.java 2009-02-11 15:06:23 UTC (rev 3835)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessArchiveClassLoadingDbTest.java 2009-02-11 16:01:39 UTC (rev 3836)
@@ -75,7 +75,7 @@
assertNull(testClassLoader.getResource("org/jbpm/jpdl/par/classresource.txt"));
assertNull(testClassLoader.getResource("org/jbpm/jpdl/par/archiveresource.txt"));
try {
- testClassLoader.loadClass("org.jbpm.jpdl.par.ResourceAction");
+ Class.forName("org.jbpm.jpdl.par.ResourceAction", false, testClassLoader);
fail("expected exception");
} catch (ClassNotFoundException e) {
// OK
@@ -123,13 +123,13 @@
try {
ClassLoader testClassLoader = ProcessArchiveClassLoadingDbTest.class.getClassLoader();
try {
- testClassLoader.loadClass("org.jbpm.jpdl.par.InstantiateAction");
+ Class.forName("org.jbpm.jpdl.par.InstantiateAction", false, testClassLoader);
fail("expected exception");
} catch (ClassNotFoundException e) {
// OK
}
try {
- testClassLoader.loadClass("org.jbpm.jpdl.par.InstantiateClass");
+ Class.forName("org.jbpm.jpdl.par.InstantiateClass", false, testClassLoader);
fail("expected exception");
} catch (ClassNotFoundException e) {
// OK
@@ -172,13 +172,13 @@
try {
ClassLoader testClassLoader = ProcessArchiveClassLoadingDbTest.class.getClassLoader();
try {
- testClassLoader.loadClass("org.jbpm.jpdl.par.InstantiateAction");
+ Class.forName("org.jbpm.jpdl.par.InstantiateAction", false, testClassLoader);
fail("expected exception");
} catch (ClassNotFoundException e) {
// OK
}
// InstantiateClass should be visible on the test classpath
- testClassLoader.loadClass("org.jbpm.jpdl.par.InstantiateClass");
+ Class.forName("org.jbpm.jpdl.par.InstantiateClass", false, testClassLoader);
// deploy the process archive
ZipInputStream zipInputStream = new ZipInputStream(new ByteArrayInputStream(zipBytes));
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessClassLoaderTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessClassLoaderTest.java 2009-02-11 15:06:23 UTC (rev 3835)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/par/ProcessClassLoaderTest.java 2009-02-11 16:01:39 UTC (rev 3836)
@@ -27,10 +27,10 @@
}
protected Class< ? > findClass(String name) throws ClassNotFoundException {
if ("TestContextClassLoader-knows-where-to-find-ContextLoadedAction".equals(name)) {
- return getParent().loadClass(ContextLoadedAction.class.getName());
+ return Class.forName(ContextLoadedAction.class.getName(), false, getParent());
}
else if ("TestContextClassLoader-knows-where-to-find-ContextLoadedExceptionAction".equals(name)) {
- return getParent().loadClass(ContextLoadedExceptionAction.class.getName());
+ return Class.forName(ContextLoadedExceptionAction.class.getName(), false, getParent());
}
return null;
}
Modified: jbpm3/trunk/modules/identity/src/main/java/org/jbpm/identity/hibernate/PermissionUserType.java
===================================================================
--- jbpm3/trunk/modules/identity/src/main/java/org/jbpm/identity/hibernate/PermissionUserType.java 2009-02-11 15:06:23 UTC (rev 3835)
+++ jbpm3/trunk/modules/identity/src/main/java/org/jbpm/identity/hibernate/PermissionUserType.java 2009-02-11 16:01:39 UTC (rev 3836)
@@ -93,9 +93,8 @@
try {
// TODO optimize performance by caching the constructors
- Class<? extends Permission> permissionClass = PermissionUserType.class.getClassLoader()
- .loadClass(className)
- .asSubclass(Permission.class);
+ ClassLoader classLoader = PermissionUserType.class.getClassLoader();
+ Class<? extends Permission> permissionClass = Class.forName(className, false, classLoader).asSubclass(Permission.class);
Constructor<? extends Permission> constructor = permissionClass.getDeclaredConstructor(NAME_ACTIOS_CONSTRUCTOR_PARAMETER_TYPES);
permission = constructor.newInstance(new Object[] { name, actions });
}
17 years, 2 months
JBoss JBPM SVN: r3835 - in projects/gwt-console/trunk: plugin-example and 3 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-02-11 10:06:23 -0500 (Wed, 11 Feb 2009)
New Revision: 3835
Modified:
projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
projects/gwt-console/trunk/plugin-example/pom.xml
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceRef.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessImageComponent.java
projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg
Log:
RPC model changes. Strip down to just process management plugin
Modified: projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
===================================================================
--- projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2009-02-11 14:57:04 UTC (rev 3834)
+++ projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2009-02-11 15:06:23 UTC (rev 3835)
@@ -44,7 +44,7 @@
{
JSONValue root = JSONParser.parse(json);
long id = JSONWalk.on(root).next("processId").asLong();
- String version = JSONWalk.on(root).next("version").asString();
+ Long version = JSONWalk.on(root).next("version").asLong();
String name = JSONWalk.on(root).next("name").asString();
return new ProcessDefinitionRef(id, name, version);
Modified: projects/gwt-console/trunk/plugin-example/pom.xml
===================================================================
--- projects/gwt-console/trunk/plugin-example/pom.xml 2009-02-11 14:57:04 UTC (rev 3834)
+++ projects/gwt-console/trunk/plugin-example/pom.xml 2009-02-11 15:06:23 UTC (rev 3835)
@@ -7,6 +7,14 @@
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
<properties>
<gwt-console.version>1.0.0-SNAPSHOT</gwt-console.version>
<gwt-ext.version>2.0.5</gwt-ext.version>
@@ -23,6 +31,12 @@
</dependency>
<dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-user</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
<groupId>com.gwtext</groupId>
<artifactId>gwtext</artifactId>
<version>${gwt-ext.version}</version>
@@ -38,7 +52,7 @@
</dependencies>
<!-- Plugins -->
- <build>
+ <build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
@@ -73,5 +87,5 @@
</plugin>
</plugins>
</build>
-
+
</project>
Modified: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceRef.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceRef.java 2009-02-11 14:57:04 UTC (rev 3834)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceRef.java 2009-02-11 15:06:23 UTC (rev 3835)
@@ -35,7 +35,7 @@
public class ProcessInstanceRef
{
private long instanceId;
- private long parentId;
+ private long definitionId;
private String key;
public enum STATE {RUNNING, SUSPENDED, ENDED};
@@ -64,7 +64,7 @@
throw new IllegalArgumentException("An instance cannot be ended and suspended at the same time");
this.instanceId = id;
- this.parentId = parentId;
+ this.definitionId = parentId;
this.startDate = startDate;
this.endDate = endDate;
this.suspended = suspended;
@@ -96,14 +96,14 @@
}
@XmlElement(name = "parentId")
- public long getParentId()
+ public long getDefinitionId()
{
- return parentId;
+ return definitionId;
}
- public void setParentId(long parentId)
+ public void setDefinitionId(long definitionId)
{
- this.parentId = parentId;
+ this.definitionId = definitionId;
}
@XmlElement(name = "key")
@@ -289,7 +289,7 @@
ProcessInstanceRef that = (ProcessInstanceRef) o;
if (instanceId != that.instanceId) return false;
- if (parentId != that.parentId) return false;
+ if (definitionId != that.definitionId) return false;
if (suspended != that.suspended) return false;
if (endDate != null ? !endDate.equals(that.endDate) : that.endDate != null) return false;
if (key != null ? !key.equals(that.key) : that.key != null) return false;
@@ -304,7 +304,7 @@
{
int result;
result = (int) (instanceId ^ (instanceId >>> 32));
- result = 31 * result + (int) (parentId ^ (parentId >>> 32));
+ result = 31 * result + (int) (definitionId ^ (definitionId >>> 32));
result = 31 * result + (key != null ? key.hashCode() : 0);
result = 31 * result + (startDate != null ? startDate.hashCode() : 0);
result = 31 * result + (endDate != null ? endDate.hashCode() : 0);
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java 2009-02-11 14:57:04 UTC (rev 3834)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java 2009-02-11 15:06:23 UTC (rev 3835)
@@ -170,7 +170,7 @@
ProcessDefinitionRef pd = new ProcessDefinitionRef(
id,
r.getAsString("name"),
- r.getAsString("version")
+ Long.valueOf( r.getAsString("version"))
);
row2ProcessMap.put(i, pd);
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessImageComponent.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessImageComponent.java 2009-02-11 14:57:04 UTC (rev 3834)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessImageComponent.java 2009-02-11 15:06:23 UTC (rev 3835)
@@ -133,7 +133,7 @@
this.activeNodeInfo = activeNodeInfo;
DiagramNodeInfo activeNode = activeNodeInfo.getActiveNode();
- String imageUrl = view.getUrlBuilder().getProcessImageURL(instance.getParentId());
+ String imageUrl = view.getUrlBuilder().getProcessImageURL(instance.getDefinitionId());
HTML html = new HTML(
"<div id=\"imageContainer\" style=\"position:relative;top:-1;left:-1;height:" + activeNodeInfo.getHeight() + "px;width:" + activeNodeInfo.getWidth() + "px\">" +
Modified: projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg
===================================================================
--- projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg 2009-02-11 14:57:04 UTC (rev 3834)
+++ projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg 2009-02-11 15:06:23 UTC (rev 3835)
@@ -1,3 +1,5 @@
org.jboss.bpm.console.client.process.ProcessEditor
-org.jboss.bpm.console.client.task.TaskEditor
-org.jboss.bpm.console.client.report.ReportEditor
\ No newline at end of file
+
+# not yet implemented in jBPM4
+#org.jboss.bpm.console.client.task.TaskEditor
+#org.jboss.bpm.console.client.report.ReportEditor
\ No newline at end of file
17 years, 2 months
JBoss JBPM SVN: r3834 - in jbpm4/trunk: modules/api/src/main/java/org/jbpm and 12 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-02-11 09:57:04 -0500 (Wed, 11 Feb 2009)
New Revision: 3834
Added:
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ModelAdaptor.java
jbpm4/trunk/modules/enterprise/src/main/resources/META-INF/services/
jbpm4/trunk/modules/enterprise/src/main/resources/META-INF/services/org.jboss.bpm.console.server.integration.ManagementFactory
jbpm4/trunk/modules/enterprise/src/main/resources/jboss-service.xml
jbpm4/trunk/modules/enterprise/src/main/resources/jbpm-roles.properties
jbpm4/trunk/modules/enterprise/src/main/resources/jbpm-users.properties
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/ExecutionService.java
jbpm4/trunk/modules/db/jbpm4-db.iml
jbpm4/trunk/modules/db/pom.xml
jbpm4/trunk/modules/distro/pom.xml
jbpm4/trunk/modules/distro/src/main/resources/installer/install-definition.xml
jbpm4/trunk/modules/enterprise/jbpm4-enterprise.iml
jbpm4/trunk/modules/enterprise/pom.xml
jbpm4/trunk/modules/enterprise/scripts/assembly-config.xml
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ManagementFactoryImpl.java
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ProcessManagementImpl.java
jbpm4/trunk/modules/enterprise/src/main/resources/jbpm.cfg.xml
jbpm4/trunk/modules/examples/jbpm4-examples.iml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ExecutionQueryImpl.java
jbpm4/trunk/modules/test-db/jpm4-test-db.iml
jbpm4/trunk/pom.xml
Log:
First cut of the console integration
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/ExecutionService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/ExecutionService.java 2009-02-11 13:42:19 UTC (rev 3833)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/ExecutionService.java 2009-02-11 14:57:04 UTC (rev 3834)
@@ -27,7 +27,7 @@
/** manages runtime process executions.
- *
+ *
* @author Tom Baeyens
*/
public interface ExecutionService {
@@ -35,7 +35,7 @@
/** starts a new execution for the ProcessDefinition with the given processDefinitionDbid.
* @param processDefinitionId the {@link ProcessDefinition#getId() unique id} of the process definition. */
Execution startExecutionById(String processDefinitionId);
-
+
/** starts a new execution for the ProcessDefinition with the given processDefinitionDbid.
* @param processDefinitionId the {@link ProcessDefinition#getId() unique id} of the process definition.
* @param executionKey is a user provided reference for the new execution that must be unique over all
@@ -55,30 +55,30 @@
Execution startExecutionById(String processDefinitionId, Map<String, Object> variables, String executionKey);
/** starts a new execution in the latest version of the given process definition.
- * @param processDefinitionKey is the key of the process definition for which the latest version will be taken. */
- Execution startExecutionByKey(String processDefinitionKey);
+ * @param processDefinitionKey is the key of the process definition for which the latest version will be taken. */
+ Execution startExecutionByKey(String processDefinitionKey);
- /** starts a new execution in the latest version of the given processDefinitionName.
- * @param processDefinitionKey is the key of the process definition
- * for which the latest version will be taken.
- * @param executionKey is a user provided reference for the new execution
- * that must be unique over all process versions with the same name. */
- Execution startExecutionByKey(String processDefinitionKey, String executionKey);
+ /** starts a new execution in the latest version of the given processDefinitionName.
+ * @param processDefinitionKey is the key of the process definition
+ * for which the latest version will be taken.
+ * @param executionKey is a user provided reference for the new execution
+ * that must be unique over all process versions with the same name. */
+ Execution startExecutionByKey(String processDefinitionKey, String executionKey);
- /** starts a new execution in the latest version of the given processDefinitionName.
- * @param processDefinitionKey is the key of the process definition
- * for which the latest version will be taken.
- * @param variables are the initial values of the process variables that
- * will be set before the execution starts (read: before the initial
- * activity is executed). */
- Execution startExecutionByKey(String processDefinitionKey, Map<String, Object> variables);
+ /** starts a new execution in the latest version of the given processDefinitionName.
+ * @param processDefinitionKey is the key of the process definition
+ * for which the latest version will be taken.
+ * @param variables are the initial values of the process variables that
+ * will be set before the execution starts (read: before the initial
+ * activity is executed). */
+ Execution startExecutionByKey(String processDefinitionKey, Map<String, Object> variables);
- /** starts a new execution in the latest version of the given processDefinitionName.
- * @param processDefinitionKey is the key of the process definition for which the latest version will be taken.
- * @param variables are the initial values of the process variables that will be set before the execution starts.
- * @param executionKey is a user provided reference for the new execution that must be unique over all
- * process versions with the same name. */
- Execution startExecutionByKey(String processDefinitionKey, Map<String, Object> variables, String executionKey);
+ /** starts a new execution in the latest version of the given processDefinitionName.
+ * @param processDefinitionKey is the key of the process definition for which the latest version will be taken.
+ * @param variables are the initial values of the process variables that will be set before the execution starts.
+ * @param executionKey is a user provided reference for the new execution that must be unique over all
+ * process versions with the same name. */
+ Execution startExecutionByKey(String processDefinitionKey, Map<String, Object> variables, String executionKey);
/** the execution that is uniquely defined by the process definition and the business key. */
Execution findExecution(String processDefinitionName, String executionKey);
@@ -88,26 +88,26 @@
/** this method returns this execution and all its child executions recursively. */
List<Execution> findExecutions(String executionId);
-
+
/** provides an external trigger to an execution. */
Execution signalExecutionById(String executionId);
-
+
/** provides a named external trigger to an execution. */
Execution signalExecutionById(String executionId, String signalName);
-
+
/** provides a named external trigger to an execution with parameters. */
Execution signalExecutionById(String executionId, String signalName, Map<String, Object> parameters);
/** provides a external trigger to an execution with parameters. */
Execution signalExecutionById(String executionId, Map<String, Object> parameters);
-
-
+
+
/** provides a named external trigger to an execution. */
Execution signalExecutionByKey(String processDefinitionKey, String executionKey);
-
+
/** provides a named external trigger to an execution. */
Execution signalExecutionByKey(String processDefinitionKey, String executionKey, String signalName);
-
+
/** provides a named external trigger to an execution with parameters. */
Execution signalExecutionByKey(String processDefinitionKey, String executionKey, Map<String, Object> parameters);
@@ -120,19 +120,19 @@
/** search for process instances with criteria */
ExecutionQuery createProcessInstanceQuery();
- /** creates or overwrites a variable value on the referenced execution */
+ /** creates or overwrites a variable value on the referenced execution */
Execution setVariable(String executionId, String name, Object value);
-
- /** creates or overwrites the variable values on the referenced execution */
+
+ /** creates or overwrites the variable values on the referenced execution */
Execution setVariables(String executionId, Map<String, Object> variables);
-
- /** retrieves a variable */
+
+ /** retrieves a variable */
Object getVariable(String executionId, String variableName);
/** all the variables visible in the given execution scope */
Set<String> getVariableNames(String executionId);
- /** retrieves a map of variables */
+ /** retrieves a map of variables */
Map<String, Object> getVariables(String executionId, Set<String> variableNames);
/** delete a process instance */
Modified: jbpm4/trunk/modules/db/jbpm4-db.iml
===================================================================
--- jbpm4/trunk/modules/db/jbpm4-db.iml 2009-02-11 13:42:19 UTC (rev 3833)
+++ jbpm4/trunk/modules/db/jbpm4-db.iml 2009-02-11 14:57:04 UTC (rev 3834)
@@ -9,7 +9,7 @@
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="jbpm4-toplevel" />
- <orderEntry type="module" module-name="jbpm4-test-base" />
+ <orderEntry type="module" module-name="jbpm4-api" />
<orderEntry type="module" module-name="jbpm4-jpdl" />
<orderEntry type="module" module-name="jbpm4-pvm" />
<orderEntry type="module-library" exported="">
Modified: jbpm4/trunk/modules/db/pom.xml
===================================================================
--- jbpm4/trunk/modules/db/pom.xml 2009-02-11 13:42:19 UTC (rev 3833)
+++ jbpm4/trunk/modules/db/pom.xml 2009-02-11 14:57:04 UTC (rev 3834)
@@ -76,6 +76,20 @@
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
+ <id>install.hibernate.database.properties</id>
+ <phase>generate-test-resources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <copy file="target/jpdl-config/hibernate.cfg.${database}.xml"
+ tofile="target/test-classes/hibernate.cfg.xml"
+ overwrite="true" />
+ </tasks>
+ </configuration>
+ </execution>
+ <execution>
<id>generate-db-scripts</id>
<phase>process-resources</phase>
<goals>
Modified: jbpm4/trunk/modules/distro/pom.xml
===================================================================
--- jbpm4/trunk/modules/distro/pom.xml 2009-02-11 13:42:19 UTC (rev 3833)
+++ jbpm4/trunk/modules/distro/pom.xml 2009-02-11 14:57:04 UTC (rev 3834)
@@ -80,6 +80,27 @@
<version>${version}</version>
</dependency>
+ <!-- GWT Console -->
+ <dependency>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console</artifactId>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-server</artifactId>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-server-integration</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-rpc</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
<!-- Please sort by groupid -->
<dependency>
<groupId>org.apache.ant</groupId>
Modified: jbpm4/trunk/modules/distro/src/main/resources/installer/install-definition.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/installer/install-definition.xml 2009-02-11 13:42:19 UTC (rev 3833)
+++ jbpm4/trunk/modules/distro/src/main/resources/installer/install-definition.xml 2009-02-11 14:57:04 UTC (rev 3834)
@@ -156,12 +156,13 @@
<!-- jbpm/jbpm-service.sar , enterprise config-->
<fileset dir="@{deploy.artifacts.dir}/resources/jbpm-enterprise-config" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-service.sar" override="true">
- <include name="jbpm.cfg.xml"/>
+ <include name="jbpm.cfg.xml"/>
+ <include name="jbpm-users.properties"/>
+ <include name="jbpm-roles.properties"/>
</fileset>
-
- <!-- jbpm/, enterprise config-->
- <fileset dir="@{deploy.artifacts.dir}/resources/jbpm-enterprise-config" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/" override="true">
- <include name="jbpm-destinations-service.xml"/>
+ <!-- jbpm/jbpm-service.sar/META-INF , enterprise config-->
+ <fileset dir="@{deploy.artifacts.dir}/resources/jbpm-enterprise-config" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-service.sar/META-INF" override="true">
+ <include name="jboss-service.xml"/>
</fileset>
<!--fileset dir="@{deploy.artifacts.dir}/resources/jbpm-integration-config" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-service.sar" override="true">
@@ -176,17 +177,19 @@
</fileset>
<!-- jbpm/jbpm-enterprise.jar -->
- <!--file src="@{deploy.artifacts.dir}/lib/jbpm-enterprise.jar" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-enterprise.jar"
- unpack="true" override="true" /-->
+ <file src="@{deploy.artifacts.dir}/lib/jbpm-enterprise.jar" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-enterprise.jar"
+ unpack="true" override="true" />
<!-- jbpm/jbpm-userguide.war -->
<!--file src="@{deploy.artifacts.dir}/lib/jbpm-userguide.jdocbook" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-userguide.war"
unpack="true" override="true" /-->
- <!-- jbpm-destinations-service -->
- <!--file src="@{resources.dir}/destination/jbpm-destinations-service.xml" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm" /-->
-
+ <!-- jbpm-destinations-service.xml -->
+ <fileset dir="@{deploy.artifacts.dir}/resources/jbpm-enterprise-config" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm/" override="true">
+ <include name="jbpm-destinations-service.xml"/>
+ </fileset>
+
<!-- Database configs to docs/examples/jbpm -->
<fileset dir="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config" targetdir="${jbossInstallPath}/docs/examples/jbpm" override="true">
<include name="hibernate.cfg.hsqldb.xml"/>
@@ -225,14 +228,16 @@
********************************
-->
- <!--pack name="GWT-Console" parent="jbpm4 JBoss Integration" required="no" preselected="yes">
+ <pack name="GWT-Console" parent="jBPM4 JBoss Integration" required="no" preselected="yes">
<description>GWT-Console</description>
<file src="@{deploy.artifacts.dir}/lib/gwt-console.war" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm" unpack="false" override="true" />
<file src="@{deploy.artifacts.dir}/lib/gwt-console-server.war" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm" unpack="false" override="true" />
- <file src="@{deploy.artifacts.dir}/lib/report-server.war" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm" unpack="false" override="true" />
+ <file src="@{deploy.artifacts.dir}/lib/gwt-console-server-integration.jar" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/lib/" unpack="false" override="true" />
+ <file src="@{deploy.artifacts.dir}/lib/gwt-console-rpc.jar" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/lib/" unpack="false" override="true" />
+ <!--file src="@{deploy.artifacts.dir}/lib/report-server.war" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm" unpack="false" override="true" />
<file src="@{deploy.artifacts.dir}/lib/gwt-console-server-report.zip" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/data/birt/" unpack="true" override="true" />
- <file src="@{deploy.artifacts.dir}/lib/report-engine.zip" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/data/birt/" unpack="true" override="true" />
- </pack-->
+ <file src="@{deploy.artifacts.dir}/lib/report-engine.zip" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/data/birt/" unpack="true" override="true" /-->
+ </pack>
<!--
********************************
Modified: jbpm4/trunk/modules/enterprise/jbpm4-enterprise.iml
===================================================================
--- jbpm4/trunk/modules/enterprise/jbpm4-enterprise.iml 2009-02-11 13:42:19 UTC (rev 3833)
+++ jbpm4/trunk/modules/enterprise/jbpm4-enterprise.iml 2009-02-11 14:57:04 UTC (rev 3834)
@@ -11,10 +11,11 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="jbpm4-toplevel" />
- <orderEntry type="module" module-name="jbpm4-test-base" />
- <orderEntry type="module" module-name="jbpm4-pvm" />
- <orderEntry type="module-library">
+ <orderEntry type="module" module-name="jbpm4-toplevel" exported="" />
+ <orderEntry type="module" module-name="jbpm4-api" exported="" />
+ <orderEntry type="module" module-name="gwt-parent" exported="" />
+ <orderEntry type="module" module-name="jbpm4-pvm" exported="" />
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: cargo:cargo:jar:0.5:test">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/cargo/cargo/0.5/cargo-0.5.jar!/" />
@@ -23,7 +24,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: cactus:cactus:jar:13-1.7.1:test">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/cactus/cactus/13-1.7.1/cactus-13-1.7.1.jar!/" />
@@ -32,7 +33,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: nekohtml:nekohtml:jar:0.9.1:test">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/nekohtml/nekohtml/0.9.1/nekohtml-0.9.1.jar!/" />
@@ -43,7 +44,7 @@
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss.client:jbossall-client:jar:4.2.2.GA:runtime">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/client/jbossall-client/4.2.2.GA/jbossall-client-4.2.2.GA.jar!/" />
@@ -52,7 +53,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: xerces:xercesImpl:jar:2.6.2:test">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/xerces/xercesImpl/2.6.2/xercesImpl-2.6.2.jar!/" />
@@ -61,7 +62,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: aspectj:aspectjrt:jar:1.2.1:test">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/aspectj/aspectjrt/1.2.1/aspectjrt-1.2.1.jar!/" />
@@ -70,7 +71,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: jboss:jboss-j2ee:jar:4.2.2.GA:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/jboss/jboss-j2ee/4.2.2.GA/jboss-j2ee-4.2.2.GA.jar!/" />
@@ -79,7 +80,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: commons-httpclient:commons-httpclient:jar:2.0.2:test">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.jar!/" />
@@ -88,7 +89,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: cactus:cactus-ant:jar:13-1.7.1:test">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/cactus/cactus-ant/13-1.7.1/cactus-ant-13-1.7.1.jar!/" />
@@ -97,7 +98,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: rhino:js:jar:1.5R4.1:test">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/rhino/js/1.5R4.1/js-1.5R4.1.jar!/" />
@@ -108,7 +109,7 @@
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: ant:ant:jar:1.5.4:test">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/ant/ant/1.5.4/ant-1.5.4.jar!/" />
@@ -117,7 +118,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: jtidy:jtidy:jar:4aug2000r7-dev:test">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/jtidy/jtidy/4aug2000r7-dev/jtidy-4aug2000r7-dev.jar!/" />
@@ -128,7 +129,7 @@
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: httpunit:httpunit:jar:1.6:test">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/httpunit/httpunit/1.6/httpunit-1.6.jar!/" />
@@ -139,7 +140,7 @@
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: xerces:xmlParserAPIs:jar:2.2.1:test">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/xerces/xmlParserAPIs/2.2.1/xmlParserAPIs-2.2.1.jar!/" />
@@ -148,7 +149,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: hsqldb:hsqldb:jar:1.8.0.7:test">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/hsqldb/hsqldb/1.8.0.7/hsqldb-1.8.0.7.jar!/" />
@@ -157,16 +158,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
- <library name="M2 Dep: javax.transaction:jta:jar:1.0.1B:compile">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: junit:junit:jar:3.8.1:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar!/" />
@@ -175,7 +167,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.hibernate:hibernate:jar:3.2.6.ga:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/hibernate/hibernate/3.2.6.ga/hibernate-3.2.6.ga.jar!/" />
@@ -184,7 +176,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: antlr:antlr:jar:2.7.6:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar!/" />
@@ -193,7 +185,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: asm:asm:jar:1.5.3:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/asm/asm/1.5.3/asm-1.5.3.jar!/" />
@@ -202,7 +194,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: net.sf.ehcache:ehcache:jar:1.2.3:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/net/sf/ehcache/ehcache/1.2.3/ehcache-1.2.3.jar!/" />
@@ -211,7 +203,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.livetribe:livetribe-jsr223:jar:2.0.5:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/livetribe/livetribe-jsr223/2.0.5/livetribe-jsr223-2.0.5.jar!/" />
@@ -220,7 +212,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: dom4j:dom4j:jar:1.6.1:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar!/" />
@@ -231,7 +223,7 @@
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: cglib:cglib:jar:2.1_3:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/cglib/cglib/2.1_3/cglib-2.1_3.jar!/" />
@@ -240,7 +232,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: asm:asm-attrs:jar:1.5.3:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/asm/asm-attrs/1.5.3/asm-attrs-1.5.3.jar!/" />
@@ -249,7 +241,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: commons-collections:commons-collections:jar:2.1.1:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-collections/commons-collections/2.1.1/commons-collections-2.1.1.jar!/" />
@@ -258,7 +250,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: log4j:log4j:jar:1.2.14:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar!/" />
@@ -269,7 +261,7 @@
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: commons-logging:commons-logging:jar:1.0.4:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar!/" />
@@ -278,7 +270,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: juel:juel-engine:jar:2.1.0:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/juel/juel-engine/2.1.0/juel-engine-2.1.0.jar!/" />
@@ -287,7 +279,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: juel:juel:jar:2.1.0:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/juel/juel/2.1.0/juel-2.1.0.jar!/" />
@@ -296,7 +288,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: juel:juel-impl:jar:2.1.0:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/juel/juel-impl/2.1.0/juel-impl-2.1.0.jar!/" />
@@ -305,7 +297,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss.identity:idm-spi:jar:1.0.0-SNAPSHOT:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/identity/idm-spi/1.0.0-SNAPSHOT/idm-spi-1.0.0-SNAPSHOT.jar!/" />
@@ -314,7 +306,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.hibernate:hibernate-commons-annotations:jar:3.0.0.ga:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/hibernate/hibernate-commons-annotations/3.0.0.ga/hibernate-commons-annotations-3.0.0.ga.jar!/" />
@@ -323,7 +315,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss.cache:jbosscache-core:jar:3.0.2.GA:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/cache/jbosscache-core/3.0.2.GA/jbosscache-core-3.0.2.GA.jar!/" />
@@ -332,7 +324,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
@@ -341,7 +333,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss.identity:idm-api:jar:1.0.0-SNAPSHOT:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/identity/idm-api/1.0.0-SNAPSHOT/idm-api-1.0.0-SNAPSHOT.jar!/" />
@@ -350,7 +342,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss.identity:idm:jar:1.0.0-SNAPSHOT:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/identity/idm/1.0.0-SNAPSHOT/idm-1.0.0-SNAPSHOT.jar!/" />
@@ -359,7 +351,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.hibernate:ejb3-persistence:jar:1.0.1.GA:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/hibernate/ejb3-persistence/1.0.1.GA/ejb3-persistence-1.0.1.GA.jar!/" />
@@ -368,7 +360,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: com.sun.xml.bind:jaxb-impl:jar:2.1.8:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/sun/xml/bind/jaxb-impl/2.1.8/jaxb-impl-2.1.8.jar!/" />
@@ -377,7 +369,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.hibernate:hibernate-entitymanager:jar:3.3.2.GA:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/hibernate/hibernate-entitymanager/3.3.2.GA/hibernate-entitymanager-3.3.2.GA.jar!/" />
@@ -386,7 +378,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar!/" />
@@ -397,7 +389,7 @@
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
@@ -406,7 +398,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: javax.servlet:servlet-api:jar:2.5:test">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar!/" />
@@ -415,7 +407,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: javassist:javassist:jar:3.4.GA:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javassist/javassist/3.4.GA/javassist-3.4.GA.jar!/" />
@@ -424,7 +416,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: javax.persistence:persistence-api:jar:1.0:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/persistence/persistence-api/1.0/persistence-api-1.0.jar!/" />
@@ -433,7 +425,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss.identity:idm-common:jar:1.0.0-SNAPSHOT:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/identity/idm-common/1.0.0-SNAPSHOT/idm-common-1.0.0-SNAPSHOT.jar!/" />
@@ -442,7 +434,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: jgroups:jgroups:jar:2.6.7.GA:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/jgroups/jgroups/2.6.7.GA/jgroups-2.6.7.GA.jar!/" />
@@ -453,7 +445,7 @@
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: javax.activation:activation:jar:1.1:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
@@ -464,7 +456,7 @@
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.hibernate:hibernate-annotations:jar:3.3.1.GA:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/hibernate/hibernate-annotations/3.3.1.GA/hibernate-annotations-3.3.1.GA.jar!/" />
@@ -473,7 +465,7 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
+ <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss:jboss-common-core:jar:2.2.10.GA:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/jboss-common-core/2.2.10.GA/jboss-common-core-2.2.10.GA.jar!/" />
@@ -484,6 +476,35 @@
</SOURCES>
</library>
</orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.gwt:gwt-servlet:jar:1.5.2:runtime">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/gwt/gwt-servlet/1.5.2/gwt-servlet-1.5.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/code/gson/gson/1.2.2/gson-1.2.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.transaction:jta:jar:1.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/transaction/jta/1.1/jta-1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/transaction/jta/1.1/jta-1.1-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
</module>
Modified: jbpm4/trunk/modules/enterprise/pom.xml
===================================================================
--- jbpm4/trunk/modules/enterprise/pom.xml 2009-02-11 13:42:19 UTC (rev 3833)
+++ jbpm4/trunk/modules/enterprise/pom.xml 2009-02-11 14:57:04 UTC (rev 3834)
@@ -39,7 +39,7 @@
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-pvm</artifactId>
<version>${version}</version>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.jboss.bpm</groupId>
<artifactId>gwt-console-server-integration</artifactId>
@@ -84,6 +84,9 @@
<excludes>
<exclude>jbpm.cfg.xml</exclude>
<exclude>jbpm-destinations-service.xml</exclude>
+ <exclude>jbpm-users.properties</exclude>
+ <exclude>jbpm-roles.properties</exclude>
+ <exclude>jboss-service.xml</exclude>
</excludes>
</configuration>
</plugin>
Modified: jbpm4/trunk/modules/enterprise/scripts/assembly-config.xml
===================================================================
--- jbpm4/trunk/modules/enterprise/scripts/assembly-config.xml 2009-02-11 13:42:19 UTC (rev 3833)
+++ jbpm4/trunk/modules/enterprise/scripts/assembly-config.xml 2009-02-11 14:57:04 UTC (rev 3834)
@@ -12,6 +12,9 @@
<includes>
<include>jbpm.cfg.xml</include>
<include>jbpm-destinations-service.xml</include>
+ <include>jbpm-users.properties</include>
+ <include>jbpm-roles.properties</include>
+ <include>jboss-service.xml</include>
</includes>
</fileSet>
</fileSets>
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ManagementFactoryImpl.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ManagementFactoryImpl.java 2009-02-11 13:42:19 UTC (rev 3833)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ManagementFactoryImpl.java 2009-02-11 14:57:04 UTC (rev 3834)
@@ -43,9 +43,4 @@
{
throw new RuntimeException("Not implemented");
}
-
- public ExtensionManagement createExtensionManagement()
- {
- throw new RuntimeException("Not implemented");
- }
}
Added: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ModelAdaptor.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ModelAdaptor.java (rev 0)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ModelAdaptor.java 2009-02-11 14:57:04 UTC (rev 3834)
@@ -0,0 +1,67 @@
+/*
+ * 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.jbpm.enterprise.mgmt;
+
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+
+import org.jbpm.ProcessDefinition;
+import org.jbpm.Execution;
+import org.jbpm.model.OpenExecution;
+import org.jbpm.model.OpenProcessDefinition;
+import org.jbpm.pvm.internal.model.ProcessElementImpl;
+
+import java.util.Date;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class ModelAdaptor
+{
+ public static ProcessDefinitionRef adoptDefinition(OpenProcessDefinition p0)
+ {
+ ProcessDefinitionRef def = new ProcessDefinitionRef();
+ def.setProcessId( ((ProcessElementImpl)p0).getDbid() );
+ def.setName(p0.getName());
+ def.setVersion(p0.getVersion());
+
+ def.setKey( p0.getKey() );
+ def.setDescription(p0.getDescription());
+ def.setPackageName(p0.getPackageName());
+
+ return def;
+
+ }
+
+ public static ProcessInstanceRef adoptExecution(OpenExecution e0)
+ {
+ ProcessInstanceRef ref = new ProcessInstanceRef();
+ ref.setInstanceId( e0.getDbid() );
+ ref.setKey(e0.getKey());
+ ref.setDefinitionId(e0.getProcessDefinition().getDbid());
+
+
+ ref.setState( ProcessInstanceRef.STATE.RUNNING); // TODO: FIXME
+ ref.setStartDate( new Date() ); // TODO: FIXME
+ return ref;
+ }
+}
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ProcessManagementImpl.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ProcessManagementImpl.java 2009-02-11 13:42:19 UTC (rev 3833)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/mgmt/ProcessManagementImpl.java 2009-02-11 14:57:04 UTC (rev 3834)
@@ -24,40 +24,80 @@
import org.jboss.bpm.console.server.integration.ProcessManagement;
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+import org.jbpm.*;
+import org.jbpm.model.OpenProcessDefinition;
+import org.jbpm.model.OpenExecution;
-import java.util.List;
+import java.util.*;
+import java.io.InputStream;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
class ProcessManagementImpl implements ProcessManagement
{
+ private ProcessEngine processEngine;
- private CommandDelegate delegate;
-
public ProcessManagementImpl()
{
- this.delegate = new CommandDelegate();
+ this.processEngine = new Configuration().buildProcessEngine();
}
public List<ProcessDefinitionRef> getProcessDefinitions()
{
- throw new RuntimeException("Not implemented");
+ List<ProcessDefinitionRef> results = new ArrayList<ProcessDefinitionRef>();
+
+ ProcessService processService = this.processEngine.getProcessService();
+ List<String> keys = processService.findProcessDefinitionKeys();
+ Set<ProcessDefinition> definitions = new HashSet<ProcessDefinition>();
+ for(String key : keys)
+ {
+ definitions.addAll(
+ processService.findProcessDefinitionsByKey(key)
+ );
+ }
+
+ // adopt ProcessDefinition to console model
+ for(ProcessDefinition p0 : definitions)
+ {
+ results.add( ModelAdaptor.adoptDefinition((OpenProcessDefinition)p0) );
+ }
+
+ return results;
+
}
public ProcessDefinitionRef getProcessDefinition(long procDefId)
{
- throw new RuntimeException("Not implemented");
+ ProcessService processService = this.processEngine.getProcessService();
+ ProcessDefinition p0 = processService.findProcessDefinitionById(String.valueOf(procDefId));
+ return ModelAdaptor.adoptDefinition((OpenProcessDefinition)p0);
}
public List<ProcessDefinitionRef> removeProcessDefinition(long procDefId)
{
- throw new RuntimeException("Not implemented");
+ ProcessService processService = this.processEngine.getProcessService();
+ processService.deleteProcessDefinitionAndInstances(String.valueOf(procDefId));
+ return getProcessDefinitions();
}
public List<ProcessInstanceRef> getProcessInstances(long procDefId)
{
- throw new RuntimeException("Not implemented");
+ ExecutionService execService = this.processEngine.getExecutionService();
+ ExecutionQuery query = execService.createExecutionQuery();
+ query.processDefinitionId(String.valueOf(procDefId));
+ List<Execution> executions = query.execute();
+
+ List<ProcessInstanceRef> results = new ArrayList<ProcessInstanceRef>();
+ for(Execution exec : executions)
+ {
+ if(((OpenExecution)exec).getProcessInstance()==null) // parent execution
+ {
+ results.add( ModelAdaptor.adoptExecution((OpenExecution)exec) );
+ }
+ }
+
+ return results;
}
public ProcessInstanceRef getProcessInstance(long procId)
@@ -79,5 +119,16 @@
{
throw new RuntimeException("Not implemented");
}
+
+ public void deploy(InputStream deployment)
+ {
+ List<ProcessDefinition> definitions =
+ this.processEngine.getProcessService()
+ .createDeployment()
+ .addInputStream("Deployment-"+UUID.randomUUID().toString(),deployment)
+ .deploy()
+ .getProcessDefinitions();
+
+ }
}
Added: jbpm4/trunk/modules/enterprise/src/main/resources/META-INF/services/org.jboss.bpm.console.server.integration.ManagementFactory
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/resources/META-INF/services/org.jboss.bpm.console.server.integration.ManagementFactory (rev 0)
+++ jbpm4/trunk/modules/enterprise/src/main/resources/META-INF/services/org.jboss.bpm.console.server.integration.ManagementFactory 2009-02-11 14:57:04 UTC (rev 3834)
@@ -0,0 +1 @@
+org.jbpm.enterprise.mgmt.ManagementFactoryImpl
\ No newline at end of file
Added: jbpm4/trunk/modules/enterprise/src/main/resources/jboss-service.xml
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/resources/jboss-service.xml (rev 0)
+++ jbpm4/trunk/modules/enterprise/src/main/resources/jboss-service.xml 2009-02-11 14:57:04 UTC (rev 3834)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <!-- The custom JAAS login configuration that installs
+ a Configuration capable of dynamically updating the
+ config settings
+ -->
+ <mbean code="org.jboss.security.auth.login.DynamicLoginConfig" name="org.jboss.jbpm:service=LoginConfig">
+ <attribute name="PolicyConfig" serialDataType="jbxb">
+ <jaas:policy xsi:schemaLocation="urn:jboss:security-config:4.1 resource:security-config_4_1.xsd" xmlns:jaas="urn:jboss:security-config:4.1"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <jaas:application-policy name="jbpm-console">
+ <jaas:authentication>
+
+ <!-- Simple authentication -->
+ <jaas:login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
+ flag="required">
+ <jaas:module-option name="usersProperties">jbpm-users.properties</jaas:module-option>
+ <jaas:module-option name="rolesProperties">jbpm-roles.properties</jaas:module-option>
+ </jaas:login-module>
+
+
+ <!-- Authenticate against the IDM database -->
+ <!--jaas:login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
+ <jaas:module-option name="dsJndiName">java:/JbpmDS</jaas:module-option>
+ <jaas:module-option name="principalsQuery"> SELECT PASSWORD_ FROM JBPM_ID_USER WHERE NAME_=? </jaas:module-option>
+ <jaas:module-option name="rolesQuery">
+ SELECT g.NAME_ ,'Roles' FROM JBPM_ID_USER u, JBPM_ID_MEMBERSHIP m, JBPM_ID_GROUP g
+ WHERE g.TYPE_='security-role' AND m.GROUP_ = g.ID_ AND m.USER_ = u.ID_ AND u.NAME_=? </jaas:module-option>
+ </jaas:login-module-->
+ </jaas:authentication>
+ </jaas:application-policy>
+ </jaas:policy>
+ </attribute>
+ <depends optional-attribute-name="LoginConfigService"> jboss.security:service=XMLLoginConfig</depends>
+ <depends optional-attribute-name="SecurityManagerService"> jboss.security:service=JaasSecurityManager</depends>
+ </mbean>
+</server>
Added: jbpm4/trunk/modules/enterprise/src/main/resources/jbpm-roles.properties
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/resources/jbpm-roles.properties (rev 0)
+++ jbpm4/trunk/modules/enterprise/src/main/resources/jbpm-roles.properties 2009-02-11 14:57:04 UTC (rev 3834)
@@ -0,0 +1 @@
+admin=admin
\ No newline at end of file
Added: jbpm4/trunk/modules/enterprise/src/main/resources/jbpm-users.properties
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/resources/jbpm-users.properties (rev 0)
+++ jbpm4/trunk/modules/enterprise/src/main/resources/jbpm-users.properties 2009-02-11 14:57:04 UTC (rev 3834)
@@ -0,0 +1 @@
+admin=admin
\ No newline at end of file
Modified: jbpm4/trunk/modules/enterprise/src/main/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/resources/jbpm.cfg.xml 2009-02-11 13:42:19 UTC (rev 3833)
+++ jbpm4/trunk/modules/enterprise/src/main/resources/jbpm.cfg.xml 2009-02-11 14:57:04 UTC (rev 3834)
@@ -20,7 +20,10 @@
<process-service />
<execution-service />
<management-service />
- <ejb-local-command-service />
+
+ <ejb-local-command-service>
+ <home jndi-name="java:jbpm/CommandExecutor"/>
+ </ejb-local-command-service>
<hibernate-configuration resource="hibernate.cfg.xml"/>
Modified: jbpm4/trunk/modules/examples/jbpm4-examples.iml
===================================================================
--- jbpm4/trunk/modules/examples/jbpm4-examples.iml 2009-02-11 13:42:19 UTC (rev 3833)
+++ jbpm4/trunk/modules/examples/jbpm4-examples.iml 2009-02-11 14:57:04 UTC (rev 3834)
@@ -10,7 +10,7 @@
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="jbpm4-toplevel" />
- <orderEntry type="module" module-name="jbpm4-test-base" />
+ <orderEntry type="module" module-name="jbpm4-api" />
<orderEntry type="module" module-name="jbpm4-jpdl" />
<orderEntry type="module" module-name="jbpm4-pvm" />
<orderEntry type="module-library">
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ExecutionQueryImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ExecutionQueryImpl.java 2009-02-11 13:42:19 UTC (rev 3833)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ExecutionQueryImpl.java 2009-02-11 14:57:04 UTC (rev 3834)
@@ -68,15 +68,15 @@
}
if (processDefinitionId!=null) {
- appendWhereClause("e.processDefinition.id = '"+processDefinitionId+"' ", hql);
+ appendWhereClause("execution.processDefinition.id = '"+processDefinitionId+"' ", hql);
}
if (processDefinitionNameLike!=null) {
- appendWhereClause("e.processDefinition.name like '"+processDefinitionNameLike+"' ", hql);
+ appendWhereClause("execution.processDefinition.name like '"+processDefinitionNameLike+"' ", hql);
}
if (processDefinitionKeyLike!=null) {
- appendWhereClause("e.processDefinition.key like '"+processDefinitionKeyLike+"' ", hql);
+ appendWhereClause("execution.processDefinition.key like '"+processDefinitionKeyLike+"' ", hql);
}
appendOrderByClause(hql);
Modified: jbpm4/trunk/modules/test-db/jpm4-test-db.iml
===================================================================
--- jbpm4/trunk/modules/test-db/jpm4-test-db.iml 2009-02-11 13:42:19 UTC (rev 3833)
+++ jbpm4/trunk/modules/test-db/jpm4-test-db.iml 2009-02-11 14:57:04 UTC (rev 3834)
@@ -9,10 +9,10 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="jbpm4-toplevel" exported="" />
- <orderEntry type="module" module-name="jbpm4-test-base" exported="" />
- <orderEntry type="module" module-name="jbpm4-jpdl" exported="" />
- <orderEntry type="module" module-name="jbpm4-pvm" exported="" />
+ <orderEntry type="module" module-name="jbpm4-toplevel" />
+ <orderEntry type="module" module-name="jbpm4-api" />
+ <orderEntry type="module" module-name="jbpm4-jpdl" />
+ <orderEntry type="module" module-name="jbpm4-pvm" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: javax.transaction:jta:jar:1.0.1B:compile">
<CLASSES>
Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml 2009-02-11 13:42:19 UTC (rev 3833)
+++ jbpm4/trunk/pom.xml 2009-02-11 14:57:04 UTC (rev 3834)
@@ -100,16 +100,31 @@
<artifactId>jbpm-db</artifactId>
<version>${version}</version>
</dependency>
+
+ <!-- GWT console -->
<dependency>
<groupId>org.jboss.bpm</groupId>
- <artifactId>gwt-console-server-integration</artifactId>
+ <artifactId>gwt-console</artifactId>
<version>${gwt.console.version}</version>
+ <type>war</type>
</dependency>
<dependency>
- <groupId>org.livetribe</groupId>
- <artifactId>livetribe-jsr223</artifactId>
- <version>${jsr233.version}</version>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-server</artifactId>
+ <version>${gwt.console.version}</version>
+ <type>war</type>
</dependency>
+ <dependency>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-server-integration</artifactId>
+ <version>${gwt.console.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-rpc</artifactId>
+ <version>${gwt.console.version}</version>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>org.jbpm.jbpm4</groupId>
@@ -200,6 +215,11 @@
<version>${log4j.version}</version>
</dependency>
<dependency>
+ <groupId>org.livetribe</groupId>
+ <artifactId>livetribe-jsr223</artifactId>
+ <version>${jsr233.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>${spring.version}</version>
17 years, 2 months
JBoss JBPM SVN: r3833 - jbpm3/trunk/hudson.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-02-11 08:42:19 -0500 (Wed, 11 Feb 2009)
New Revision: 3833
Modified:
jbpm3/trunk/hudson/profiles.xml.redhat.qa
Log:
updates requested by aleksandar kostadinov
Modified: jbpm3/trunk/hudson/profiles.xml.redhat.qa
===================================================================
--- jbpm3/trunk/hudson/profiles.xml.redhat.qa 2009-02-11 13:33:15 UTC (rev 3832)
+++ jbpm3/trunk/hudson/profiles.xml.redhat.qa 2009-02-11 13:42:19 UTC (rev 3833)
@@ -28,12 +28,13 @@
<jdbc.sybase.username>jbpm3</jdbc.sybase.username>
<jdbc.sybase.password>jbpm3</jdbc.sybase.password>
- <jdbc.postgresql.url>jdbc:postgresql://localhost:5432/jbpmtest</jdbc.postgresql.url>
- <jdbc.postgresql.server>localhost</jdbc.postgresql.server>
+ <jdbc.postgresql.url>jdbc:postgresql://dev01.qa.atl2.redhat.com:5432/jbpm3</jdbc.postgresql.url>
+ <jdbc.postgresql.server>dev01.qa.atl2.redhat.com</jdbc.postgresql.server>
<jdbc.postgresql.port>5432</jdbc.postgresql.port>
- <jdbc.postgresql.database>jbpmtest</jdbc.postgresql.database>
- <jdbc.postgresql.username>jbpmtest</jdbc.postgresql.username>
- <jdbc.postgresql.password></jdbc.postgresql.password>
+ <jdbc.postgresql.database>jbpm3</jdbc.postgresql.database>
+ <jdbc.postgresql.username>jbpm3</jdbc.postgresql.username>
+ <jdbc.postgresql.password>jbpm3</jdbc.postgresql.password>
+
</properties>
</profile>
17 years, 2 months
JBoss JBPM SVN: r3832 - in jbpm3/trunk/modules/core/src: test/java/org/jbpm and 1 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-02-11 08:33:15 -0500 (Wed, 11 Feb 2009)
New Revision: 3832
Added:
jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm2036/
jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm2036/JBPM2036Test.java
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/exe/Token.java
Log:
[JBPM-2036] Added test case
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/exe/Token.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/exe/Token.java 2009-02-11 13:13:20 UTC (rev 3831)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/exe/Token.java 2009-02-11 13:33:15 UTC (rev 3832)
@@ -456,7 +456,8 @@
public String toString()
{
- return "Token(" + getFullName() + ")";
+ getNode();
+ return "Token[name=" + getFullName() + ",node=" + getNode() + "]";
}
public boolean hasEnded()
Added: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm2036/JBPM2036Test.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm2036/JBPM2036Test.java (rev 0)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm2036/JBPM2036Test.java 2009-02-11 13:33:15 UTC (rev 3832)
@@ -0,0 +1,69 @@
+package org.jbpm.jbpm2036;
+
+import org.jbpm.db.AbstractDbTestCase;
+import org.jbpm.graph.def.ActionHandler;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ExecutionContext;
+import org.jbpm.graph.exe.ProcessInstance;
+import org.jbpm.graph.exe.Token;
+
+/**
+ * StaleObjectStateException when timer ends process
+ *
+ * https://jira.jboss.org/jira/browse/JBPM-2036
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 11-Feb-2009
+ */
+public class JBPM2036Test extends AbstractDbTestCase
+{
+ public void testTimerAction()
+ {
+ if (true)
+ {
+ System.out.println("FIXME: [JBPM-2036] StaleObjectStateException when timer ends process");
+ return;
+ }
+
+ ProcessDefinition pd = getProcessDefinition();
+ jbpmContext.deployProcessDefinition(pd);
+ newTransaction();
+ try
+ {
+ ProcessInstance pi = pd.createProcessInstance();
+ Token tok = pi.getRootToken();
+ tok.signal();
+ }
+ finally {
+ graphSession.deleteProcessDefinition(pd.getId());
+ }
+ }
+
+ private ProcessDefinition getProcessDefinition()
+ {
+ ProcessDefinition pd = ProcessDefinition.parseXmlString("<process-definition name='jbpm2036' initial='start'>"
+ + " <node name='start'>"
+ + " <transition to='state1'/>"
+ + " </node>"
+ + " <state name='state1'>"
+ + " <timer name='timer-to-end-with-repeat' duedate='1 second' repeat='5 seconds'>"
+ + " <action class='" + TimerAction.class.getName() + "' />"
+ + " </timer>"
+ + " <transition to='end'/>"
+ + " </state>"
+ + " <end-state name='end' />"
+ + "</process-definition>");
+ return pd;
+ }
+
+ public static class TimerAction implements ActionHandler
+ {
+ private static final long serialVersionUID = 1L;
+
+ public void execute(ExecutionContext executionContext) throws Exception
+ {
+ System.out.println("leaveNode");
+ executionContext.leaveNode();
+ }
+ }
+}
Property changes on: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm2036/JBPM2036Test.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 2 months
JBoss JBPM SVN: r3831 - in projects/gwt-console/trunk: plugin-api and 9 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-02-11 08:13:20 -0500 (Wed, 11 Feb 2009)
New Revision: 3831
Added:
projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/gson/
projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/gson/GsonFactory.java
projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/gson/SQLDateTypeAdapter.java
Removed:
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/server/gson/
projects/gwt-console/trunk/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ExtensionManagement.java
Modified:
projects/gwt-console/trunk/gwt-parent.iml
projects/gwt-console/trunk/plugin-api/plugin.iml
projects/gwt-console/trunk/pom.xml
projects/gwt-console/trunk/rpc/pom.xml
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java
projects/gwt-console/trunk/server-integration/gwt-server-integration.iml
projects/gwt-console/trunk/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ManagementFactory.java
projects/gwt-console/trunk/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ProcessManagement.java
projects/gwt-console/trunk/server/pom.xml
projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java
projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java
projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/TestFacade.java
projects/gwt-console/trunk/war/gwt-war.iml
Log:
Cleanup dependencies
Modified: projects/gwt-console/trunk/gwt-parent.iml
===================================================================
--- projects/gwt-console/trunk/gwt-parent.iml 2009-02-11 12:12:09 UTC (rev 3830)
+++ projects/gwt-console/trunk/gwt-parent.iml 2009-02-11 13:13:20 UTC (rev 3831)
@@ -4,11 +4,12 @@
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/plugin-api/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/plugin-api/src/main/resources" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/plugin-example/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/plugin-example/src/main/resources" isTestSource="false" />
- <sourceFolder url="file://$MODULE_DIR$/plugin/src/main/java" isTestSource="false" />
- <sourceFolder url="file://$MODULE_DIR$/plugin/src/main/resources" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/rpc/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/server-integration/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/server/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/server/src/main/resources" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/server/src/test/java" isTestSource="true" />
@@ -29,15 +30,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.google.gwt:gwt-servlet:jar:1.5.2:runtime">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-servlet/1.5.2/gwt-servlet-1.5.2.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss:jboss-common-core:jar:2.2.7.GA:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/jboss-common-core/2.2.7.GA/jboss-common-core-2.2.7.GA.jar!/" />
@@ -184,15 +176,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:compile">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/code/gson/gson/1.2.2/gson-1.2.2.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.scannotation:scannotation:jar:1.0.2:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/scannotation/scannotation/1.0.2/scannotation-1.0.2.jar!/" />
@@ -220,15 +203,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.gwtext:gwtext:jar:2.0.5:compile">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/gwtext/gwtext/2.0.5/gwtext-2.0.5.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: net.sf.ezmorph:ezmorph:jar:1.0.6:test">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/net/sf/ezmorph/ezmorph/1.0.6/ezmorph-1.0.6.jar!/" />
@@ -313,6 +287,33 @@
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.gwt:gwt-servlet:jar:1.5.2:runtime">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-servlet/1.5.2/gwt-servlet-1.5.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/code/gson/gson/1.2.2/gson-1.2.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.gwtext:gwtext:jar:2.0.5:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/gwtext/gwtext/2.0.5/gwtext-2.0.5.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
</module>
Modified: projects/gwt-console/trunk/plugin-api/plugin.iml
===================================================================
--- projects/gwt-console/trunk/plugin-api/plugin.iml 2009-02-11 12:12:09 UTC (rev 3830)
+++ projects/gwt-console/trunk/plugin-api/plugin.iml 2009-02-11 13:13:20 UTC (rev 3831)
@@ -9,6 +9,7 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="gwt-parent" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: com.gwtext:gwtext:jar:2.0.5:compile">
<CLASSES>
@@ -55,17 +56,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: org.jbpm.jbpm3:gwt-console-rpc:jar:1.0.0-SNAPSHOT:compile">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jbpm/jbpm3/gwt-console-rpc/1.0.0-SNAPSHOT/gwt-console-rpc-1.0.0-SNAPSHOT.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jbpm/jbpm3/gwt-console-rpc/1.0.0-SNAPSHOT/gwt-console-rpc-1.0.0-SNAPSHOT-sources.jar!/" />
- </SOURCES>
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
Modified: projects/gwt-console/trunk/pom.xml
===================================================================
--- projects/gwt-console/trunk/pom.xml 2009-02-11 12:12:09 UTC (rev 3830)
+++ projects/gwt-console/trunk/pom.xml 2009-02-11 13:13:20 UTC (rev 3831)
@@ -1,165 +1,195 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <name>JBoss BPM - GWT Console</name>
- <groupId>org.jboss.bpm</groupId>
- <artifactId>gwt-console-parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <packaging>pom</packaging>
+ <modelVersion>4.0.0</modelVersion>
+ <name>JBoss BPM - GWT Console</name>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>gwt-console-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
- <!-- Parent -->
- <parent>
- <groupId>org.jbpm</groupId>
- <artifactId>jbpm-parent</artifactId>
- <version>1.0.0.GA</version>
- </parent>
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jbpm</groupId>
+ <artifactId>jbpm-parent</artifactId>
+ <version>1.0.0.GA</version>
+ </parent>
- <properties>
- <bpm.spec.version>1.0.0-Alpha1</bpm.spec.version>
- <commons.fileupload.version>1.2.1</commons.fileupload.version>
- <commons.io.version>1.3.2</commons.io.version>
- <commons.logging.version>1.1.1</commons.logging.version>
- <gson.version>1.2.2</gson.version>
- <gwt.version>1.5.2</gwt.version>
- <gwtext.version>2.0.5</gwtext.version>
- <gwt-log.version>2.5.2</gwt-log.version>
- <jaf.version>1.1</jaf.version>
- <javax.ejb.version>3.0</javax.ejb.version>
- <javax.jaxb.version>2.1</javax.jaxb.version>
- <jboss.common.version>2.2.7.GA</jboss.common.version>
- <jbpm.version>3.3.1.GA</jbpm.version>
- <junit.version>3.8.1</junit.version>
- <resteasy.version>1.0-beta-8</resteasy.version>
- <stax-api.version>1.0-2</stax-api.version>
- </properties>
+ <properties>
+ <bpm.spec.version>1.0.0-Alpha1</bpm.spec.version>
+ <commons.fileupload.version>1.2.1</commons.fileupload.version>
+ <commons.io.version>1.3.2</commons.io.version>
+ <commons.logging.version>1.1.1</commons.logging.version>
+ <gson.version>1.2.2</gson.version>
+ <gwt.version>1.5.2</gwt.version>
+ <gwtext.version>2.0.5</gwtext.version>
+ <gwt-log.version>2.5.2</gwt-log.version>
+ <jaf.version>1.1</jaf.version>
+ <javax.ejb.version>3.0</javax.ejb.version>
+ <javax.jaxb.version>2.1</javax.jaxb.version>
+ <jboss.common.version>2.2.7.GA</jboss.common.version>
+ <jbpm.version>3.3.1.GA</jbpm.version>
+ <junit.version>3.8.1</junit.version>
+ <resteasy.version>1.0-beta-8</resteasy.version>
+ <stax-api.version>1.0-2</stax-api.version>
+ </properties>
- <modules>
- <module>rpc</module>
- <module>server-integration</module>
- <module>server</module>
- <module>war</module>
- <module>plugin-api/</module>
- <module>plugin-example</module>
- </modules>
+ <modules>
+ <module>rpc</module>
+ <module>server-integration</module>
+ <module>server</module>
+ <module>war</module>
+ <module>plugin-api/</module>
+ <module>plugin-example</module>
+ </modules>
- <dependencyManagement>
- <dependencies>
+ <dependencyManagement>
+ <dependencies>
- <!-- GET related -->
- <dependency>
- <groupId>com.google.gwt</groupId>
- <artifactId>gwt-servlet</artifactId>
- <version>${gwt.version}</version>
- </dependency>
- <dependency>
- <groupId>com.google.gwt</groupId>
- <artifactId>gwt-user</artifactId>
- <version>${gwt.version}</version>
- </dependency>
+ <!-- GET related -->
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-servlet</artifactId>
+ <version>${gwt.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-user</artifactId>
+ <version>${gwt.version}</version>
+ </dependency>
- <dependency>
- <groupId>com.gwtext</groupId>
- <artifactId>gwtext</artifactId>
- <version>${gwtext.version}</version>
- </dependency>
- <dependency>
- <groupId>com.google.gwt</groupId>
- <artifactId>gchart</artifactId>
- <version>${gchart.version}</version>
- </dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>${gson.version}</version>
- </dependency>
- <dependency>
- <groupId>com.google.code.gwt-log</groupId>
- <artifactId>gwt-log</artifactId>
- <version>${gwt-log.version}</version>
- </dependency>
+ <dependency>
+ <groupId>com.gwtext</groupId>
+ <artifactId>gwtext</artifactId>
+ <version>${gwtext.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gchart</artifactId>
+ <version>${gchart.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>${gson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gwt-log</groupId>
+ <artifactId>gwt-log</artifactId>
+ <version>${gwt-log.version}</version>
+ </dependency>
- <!-- Other -->
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>${commons.logging.version}</version>
- </dependency>
+ <!-- Other -->
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>${commons.logging.version}</version>
+ </dependency>
- <dependency>
- <groupId>javax.xml.stream</groupId>
- <artifactId>stax-api</artifactId>
- <version>${stax-api.version}</version>
- </dependency>
- <dependency>
- <groupId>javax.activation</groupId>
- <artifactId>activation</artifactId>
- <version>${jaf.version}</version>
- </dependency>
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>${javax.jaxb.version}</version>
- </dependency>
- <dependency>
- <groupId>javax.ejb</groupId>
- <artifactId>ejb-api</artifactId>
- <version>${javax.ejb.version}</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- <version>${jboss.common.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.resteasy</groupId>
- <artifactId>resteasy-jaxrs</artifactId>
- <version>${resteasy.version}</version>
- </dependency>
+ <dependency>
+ <groupId>javax.xml.stream</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>${stax-api.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ <version>${jaf.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>${javax.jaxb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.ejb</groupId>
+ <artifactId>ejb-api</artifactId>
+ <version>${javax.ejb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <version>${jboss.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxrs</artifactId>
+ <version>${resteasy.version}</version>
+ </dependency>
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- <version>${commons.fileupload.version}</version>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>${commons.io.version}</version>
- </dependency>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ <version>${commons.fileupload.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>${commons.io.version}</version>
+ </dependency>
- </dependencies>
- </dependencyManagement>
+ </dependencies>
+ </dependencyManagement>
- <!-- Repositories -->
- <repositories>
- <repository>
- <id>repository.jboss.org</id>
- <url>http://repository.jboss.org/maven2</url>
- </repository>
- <repository>
- <id>snapshots.jboss.org</id>
- <name>JBoss Snapshot Repository</name>
- <url>http://snapshots.jboss.org/maven2</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
- <pluginRepositories>
- <pluginRepository>
- <id>gwt-maven</id>
- <url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo</url>
- </pluginRepository>
- </pluginRepositories>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <!-- Profiles -->
+ <profiles>
+
+ <profile>
+ <id>enableTests</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skipTests>false</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+
+ <!-- Repositories -->
+ <repositories>
+ <repository>
+ <id>repository.jboss.org</id>
+ <url>http://repository.jboss.org/maven2</url>
+ </repository>
+ <repository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshot Repository</name>
+ <url>http://snapshots.jboss.org/maven2</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>gwt-maven</id>
+ <url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo</url>
+ </pluginRepository>
+ </pluginRepositories>
+
</project>
Modified: projects/gwt-console/trunk/rpc/pom.xml
===================================================================
--- projects/gwt-console/trunk/rpc/pom.xml 2009-02-11 12:12:09 UTC (rev 3830)
+++ projects/gwt-console/trunk/rpc/pom.xml 2009-02-11 13:13:20 UTC (rev 3831)
@@ -16,15 +16,9 @@
<relativePath>../pom.xml</relativePath>
</parent>
- <dependencies>
+ <dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
- <artifactId>gwt-servlet</artifactId>
- <version>${gwt.version}</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwt.version}</version>
<scope>provided</scope>
Modified: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java 2009-02-11 12:12:09 UTC (rev 3830)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java 2009-02-11 13:13:20 UTC (rev 3831)
@@ -30,80 +30,113 @@
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
@XmlRootElement(name="processDefinition")
-public class ProcessDefinitionRef implements IsSerializable
+public class ProcessDefinitionRef
{
- private long processId;
- private String name;
- private String version;
+ private long processId;
+ private String name;
+ private long version;
+ private String key;
+ private String description;
+ private String packageName;
- public ProcessDefinitionRef()
- {
- }
+ public ProcessDefinitionRef()
+ {
+ }
- public ProcessDefinitionRef(long id, String name, String version)
- {
- this.processId = id;
- this.name = name;
- this.version = version;
- }
+ public ProcessDefinitionRef(long id, String name, long version)
+ {
+ this.processId = id;
+ this.name = name;
+ this.version = version;
+ }
- @XmlElement(name = "processId")
- public long getProcessId()
- {
- return processId;
- }
+ @XmlElement(name = "processId")
+ public long getProcessId()
+ {
+ return processId;
+ }
- public void setProcessId(long processId)
- {
- this.processId = processId;
- }
+ public void setProcessId(long processId)
+ {
+ this.processId = processId;
+ }
- @XmlElement(name = "name")
- public String getName()
- {
- return name;
- }
+ @XmlElement(name = "name")
+ public String getName()
+ {
+ return name;
+ }
- public void setName(String name)
- {
- this.name = name;
- }
+ public void setName(String name)
+ {
+ this.name = name;
+ }
- public String getVersion()
- {
- return version;
- }
+ public long getVersion()
+ {
+ return version;
+ }
- public void setVersion(String version)
- {
- this.version = version;
- }
+ public void setVersion(long version)
+ {
+ this.version = version;
+ }
- public String toString()
- {
- return "ProcessDefinitionRef{id="+this.processId +", name="+this.name+", version="+this.version+"}";
- }
+ public String toString()
+ {
+ return "ProcessDefinitionRef{id="+this.processId +", name="+this.name+", version="+this.version+"}";
+ }
- public boolean equals(Object o)
- {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
+ public String getKey()
+ {
+ return key;
+ }
- ProcessDefinitionRef that = (ProcessDefinitionRef) o;
+ public void setKey(String key)
+ {
+ this.key = key;
+ }
- if (processId != that.processId) return false;
- if (name != null ? !name.equals(that.name) : that.name != null) return false;
- if (version != null ? !version.equals(that.version) : that.version != null) return false;
+ public String getDescription()
+ {
+ return description;
+ }
- return true;
- }
+ public void setDescription(String description)
+ {
+ this.description = description;
+ }
- public int hashCode()
- {
- int result;
- result = (int) (processId ^ (processId >>> 32));
- result = 31 * result + (name != null ? name.hashCode() : 0);
- result = 31 * result + (version != null ? version.hashCode() : 0);
- return result;
- }
+ public String getPackageName()
+ {
+ return packageName;
+ }
+
+ public void setPackageName(String packageName)
+ {
+ this.packageName = packageName;
+ }
+
+ public boolean equals(Object o)
+ {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ ProcessDefinitionRef that = (ProcessDefinitionRef) o;
+
+ if (processId != that.processId) return false;
+ if (version != that.version) return false;
+ if (name != null ? !name.equals(that.name) : that.name != null) return false;
+
+ return true;
+ }
+
+ public int hashCode()
+ {
+ int result;
+ result = (int) (processId ^ (processId >>> 32));
+ result = 31 * result + (name != null ? name.hashCode() : 0);
+ result = 31 * result + (int) (version ^ (version >>> 32));
+ return result;
+ }
}
Modified: projects/gwt-console/trunk/server/pom.xml
===================================================================
--- projects/gwt-console/trunk/server/pom.xml 2009-02-11 12:12:09 UTC (rev 3830)
+++ projects/gwt-console/trunk/server/pom.xml 2009-02-11 13:13:20 UTC (rev 3831)
@@ -26,11 +26,13 @@
<groupId>org.jboss.bpm</groupId>
<artifactId>gwt-console-rpc</artifactId>
<version>${version}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.bpm</groupId>
<artifactId>gwt-console-server-integration</artifactId>
<version>${version}</version>
+ <scope>provided</scope>
</dependency>
<!-- GWT related -->
Modified: projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java
===================================================================
--- projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java 2009-02-11 12:12:09 UTC (rev 3830)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java 2009-02-11 13:13:20 UTC (rev 3831)
@@ -34,7 +34,6 @@
import org.jboss.bpm.console.client.model.ProcessInstanceRef;
import org.jboss.bpm.console.client.model.ProcessInstanceRefWrapper;
import org.jboss.bpm.console.server.gson.GsonFactory;
-import org.jboss.bpm.console.server.integration.ExtensionManagement;
import org.jboss.bpm.console.server.integration.ManagementFactory;
import org.jboss.bpm.console.server.integration.ProcessManagement;
Modified: projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java
===================================================================
--- projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java 2009-02-11 12:12:09 UTC (rev 3830)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java 2009-02-11 13:13:20 UTC (rev 3831)
@@ -25,17 +25,12 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.console.client.model.TaskRefWrapper;
-import org.jboss.bpm.console.client.model.util.MapEntry;
import org.jboss.bpm.console.server.gson.GsonFactory;
-import org.jboss.bpm.console.server.integration.ExtensionManagement;
import org.jboss.bpm.console.server.integration.ManagementFactory;
import org.jboss.bpm.console.server.integration.TaskManagement;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
/**
* REST server module for accessing task related data.
@@ -48,7 +43,6 @@
private static final Log log = LogFactory.getLog(TaskMgmtFacade.class);
private TaskManagement taskManagement;
- private ExtensionManagement JBPM3Extension;
/**
* Lazy load the {@link org.jboss.bpm.console.server.integration.ProcessManagement}
@@ -65,18 +59,6 @@
return this.taskManagement;
}
- private ExtensionManagement getManagementExtension()
- {
- if(null==this.JBPM3Extension)
- {
- ManagementFactory factory = ManagementFactory.newInstance();
- this.JBPM3Extension = factory.createExtensionManagement();
- }
-
- return this.JBPM3Extension;
-
- }
-
@GET
@Path("actor/{actorName}")
@Produces("application/json")
@@ -90,26 +72,6 @@
return createJsonResponse(wrapper);
}
- @GET
- @Path("forms/{processId}")
- @Produces("application/json")
- public Response getTasksForms(
- @PathParam("processId")
- long processId
- )
- {
- Map<String,String> formMapping =
- getManagementExtension().getAvailableTaskForms(processId);
-
- List<MapEntry> entries = new ArrayList<MapEntry>();
- for(String s : formMapping.keySet())
- {
- entries.add( new MapEntry(s, formMapping.get(s)) );
- }
-
- return createJsonResponse( entries );
- }
-
@POST
@Path("{taskId}/assignment/{actorId}")
@Produces("application/json")
Modified: projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/TestFacade.java
===================================================================
--- projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/TestFacade.java 2009-02-11 12:12:09 UTC (rev 3830)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/TestFacade.java 2009-02-11 13:13:20 UTC (rev 3831)
@@ -21,25 +21,20 @@
*/
package org.jboss.bpm.console.server;
+import com.google.gson.Gson;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
-import org.jboss.bpm.console.server.integration.ExtensionManagement;
+import org.jboss.bpm.console.server.gson.GsonFactory;
import org.jboss.bpm.console.server.integration.ManagementFactory;
import org.jboss.bpm.console.server.integration.ProcessManagement;
-import org.jboss.bpm.console.server.gson.GsonFactory;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
-import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
import java.io.InputStream;
import java.util.List;
-import com.google.gson.Gson;
-
/**
* Test utility to simplify GWT tests.
*
@@ -50,22 +45,9 @@
{
private static final Log log = LogFactory.getLog(TaskMgmtFacade.class);
- private ExtensionManagement JBPM3Extension;
private ProcessManagement processManagement;
private static final String SAMPLE_PROCESS_PAR = "/SampleProcess.par";
- private ExtensionManagement getManagementExtension()
- {
- if(null==this.JBPM3Extension)
- {
- ManagementFactory factory = ManagementFactory.newInstance();
- this.JBPM3Extension = factory.createExtensionManagement();
- }
-
- return this.JBPM3Extension;
-
- }
-
private ProcessManagement getProcessManagement()
{
if(null==this.processManagement)
@@ -82,33 +64,12 @@
@Path("deploy/harness")
public Response deployTestHarness()
{
- try
- {
- InputStream in = getClass().getResourceAsStream(SAMPLE_PROCESS_PAR);
+ InputStream in = getClass().getResourceAsStream(SAMPLE_PROCESS_PAR);
+ if(null==in)
+ throw new RuntimeException("Failed to read test deployment: " + SAMPLE_PROCESS_PAR);
- if(null==in)
- throw new RuntimeException("Failed to read test deployment: " + SAMPLE_PROCESS_PAR);
-
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- final int BUF_SIZE = 1 << 8;
- byte[] buffer = new byte[BUF_SIZE];
- int bytesRead = -1;
- while((bytesRead = in.read(buffer)) > -1) {
- out.write(buffer, 0, bytesRead);
- }
- in.close();
- byte[] data = out.toByteArray();
-
- ProcessDefinitionRef def = getManagementExtension().deployNewDefinition(data);
- log.info("Deployed test process definition " + def);
-
- return createJsonResponse(def);
- }
- catch (IOException e)
- {
- throw new WebApplicationException(e, 500);
- }
-
+ getProcessManagement().deploy(in);
+ return Response.ok().build();
}
@POST
Added: projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/gson/GsonFactory.java
===================================================================
--- projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/gson/GsonFactory.java (rev 0)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/gson/GsonFactory.java 2009-02-11 13:13:20 UTC (rev 3831)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server.gson;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class GsonFactory
+{
+ public static Gson createInstance()
+ {
+ Gson gson = new GsonBuilder()
+ .setDateFormat("yyyy-MM-dd HH:mm:ss")
+ .registerTypeAdapter(java.sql.Timestamp.class, new SQLDateTypeAdapter())
+ .create();
+ return gson;
+ }
+}
Added: projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/gson/SQLDateTypeAdapter.java
===================================================================
--- projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/gson/SQLDateTypeAdapter.java (rev 0)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/gson/SQLDateTypeAdapter.java 2009-02-11 13:13:20 UTC (rev 3831)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server.gson;
+
+import com.google.gson.*;
+
+import java.util.Date;
+import java.text.*;
+import java.lang.reflect.Type;
+
+
+/**
+ * A default type adapter for a {@link java.util.Date} object.<br>
+ * Create a GSON instance that can serialize/deserialize "java.util.Date" objects:
+ * <pre>
+ * Gson gson = new GsonBuilder()
+ * .registerTypeAdapter(new DateTypeAdapter())
+ * .create();
+ * </pre>
+ *
+ * @author Joel Leitch
+ */
+public class SQLDateTypeAdapter implements JsonSerializer<java.sql.Timestamp>, JsonDeserializer<Date>
+{
+ private final DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+ public JsonElement serialize(java.sql.Timestamp src, Type typeOfSrc, JsonSerializationContext context)
+ {
+ String dateFormatAsString = format.format(src);
+ return new JsonPrimitive(dateFormatAsString);
+ }
+
+ public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
+ throws JsonParseException
+ {
+ if (!(json instanceof JsonPrimitive)) {
+ throw new JsonParseException("The date should be a string value");
+ }
+
+ try
+ {
+ return format.parse(json.getAsString());
+ }
+ catch (ParseException e)
+ {
+ throw new JsonParseException(e);
+ }
+
+ }
+}
Modified: projects/gwt-console/trunk/server-integration/gwt-server-integration.iml
===================================================================
--- projects/gwt-console/trunk/server-integration/gwt-server-integration.iml 2009-02-11 12:12:09 UTC (rev 3830)
+++ projects/gwt-console/trunk/server-integration/gwt-server-integration.iml 2009-02-11 13:13:20 UTC (rev 3831)
@@ -8,6 +8,63 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="gwt-parent" />
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.ejb:ejb-api:jar:3.0:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/ejb/ejb-api/3.0/ejb-api-3.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/code/gson/gson/1.2.2/gson-1.2.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.gwt:gwt-servlet:jar:1.5.2:runtime">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/gwt/gwt-servlet/1.5.2/gwt-servlet-1.5.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: javax.activation:activation:jar:1.1:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
</module>
Deleted: projects/gwt-console/trunk/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ExtensionManagement.java
===================================================================
--- projects/gwt-console/trunk/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ExtensionManagement.java 2009-02-11 12:12:09 UTC (rev 3830)
+++ projects/gwt-console/trunk/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ExtensionManagement.java 2009-02-11 13:13:20 UTC (rev 3831)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.server.integration;
-
-import java.util.Map;
-
-import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
-import org.jboss.bpm.console.client.model.jbpm3.ActiveNodeInfo;
-import org.jboss.bpm.console.client.model.jbpm3.DiagramInfo;
-
-/**
- * Proprietary to jBPM3, no sure if it will stay.
- *
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public interface ExtensionManagement
-{
- byte[] getProcessImage(long processId);
-
- DiagramInfo getDiagramInfo(long processId);
-
- ActiveNodeInfo getActivNodeInfo(long instanceId);
-
- Map<String, String> getAvailableTaskForms(long processId);
-
- byte[] getTaskFormByTaskName(long processId, long taskId);
-
- ProcessDefinitionRef deployNewDefinition(byte[] data);
-}
Modified: projects/gwt-console/trunk/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ManagementFactory.java
===================================================================
--- projects/gwt-console/trunk/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ManagementFactory.java 2009-02-11 12:12:09 UTC (rev 3830)
+++ projects/gwt-console/trunk/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ManagementFactory.java 2009-02-11 13:13:20 UTC (rev 3831)
@@ -49,6 +49,5 @@
public abstract TaskManagement createTaskManagement();
public abstract UserManagement createUserManagement();
-
- public abstract ExtensionManagement createExtensionManagement();
+
}
Modified: projects/gwt-console/trunk/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ProcessManagement.java
===================================================================
--- projects/gwt-console/trunk/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ProcessManagement.java 2009-02-11 12:12:09 UTC (rev 3830)
+++ projects/gwt-console/trunk/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ProcessManagement.java 2009-02-11 13:13:20 UTC (rev 3831)
@@ -26,6 +26,7 @@
import org.jboss.bpm.console.client.model.ProcessInstanceRef.STATE;
import java.util.List;
+import java.io.InputStream;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -33,19 +34,21 @@
*/
public interface ProcessManagement
{
- List<ProcessDefinitionRef> getProcessDefinitions();
+ List<ProcessDefinitionRef> getProcessDefinitions();
- ProcessDefinitionRef getProcessDefinition(long procDefId);
+ ProcessDefinitionRef getProcessDefinition(long procDefId);
- List<ProcessDefinitionRef> removeProcessDefinition(long procDefId);
+ List<ProcessDefinitionRef> removeProcessDefinition(long procDefId);
- List<ProcessInstanceRef> getProcessInstances(long procDefId);
+ List<ProcessInstanceRef> getProcessInstances(long procDefId);
- ProcessInstanceRef getProcessInstance(long procId);
+ ProcessInstanceRef getProcessInstance(long procId);
- ProcessInstanceRef newInstance(long procDefId);
+ ProcessInstanceRef newInstance(long procDefId);
- void setProcessState(long procId, STATE nextState);
+ void setProcessState(long procId, STATE nextState);
- void signalToken(long tokenId, String signal);
+ void signalToken(long tokenId, String signal);
+
+ void deploy(InputStream deployment);
}
Modified: projects/gwt-console/trunk/war/gwt-war.iml
===================================================================
--- projects/gwt-console/trunk/war/gwt-war.iml 2009-02-11 12:12:09 UTC (rev 3830)
+++ projects/gwt-console/trunk/war/gwt-war.iml 2009-02-11 13:13:20 UTC (rev 3831)
@@ -11,7 +11,6 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="plugin" />
<orderEntry type="module" module-name="gwt-parent" />
<orderEntry type="module-library">
<library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:compile">
17 years, 2 months
JBoss JBPM SVN: r3830 - in jbpm4/trunk/modules: enterprise/src/main/java/org/jbpm/enterprise/internal/ejb and 19 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-02-11 07:12:09 -0500 (Wed, 11 Feb 2009)
New Revision: 3830
Added:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/JobQuery.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/JobQueryImpl.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/AsyncContinuationsTest.java
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/MessageFinder.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/AutomaticActivity.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ContinuationTest.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveMessagesTest.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveTestCommand.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceMessageTest.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceTestCommand.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingMessageTest.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingTestCommand.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/GenerateExceptionTestCommand.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/JobExecutorTestCase.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageCommand.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageTest.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/Recorder.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/WaitState.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/executions/
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/executions/Automatic.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/executions/ProcessExecutionTest.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/AddCommentCmd.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/MessageProcessingTest.java
jbpm4/trunk/modules/test-load/src/test/resources/org/jbpm/test/load/executions/
jbpm4/trunk/modules/test-load/src/test/resources/org/jbpm/test/load/executions/process.jpdl.xml
Removed:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetMessagesCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTimersCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/ExecuteJobCmd.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/AutomaticActivity.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ContinuationTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ExclusiveMessagesTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ExclusiveTestCommand.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/FailOnceMessageTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/FailOnceTestCommand.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/FailingMessageTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/FailingTestCommand.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/GenerateExceptionTestCommand.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTestCase.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/NormalMessageCommand.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/NormalMessageTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/Recorder.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/WaitState.java
jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/mgmt/ManagementServiceTest.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/AddCommentMessage.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/Automatic.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/MessageProcessingTest.java
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/ProcessExecutionTest.java
jbpm4/trunk/modules/test-load/src/test/resources/org/jbpm/test/load/process.jpdl.xml
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/ManagementService.java
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.java
jbpm4/trunk/modules/pvm/src/main/docs/module.dependencies.uml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorThread.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ManagementServiceImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/test/JobTestHelper.java
jbpm4/trunk/modules/pvm/src/test/resources/logging.properties
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/DbTestCase.java
jbpm4/trunk/modules/test-load/pom.xml
jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/LoadTestCase.java
jbpm4/trunk/modules/test-load/src/test/resources/jbpm.cfg.xml
Log:
JBPM-1280 moved multithreaded job executor tests to test-load module
Added: jbpm4/trunk/modules/api/src/main/java/org/jbpm/JobQuery.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/JobQuery.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/JobQuery.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm;
+
+import java.util.List;
+
+import org.jbpm.job.Job;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public interface JobQuery {
+
+ JobQuery messages();
+ JobQuery timers();
+
+ JobQuery processInstanceId(String processInstanceId);
+
+ JobQuery exception();
+
+ JobQuery orderAsc(String property);
+ JobQuery orderDesc(String property);
+
+ JobQuery page(int firstResult, int maxResults);
+
+ List<Job> execute();
+}
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/JobQuery.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/ManagementService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/ManagementService.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/ManagementService.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -21,13 +21,8 @@
*/
package org.jbpm;
-import java.util.List;
-import org.jbpm.job.Job;
-import org.jbpm.job.Message;
-import org.jbpm.job.Timer;
-
/** operations targeted to system operators that need to keep
* the process engine up and running. This functionality is typically
* exposed through a management web console.
@@ -36,22 +31,14 @@
*/
public interface ManagementService {
- /** all the messages which are waiting to be executed.
- * Messages that are already acquired will not show up in the list. */
- List<Message> getMessages(int firstResult, int maxResults);
-
- /** all the timers which are waiting for their due date.
- * Timers that are already acquired will not show up in the list. */
- List<Timer> getTimers(int firstResult, int maxResults);
-
- /** all jobs for which all the retry attempts have failed and
- * which are parked, waiting for operator intervention */
- List<Job> getJobsWithException(int firstResult, int maxResults);
-
/** resets the retry count, clears the exception and executes the job.
* An exception is thrown out of this method in case the execution
* of the job fails. In case the async command executor is configured
* for this service, failing job execution will not result into an
* exception coming out of this method. */
- void executeJob(String jobId);
+ void executeJob(long jobDbid);
+
+ /** search for jobs */
+ JobQuery createJobQuery();
+
}
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -43,7 +43,7 @@
import org.jbpm.cmd.Command;
import org.jbpm.job.Job;
import org.jbpm.log.Log;
-import org.jbpm.pvm.internal.jobexecutor.ExecuteJobCmd;
+import org.jbpm.pvm.internal.cmd.ExecuteJobCmd;
/**
* Message driven command receiver.
Modified: jbpm4/trunk/modules/pvm/src/main/docs/module.dependencies.uml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/docs/module.dependencies.uml 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/pvm/src/main/docs/module.dependencies.uml 2009-02-11 12:12:09 UTC (rev 3830)
@@ -61,15 +61,15 @@
<XPD:REF name="DiagramOwner">mNlhQxH3RkCjxaH3VQBTwQAA</XPD:REF>
<XPD:OBJ name="DiagramView" type="UMLComponentDiagramView" guid="Ly6NXYaRhEOxVqp3jH5kgQAA">
<XPD:REF name="Diagram">P3SoCbzoDE6hYcPIUEpSNAAA</XPD:REF>
-<XPD:ATTR name="#OwnedViews" type="integer">35</XPD:ATTR>
+<XPD:ATTR name="#OwnedViews" type="integer">36</XPD:ATTR>
<XPD:OBJ name="OwnedViews[0]" type="UMLPackageView" guid="7gpcdFJdLEyTK/UY/CuWfgAA">
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Courier New</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">12</XPD:ATTR>
-<XPD:ATTR name="Left" type="integer">50</XPD:ATTR>
-<XPD:ATTR name="Top" type="integer">240</XPD:ATTR>
-<XPD:ATTR name="Width" type="integer">200</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Left" type="integer">70</XPD:ATTR>
+<XPD:ATTR name="Top" type="integer">505</XPD:ATTR>
+<XPD:ATTR name="Width" type="integer">160</XPD:ATTR>
<XPD:ATTR name="Height" type="integer">121</XPD:ATTR>
<XPD:REF name="Model">5TvqnjB1jkG25vsTu+A0XgAA</XPD:REF>
<XPD:OBJ name="NameCompartment" type="UMLNameCompartmentView" guid="dp6Ei5LmwUK7Gm5YrkOB/AAA">
@@ -88,11 +88,11 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Courier New</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">12</XPD:ATTR>
-<XPD:ATTR name="Left" type="integer">265</XPD:ATTR>
-<XPD:ATTR name="Top" type="integer">110</XPD:ATTR>
-<XPD:ATTR name="Width" type="integer">491</XPD:ATTR>
-<XPD:ATTR name="Height" type="integer">391</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Left" type="integer">65</XPD:ATTR>
+<XPD:ATTR name="Top" type="integer">100</XPD:ATTR>
+<XPD:ATTR name="Width" type="integer">356</XPD:ATTR>
+<XPD:ATTR name="Height" type="integer">366</XPD:ATTR>
<XPD:REF name="Model">tfl5FprffUy9SE+AmL+zpQAA</XPD:REF>
<XPD:OBJ name="NameCompartment" type="UMLNameCompartmentView" guid="NlT0a5NumEyWnqIha2n/8QAA">
<XPD:OBJ name="NameLabel" type="LabelView" guid="tSximKu16E6V7ne50DVjiAAA">
@@ -110,10 +110,10 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Left" type="integer">400</XPD:ATTR>
-<XPD:ATTR name="Top" type="integer">160</XPD:ATTR>
-<XPD:ATTR name="Width" type="integer">103</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Left" type="integer">110</XPD:ATTR>
+<XPD:ATTR name="Top" type="integer">135</XPD:ATTR>
+<XPD:ATTR name="Width" type="integer">89</XPD:ATTR>
<XPD:ATTR name="Height" type="integer">45</XPD:ATTR>
<XPD:REF name="Model">Ois8O253kUadM8pwQY3z1AAA</XPD:REF>
<XPD:OBJ name="NameCompartment" type="UMLNameCompartmentView" guid="hNVtOPEDiUeVRTg/RcehGgAA">
@@ -137,10 +137,10 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Left" type="integer">395</XPD:ATTR>
-<XPD:ATTR name="Top" type="integer">280</XPD:ATTR>
-<XPD:ATTR name="Width" type="integer">115</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Left" type="integer">103</XPD:ATTR>
+<XPD:ATTR name="Top" type="integer">260</XPD:ATTR>
+<XPD:ATTR name="Width" type="integer">97</XPD:ATTR>
<XPD:ATTR name="Height" type="integer">45</XPD:ATTR>
<XPD:REF name="Model">F/VKixV7K02VlwQlQmAvKwAA</XPD:REF>
<XPD:OBJ name="NameCompartment" type="UMLNameCompartmentView" guid="Ok6AsWY7DEq0NFgv+JRDPgAA">
@@ -164,9 +164,9 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Left" type="integer">310</XPD:ATTR>
-<XPD:ATTR name="Top" type="integer">350</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Left" type="integer">170</XPD:ATTR>
+<XPD:ATTR name="Top" type="integer">330</XPD:ATTR>
<XPD:ATTR name="Width" type="integer">115</XPD:ATTR>
<XPD:ATTR name="Height" type="integer">45</XPD:ATTR>
<XPD:REF name="Model">AXGT6sG/YkWAzbne6BYH9gAA</XPD:REF>
@@ -191,10 +191,10 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Left" type="integer">75</XPD:ATTR>
-<XPD:ATTR name="Top" type="integer">305</XPD:ATTR>
-<XPD:ATTR name="Width" type="integer">163</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Left" type="integer">80</XPD:ATTR>
+<XPD:ATTR name="Top" type="integer">560</XPD:ATTR>
+<XPD:ATTR name="Width" type="integer">137</XPD:ATTR>
<XPD:ATTR name="Height" type="integer">45</XPD:ATTR>
<XPD:REF name="Model">rN2k9cfQlk2UzNSPqqPOegAA</XPD:REF>
<XPD:OBJ name="NameCompartment" type="UMLNameCompartmentView" guid="y6tXNO0XVEmE4S8cz/JZzwAA">
@@ -218,10 +218,10 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFB9</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Left" type="integer">230</XPD:ATTR>
-<XPD:ATTR name="Top" type="integer">550</XPD:ATTR>
-<XPD:ATTR name="Width" type="integer">158</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Left" type="integer">260</XPD:ATTR>
+<XPD:ATTR name="Top" type="integer">610</XPD:ATTR>
+<XPD:ATTR name="Width" type="integer">132</XPD:ATTR>
<XPD:ATTR name="Height" type="integer">45</XPD:ATTR>
<XPD:REF name="Model">MsVxfbvaTkidMyurdVALEAAA</XPD:REF>
<XPD:OBJ name="NameCompartment" type="UMLNameCompartmentView" guid="w5f7JGC/hUGxNQi+v+vWNwAA">
@@ -245,10 +245,10 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFB9</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Left" type="integer">400</XPD:ATTR>
-<XPD:ATTR name="Top" type="integer">550</XPD:ATTR>
-<XPD:ATTR name="Width" type="integer">139</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Left" type="integer">260</XPD:ATTR>
+<XPD:ATTR name="Top" type="integer">555</XPD:ATTR>
+<XPD:ATTR name="Width" type="integer">131</XPD:ATTR>
<XPD:ATTR name="Height" type="integer">45</XPD:ATTR>
<XPD:REF name="Model">kwDBvXNU5ECCKv4hB67TCgAA</XPD:REF>
<XPD:OBJ name="NameCompartment" type="UMLNameCompartmentView" guid="qQbpeM449UyU4IOJYERcSAAA">
@@ -272,10 +272,10 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFB9</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Left" type="integer">60</XPD:ATTR>
-<XPD:ATTR name="Top" type="integer">550</XPD:ATTR>
-<XPD:ATTR name="Width" type="integer">155</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Left" type="integer">75</XPD:ATTR>
+<XPD:ATTR name="Top" type="integer">650</XPD:ATTR>
+<XPD:ATTR name="Width" type="integer">129</XPD:ATTR>
<XPD:ATTR name="Height" type="integer">45</XPD:ATTR>
<XPD:REF name="Model">Ti77WPS+TES4vmhJCWTIqAAA</XPD:REF>
<XPD:OBJ name="NameCompartment" type="UMLNameCompartmentView" guid="Pi3oXqbiR0u8yHfBhG0migAA">
@@ -299,10 +299,10 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Left" type="integer">395</XPD:ATTR>
-<XPD:ATTR name="Top" type="integer">440</XPD:ATTR>
-<XPD:ATTR name="Width" type="integer">109</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Left" type="integer">105</XPD:ATTR>
+<XPD:ATTR name="Top" type="integer">400</XPD:ATTR>
+<XPD:ATTR name="Width" type="integer">94</XPD:ATTR>
<XPD:ATTR name="Height" type="integer">45</XPD:ATTR>
<XPD:REF name="Model">Bs15lMzAj0mz+NvzVS7E4QAA</XPD:REF>
<XPD:OBJ name="NameCompartment" type="UMLNameCompartmentView" guid="dJnh7tU3dU2NiM5LIrSRHQAA">
@@ -326,8 +326,8 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Points" type="Points">452,280;451,204</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Points" type="Points">152,260;154,179</XPD:ATTR>
<XPD:REF name="Model">UzW89zVUMkOD2XR49GKBSwAA</XPD:REF>
<XPD:REF name="Head">92NqScYMQkimi4w+8NuFxQAA</XPD:REF>
<XPD:REF name="Tail">kL0ifBLH8k2M0PxjEkWXUwAA</XPD:REF>
@@ -354,8 +354,8 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Points" type="Points">394,350;425,324</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Points" type="Points">203,330;175,304</XPD:ATTR>
<XPD:REF name="Model">USrXc+RVC06k6g8JDBkKtQAA</XPD:REF>
<XPD:REF name="Head">kL0ifBLH8k2M0PxjEkWXUwAA</XPD:REF>
<XPD:REF name="Tail">Gv5w/Hcm0k61rZhkNLQGtQAA</XPD:REF>
@@ -382,8 +382,8 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Points" type="Points">449,440;452,324</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Points" type="Points">151,400;151,304</XPD:ATTR>
<XPD:REF name="Model">Y4WLKpAHrUilfBgG5ABxQgAA</XPD:REF>
<XPD:REF name="Head">kL0ifBLH8k2M0PxjEkWXUwAA</XPD:REF>
<XPD:REF name="Tail">uaMGdUZ3rUGciJaxG5vJyAAA</XPD:REF>
@@ -410,8 +410,8 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Points" type="Points">237,314;290,305;395,303</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Points" type="Points">93,560;55,545;55,340;115,304</XPD:ATTR>
<XPD:REF name="Model">3soARAGPkkK23DUBcA3VbAAA</XPD:REF>
<XPD:REF name="Head">kL0ifBLH8k2M0PxjEkWXUwAA</XPD:REF>
<XPD:REF name="Tail">0Vw/eC4690OaqgqTJ+R97QAA</XPD:REF>
@@ -438,8 +438,8 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Points" type="Points">336,550;421,484</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Points" type="Points">260,622;245,620;245,490;181,444</XPD:ATTR>
<XPD:REF name="Model">1CXs2RCBIEmDFPmyngQ7wQAA</XPD:REF>
<XPD:REF name="Head">uaMGdUZ3rUGciJaxG5vJyAAA</XPD:REF>
<XPD:REF name="Tail">WMFeUrRaqkmSFaxxGYhliQAA</XPD:REF>
@@ -450,9 +450,10 @@
<XPD:REF name="Model">1CXs2RCBIEmDFPmyngQ7wQAA</XPD:REF>
</XPD:OBJ>
<XPD:OBJ name="StereotypeLabel" type="EdgeLabelView" guid="qx+nvFgOpEmfpqN0d8S+ygAA">
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Visible" type="boolean">False</XPD:ATTR>
<XPD:ATTR name="Alpha" type="real">-3,3733085417589</XPD:ATTR>
<XPD:ATTR name="Distance" type="real">21,9317121994613</XPD:ATTR>
-<XPD:ATTR name="Text" type="string"><<runtime>></XPD:ATTR>
<XPD:REF name="Model">1CXs2RCBIEmDFPmyngQ7wQAA</XPD:REF>
</XPD:OBJ>
<XPD:OBJ name="PropertyLabel" type="EdgeLabelView" guid="eH/awcIp+k6tEkVnEeqKmQAA">
@@ -466,8 +467,8 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Points" type="Points">465,550;453,484</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Points" type="Points">260,571;245,570;245,490;181,444</XPD:ATTR>
<XPD:REF name="Model">JmpD2e0w4UycQJFvCIIURQAA</XPD:REF>
<XPD:REF name="Head">uaMGdUZ3rUGciJaxG5vJyAAA</XPD:REF>
<XPD:REF name="Tail">os/ZpLf6E0C9OkWrF0aPPwAA</XPD:REF>
@@ -478,8 +479,9 @@
<XPD:REF name="Model">JmpD2e0w4UycQJFvCIIURQAA</XPD:REF>
</XPD:OBJ>
<XPD:OBJ name="StereotypeLabel" type="EdgeLabelView" guid="HXVe8usV8kO191DDCVY/WgAA">
-<XPD:ATTR name="Alpha" type="real">2,7430715600805</XPD:ATTR>
-<XPD:ATTR name="Distance" type="real">9,21954445729289</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Alpha" type="real">-0,259331685062154</XPD:ATTR>
+<XPD:ATTR name="Distance" type="real">50,6951674225463</XPD:ATTR>
<XPD:ATTR name="Text" type="string"><<runtime>></XPD:ATTR>
<XPD:REF name="Model">JmpD2e0w4UycQJFvCIIURQAA</XPD:REF>
</XPD:OBJ>
@@ -494,8 +496,8 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Points" type="Points">150,550;290,305;395,303</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Points" type="Points">81,650;55,640;55,340;115,304</XPD:ATTR>
<XPD:REF name="Model">KGxkaAq6n0iaJ5qJnbuCiAAA</XPD:REF>
<XPD:REF name="Head">kL0ifBLH8k2M0PxjEkWXUwAA</XPD:REF>
<XPD:REF name="Tail">m19PobYTBkqfijmLqUHsGgAA</XPD:REF>
@@ -522,10 +524,10 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFB9</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Left" type="integer">550</XPD:ATTR>
-<XPD:ATTR name="Top" type="integer">550</XPD:ATTR>
-<XPD:ATTR name="Width" type="integer">153</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Left" type="integer">265</XPD:ATTR>
+<XPD:ATTR name="Top" type="integer">500</XPD:ATTR>
+<XPD:ATTR name="Width" type="integer">128</XPD:ATTR>
<XPD:ATTR name="Height" type="integer">45</XPD:ATTR>
<XPD:REF name="Model">ldE/OPmI/UqAVOba04r45QAA</XPD:REF>
<XPD:OBJ name="NameCompartment" type="UMLNameCompartmentView" guid="YT8uROkxlU6fR+/+ywr8ZgAA">
@@ -549,8 +551,8 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Points" type="Points">591,550;484,484</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Points" type="Points">265,517;245,515;245,490;181,444</XPD:ATTR>
<XPD:REF name="Model">gNdjs1FEbkyttFXd3t0sNQAA</XPD:REF>
<XPD:REF name="Head">uaMGdUZ3rUGciJaxG5vJyAAA</XPD:REF>
<XPD:REF name="Tail">NR+DCad5w0aNy08gEmohjgAA</XPD:REF>
@@ -561,9 +563,10 @@
<XPD:REF name="Model">gNdjs1FEbkyttFXd3t0sNQAA</XPD:REF>
</XPD:OBJ>
<XPD:OBJ name="StereotypeLabel" type="EdgeLabelView" guid="JInfIiF+yUWGEwRuC/fBbQAA">
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Visible" type="boolean">False</XPD:ATTR>
<XPD:ATTR name="Alpha" type="real">3,54584433817258</XPD:ATTR>
<XPD:ATTR name="Distance" type="real">26,3058928759318</XPD:ATTR>
-<XPD:ATTR name="Text" type="string"><<runtime>></XPD:ATTR>
<XPD:REF name="Model">gNdjs1FEbkyttFXd3t0sNQAA</XPD:REF>
</XPD:OBJ>
<XPD:OBJ name="PropertyLabel" type="EdgeLabelView" guid="bW5E7jctskGxAqy4fBJsUwAA">
@@ -577,9 +580,9 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00E8E8E8</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Left" type="integer">275</XPD:ATTR>
-<XPD:ATTR name="Top" type="integer">30</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Left" type="integer">55</XPD:ATTR>
+<XPD:ATTR name="Top" type="integer">25</XPD:ATTR>
<XPD:ATTR name="Width" type="integer">111</XPD:ATTR>
<XPD:ATTR name="Height" type="integer">45</XPD:ATTR>
<XPD:REF name="Model">7b0gCEntNUmxlyQ1YVGDvwAA</XPD:REF>
@@ -604,10 +607,10 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Left" type="integer">570</XPD:ATTR>
-<XPD:ATTR name="Top" type="integer">280</XPD:ATTR>
-<XPD:ATTR name="Width" type="integer">158</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Left" type="integer">230</XPD:ATTR>
+<XPD:ATTR name="Top" type="integer">260</XPD:ATTR>
+<XPD:ATTR name="Width" type="integer">131</XPD:ATTR>
<XPD:ATTR name="Height" type="integer">45</XPD:ATTR>
<XPD:REF name="Model">RnhmSXHjpkqPifkoBI0xMQAA</XPD:REF>
<XPD:OBJ name="NameCompartment" type="UMLNameCompartmentView" guid="QhSleJX7IUih8ZGA9w7ViAAA">
@@ -631,9 +634,9 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00E8E8E8</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Left" type="integer">535</XPD:ATTR>
-<XPD:ATTR name="Top" type="integer">30</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Left" type="integer">200</XPD:ATTR>
+<XPD:ATTR name="Top" type="integer">25</XPD:ATTR>
<XPD:ATTR name="Width" type="integer">96</XPD:ATTR>
<XPD:ATTR name="Height" type="integer">45</XPD:ATTR>
<XPD:REF name="Model">fTUNxe8WmEWd/zpINe6SCQAA</XPD:REF>
@@ -658,8 +661,8 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Points" type="Points">421,280;330,215;330,74</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Points" type="Points">129,260;80,210;80,80;90,69</XPD:ATTR>
<XPD:REF name="Model">b+gX8dz5uEe/vDyX6nczwgAA</XPD:REF>
<XPD:REF name="Head">3fKHNq8HbU6ne7o9d0+49QAA</XPD:REF>
<XPD:REF name="Tail">kL0ifBLH8k2M0PxjEkWXUwAA</XPD:REF>
@@ -686,9 +689,9 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00E8E8E8</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Left" type="integer">665</XPD:ATTR>
-<XPD:ATTR name="Top" type="integer">30</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Left" type="integer">330</XPD:ATTR>
+<XPD:ATTR name="Top" type="integer">25</XPD:ATTR>
<XPD:ATTR name="Width" type="integer">96</XPD:ATTR>
<XPD:ATTR name="Height" type="integer">45</XPD:ATTR>
<XPD:REF name="Model">q2sDsF5njUmjPrBEjAya2AAA</XPD:REF>
@@ -713,8 +716,8 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Points" type="Points">668,280;695,250;695,140;708,74</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Points" type="Points">333,260;385,230;385,120;379,69</XPD:ATTR>
<XPD:REF name="Model">j1GCNWMKW0CgQEXmzVa7bQAA</XPD:REF>
<XPD:REF name="Head">okCq8TeiSkSTXxYO7BUdpgAA</XPD:REF>
<XPD:REF name="Tail">1ltfrrUBG0q0sFN/n22amgAA</XPD:REF>
@@ -741,8 +744,8 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Points" type="Points">668,280;695,250;695,135;612,74</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Points" type="Points">333,260;385,230;385,115;292,69</XPD:ATTR>
<XPD:REF name="Model">ATdgO9ALgEG91h9rrbmQpgAA</XPD:REF>
<XPD:REF name="Head">rbLmK4jPbkGOYpeFKoIgSgAA</XPD:REF>
<XPD:REF name="Tail">1ltfrrUBG0q0sFN/n22amgAA</XPD:REF>
@@ -753,8 +756,9 @@
<XPD:REF name="Model">ATdgO9ALgEG91h9rrbmQpgAA</XPD:REF>
</XPD:OBJ>
<XPD:OBJ name="StereotypeLabel" type="EdgeLabelView" guid="dKb6ieet20GTJwk4JpHUcgAA">
-<XPD:ATTR name="Alpha" type="real">-5,724585237714</XPD:ATTR>
-<XPD:ATTR name="Distance" type="real">113,207773584679</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Alpha" type="real">-5,60702717702113</XPD:ATTR>
+<XPD:ATTR name="Distance" type="real">110,258786497948</XPD:ATTR>
<XPD:ATTR name="Text" type="string"><<provided>></XPD:ATTR>
<XPD:REF name="Model">ATdgO9ALgEG91h9rrbmQpgAA</XPD:REF>
</XPD:OBJ>
@@ -769,8 +773,8 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Points" type="Points">429,440;387,394</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Points" type="Points">175,400;203,374</XPD:ATTR>
<XPD:REF name="Model">ITZTIh3Yc06xCgHd+5qbvAAA</XPD:REF>
<XPD:REF name="Head">Gv5w/Hcm0k61rZhkNLQGtQAA</XPD:REF>
<XPD:REF name="Tail">uaMGdUZ3rUGciJaxG5vJyAAA</XPD:REF>
@@ -797,8 +801,8 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Points" type="Points">309,594;310,615;715,615;715,375;668,324</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Points" type="Points">391,630;405,630;405,355;328,304</XPD:ATTR>
<XPD:REF name="Model">qYZxI+u2T0KrBKsT29viVAAA</XPD:REF>
<XPD:REF name="Head">1ltfrrUBG0q0sFN/n22amgAA</XPD:REF>
<XPD:REF name="Tail">WMFeUrRaqkmSFaxxGYhliQAA</XPD:REF>
@@ -825,8 +829,8 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Points" type="Points">625,594;625,615;715,615;715,375;668,324</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Points" type="Points">392,520;405,520;405,355;328,304</XPD:ATTR>
<XPD:REF name="Model">QA6wifJqU0uoQEOC7wjPbgAA</XPD:REF>
<XPD:REF name="Head">1ltfrrUBG0q0sFN/n22amgAA</XPD:REF>
<XPD:REF name="Tail">NR+DCad5w0aNy08gEmohjgAA</XPD:REF>
@@ -853,8 +857,8 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Points" type="Points">470,594;470,615;715,615;715,375;668,324</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Points" type="Points">390,575;405,575;405,355;328,304</XPD:ATTR>
<XPD:REF name="Model">Ybqb/Q8TQUqgiUYrvmAmKgAA</XPD:REF>
<XPD:REF name="Head">1ltfrrUBG0q0sFN/n22amgAA</XPD:REF>
<XPD:REF name="Tail">os/ZpLf6E0C9OkWrF0aPPwAA</XPD:REF>
@@ -881,8 +885,8 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Points" type="Points">659,280;675,250;675,170;530,170;502,174</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Points" type="Points">325,260;365,230;365,150;220,150;198,152</XPD:ATTR>
<XPD:REF name="Model">0G9IV2lOwEGquFmnHxVYQgAA</XPD:REF>
<XPD:REF name="Head">92NqScYMQkimi4w+8NuFxQAA</XPD:REF>
<XPD:REF name="Tail">1ltfrrUBG0q0sFN/n22amgAA</XPD:REF>
@@ -909,10 +913,10 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Left" type="integer">540</XPD:ATTR>
-<XPD:ATTR name="Top" type="integer">195</XPD:ATTR>
-<XPD:ATTR name="Width" type="integer">122</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Left" type="integer">250</XPD:ATTR>
+<XPD:ATTR name="Top" type="integer">185</XPD:ATTR>
+<XPD:ATTR name="Width" type="integer">89</XPD:ATTR>
<XPD:ATTR name="Height" type="integer">45</XPD:ATTR>
<XPD:REF name="Model">cmkpYh9kWUe54vVNch7vwgAA</XPD:REF>
<XPD:OBJ name="NameCompartment" type="UMLNameCompartmentView" guid="Fv0gvo7OiUW8zm+HtL8LzQAA">
@@ -936,8 +940,8 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Points" type="Points">636,280;613,239</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Points" type="Points">295,260;294,229</XPD:ATTR>
<XPD:REF name="Model">+zYUHfvAdES31I2z2CHbmQAA</XPD:REF>
<XPD:REF name="Head">9h9tg46+zEqxK6eZGIVN3wAA</XPD:REF>
<XPD:REF name="Tail">1ltfrrUBG0q0sFN/n22amgAA</XPD:REF>
@@ -964,8 +968,8 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Points" type="Points">490,280;562,239</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Points" type="Points">193,260;252,229</XPD:ATTR>
<XPD:REF name="Model">/soSCHK5oECw23ApKZpFJQAA</XPD:REF>
<XPD:REF name="Head">9h9tg46+zEqxK6eZGIVN3wAA</XPD:REF>
<XPD:REF name="Tail">kL0ifBLH8k2M0PxjEkWXUwAA</XPD:REF>
@@ -992,8 +996,8 @@
<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
-<XPD:ATTR name="FontSize" type="integer">11</XPD:ATTR>
-<XPD:ATTR name="Points" type="Points">509,302;570,302</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Points" type="Points">199,282;230,282</XPD:ATTR>
<XPD:REF name="Model">CvL1H2cfL0aBb2DIsO3Z/QAA</XPD:REF>
<XPD:REF name="Head">1ltfrrUBG0q0sFN/n22amgAA</XPD:REF>
<XPD:REF name="Tail">kL0ifBLH8k2M0PxjEkWXUwAA</XPD:REF>
@@ -1016,8 +1020,37 @@
<XPD:REF name="Model">CvL1H2cfL0aBb2DIsO3Z/QAA</XPD:REF>
</XPD:OBJ>
</XPD:OBJ>
+<XPD:OBJ name="OwnedViews[35]" type="UMLDependencyView" guid="M29407aZXUuJm2P05+NgVgAA">
+<XPD:ATTR name="LineColor" type="string">clMaroon</XPD:ATTR>
+<XPD:ATTR name="FillColor" type="string">$00B9FFFF</XPD:ATTR>
+<XPD:ATTR name="FontFace" type="string">Verdana</XPD:ATTR>
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Points" type="Points">216,575;220,575;220,500;170,444</XPD:ATTR>
+<XPD:REF name="Model">KVrn3WbJ9kukPyN/3xu9qQAA</XPD:REF>
+<XPD:REF name="Head">uaMGdUZ3rUGciJaxG5vJyAAA</XPD:REF>
+<XPD:REF name="Tail">0Vw/eC4690OaqgqTJ+R97QAA</XPD:REF>
+<XPD:OBJ name="NameLabel" type="EdgeLabelView" guid="rxUyd/KQiEKe50ZrgKXVsgAA">
+<XPD:ATTR name="Visible" type="boolean">False</XPD:ATTR>
+<XPD:ATTR name="Alpha" type="real">1,5707963267949</XPD:ATTR>
+<XPD:ATTR name="Distance" type="real">15</XPD:ATTR>
+<XPD:REF name="Model">KVrn3WbJ9kukPyN/3xu9qQAA</XPD:REF>
</XPD:OBJ>
+<XPD:OBJ name="StereotypeLabel" type="EdgeLabelView" guid="iDzZrTOIVUeZoq5clonoOAAA">
+<XPD:ATTR name="FontSize" type="integer">9</XPD:ATTR>
+<XPD:ATTR name="Alpha" type="real">-5,8420051300339</XPD:ATTR>
+<XPD:ATTR name="Distance" type="real">39,8120584747888</XPD:ATTR>
+<XPD:ATTR name="Text" type="string"><<test>></XPD:ATTR>
+<XPD:REF name="Model">KVrn3WbJ9kukPyN/3xu9qQAA</XPD:REF>
</XPD:OBJ>
+<XPD:OBJ name="PropertyLabel" type="EdgeLabelView" guid="l6iyGMrOJUmJ0ciSj+X15AAA">
+<XPD:ATTR name="Visible" type="boolean">False</XPD:ATTR>
+<XPD:ATTR name="Alpha" type="real">-1,5707963267949</XPD:ATTR>
+<XPD:ATTR name="Distance" type="real">15</XPD:ATTR>
+<XPD:REF name="Model">KVrn3WbJ9kukPyN/3xu9qQAA</XPD:REF>
+</XPD:OBJ>
+</XPD:OBJ>
+</XPD:OBJ>
+</XPD:OBJ>
<XPD:OBJ name="OwnedDiagrams[2]" type="UMLComponentDiagram" guid="taMwNEcyNEONZh4emW/4wwAA">
<XPD:ATTR name="Name" type="string">User code dependencies</XPD:ATTR>
<XPD:REF name="DiagramOwner">mNlhQxH3RkCjxaH3VQBTwQAA</XPD:REF>
@@ -1439,7 +1472,7 @@
</XPD:OBJ>
</XPD:OBJ>
</XPD:OBJ>
-<XPD:ATTR name="#OwnedElements" type="integer">52</XPD:ATTR>
+<XPD:ATTR name="#OwnedElements" type="integer">53</XPD:ATTR>
<XPD:OBJ name="OwnedElements[0]" type="UMLComponent" guid="Ois8O253kUadM8pwQY3z1AAA">
<XPD:ATTR name="Name" type="string">jbpm-api</XPD:ATTR>
<XPD:REF name="Namespace">mNlhQxH3RkCjxaH3VQBTwQAA</XPD:REF>
@@ -1473,8 +1506,8 @@
<XPD:ATTR name="#SupplierDependencies" type="integer">4</XPD:ATTR>
<XPD:REF name="SupplierDependencies[0]">Y4WLKpAHrUilfBgG5ABxQgAA</XPD:REF>
<XPD:REF name="SupplierDependencies[1]">KGxkaAq6n0iaJ5qJnbuCiAAA</XPD:REF>
-<XPD:REF name="SupplierDependencies[2]">3soARAGPkkK23DUBcA3VbAAA</XPD:REF>
-<XPD:REF name="SupplierDependencies[3]">USrXc+RVC06k6g8JDBkKtQAA</XPD:REF>
+<XPD:REF name="SupplierDependencies[2]">USrXc+RVC06k6g8JDBkKtQAA</XPD:REF>
+<XPD:REF name="SupplierDependencies[3]">3soARAGPkkK23DUBcA3VbAAA</XPD:REF>
</XPD:OBJ>
<XPD:OBJ name="OwnedElements[2]" type="UMLComponent" guid="AXGT6sG/YkWAzbne6BYH9gAA">
<XPD:ATTR name="Name" type="string">jbpm-task</XPD:ATTR>
@@ -1493,8 +1526,9 @@
<XPD:ATTR name="#Views" type="integer">2</XPD:ATTR>
<XPD:REF name="Views[0]">0Vw/eC4690OaqgqTJ+R97QAA</XPD:REF>
<XPD:REF name="Views[1]">4QPtyjldhUunEN0gz7mavgAA</XPD:REF>
-<XPD:ATTR name="#ClientDependencies" type="integer">1</XPD:ATTR>
+<XPD:ATTR name="#ClientDependencies" type="integer">2</XPD:ATTR>
<XPD:REF name="ClientDependencies[0]">3soARAGPkkK23DUBcA3VbAAA</XPD:REF>
+<XPD:REF name="ClientDependencies[1]">KVrn3WbJ9kukPyN/3xu9qQAA</XPD:REF>
</XPD:OBJ>
<XPD:OBJ name="OwnedElements[4]" type="UMLComponent" guid="MsVxfbvaTkidMyurdVALEAAA">
<XPD:ATTR name="Name" type="string">jbpm-examples</XPD:ATTR>
@@ -1540,11 +1574,12 @@
<XPD:REF name="ClientDependencies[1]">ITZTIh3Yc06xCgHd+5qbvAAA</XPD:REF>
<XPD:REF name="ClientDependencies[2]">G2xeWXCBOEGWVsaaT++RSAAA</XPD:REF>
<XPD:REF name="ClientDependencies[3]">IVVD7BW6MkCqjmD6+TzTfAAA</XPD:REF>
-<XPD:ATTR name="#SupplierDependencies" type="integer">4</XPD:ATTR>
+<XPD:ATTR name="#SupplierDependencies" type="integer">5</XPD:ATTR>
<XPD:REF name="SupplierDependencies[0]">1CXs2RCBIEmDFPmyngQ7wQAA</XPD:REF>
<XPD:REF name="SupplierDependencies[1]">JmpD2e0w4UycQJFvCIIURQAA</XPD:REF>
<XPD:REF name="SupplierDependencies[2]">gNdjs1FEbkyttFXd3t0sNQAA</XPD:REF>
<XPD:REF name="SupplierDependencies[3]">/M/x3rnebUe2dGXfP6ErHwAA</XPD:REF>
+<XPD:REF name="SupplierDependencies[4]">KVrn3WbJ9kukPyN/3xu9qQAA</XPD:REF>
</XPD:OBJ>
<XPD:OBJ name="OwnedElements[8]" type="UMLDependency" guid="UzW89zVUMkOD2XR49GKBSwAA">
<XPD:REF name="Namespace">mNlhQxH3RkCjxaH3VQBTwQAA</XPD:REF>
@@ -1587,7 +1622,6 @@
<XPD:REF name="Views[3]">yCBx070VyUSE7L6mIiqZ6gAA</XPD:REF>
</XPD:OBJ>
<XPD:OBJ name="OwnedElements[12]" type="UMLDependency" guid="1CXs2RCBIEmDFPmyngQ7wQAA">
-<XPD:ATTR name="StereotypeName" type="string">runtime</XPD:ATTR>
<XPD:REF name="Namespace">mNlhQxH3RkCjxaH3VQBTwQAA</XPD:REF>
<XPD:REF name="Client">MsVxfbvaTkidMyurdVALEAAA</XPD:REF>
<XPD:REF name="Supplier">Bs15lMzAj0mz+NvzVS7E4QAA</XPD:REF>
@@ -1630,7 +1664,6 @@
<XPD:REF name="ClientDependencies[2]">TC2p7E/uqEKL4MYpl3vDjgAA</XPD:REF>
</XPD:OBJ>
<XPD:OBJ name="OwnedElements[16]" type="UMLDependency" guid="gNdjs1FEbkyttFXd3t0sNQAA">
-<XPD:ATTR name="StereotypeName" type="string">runtime</XPD:ATTR>
<XPD:REF name="Namespace">mNlhQxH3RkCjxaH3VQBTwQAA</XPD:REF>
<XPD:REF name="Client">ldE/OPmI/UqAVOba04r45QAA</XPD:REF>
<XPD:REF name="Supplier">Bs15lMzAj0mz+NvzVS7E4QAA</XPD:REF>
@@ -1970,7 +2003,18 @@
<XPD:REF name="Views[2]">CN6zyu45XUWna7JwqXyDSAAA</XPD:REF>
<XPD:REF name="Views[3]">iicoPDgFQ0qMQebeFzttaQAA</XPD:REF>
</XPD:OBJ>
+<XPD:OBJ name="OwnedElements[52]" type="UMLDependency" guid="KVrn3WbJ9kukPyN/3xu9qQAA">
+<XPD:ATTR name="StereotypeName" type="string">test</XPD:ATTR>
+<XPD:REF name="Namespace">mNlhQxH3RkCjxaH3VQBTwQAA</XPD:REF>
+<XPD:REF name="Client">rN2k9cfQlk2UzNSPqqPOegAA</XPD:REF>
+<XPD:REF name="Supplier">Bs15lMzAj0mz+NvzVS7E4QAA</XPD:REF>
+<XPD:ATTR name="#Views" type="integer">4</XPD:ATTR>
+<XPD:REF name="Views[0]">M29407aZXUuJm2P05+NgVgAA</XPD:REF>
+<XPD:REF name="Views[1]">rxUyd/KQiEKe50ZrgKXVsgAA</XPD:REF>
+<XPD:REF name="Views[2]">iDzZrTOIVUeZoq5clonoOAAA</XPD:REF>
+<XPD:REF name="Views[3]">l6iyGMrOJUmJ0ciSj+X15AAA</XPD:REF>
</XPD:OBJ>
+</XPD:OBJ>
<XPD:OBJ name="OwnedElements[3]" type="UMLModel" guid="D4U+Tw7Eg0mlnh0cjb2/cQAA">
<XPD:ATTR name="Name" type="string">Implementation Model</XPD:ATTR>
<XPD:ATTR name="StereotypeProfile" type="string">UMLStandard</XPD:ATTR>
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java (from rev 3816, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/ExecuteJobCmd.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -0,0 +1,103 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.cmd;
+
+import java.util.Date;
+
+import org.jbpm.JbpmException;
+import org.jbpm.cmd.Command;
+import org.jbpm.cmd.CommandService;
+import org.jbpm.env.Environment;
+import org.jbpm.env.Transaction;
+import org.jbpm.job.Job;
+import org.jbpm.log.Log;
+import org.jbpm.pvm.internal.job.JobImpl;
+import org.jbpm.pvm.internal.jobexecutor.JobDbSession;
+import org.jbpm.pvm.internal.jobexecutor.JobExceptionHandler;
+
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ExecuteJobCmd implements Command<Job> {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Log log = Log.getLog(ExecuteJobCmd.class.getName());
+
+ protected long jobDbid;
+
+ public ExecuteJobCmd(long jobDbid) {
+ this.jobDbid = jobDbid;
+ }
+
+ public Job execute(Environment environment) throws Exception {
+ JobDbSession session = environment.get(JobDbSession.class);
+ if (session==null) {
+ throw new JbpmException("no job session configured to get job "+jobDbid+" for execution");
+ }
+ JobImpl<?> job = (JobImpl<?>) session.get(JobImpl.class, jobDbid);
+
+ // in case of exclusive jobs, the job might have been deleted
+ // before we execute it (they are in a list)
+ if (job != null) {
+ try {
+ log.debug("executing job "+job+"...");
+ job.execute(environment);
+ log.debug("executed job "+job);
+
+ // if this job is locked too long, it could be unlocked by the lockmonitor and
+ // executed by another thread.
+ Date lockExpirationDate = job.getLockExpirationTime();
+ // can be null if it was rescheduled
+ if (lockExpirationDate != null) {
+ long lockExpiration = lockExpirationDate.getTime();
+ long currentTime = System.currentTimeMillis();
+ if (currentTime>lockExpiration) {
+ throw new JbpmException("job took too long: lock expired "+(currentTime-lockExpiration)+"ms ago");
+ }
+ }
+ } catch (Throwable exception) {
+ log.error("exception while executing '"+job+"'", exception);
+ handleJobExecutionException(environment, job, exception);
+ }
+
+ } else {
+ log.debug("job " + jobDbid + " no longer exists");
+ }
+ return job;
+ }
+
+ /** This transaction will be marked for rollback. A command will be associated with the
+ * Transaction.EVENT_AFTERCOMPLETION (after the job locks of the current transaction are
+ * released). Then the command will update the job with the exception details in a separate
+ * transaction. */
+ protected void handleJobExecutionException(Environment environment, JobImpl<?> job, Throwable exception) {
+ Transaction transaction = environment.get(Transaction.class);
+ transaction.setRollbackOnly();
+
+ CommandService commandService = (CommandService) environment.get(CommandService.class);
+ JobExceptionHandler jobExceptionHandler = new JobExceptionHandler(job.getDbid(), exception, commandService);
+ transaction.registerSynchronization(jobExceptionHandler);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetMessagesCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetMessagesCmd.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetMessagesCmd.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.cmd;
-
-import java.util.List;
-
-import org.jbpm.env.Environment;
-import org.jbpm.job.Message;
-import org.jbpm.session.PvmDbSession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class GetMessagesCmd extends QueryCommand<List<Message>> {
-
- private static final long serialVersionUID = 1L;
-
- public GetMessagesCmd(int firstResult, int maxResults) {
- super(firstResult, maxResults);
- }
-
- public List<Message> execute(Environment environment) throws Exception {
- PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
- return pvmDbSession.findMessages(firstResult, maxResults);
- }
-
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTimersCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTimersCmd.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTimersCmd.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.cmd;
-
-import java.util.List;
-
-import org.jbpm.env.Environment;
-import org.jbpm.job.Timer;
-import org.jbpm.session.PvmDbSession;
-
-/**
- * @author Tom Baeyens
- */
-public class GetTimersCmd extends QueryCommand<List<Timer>> {
-
- private static final long serialVersionUID = 1L;
-
- public GetTimersCmd(int firstResult, int maxResults) {
- super(firstResult, maxResults);
- }
-
- public List<Timer> execute(Environment environment) throws Exception {
- PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
- return pvmDbSession.findTimers(firstResult, maxResults);
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/ExecuteJobCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/ExecuteJobCmd.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/ExecuteJobCmd.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -1,102 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.jobexecutor;
-
-import java.util.Date;
-
-import org.hibernate.Session;
-import org.jbpm.JbpmException;
-import org.jbpm.cmd.Command;
-import org.jbpm.cmd.CommandService;
-import org.jbpm.env.Environment;
-import org.jbpm.env.Transaction;
-import org.jbpm.job.Job;
-import org.jbpm.log.Log;
-import org.jbpm.pvm.internal.job.JobImpl;
-
-
-
-/**
- * @author Tom Baeyens
- */
-public class ExecuteJobCmd implements Command<Job> {
-
- private static final long serialVersionUID = 1L;
-
- private static final Log log = Log.getLog(ExecuteJobCmd.class.getName());
-
- protected long jobDbid;
-
- public ExecuteJobCmd(long jobDbid) {
- this.jobDbid = jobDbid;
- }
-
- public Job execute(Environment environment) throws Exception {
- JobDbSession session = environment.get(JobDbSession.class);
- if (session==null) {
- throw new JbpmException("no job session configured to get job "+jobDbid+" for execution");
- }
- JobImpl<?> job = (JobImpl<?>) session.get(JobImpl.class, jobDbid);
-
- // in case of exclusive jobs, the job might have been deleted
- // before we execute it (they are in a list)
- if (job != null) {
- try {
- log.debug("executing job "+job+"...");
- job.execute(environment);
- log.debug("executed job "+job);
-
- // if this job is locked too long, it could be unlocked by the lockmonitor and
- // executed by another thread.
- Date lockExpirationDate = job.getLockExpirationTime();
- // can be null if it was rescheduled
- if (lockExpirationDate != null) {
- long lockExpiration = lockExpirationDate.getTime();
- long currentTime = System.currentTimeMillis();
- if (currentTime>lockExpiration) {
- throw new JbpmException("job took too long: lock expired "+(currentTime-lockExpiration)+"ms ago");
- }
- }
- } catch (Throwable exception) {
- log.error("exception while executing '"+job+"'", exception);
- handleJobExecutionException(environment, job, exception);
- }
-
- } else {
- log.debug("job " + jobDbid + " no longer exists");
- }
- return job;
- }
-
- /** This transaction will be marked for rollback. A command will be associated with the
- * Transaction.EVENT_AFTERCOMPLETION (after the job locks of the current transaction are
- * released). Then the command will update the job with the exception details in a separate
- * transaction. */
- protected void handleJobExecutionException(Environment environment, JobImpl<?> job, Throwable exception) {
- Transaction transaction = environment.get(Transaction.class);
- transaction.setRollbackOnly();
-
- CommandService commandService = (CommandService) environment.get(CommandService.class);
- JobExceptionHandler jobExceptionHandler = new JobExceptionHandler(job.getDbid(), exception, commandService);
- transaction.registerSynchronization(jobExceptionHandler);
- }
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorThread.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorThread.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorThread.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -26,6 +26,7 @@
import org.jbpm.cmd.CommandService;
import org.jbpm.log.Log;
+import org.jbpm.pvm.internal.cmd.ExecuteJobCmd;
/**
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -579,7 +579,7 @@
throw new JbpmException("no message-session configured to send asynchronous continuation message");
}
MessageImpl<?> asyncMessage = operation.createAsyncMessage(this);
- lock("async continuation message "+asyncMessage);
+ lock(Execution.STATE_ASYNC);
messageSession.send(asyncMessage);
}
Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/JobQueryImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/JobQueryImpl.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/JobQueryImpl.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -0,0 +1,116 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.query;
+
+import java.util.List;
+
+import org.hibernate.Query;
+import org.jbpm.JobQuery;
+import org.jbpm.cmd.CommandService;
+import org.jbpm.job.Job;
+import org.jbpm.pvm.internal.job.JobImpl;
+import org.jbpm.pvm.internal.job.MessageImpl;
+import org.jbpm.pvm.internal.job.TimerImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class JobQueryImpl extends AbstractQuery implements JobQuery {
+
+ private static final long serialVersionUID = 1L;
+
+ protected boolean messagesOnly = false;
+ protected boolean timersOnly = false;
+ protected String processInstanceId = null;
+ protected boolean exception = false;
+
+ public JobQueryImpl(CommandService commandService) {
+ super(commandService);
+ }
+
+ public String hql() {
+ StringBuffer hql = new StringBuffer();
+ hql.append("select j ");
+ hql.append("from ");
+ if (messagesOnly) {
+ hql.append(MessageImpl.class.getName());
+ } else if (timersOnly) {
+ hql.append(TimerImpl.class.getName());
+ } else {
+ hql.append(JobImpl.class.getName());
+ }
+ hql.append(" j ");
+
+ if (processInstanceId!=null) {
+ appendWhereClause("j.processInstance.id = '"+processInstanceId+"' ", hql);
+ }
+
+ if (exception) {
+ appendWhereClause("j.exception is not null ", hql);
+ }
+
+ return hql.toString();
+ }
+
+ protected void applyParameters(Query query) {
+ }
+
+ public List<Job> execute() {
+ return (List<Job>) commandService.execute(this);
+ }
+
+ public JobQuery messages() {
+ this.messagesOnly = true;
+ return this;
+ }
+
+ public JobQuery timers() {
+ this.timersOnly = true;
+ return this;
+ }
+
+ public JobQuery exception() {
+ this.exception = true;
+ return this;
+ }
+
+ public JobQuery orderAsc(String property) {
+ addOrderByClause("j."+property+" asc");
+ return this;
+ }
+
+ public JobQuery orderDesc(String property) {
+ addOrderByClause("j."+property+" asc");
+ return this;
+ }
+
+ public JobQuery page(int firstResult, int maxResults) {
+ this.page = new Page(firstResult, maxResults);
+ return this;
+ }
+
+ public JobQuery processInstanceId(String processInstanceId) {
+ this.processInstanceId = processInstanceId;
+ return this;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/JobQueryImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ManagementServiceImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ManagementServiceImpl.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/ManagementServiceImpl.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -21,15 +21,11 @@
*/
package org.jbpm.pvm.internal.svc;
-import java.util.List;
-
+import org.jbpm.JobQuery;
import org.jbpm.ManagementService;
import org.jbpm.cmd.CommandService;
-import org.jbpm.job.Job;
-import org.jbpm.job.Message;
-import org.jbpm.job.Timer;
-import org.jbpm.pvm.internal.cmd.GetMessagesCmd;
-import org.jbpm.pvm.internal.cmd.GetTimersCmd;
+import org.jbpm.pvm.internal.cmd.ExecuteJobCmd;
+import org.jbpm.pvm.internal.query.JobQueryImpl;
/**
@@ -39,21 +35,11 @@
protected CommandService commandService;
- public void executeJob(String jobId) {
- // TODO
+ public void executeJob(long jobDbid) {
+ commandService.execute(new ExecuteJobCmd(jobDbid));
}
- public List<Job> getJobsWithException(int firstResult, int maxResults) {
- // TODO
- return null;
+ public JobQuery createJobQuery() {
+ return new JobQueryImpl(commandService);
}
-
- public List<Message> getMessages(int firstResult, int maxResults) {
- return commandService.execute(new GetMessagesCmd(firstResult, maxResults));
- }
-
- public List<Timer> getTimers(int firstResult, int maxResults) {
- return commandService.execute(new GetTimersCmd(firstResult, maxResults));
- }
-
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/test/JobTestHelper.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/test/JobTestHelper.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/test/JobTestHelper.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -28,9 +28,9 @@
import org.jbpm.cmd.CommandService;
import org.jbpm.env.Environment;
import org.jbpm.job.Job;
+import org.jbpm.pvm.internal.cmd.ExecuteJobCmd;
import org.jbpm.pvm.internal.job.MessageImpl;
import org.jbpm.pvm.internal.job.TimerImpl;
-import org.jbpm.pvm.internal.jobexecutor.ExecuteJobCmd;
/** helper class for testing that executes messages and timers
Added: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/AsyncContinuationsTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/AsyncContinuationsTest.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/AsyncContinuationsTest.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -0,0 +1,102 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.jobexecutor;
+
+import org.hibernate.Session;
+import org.jbpm.Execution;
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.model.OpenProcessDefinition;
+import org.jbpm.pvm.activities.AutomaticActivity;
+import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
+import org.jbpm.test.DbTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class AsyncContinuationsTest extends DbTestCase {
+
+ public void testContinuations() {
+ deployProcess();
+
+ Execution execution = executionService.startExecutionByKey("continuations");
+
+ assertEquals("start", execution.getActivityName());
+ assertEquals(Execution.STATE_ASYNC, execution.getState());
+
+ executeAsyncMessage(execution);
+ execution = executionService.findExecution(execution.getId());
+
+ assertEquals("a", execution.getActivityName());
+ assertEquals(Execution.STATE_ASYNC, execution.getState());
+
+ executeAsyncMessage(execution);
+ execution = executionService.findExecution(execution.getId());
+
+ assertEquals("b", execution.getActivityName());
+ assertEquals(Execution.STATE_ASYNC, execution.getState());
+
+ executeAsyncMessage(execution);
+ execution = executionService.findExecution(execution.getId());
+
+ assertEquals("c", execution.getActivityName());
+ assertEquals(Execution.STATE_ASYNC, execution.getState());
+
+ executeAsyncMessage(execution);
+
+ assertNull(executionService.findExecution(execution.getId()));
+ }
+
+ public void deployProcess() {
+ commandService.execute(new Command<Object>() {
+ public Object execute(Environment environment) throws Exception {
+ OpenProcessDefinition processDefinition = ProcessDefinitionBuilder.startProcess("continuations")
+ .key("continuations")
+ .startActivity("start", AutomaticActivity.class)
+ .initial()
+ .asyncExecute()
+ .flow("a")
+ .endActivity()
+ .startActivity("a", AutomaticActivity.class)
+ .asyncExecute()
+ .flow("b")
+ .endActivity()
+ .startActivity("b", AutomaticActivity.class)
+ .asyncExecute()
+ .flow("c")
+ .endActivity()
+ .startActivity("c", AutomaticActivity.class)
+ .asyncExecute()
+ .flow("end")
+ .endActivity()
+ .startActivity("end", AutomaticActivity.class)
+ .endActivity()
+ .endProcess();
+
+ Session session = environment.get(Session.class);
+ session.save(processDefinition);
+ return null;
+ }
+ });
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/AsyncContinuationsTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/AutomaticActivity.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/AutomaticActivity.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/AutomaticActivity.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.jobexecutor;
-
-import org.jbpm.activity.ActivityBehaviour;
-import org.jbpm.activity.ActivityExecution;
-
-/** a activity behaviour implementation that records its execution and then
- * just proceeds.
- *
- * @author Tom Baeyens
- */
-public class AutomaticActivity implements ActivityBehaviour {
-
- private static final long serialVersionUID = 1L;
-
- public AutomaticActivity() {
- }
-
- public void execute(ActivityExecution execution) throws Exception {
- ContinuationTest.recorder.record(execution.getDbid(), "execute("+execution.getActivity().getName()+")");
- }
-}
\ No newline at end of file
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ContinuationTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ContinuationTest.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ContinuationTest.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -1,107 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.jobexecutor;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.hibernate.Session;
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-import org.jbpm.model.OpenProcessDefinition;
-import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
-
-/**
- * @author Tom Baeyens
- */
-public class ContinuationTest extends JobExecutorTestCase {
-
- // private static final Log log = Log.getLog(ContinuationTest.class.getName());
-
- static Recorder recorder = new Recorder();
-
- int nbrOfExecutions = 1;
-
- public void testContinuations() {
-
- try {
- deployProcess();
- startExecutions();
- jobExecutor.start();
- waitTillNoMoreMessages();
-
- } finally {
- jobExecutor.stop(true);
- }
-
- List<String> expectedLogs = new ArrayList<String>();
- expectedLogs.add("execute(start)");
- expectedLogs.add("execute(a)");
- expectedLogs.add("execute(b)");
- expectedLogs.add("execute(c)");
- expectedLogs.add("execute(end)");
-
- assertEquals(nbrOfExecutions, recorder.executionEvents.size());
- for (List<String> executionLogs : recorder.executionEvents.values()) {
- assertEquals(expectedLogs, executionLogs);
- }
- }
-
- public void deployProcess() {
- commandService.execute(new Command<Object>() {
- public Object execute(Environment environment) throws Exception {
- OpenProcessDefinition processDefinition = ProcessDefinitionBuilder.startProcess("continuations")
- .key("continuations")
- .startActivity("start", AutomaticActivity.class)
- .initial()
- .asyncExecute()
- .flow("a")
- .endActivity()
- .startActivity("a", AutomaticActivity.class)
- .asyncExecute()
- .flow("b")
- .endActivity()
- .startActivity("b", AutomaticActivity.class)
- .asyncExecute()
- .flow("c")
- .endActivity()
- .startActivity("c", AutomaticActivity.class)
- .asyncExecute()
- .flow("end")
- .endActivity()
- .startActivity("end", WaitState.class)
- .endActivity()
- .endProcess();
-
- Session session = environment.get(Session.class);
- session.save(processDefinition);
- return null;
- }
- });
- }
-
- public void startExecutions() {
- for (int i = 0; i < nbrOfExecutions; i++) {
- executionService.startExecutionByKey("continuations");
- }
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ExclusiveMessagesTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ExclusiveMessagesTest.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ExclusiveMessagesTest.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -1,133 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.jobexecutor;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.hibernate.Session;
-import org.jbpm.Execution;
-import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivityBehaviour;
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
-import org.jbpm.pvm.internal.cmd.StartExecutionCmd;
-import org.jbpm.pvm.internal.job.CommandMessage;
-import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
-import org.jbpm.session.MessageSession;
-
-/**
- * @author Tom Baeyens
- */
-public class ExclusiveMessagesTest extends JobExecutorTestCase {
-
- static Map<String, Set<Long>> exclusiveThreadIds;
-
- static int nbrOfTestMessagesPerExecution = 5;
- static int nbrOfTestExecutions = 5;
-
- public void setUp() throws Exception {
- super.setUp();
-
- exclusiveThreadIds = new HashMap<String, Set<Long>>();
- }
-
- public void testExclusiveMessageProcessing() {
- insertExclusiveTestMessages();
-
- JobExecutor jobExecutor = processEngine.get(JobExecutor.class);
- jobExecutor.start();
- try {
-
- waitTillNoMoreMessages();
-
- } finally {
- jobExecutor.stop(true);
- }
-
- commandService.execute(new Command<Object>() {
-
- public Object execute(Environment environment) throws Exception {
- // exclusiveMessageIds maps execution keys to a set of thread ids.
- // the idea is that for each execution, all the exclusive jobs will
- // be executed by 1 thread sequentially.
-
- for (int i = 0; i < nbrOfTestExecutions; i++) {
- String executionKey = "execution-" + i;
- Set<Long> threadIds = exclusiveThreadIds.get(executionKey);
- assertNotNull("no thread id set for " + executionKey + " in: " + exclusiveThreadIds, threadIds);
- assertEquals("exclusive messages for " + executionKey + " have been executed by multiple threads: " + threadIds, 1, threadIds.size());
- }
- return null;
- }
- });
- }
-
- public static class WaitState implements ExternalActivityBehaviour {
-
- private static final long serialVersionUID = 1L;
-
- public void execute(ActivityExecution execution) throws Exception {
- execution.waitForSignal();
- }
- public void signal(ActivityExecution execution, String signalName, Map<String, Object> parameters) throws Exception {
- execution.take(signalName);
- }
- }
-
- public void insertExclusiveTestMessages() {
- commandService.execute(new Command<Object>() {
- public Object execute(Environment environment) throws Exception {
- ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) ProcessDefinitionBuilder
- .startProcess("excl")
- .startActivity("wait", WaitState.class)
- .initial()
- .endActivity()
- .endProcess();
- processDefinition.setId("excl:1");
-
- Session session = environment.get(Session.class);
- session.save(processDefinition);
- return null;
- }
- });
-
- commandService.execute(new Command<Object>() {
-
- public Object execute(Environment environment) throws Exception {
- MessageSession messageSession = environment.get(MessageSession.class);
- for (int i = 0; i < nbrOfTestExecutions; i++) {
- Execution execution = new StartExecutionCmd("excl:1", null, "execution-" + i).execute(environment);
-
- for (int j = 0; j < nbrOfTestMessagesPerExecution; j++) {
- CommandMessage exclusiveTestMessage = ExclusiveTestCommand.createMessage(execution);
- messageSession.send(exclusiveTestMessage);
- }
- }
- return null;
- }
- });
- }
-
-}
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ExclusiveTestCommand.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ExclusiveTestCommand.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ExclusiveTestCommand.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -1,99 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.jobexecutor;
-
-import java.util.HashSet;
-import java.util.Random;
-import java.util.Set;
-
-import org.hibernate.Session;
-import org.jbpm.Execution;
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-import org.jbpm.log.Log;
-import org.jbpm.pvm.internal.job.CommandMessage;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.wire.descriptor.LongDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-
-
-/**
- * @author Tom Baeyens
- */
-public class ExclusiveTestCommand implements Command<Object> {
-
- private static final long serialVersionUID = 1L;
- private static final Log log = Log.getLog(ExclusiveTestCommand.class.getName());
- static Random random = new Random();
-
- long executionId;
-
- public ExclusiveTestCommand() {
- }
-
- public static CommandMessage createMessage(Execution execution) {
- CommandMessage commandMessage = new CommandMessage();
- commandMessage.setExecution((ExecutionImpl) execution);
- commandMessage.setExclusive(true);
-
- ObjectDescriptor commandDescriptor = new ObjectDescriptor(ExclusiveTestCommand.class);
- commandDescriptor.addInjection("executionId", new LongDescriptor(execution.getDbid()));
- commandMessage.setCommandDescriptor(commandDescriptor);
- return commandMessage;
- }
-
- public Object execute(Environment environment) throws Exception {
- Long threadId = Thread.currentThread().getId();
-
- Session session = environment.get(Session.class);
- ExecutionImpl execution = (ExecutionImpl) session.get(ExecutionImpl.class, executionId);
-
- String executionKey = execution.getKey();
-
- // exclusiveMessageIds maps execution keys to a set of thread ids.
- // the idea is that for each execution, all the exclusive jobs will
- // be executed by 1 thread sequentially.
-
- // in the end, each set should contain exactly 1 element
-
- Set<Long> groupMessages = ExclusiveMessagesTest.exclusiveThreadIds.get(executionKey);
- if (groupMessages==null) {
- groupMessages = new HashSet<Long>();
- ExclusiveMessagesTest.exclusiveThreadIds.put(executionKey, groupMessages);
- }
- groupMessages.add(threadId);
-
- /*
- // let's assume that an average jobImpl takes between 0 and 150 millis to complete.
- int workTime = random.nextInt(150);
- log.debug("executing exclusive message for "+execution+". this is going to take "+workTime+"ms");
- try {
- Thread.sleep(workTime);
- } catch (RuntimeException e) {
- log.debug("sleeping was interrupted");
- }
- */
-
- return null;
- }
-
-}
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/FailOnceMessageTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/FailOnceMessageTest.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/FailOnceMessageTest.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -1,107 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.jobexecutor;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.hibernate.Session;
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-import org.jbpm.log.Log;
-import org.jbpm.model.Comment;
-import org.jbpm.pvm.internal.job.CommandMessage;
-import org.jbpm.pvm.internal.model.CommentImpl;
-import org.jbpm.session.MessageSession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class FailOnceMessageTest extends JobExecutorTestCase {
-
- private static final Log log = Log.getLog(FailOnceMessageTest.class.getName());
-
- static long nbrOfTestMessages = 1;
-
- static List<Integer> failOnceMessageIds = Collections.synchronizedList(new ArrayList<Integer>());
-
- public void testFailOnceMessages() {
- failOnceMessageIds.clear();
-
- jobExecutor.start();
- try {
- insertFailOnceTestMessages();
- waitTillNoMoreMessages();
-
- } finally {
- log.debug("stopping job executor");
- jobExecutor.stop(true);
- }
-
- for (int i = 0; i < nbrOfTestMessages; i++) {
- assertTrue("message " + i + " is not failed once: " + failOnceMessageIds, failOnceMessageIds.contains(i));
- }
- assertEquals(nbrOfTestMessages, failOnceMessageIds.size());
-
- log.debug("==== all messages processed, now checking if all messages have arrived exactly once ====");
-
- commandService.execute(new Command<Object>() {
-
- public Object execute(Environment environment) throws Exception {
- Session session = environment.get(Session.class);
- List<Comment> comments = session.createQuery("from " + CommentImpl.class.getName()).list();
-
- for (Comment comment : comments) {
- log.debug("retrieved message: "+comment.getMessage());
- Integer messageId = new Integer(comment.getMessage());
- assertTrue("message " + messageId + " committed twice", failOnceMessageIds.remove(messageId));
- }
-
- assertTrue("not all messages made a successful commit: " + failOnceMessageIds, failOnceMessageIds.isEmpty());
- return null;
- }
- });
- }
-
- public static class InsertFailOnceTestMsgCmd implements Command<Object> {
- private static final long serialVersionUID = 1L;
- int i;
- public InsertFailOnceTestMsgCmd(int i) {
- this.i = i;
- }
- public Object execute(Environment environment) throws Exception {
- MessageSession messageSession = environment.get(MessageSession.class);
- CommandMessage commandMessage = FailOnceTestCommand.createMessage(i);
- messageSession.send(commandMessage);
- return null;
- }
- }
-
- void insertFailOnceTestMessages() {
- for (int i = 0; i < nbrOfTestMessages; i++) {
- commandService.execute(new InsertFailOnceTestMsgCmd(i));
- }
- }
-
-}
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/FailOnceTestCommand.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/FailOnceTestCommand.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/FailOnceTestCommand.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -1,84 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.jobexecutor;
-
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-import org.jbpm.log.Log;
-import org.jbpm.model.Comment;
-import org.jbpm.pvm.internal.job.CommandMessage;
-import org.jbpm.pvm.internal.job.JobImpl;
-import org.jbpm.pvm.internal.model.CommentImpl;
-import org.jbpm.pvm.internal.wire.descriptor.IntegerDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-import org.jbpm.session.DbSession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class FailOnceTestCommand implements Command<Object> {
-
- private static final long serialVersionUID = 1L;
- private static final Log log = Log.getLog(FailOnceTestCommand.class.getName());
-
- int messageId;
-
- public FailOnceTestCommand() {
- }
-
- public static CommandMessage createMessage(int messageId) {
- CommandMessage commandMessage = new CommandMessage();
- ObjectDescriptor commandDescriptor = new ObjectDescriptor(FailOnceTestCommand.class);
- commandDescriptor.addInjection("messageId", new IntegerDescriptor(messageId));
- commandMessage.setCommandDescriptor(commandDescriptor);
- return commandMessage;
- }
-
- public Object execute(Environment environment) throws Exception {
- DbSession dbSession = environment.get(DbSession.class);
-
- // this message execution should be rolled back
- Comment comment = new CommentImpl(Integer.toString(messageId));
- dbSession.save(comment);
-
- if (!FailOnceMessageTest.failOnceMessageIds.contains(messageId)) {
- // registering the failed message in a non-transactional resource
- // so the messageId will still be added even after the transaction has rolled back
- log.debug("adding failonce message "+messageId);
- FailOnceMessageTest.failOnceMessageIds.add(messageId);
-
- throw new RuntimeException("failing once");
- }
-
- try {
- Thread.sleep(700);
- } catch (Exception e) {
- log.error(e.toString());
- }
-
- log.debug("message "+messageId+" now succeeds");
-
- return null;
- }
-
-}
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/FailingMessageTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/FailingMessageTest.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/FailingMessageTest.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -1,77 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.jobexecutor;
-
-import java.util.List;
-
-import org.hibernate.Session;
-import org.jbpm.cmd.Command;
-import org.jbpm.cmd.CommandService;
-import org.jbpm.env.Environment;
-import org.jbpm.job.Job;
-import org.jbpm.pvm.internal.job.CommandMessage;
-import org.jbpm.pvm.internal.model.CommentImpl;
-import org.jbpm.session.MessageSession;
-import org.jbpm.session.PvmDbSession;
-import org.jbpm.test.DbTestCase;
-
-
-/**
- * @author Tom Baeyens
- */
-public class FailingMessageTest extends JobExecutorTestCase {
-
-
- public void testFailedMessageProcessing() {
- jobExecutor.start();
- try {
- commandService.execute(new Command<Object>() {
-
- public Object execute(Environment environment) throws Exception {
- MessageSession messageSession = environment.get(MessageSession.class);
- CommandMessage commandMessage = FailingTestCommand.createMessage();
- messageSession.send(commandMessage);
- return null;
- }
- });
-
- waitTillNoMoreMessages();
-
- } finally {
- jobExecutor.stop(true);
- }
-
- commandService.execute(new Command<Object>() {
-
- public Object execute(Environment environment) throws Exception {
- PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
- List<Job> deadJobs = pvmDbSession.findJobsWithException(0, 10);
- assertEquals("there should be one dead job", 1, deadJobs.size());
-
- Session session = environment.get(Session.class);
- List commands = session.createQuery("from " + CommentImpl.class.getName()).list();
- assertTrue("command insertion should have been rolled back", commands.isEmpty());
- return null;
- }
- });
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/FailingTestCommand.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/FailingTestCommand.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/FailingTestCommand.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.jobexecutor;
-
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-import org.jbpm.model.Comment;
-import org.jbpm.pvm.internal.job.CommandMessage;
-import org.jbpm.pvm.internal.model.CommentImpl;
-import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-import org.jbpm.session.DbSession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class FailingTestCommand implements Command<Object> {
-
- private static final long serialVersionUID = 1L;
-
- public Object execute(Environment environment) throws Exception {
- DbSession dbSession = environment.get(DbSession.class);
-
- // this message execution should be rolled back
- Comment comment = new CommentImpl("failing update");
- dbSession.save(comment);
-
- throw new RuntimeException("ooops");
- }
-
- public static CommandMessage createMessage() {
- CommandMessage commandMessage = new CommandMessage();
- ObjectDescriptor commandDescriptor = new ObjectDescriptor(FailingTestCommand.class);
- commandMessage.setCommandDescriptor(commandDescriptor);
- return commandMessage;
- }
-
-}
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/GenerateExceptionTestCommand.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/GenerateExceptionTestCommand.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/GenerateExceptionTestCommand.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -1,66 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.jobexecutor;
-
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-import org.jbpm.pvm.internal.job.CommandMessage;
-import org.jbpm.pvm.internal.wire.descriptor.IntegerDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-
-
-/**
- * @author Tom Baeyens
- * @author Guillaume Porcher
- *
- * Simple command that will create an exception during execution.
- * The exception will generate a stacktrace with variable length
- * (controlled by the length parameter).
- *
- * This class is to test the persistence of exception stacktrace in jobs.
- */
-public class GenerateExceptionTestCommand implements Command<Object> {
-
- private static final long serialVersionUID = 1L;
-
- int length;
-
- public GenerateExceptionTestCommand() {
- }
-
- public static CommandMessage createMessage(int recursionInitialDepth) {
- CommandMessage commandMessage = new CommandMessage();
- ObjectDescriptor commandDescriptor = new ObjectDescriptor(GenerateExceptionTestCommand.class);
- commandDescriptor.addInjection("length", new IntegerDescriptor(recursionInitialDepth));
- commandMessage.setCommandDescriptor(commandDescriptor);
- return commandMessage;
- }
-
- public Object execute(Environment environment) throws Exception {
- StringBuilder stringBuilder = new StringBuilder();
- while (stringBuilder.length() < length) {
- stringBuilder.append("This is a long test message. ");
- }
- throw new RuntimeException(stringBuilder.toString());
- }
-
-}
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTestCase.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTestCase.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTestCase.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -1,114 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.jobexecutor;
-
-import java.util.Date;
-import java.util.Timer;
-import java.util.TimerTask;
-
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.jbpm.cmd.Command;
-import org.jbpm.cmd.CommandService;
-import org.jbpm.env.Environment;
-import org.jbpm.pvm.internal.job.JobImpl;
-import org.jbpm.test.DbTestCase;
-
-
-/**
- * @author Tom Baeyens
- */
-public class JobExecutorTestCase extends DbTestCase {
-
- static long timeoutMillis = 20 * 1000; // 10 seconds
- static long checkInterval = 200;
-
- static String jobsAvailableQueryText =
- "select count(*) "+
- "from "+JobImpl.class.getName()+" as job "+
- "where ( (job.dueDate is null) or (job.dueDate <= :now) ) "+
- " and ( job.retries > 0 )";
-
- protected CommandService commandService;
- protected JobExecutor jobExecutor;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- commandService = processEngine.get(CommandService.class);
- jobExecutor = processEngine.get(JobExecutor.class);
- }
-
- protected void waitTillNoMoreMessages() {
-
- // install a timer that will interrupt if it takes too long
- // if that happens, it will lead to an interrupted exception and the test
- // will fail
- TimerTask interruptTask = new TimerTask() {
-
- Thread testThread = Thread.currentThread();
-
- public void run() {
- log.debug("test " + getName() + " took too long. going to interrupt..." + testThread);
- testThread.interrupt();
- }
- };
- Timer timer = new Timer();
- timer.schedule(interruptTask, timeoutMillis);
-
- try {
- boolean jobsAvailable = true;
- while (jobsAvailable) {
- log.debug("going to sleep for " + checkInterval + " millis, waiting for the job executor to process more jobs");
- Thread.sleep(checkInterval);
- jobsAvailable = areJobsAvailable();
- }
-
- } catch (InterruptedException e) {
- fail("test execution exceeded treshold of " + timeoutMillis + " milliseconds");
- } finally {
- timer.cancel();
- }
- }
-
- public boolean areJobsAvailable() {
- return commandService.execute(new Command<Boolean>() {
- public Boolean execute(Environment environment) {
- Session session = environment.get(Session.class);
-
- Query query = session.createQuery(jobsAvailableQueryText);
- query.setDate("now", new Date());
-
- Long jobs = (Long) query.uniqueResult();
-
- if (jobs.longValue()>0) {
- log.debug("found "+jobs+" more jobs to process");
- return true;
- }
- log.debug("no more jobs to process");
-
- return false;
- }
- });
- }
-
-}
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/NormalMessageCommand.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/NormalMessageCommand.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/NormalMessageCommand.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -1,65 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.jobexecutor;
-
-import java.util.Random;
-
-import org.hibernate.Session;
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-import org.jbpm.pvm.internal.job.CommandMessage;
-import org.jbpm.pvm.internal.model.CommentImpl;
-import org.jbpm.pvm.internal.wire.descriptor.IntegerDescriptor;
-import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
-
-/**
- * @author Tom Baeyens
- */
-public class NormalMessageCommand implements Command<Void> {
-
- private static final long serialVersionUID = 1L;
- static Random random = new Random();
-
- int messageId;
-
- public NormalMessageCommand() {
- }
-
- public NormalMessageCommand(int messageId) {
- this.messageId = messageId;
- }
-
- public static CommandMessage createMessage(int messageId) {
- CommandMessage commandMessage = new CommandMessage();
- ObjectDescriptor commandDescriptor = new ObjectDescriptor(NormalMessageCommand.class);
- commandDescriptor.addInjection("messageId", new IntegerDescriptor(messageId));
- commandMessage.setCommandDescriptor(commandDescriptor);
- return commandMessage;
- }
-
- public Void execute(Environment environment) throws Exception {
- CommentImpl comment = new CommentImpl(Integer.toString(messageId));
- Session session = environment.get(Session.class);
- session.save(comment);
- return null;
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/NormalMessageTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/NormalMessageTest.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/NormalMessageTest.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -1,103 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.jobexecutor;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.hibernate.Session;
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-import org.jbpm.model.Comment;
-import org.jbpm.pvm.internal.job.CommandMessage;
-import org.jbpm.pvm.internal.model.CommentImpl;
-import org.jbpm.session.MessageSession;
-import org.jbpm.test.Db;
-
-/**
- * @author Tom Baeyens
- */
-public class NormalMessageTest extends JobExecutorTestCase {
-
- static long nbrOfTestMessages = 5;
-
- static long timeoutMillis = 30 * 1000; // 30 seconds
- static long checkInterval = 400;
-
-
- protected void setUp() throws Exception {
- super.setUp();
- Db.clean(processEngine);
- }
-
- public void testNormalMessageProcessing() {
- JobExecutor jobExecutor = processEngine.get(JobExecutor.class);
- jobExecutor.start();
-
- try {
- // insert ${nbrOfTestMessages} messages...
- for (int i = 0; i < nbrOfTestMessages; i++) {
- commandService.execute(new InsertNormalMessageCmd(i));
- }
-
- // wait till all messages are processed
- waitTillNoMoreMessages();
-
- } finally {
- jobExecutor.stop(true);
- }
-
- List<Integer> processedMessageNumbers = commandService.execute(new Command<List<Integer>>() {
- public List<Integer> execute(Environment environment) {
- List<Integer> processedMessageNumbers = new ArrayList<Integer>();
- Session session = environment.get(Session.class);
- List<Comment> comments = session.createCriteria(CommentImpl.class).list();
- for (Comment comment: comments) {
- int processedMessageNumber = Integer.parseInt(comment.getMessage());
- processedMessageNumbers.add(processedMessageNumber);
- // make sure the db stays clean
- session.delete(comment);
- }
- return processedMessageNumbers;
- }
- });
-
- for (int i = 0; i < nbrOfTestMessages; i++) {
- assertTrue("message " + i + " is not processed: " + processedMessageNumbers, processedMessageNumbers.contains(i));
- }
- }
-
- public static class InsertNormalMessageCmd implements Command<Object> {
- private static final long serialVersionUID = 1L;
- int i;
- public InsertNormalMessageCmd(int i) {
- this.i = i;
- }
- public Object execute(Environment environment) throws Exception {
- MessageSession messageSession = environment.get(MessageSession.class);
- CommandMessage commandMessage = NormalMessageCommand.createMessage(i);
- messageSession.send(commandMessage);
- return null;
- }
- }
-
-}
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/Recorder.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/Recorder.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/Recorder.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.jobexecutor;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author Tom Baeyens
- */
-public class Recorder {
-
- public Map<Object, List<String>> executionEvents = null;
-
- public synchronized void record(long executionDbid, String event) {
- if (executionEvents==null) {
- executionEvents = new HashMap<Object, List<String>>();
- }
- List<String> events = executionEvents.get(executionDbid);
- if (events == null) {
- events = new ArrayList<String>();
- executionEvents.put(executionDbid, events);
- }
- events.add(event);
- }
-
- public void reset() {
- executionEvents = null;
- }
-}
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/WaitState.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/WaitState.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/WaitState.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.jobexecutor;
-
-import java.util.Map;
-
-import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivityBehaviour;
-
-/**
- * @author Tom Baeyens
- */
-public class WaitState implements ExternalActivityBehaviour {
-
- private static final long serialVersionUID = 1L;
-
- public WaitState() {
- }
-
- public void execute(ActivityExecution execution) throws Exception {
- ContinuationTest.recorder.record(execution.getDbid(), "execute("+execution.getActivity().getName()+")");
- }
-
- public void signal(ActivityExecution execution, String signal, Map<String, Object> parameters) throws Exception {
- throw new UnsupportedOperationException();
- }
-}
\ No newline at end of file
Modified: jbpm4/trunk/modules/pvm/src/test/resources/logging.properties
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/logging.properties 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/pvm/src/test/resources/logging.properties 2009-02-11 12:12:09 UTC (rev 3830)
@@ -4,7 +4,7 @@
redirect.commons.logging = enabled
-java.util.logging.ConsoleHandler.level = SEVERE
+java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = org.jbpm.log.LogFormatter
# org.jbpm.util.ErrorTriggeredFileHandler.size = 500
@@ -14,7 +14,7 @@
# For example, set the com.xyz.foo logger to only log SEVERE messages:
# com.xyz.foo.level = SEVERE
-org.jbpm.level=INFO
+org.jbpm.level=FINE
# org.jbpm.pvm.internal.tx.level=FINE
# org.jbpm.pvm.internal.wire.level=FINE
# org.jbpm.pvm.internal.util.level=FINE
Modified: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/DbTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/DbTestCase.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/DbTestCase.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -34,6 +34,7 @@
import org.jbpm.ProcessService;
import org.jbpm.TaskService;
import org.jbpm.cmd.CommandService;
+import org.jbpm.job.Job;
import org.jbpm.task.Task;
/**
@@ -210,6 +211,24 @@
}
return null;
}
+
+ public void executeAsyncMessage(Execution execution) {
+ List<Job> jobs = managementService
+ .createJobQuery()
+ .messages()
+ .processInstanceId(execution.getId())
+ .execute();
+
+ if (jobs.isEmpty()) {
+ fail("no async message");
+ }
+
+ if (jobs.size()>1) {
+ fail("more then one async message");
+ }
+
+ managementService.executeJob(jobs.get(0).getDbid());
+ }
public static void assertContainsTask(List<Task> taskList, String taskName, String assignee) {
if (getTask(taskList, taskName, assignee)==null) {
Added: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/MessageFinder.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/MessageFinder.java (rev 0)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/MessageFinder.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class MessageFinder {
+
+ protected DbTestCase dbTestCase;
+
+ public MessageFinder(DbTestCase dbTestCase) {
+ this.dbTestCase = dbTestCase;
+ }
+
+
+
+}
Property changes on: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/MessageFinder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/mgmt/ManagementServiceTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/mgmt/ManagementServiceTest.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/mgmt/ManagementServiceTest.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -1,36 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.test.mgmt;
-
-import org.jbpm.test.DbTestCase;
-
-/**
- * @author Tom Baeyens
- */
-public class ManagementServiceTest extends DbTestCase {
-
- public void testGetJobs() {
- assertEquals(0, managementService.getTimers(0, 10).size());
- assertEquals(0, managementService.getMessages(0, 10).size());
- }
-
-}
Modified: jbpm4/trunk/modules/test-load/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-load/pom.xml 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/test-load/pom.xml 2009-02-11 12:12:09 UTC (rev 3830)
@@ -72,8 +72,52 @@
</excludes>
</configuration>
</plugin>
+
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack.jbpm.db</id>
+ <phase>generate-test-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-jpdl</artifactId>
+ <classifier>config</classifier>
+ <overWrite>true</overWrite>
+ </artifactItem>
+ </artifactItems>
+ <excludeTransitive>true</excludeTransitive>
+ <outputDirectory>target/jpdl-config</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>install.hibernate.database.properties</id>
+ <phase>generate-test-resources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <copy file="target/jpdl-config/hibernate.cfg.${database}.xml"
+ tofile="target/test-classes/hibernate.cfg.xml"
+ overwrite="true" />
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
-
</project>
\ No newline at end of file
Deleted: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/AddCommentMessage.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/AddCommentMessage.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/AddCommentMessage.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.test.load;
-
-import org.hibernate.Session;
-import org.jbpm.env.Environment;
-import org.jbpm.pvm.internal.job.MessageImpl;
-import org.jbpm.pvm.internal.model.CommentImpl;
-
-/**
- * @author Tom Baeyens
- */
-public class AddCommentMessage extends MessageImpl<Void> {
-
- private static final long serialVersionUID = 1L;
-
- public AddCommentMessage() {
- }
-
- public AddCommentMessage(String message) {
- this.info = message;
- }
-
- public Void execute(Environment environment) throws Exception {
- CommentImpl comment = new CommentImpl(info);
- Session session = environment.get(Session.class);
- session.save(comment);
- session.delete(this);
- MessageProcessingTest.commentAdded();
- return null;
- }
-}
Deleted: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/Automatic.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/Automatic.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/Automatic.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -1,31 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.test.load;
-
-/**
- * @author Tom Baeyens
- */
-public class Automatic {
-
- public void doNothing() {
- }
-}
Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/LoadTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/LoadTestCase.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/LoadTestCase.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -41,25 +41,25 @@
*/
public class LoadTestCase extends DbTestCase {
- static final long SECOND = 1000;
- static final long MINUTE = 60 * SECOND;
- static final long HOUR = 60 * MINUTE;
+ protected static final long SECOND = 1000;
+ protected static final long MINUTE = 60 * SECOND;
+ protected static final long HOUR = 60 * MINUTE;
- static long checkInterval = 200;
+ protected static long checkInterval = 2000;
- static String jobsAvailableQueryText =
+ protected static String jobsAvailableQueryText =
"select count(*) "+
"from "+JobImpl.class.getName()+" as job "+
"where ( (job.dueDate is null) or (job.dueDate <= :now) ) "+
" and ( job.retries > 0 )";
- static boolean measureMemory = true;
+ protected static boolean measureMemory = true;
protected CommandService commandService;
protected JobExecutor jobExecutor;
- long startTime = -1;
- long stopTime = -1;
- PrintWriter logFileWriter;
+ protected long startTime = -1;
+ protected long stopTime = -1;
+ protected PrintWriter logFileWriter;
public void setUp() throws Exception {
Deleted: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/MessageProcessingTest.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/MessageProcessingTest.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/MessageProcessingTest.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -1,130 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.test.load;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.hibernate.Session;
-import org.jbpm.cmd.Command;
-import org.jbpm.env.Environment;
-import org.jbpm.job.Message;
-import org.jbpm.log.Log;
-import org.jbpm.model.Comment;
-import org.jbpm.pvm.internal.cmd.CompositeCmd;
-import org.jbpm.pvm.internal.cmd.SendMessageCmd;
-import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
-import org.jbpm.pvm.internal.model.CommentImpl;
-
-/**
- * @author Tom Baeyens
- * @author Guillaume Porcher
- */
-public class MessageProcessingTest extends LoadTestCase {
-
- private static final Log log = Log.getLog(MessageProcessingTest.class.getName());
-
- static long nbrOfTestMessages = 10000; // nbrOfTestMessages must be dividable by insertGroupSize
- static long insertGroupSize = 100;
-
- static int commentsAdded = 0;
-
- public static synchronized void commentAdded() {
- commentsAdded++;
- }
-
- public void setUp() throws Exception {
- super.setUp();
-
- if ( (nbrOfTestMessages % insertGroupSize) != 0 ) {
- fail("nbrOfTestMessages ("+nbrOfTestMessages+") is not dividable by insertGroupSize ("+insertGroupSize+")");
- }
- }
-
- protected void logColumnTitles() {
- logFileWriter.println("Used Memory\tProcessed Messages\tTime");
- }
-
- public void logStatus() {
- String measuredTime = getMeasuredTime();
- logFileWriter.println(getUsedMemory()+"\t"+commentsAdded+"\t"+measuredTime);
- logFileWriter.flush();
- log.info(commentsAdded+" msgs in "+measuredTime);
- }
-
- public void testMessageProcessing() throws Exception {
- JobExecutor jobExecutor = processEngine.get(JobExecutor.class);
-
- try {
- int messageIndex = 0;
- // insert ${nbrOfTestMessages} messages...
- for (int i = 0; i < nbrOfTestMessages; i+=insertGroupSize) {
- CompositeCmd compositeCmd = new CompositeCmd();
- // ...in groups of ${insertGroupSize}
- for (int j = 0; j <insertGroupSize ; j++) {
- Message message = new AddCommentMessage(Integer.toString(messageIndex));
- SendMessageCmd sendMessageCmd = new SendMessageCmd(message);
- compositeCmd.addCommand(sendMessageCmd);
-
- messageIndex++;
- }
- commandService.execute(compositeCmd);
-
- log.info("added "+messageIndex+" messages");
- }
-
- startMeasuringTime();
-
- jobExecutor.start();
-
- // wait till all messages are processed
- waitTillNoMoreMessages(jobExecutor);
-
- } finally {
- stopMeasuringTime();
-
- jobExecutor.stop(true);
- }
-
- log.info("processing "+nbrOfTestMessages+" messages took "+getMeasuredTime());
-
- List<Integer> processedMessageNumbers = commandService.execute(new Command<List<Integer>>() {
- public List<Integer> execute(Environment environment) {
- List<Integer> processedMessageNumbers = new ArrayList<Integer>();
- Session session = environment.get(Session.class);
- List<Comment> comments = session.createCriteria(CommentImpl.class).list();
- for (Comment comment: comments) {
- int processedMessageNumber = Integer.parseInt(comment.getMessage());
- processedMessageNumbers.add(processedMessageNumber);
- // make sure the db stays clean
- session.delete(comment);
- }
- return processedMessageNumbers;
- }
- });
-
- for (int i = 0; i < nbrOfTestMessages; i++) {
- assertTrue("message " + i + " is not processed: " + processedMessageNumbers, processedMessageNumbers.contains(i));
- }
- }
-
-}
Deleted: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/ProcessExecutionTest.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/ProcessExecutionTest.java 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/ProcessExecutionTest.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -1,113 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.test.load;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jbpm.Execution;
-import org.jbpm.log.Log;
-
-
-/**
- * @author Tom Baeyens
- */
-public class ProcessExecutionTest extends LoadTestCase {
-
- private static Log log = Log.getLog(ProcessExecutionTest.class.getName());
-
- static int processes = 10000;
- static int threads = 5;
-
- Throwable exception;
- int finished;
-
- public void logStatus() {
- String measuredTime = getMeasuredTime();
- logFileWriter.println(getUsedMemory()+"\t"+finished+"\t"+measuredTime);
- logFileWriter.flush();
- log.info(finished+" executions in "+measuredTime);
- }
-
- protected void logColumnTitles() {
- logFileWriter.println("Used Memory\tFinished Executions\tTime");
- logFileWriter.flush();
- }
-
- public void testExecuteProcesses() throws Exception {
- deployJpdlResource("org/jbpm/test/load/process.jpdl.xml");
-
- startMeasuringTime();
-
- List<Thread> threadList = new ArrayList<Thread>();
- for (int i=0; i<threads; i++) {
- Thread thread = new ProcessExecutor();
- thread.start();
- threadList.add(thread);
- }
-
-
- for (Thread thread: threadList) {
- while (thread.isAlive()) {
- try {
- thread.join(checkInterval);
- } catch (InterruptedException e) {
- log.info(e.toString());
- }
- logStatus();
- }
- if (exception!=null) {
- break;
- }
- }
-
- if (exception!=null) {
- throw new Exception("thread threw: "+exception.getMessage(), exception);
- } else {
- log.info(finished+" executions in "+getMeasuredTime());
- }
- }
-
- public class ProcessExecutor extends Thread {
- public void run() {
- try {
- for (int i=0; i<processes; i++) {
- executeProcess();
- }
- } catch (Throwable t) {
- exception = t;
- }
- }
- public void executeProcess() {
- Execution execution = executionService.startExecutionByKey("Process");
- assertEquals("c", execution.getActivityName());
- String executionId = execution.getId();
- execution = executionService.signalExecutionById(executionId);
- assertTrue(execution.isEnded());
- processFinished();
- }
- }
-
- public synchronized void processFinished() {
- finished++;
- }
-}
Copied: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/AutomaticActivity.java (from rev 3816, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/AutomaticActivity.java)
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/AutomaticActivity.java (rev 0)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/AutomaticActivity.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.load.async;
+
+import org.jbpm.activity.ActivityBehaviour;
+import org.jbpm.activity.ActivityExecution;
+
+/** a activity behaviour implementation that records its execution and then
+ * just proceeds.
+ *
+ * @author Tom Baeyens
+ */
+public class AutomaticActivity implements ActivityBehaviour {
+
+ private static final long serialVersionUID = 1L;
+
+ public AutomaticActivity() {
+ }
+
+ public void execute(ActivityExecution execution) throws Exception {
+ ContinuationTest.recorder.record(execution.getDbid(), "execute("+execution.getActivity().getName()+")");
+ }
+}
\ No newline at end of file
Copied: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ContinuationTest.java (from rev 3816, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ContinuationTest.java)
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ContinuationTest.java (rev 0)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ContinuationTest.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.load.async;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hibernate.Session;
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.model.OpenProcessDefinition;
+import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
+
+/**
+ * @author Tom Baeyens
+ */
+public class ContinuationTest extends JobExecutorTestCase {
+
+ // private static final Log log = Log.getLog(ContinuationTest.class.getName());
+
+ static Recorder recorder = new Recorder();
+
+ int nbrOfExecutions = 100;
+
+ public void testContinuations() {
+
+ try {
+ deployProcess();
+ startExecutions();
+ jobExecutor.start();
+ waitTillNoMoreMessages();
+
+ } finally {
+ jobExecutor.stop(true);
+ }
+
+ List<String> expectedLogs = new ArrayList<String>();
+ expectedLogs.add("execute(start)");
+ expectedLogs.add("execute(a)");
+ expectedLogs.add("execute(b)");
+ expectedLogs.add("execute(c)");
+ expectedLogs.add("execute(end)");
+
+ assertEquals(nbrOfExecutions, recorder.executionEvents.size());
+ for (List<String> executionLogs : recorder.executionEvents.values()) {
+ assertEquals(expectedLogs, executionLogs);
+ }
+ }
+
+ public void deployProcess() {
+ commandService.execute(new Command<Object>() {
+ public Object execute(Environment environment) throws Exception {
+ OpenProcessDefinition processDefinition = ProcessDefinitionBuilder.startProcess("continuations")
+ .key("continuations")
+ .startActivity("start", AutomaticActivity.class)
+ .initial()
+ .asyncExecute()
+ .flow("a")
+ .endActivity()
+ .startActivity("a", AutomaticActivity.class)
+ .asyncExecute()
+ .flow("b")
+ .endActivity()
+ .startActivity("b", AutomaticActivity.class)
+ .asyncExecute()
+ .flow("c")
+ .endActivity()
+ .startActivity("c", AutomaticActivity.class)
+ .asyncExecute()
+ .flow("end")
+ .endActivity()
+ .startActivity("end", WaitState.class)
+ .endActivity()
+ .endProcess();
+
+ Session session = environment.get(Session.class);
+ session.save(processDefinition);
+ return null;
+ }
+ });
+ }
+
+ public void startExecutions() {
+ for (int i = 0; i < nbrOfExecutions; i++) {
+ executionService.startExecutionByKey("continuations");
+ }
+ }
+}
Copied: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveMessagesTest.java (from rev 3816, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ExclusiveMessagesTest.java)
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveMessagesTest.java (rev 0)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveMessagesTest.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -0,0 +1,134 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.load.async;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.hibernate.Session;
+import org.jbpm.Execution;
+import org.jbpm.activity.ActivityExecution;
+import org.jbpm.activity.ExternalActivityBehaviour;
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
+import org.jbpm.pvm.internal.cmd.StartExecutionCmd;
+import org.jbpm.pvm.internal.job.CommandMessage;
+import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
+import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+import org.jbpm.session.MessageSession;
+
+/**
+ * @author Tom Baeyens
+ */
+public class ExclusiveMessagesTest extends JobExecutorTestCase {
+
+ static Map<String, Set<Long>> exclusiveThreadIds;
+
+ static int nbrOfTestMessagesPerExecution = 5;
+ static int nbrOfTestExecutions = 20;
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ exclusiveThreadIds = new HashMap<String, Set<Long>>();
+ }
+
+ public void testExclusiveMessageProcessing() {
+ insertExclusiveTestMessages();
+
+ JobExecutor jobExecutor = processEngine.get(JobExecutor.class);
+ jobExecutor.start();
+ try {
+
+ waitTillNoMoreMessages();
+
+ } finally {
+ jobExecutor.stop(true);
+ }
+
+ commandService.execute(new Command<Object>() {
+
+ public Object execute(Environment environment) throws Exception {
+ // exclusiveMessageIds maps execution keys to a set of thread ids.
+ // the idea is that for each execution, all the exclusive jobs will
+ // be executed by 1 thread sequentially.
+
+ for (int i = 0; i < nbrOfTestExecutions; i++) {
+ String executionKey = "execution-" + i;
+ Set<Long> threadIds = exclusiveThreadIds.get(executionKey);
+ assertNotNull("no thread id set for " + executionKey + " in: " + exclusiveThreadIds, threadIds);
+ assertEquals("exclusive messages for " + executionKey + " have been executed by multiple threads: " + threadIds, 1, threadIds.size());
+ }
+ return null;
+ }
+ });
+ }
+
+ public static class WaitState implements ExternalActivityBehaviour {
+
+ private static final long serialVersionUID = 1L;
+
+ public void execute(ActivityExecution execution) throws Exception {
+ execution.waitForSignal();
+ }
+ public void signal(ActivityExecution execution, String signalName, Map<String, Object> parameters) throws Exception {
+ execution.take(signalName);
+ }
+ }
+
+ public void insertExclusiveTestMessages() {
+ commandService.execute(new Command<Object>() {
+ public Object execute(Environment environment) throws Exception {
+ ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) ProcessDefinitionBuilder
+ .startProcess("excl")
+ .startActivity("wait", WaitState.class)
+ .initial()
+ .endActivity()
+ .endProcess();
+ processDefinition.setId("excl:1");
+
+ Session session = environment.get(Session.class);
+ session.save(processDefinition);
+ return null;
+ }
+ });
+
+ commandService.execute(new Command<Object>() {
+
+ public Object execute(Environment environment) throws Exception {
+ MessageSession messageSession = environment.get(MessageSession.class);
+ for (int i = 0; i < nbrOfTestExecutions; i++) {
+ Execution execution = new StartExecutionCmd("excl:1", null, "execution-" + i).execute(environment);
+
+ for (int j = 0; j < nbrOfTestMessagesPerExecution; j++) {
+ CommandMessage exclusiveTestMessage = ExclusiveTestCommand.createMessage(execution);
+ messageSession.send(exclusiveTestMessage);
+ }
+ }
+ return null;
+ }
+ });
+ }
+
+}
Property changes on: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveMessagesTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveTestCommand.java (from rev 3816, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ExclusiveTestCommand.java)
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveTestCommand.java (rev 0)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveTestCommand.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.load.async;
+
+import java.util.HashSet;
+import java.util.Random;
+import java.util.Set;
+
+import org.hibernate.Session;
+import org.jbpm.Execution;
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.log.Log;
+import org.jbpm.pvm.internal.job.CommandMessage;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.wire.descriptor.LongDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ExclusiveTestCommand implements Command<Object> {
+
+ private static final long serialVersionUID = 1L;
+ private static final Log log = Log.getLog(ExclusiveTestCommand.class.getName());
+ static Random random = new Random();
+
+ long executionId;
+
+ public ExclusiveTestCommand() {
+ }
+
+ public static CommandMessage createMessage(Execution execution) {
+ CommandMessage commandMessage = new CommandMessage();
+ commandMessage.setExecution((ExecutionImpl) execution);
+ commandMessage.setExclusive(true);
+
+ ObjectDescriptor commandDescriptor = new ObjectDescriptor(ExclusiveTestCommand.class);
+ commandDescriptor.addInjection("executionId", new LongDescriptor(execution.getDbid()));
+ commandMessage.setCommandDescriptor(commandDescriptor);
+ return commandMessage;
+ }
+
+ public Object execute(Environment environment) throws Exception {
+ Long threadId = Thread.currentThread().getId();
+
+ Session session = environment.get(Session.class);
+ ExecutionImpl execution = (ExecutionImpl) session.get(ExecutionImpl.class, executionId);
+
+ String executionKey = execution.getKey();
+
+ // exclusiveMessageIds maps execution keys to a set of thread ids.
+ // the idea is that for each execution, all the exclusive jobs will
+ // be executed by 1 thread sequentially.
+
+ // in the end, each set should contain exactly 1 element
+
+ Set<Long> groupMessages = ExclusiveMessagesTest.exclusiveThreadIds.get(executionKey);
+ if (groupMessages==null) {
+ groupMessages = new HashSet<Long>();
+ ExclusiveMessagesTest.exclusiveThreadIds.put(executionKey, groupMessages);
+ }
+ groupMessages.add(threadId);
+
+ /*
+ // let's assume that an average jobImpl takes between 0 and 150 millis to complete.
+ int workTime = random.nextInt(150);
+ log.debug("executing exclusive message for "+execution+". this is going to take "+workTime+"ms");
+ try {
+ Thread.sleep(workTime);
+ } catch (RuntimeException e) {
+ log.debug("sleeping was interrupted");
+ }
+ */
+
+ return null;
+ }
+
+}
Copied: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceMessageTest.java (from rev 3816, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/FailOnceMessageTest.java)
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceMessageTest.java (rev 0)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceMessageTest.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.load.async;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.hibernate.Session;
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.log.Log;
+import org.jbpm.model.Comment;
+import org.jbpm.pvm.internal.job.CommandMessage;
+import org.jbpm.pvm.internal.model.CommentImpl;
+import org.jbpm.session.MessageSession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class FailOnceMessageTest extends JobExecutorTestCase {
+
+ private static final Log log = Log.getLog(FailOnceMessageTest.class.getName());
+
+ static long nbrOfTestMessages = 50;
+
+ static List<Integer> failOnceMessageIds = Collections.synchronizedList(new ArrayList<Integer>());
+
+ public void testFailOnceMessages() {
+ failOnceMessageIds.clear();
+
+ jobExecutor.start();
+ try {
+ insertFailOnceTestMessages();
+ waitTillNoMoreMessages();
+
+ } finally {
+ log.debug("stopping job executor");
+ jobExecutor.stop(true);
+ }
+
+ for (int i = 0; i < nbrOfTestMessages; i++) {
+ assertTrue("message " + i + " is not failed once: " + failOnceMessageIds, failOnceMessageIds.contains(i));
+ }
+ assertEquals(nbrOfTestMessages, failOnceMessageIds.size());
+
+ log.debug("==== all messages processed, now checking if all messages have arrived exactly once ====");
+
+ commandService.execute(new Command<Object>() {
+
+ public Object execute(Environment environment) throws Exception {
+ Session session = environment.get(Session.class);
+ List<Comment> comments = session.createQuery("from " + CommentImpl.class.getName()).list();
+
+ for (Comment comment : comments) {
+ log.debug("retrieved message: "+comment.getMessage());
+ Integer messageId = new Integer(comment.getMessage());
+ assertTrue("message " + messageId + " committed twice", failOnceMessageIds.remove(messageId));
+ }
+
+ assertTrue("not all messages made a successful commit: " + failOnceMessageIds, failOnceMessageIds.isEmpty());
+ return null;
+ }
+ });
+ }
+
+ public static class InsertFailOnceTestMsgCmd implements Command<Object> {
+ private static final long serialVersionUID = 1L;
+ int i;
+ public InsertFailOnceTestMsgCmd(int i) {
+ this.i = i;
+ }
+ public Object execute(Environment environment) throws Exception {
+ MessageSession messageSession = environment.get(MessageSession.class);
+ CommandMessage commandMessage = FailOnceTestCommand.createMessage(i);
+ messageSession.send(commandMessage);
+ return null;
+ }
+ }
+
+ void insertFailOnceTestMessages() {
+ for (int i = 0; i < nbrOfTestMessages; i++) {
+ commandService.execute(new InsertFailOnceTestMsgCmd(i));
+ }
+ }
+
+}
Property changes on: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceMessageTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceTestCommand.java (from rev 3816, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/FailOnceTestCommand.java)
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceTestCommand.java (rev 0)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceTestCommand.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.load.async;
+
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.log.Log;
+import org.jbpm.model.Comment;
+import org.jbpm.pvm.internal.job.CommandMessage;
+import org.jbpm.pvm.internal.job.JobImpl;
+import org.jbpm.pvm.internal.model.CommentImpl;
+import org.jbpm.pvm.internal.wire.descriptor.IntegerDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
+import org.jbpm.session.DbSession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class FailOnceTestCommand implements Command<Object> {
+
+ private static final long serialVersionUID = 1L;
+ private static final Log log = Log.getLog(FailOnceTestCommand.class.getName());
+
+ int messageId;
+
+ public FailOnceTestCommand() {
+ }
+
+ public static CommandMessage createMessage(int messageId) {
+ CommandMessage commandMessage = new CommandMessage();
+ ObjectDescriptor commandDescriptor = new ObjectDescriptor(FailOnceTestCommand.class);
+ commandDescriptor.addInjection("messageId", new IntegerDescriptor(messageId));
+ commandMessage.setCommandDescriptor(commandDescriptor);
+ return commandMessage;
+ }
+
+ public Object execute(Environment environment) throws Exception {
+ DbSession dbSession = environment.get(DbSession.class);
+
+ // this message execution should be rolled back
+ Comment comment = new CommentImpl(Integer.toString(messageId));
+ dbSession.save(comment);
+
+ if (!FailOnceMessageTest.failOnceMessageIds.contains(messageId)) {
+ // registering the failed message in a non-transactional resource
+ // so the messageId will still be added even after the transaction has rolled back
+ log.debug("adding failonce message "+messageId);
+ FailOnceMessageTest.failOnceMessageIds.add(messageId);
+
+ throw new RuntimeException("failing once");
+ }
+
+ try {
+ Thread.sleep(700);
+ } catch (Exception e) {
+ log.error(e.toString());
+ }
+
+ log.debug("message "+messageId+" now succeeds");
+
+ return null;
+ }
+
+}
Copied: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingMessageTest.java (from rev 3816, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/FailingMessageTest.java)
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingMessageTest.java (rev 0)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingMessageTest.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.load.async;
+
+import java.util.List;
+
+import org.hibernate.Session;
+import org.jbpm.cmd.Command;
+import org.jbpm.cmd.CommandService;
+import org.jbpm.env.Environment;
+import org.jbpm.job.Job;
+import org.jbpm.pvm.internal.job.CommandMessage;
+import org.jbpm.pvm.internal.model.CommentImpl;
+import org.jbpm.session.MessageSession;
+import org.jbpm.session.PvmDbSession;
+import org.jbpm.test.DbTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class FailingMessageTest extends JobExecutorTestCase {
+
+
+ public void testFailedMessageProcessing() {
+ jobExecutor.start();
+ try {
+ commandService.execute(new Command<Object>() {
+
+ public Object execute(Environment environment) throws Exception {
+ MessageSession messageSession = environment.get(MessageSession.class);
+ CommandMessage commandMessage = FailingTestCommand.createMessage();
+ messageSession.send(commandMessage);
+ return null;
+ }
+ });
+
+ waitTillNoMoreMessages();
+
+ } finally {
+ jobExecutor.stop(true);
+ }
+
+ commandService.execute(new Command<Object>() {
+
+ public Object execute(Environment environment) throws Exception {
+ PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
+ List<Job> deadJobs = pvmDbSession.findJobsWithException(0, 10);
+ assertEquals("there should be one dead job", 1, deadJobs.size());
+
+ Session session = environment.get(Session.class);
+ List commands = session.createQuery("from " + CommentImpl.class.getName()).list();
+ assertTrue("command insertion should have been rolled back", commands.isEmpty());
+ return null;
+ }
+ });
+ }
+}
Property changes on: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingMessageTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingTestCommand.java (from rev 3816, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/FailingTestCommand.java)
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingTestCommand.java (rev 0)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingTestCommand.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.load.async;
+
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.model.Comment;
+import org.jbpm.pvm.internal.job.CommandMessage;
+import org.jbpm.pvm.internal.model.CommentImpl;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
+import org.jbpm.session.DbSession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class FailingTestCommand implements Command<Object> {
+
+ private static final long serialVersionUID = 1L;
+
+ public Object execute(Environment environment) throws Exception {
+ DbSession dbSession = environment.get(DbSession.class);
+
+ // this message execution should be rolled back
+ Comment comment = new CommentImpl("failing update");
+ dbSession.save(comment);
+
+ throw new RuntimeException("ooops");
+ }
+
+ public static CommandMessage createMessage() {
+ CommandMessage commandMessage = new CommandMessage();
+ ObjectDescriptor commandDescriptor = new ObjectDescriptor(FailingTestCommand.class);
+ commandMessage.setCommandDescriptor(commandDescriptor);
+ return commandMessage;
+ }
+
+}
Copied: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/GenerateExceptionTestCommand.java (from rev 3816, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/GenerateExceptionTestCommand.java)
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/GenerateExceptionTestCommand.java (rev 0)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/GenerateExceptionTestCommand.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.load.async;
+
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.pvm.internal.job.CommandMessage;
+import org.jbpm.pvm.internal.wire.descriptor.IntegerDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
+
+
+/**
+ * @author Tom Baeyens
+ * @author Guillaume Porcher
+ *
+ * Simple command that will create an exception during execution.
+ * The exception will generate a stacktrace with variable length
+ * (controlled by the length parameter).
+ *
+ * This class is to test the persistence of exception stacktrace in jobs.
+ */
+public class GenerateExceptionTestCommand implements Command<Object> {
+
+ private static final long serialVersionUID = 1L;
+
+ int length;
+
+ public GenerateExceptionTestCommand() {
+ }
+
+ public static CommandMessage createMessage(int recursionInitialDepth) {
+ CommandMessage commandMessage = new CommandMessage();
+ ObjectDescriptor commandDescriptor = new ObjectDescriptor(GenerateExceptionTestCommand.class);
+ commandDescriptor.addInjection("length", new IntegerDescriptor(recursionInitialDepth));
+ commandMessage.setCommandDescriptor(commandDescriptor);
+ return commandMessage;
+ }
+
+ public Object execute(Environment environment) throws Exception {
+ StringBuilder stringBuilder = new StringBuilder();
+ while (stringBuilder.length() < length) {
+ stringBuilder.append("This is a long test message. ");
+ }
+ throw new RuntimeException(stringBuilder.toString());
+ }
+
+}
Copied: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/JobExecutorTestCase.java (from rev 3816, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorTestCase.java)
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/JobExecutorTestCase.java (rev 0)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/JobExecutorTestCase.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.load.async;
+
+import java.util.Date;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.jbpm.cmd.Command;
+import org.jbpm.cmd.CommandService;
+import org.jbpm.env.Environment;
+import org.jbpm.pvm.internal.job.JobImpl;
+import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
+import org.jbpm.test.DbTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class JobExecutorTestCase extends DbTestCase {
+
+ long timeoutMillis = 20 * 1000; // 20 seconds
+ long checkInterval = 400;
+
+ static String jobsAvailableQueryText =
+ "select count(*) "+
+ "from "+JobImpl.class.getName()+" as job "+
+ "where ( (job.dueDate is null) or (job.dueDate <= :now) ) "+
+ " and ( job.retries > 0 )";
+
+ protected CommandService commandService;
+ protected JobExecutor jobExecutor;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ commandService = processEngine.get(CommandService.class);
+ jobExecutor = processEngine.get(JobExecutor.class);
+ }
+
+ protected void waitTillNoMoreMessages() {
+
+ // install a timer that will interrupt if it takes too long
+ // if that happens, it will lead to an interrupted exception and the test
+ // will fail
+ TimerTask interruptTask = new TimerTask() {
+
+ Thread testThread = Thread.currentThread();
+
+ public void run() {
+ log.debug("test " + getName() + " took too long. going to interrupt..." + testThread);
+ testThread.interrupt();
+ }
+ };
+ Timer timer = new Timer();
+ timer.schedule(interruptTask, timeoutMillis);
+
+ try {
+ boolean jobsAvailable = true;
+ while (jobsAvailable) {
+ log.debug("going to sleep for " + checkInterval + " millis, waiting for the job executor to process more jobs");
+ Thread.sleep(checkInterval);
+ jobsAvailable = areJobsAvailable();
+ }
+
+ } catch (InterruptedException e) {
+ fail("test execution exceeded treshold of " + timeoutMillis + " milliseconds");
+ } finally {
+ timer.cancel();
+ }
+ }
+
+ public boolean areJobsAvailable() {
+ return commandService.execute(new Command<Boolean>() {
+ public Boolean execute(Environment environment) {
+ Session session = environment.get(Session.class);
+
+ Query query = session.createQuery(jobsAvailableQueryText);
+ query.setDate("now", new Date());
+
+ Long jobs = (Long) query.uniqueResult();
+
+ if (jobs.longValue()>0) {
+ log.debug("found "+jobs+" more jobs to process");
+ return true;
+ }
+ log.debug("no more jobs to process");
+
+ return false;
+ }
+ });
+ }
+
+}
Property changes on: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/JobExecutorTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageCommand.java (from rev 3816, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/NormalMessageCommand.java)
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageCommand.java (rev 0)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageCommand.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.load.async;
+
+import java.util.Random;
+
+import org.hibernate.Session;
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.pvm.internal.job.CommandMessage;
+import org.jbpm.pvm.internal.model.CommentImpl;
+import org.jbpm.pvm.internal.wire.descriptor.IntegerDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
+
+/**
+ * @author Tom Baeyens
+ */
+public class NormalMessageCommand implements Command<Void> {
+
+ private static final long serialVersionUID = 1L;
+ static Random random = new Random();
+
+ int messageId;
+
+ public NormalMessageCommand() {
+ }
+
+ public NormalMessageCommand(int messageId) {
+ this.messageId = messageId;
+ }
+
+ public static CommandMessage createMessage(int messageId) {
+ CommandMessage commandMessage = new CommandMessage();
+ ObjectDescriptor commandDescriptor = new ObjectDescriptor(NormalMessageCommand.class);
+ commandDescriptor.addInjection("messageId", new IntegerDescriptor(messageId));
+ commandMessage.setCommandDescriptor(commandDescriptor);
+ return commandMessage;
+ }
+
+ public Void execute(Environment environment) throws Exception {
+ CommentImpl comment = new CommentImpl(Integer.toString(messageId));
+ Session session = environment.get(Session.class);
+ session.save(comment);
+ return null;
+ }
+}
Property changes on: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageCommand.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageTest.java (from rev 3816, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/NormalMessageTest.java)
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageTest.java (rev 0)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageTest.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -0,0 +1,100 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.load.async;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hibernate.Session;
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.model.Comment;
+import org.jbpm.pvm.internal.job.CommandMessage;
+import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
+import org.jbpm.pvm.internal.model.CommentImpl;
+import org.jbpm.session.MessageSession;
+import org.jbpm.test.Db;
+
+/**
+ * @author Tom Baeyens
+ */
+public class NormalMessageTest extends JobExecutorTestCase {
+
+ static long nbrOfTestMessages = 100;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ Db.clean(processEngine);
+ }
+
+ public void testNormalMessageProcessing() {
+ JobExecutor jobExecutor = processEngine.get(JobExecutor.class);
+ jobExecutor.start();
+
+ try {
+ // insert ${nbrOfTestMessages} messages...
+ for (int i = 0; i < nbrOfTestMessages; i++) {
+ commandService.execute(new InsertNormalMessageCmd(i));
+ }
+
+ // wait till all messages are processed
+ waitTillNoMoreMessages();
+
+ } finally {
+ jobExecutor.stop(true);
+ }
+
+ List<Integer> processedMessageNumbers = commandService.execute(new Command<List<Integer>>() {
+ public List<Integer> execute(Environment environment) {
+ List<Integer> processedMessageNumbers = new ArrayList<Integer>();
+ Session session = environment.get(Session.class);
+ List<Comment> comments = session.createCriteria(CommentImpl.class).list();
+ for (Comment comment: comments) {
+ int processedMessageNumber = Integer.parseInt(comment.getMessage());
+ processedMessageNumbers.add(processedMessageNumber);
+ // make sure the db stays clean
+ session.delete(comment);
+ }
+ return processedMessageNumbers;
+ }
+ });
+
+ for (int i = 0; i < nbrOfTestMessages; i++) {
+ assertTrue("message " + i + " is not processed: " + processedMessageNumbers, processedMessageNumbers.contains(i));
+ }
+ }
+
+ public static class InsertNormalMessageCmd implements Command<Object> {
+ private static final long serialVersionUID = 1L;
+ int i;
+ public InsertNormalMessageCmd(int i) {
+ this.i = i;
+ }
+ public Object execute(Environment environment) throws Exception {
+ MessageSession messageSession = environment.get(MessageSession.class);
+ CommandMessage commandMessage = NormalMessageCommand.createMessage(i);
+ messageSession.send(commandMessage);
+ return null;
+ }
+ }
+
+}
Property changes on: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/Recorder.java (from rev 3816, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/Recorder.java)
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/Recorder.java (rev 0)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/Recorder.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.load.async;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Tom Baeyens
+ */
+public class Recorder {
+
+ public Map<Object, List<String>> executionEvents = null;
+
+ public synchronized void record(long executionDbid, String event) {
+ if (executionEvents==null) {
+ executionEvents = new HashMap<Object, List<String>>();
+ }
+ List<String> events = executionEvents.get(executionDbid);
+ if (events == null) {
+ events = new ArrayList<String>();
+ executionEvents.put(executionDbid, events);
+ }
+ events.add(event);
+ }
+
+ public void reset() {
+ executionEvents = null;
+ }
+}
Copied: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/WaitState.java (from rev 3816, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/WaitState.java)
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/WaitState.java (rev 0)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/WaitState.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.load.async;
+
+import java.util.Map;
+
+import org.jbpm.activity.ActivityExecution;
+import org.jbpm.activity.ExternalActivityBehaviour;
+
+/**
+ * @author Tom Baeyens
+ */
+public class WaitState implements ExternalActivityBehaviour {
+
+ private static final long serialVersionUID = 1L;
+
+ public WaitState() {
+ }
+
+ public void execute(ActivityExecution execution) throws Exception {
+ ContinuationTest.recorder.record(execution.getDbid(), "execute("+execution.getActivity().getName()+")");
+ }
+
+ public void signal(ActivityExecution execution, String signal, Map<String, Object> parameters) throws Exception {
+ throw new UnsupportedOperationException();
+ }
+}
\ No newline at end of file
Copied: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/executions/Automatic.java (from rev 3816, jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/Automatic.java)
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/executions/Automatic.java (rev 0)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/executions/Automatic.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.load.executions;
+
+/**
+ * @author Tom Baeyens
+ */
+public class Automatic {
+
+ public void doNothing() {
+ }
+}
Property changes on: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/executions/Automatic.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/executions/ProcessExecutionTest.java (from rev 3816, jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/ProcessExecutionTest.java)
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/executions/ProcessExecutionTest.java (rev 0)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/executions/ProcessExecutionTest.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -0,0 +1,114 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.load.executions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jbpm.Execution;
+import org.jbpm.log.Log;
+import org.jbpm.test.load.LoadTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ProcessExecutionTest extends LoadTestCase {
+
+ private static Log log = Log.getLog(ProcessExecutionTest.class.getName());
+
+ static int processes = 1000;
+ static int threads = 5;
+
+ Throwable exception;
+ int finished;
+
+ public void logStatus() {
+ String measuredTime = getMeasuredTime();
+ logFileWriter.println(getUsedMemory()+"\t"+finished+"\t"+measuredTime);
+ logFileWriter.flush();
+ log.info(finished+" executions in "+measuredTime);
+ }
+
+ protected void logColumnTitles() {
+ logFileWriter.println("Used Memory\tFinished Executions\tTime");
+ logFileWriter.flush();
+ }
+
+ public void testExecuteProcesses() throws Exception {
+ deployJpdlResource("org/jbpm/test/load/executions/process.jpdl.xml");
+
+ startMeasuringTime();
+
+ List<Thread> threadList = new ArrayList<Thread>();
+ for (int i=0; i<threads; i++) {
+ Thread thread = new ProcessExecutor();
+ thread.start();
+ threadList.add(thread);
+ }
+
+
+ for (Thread thread: threadList) {
+ while (thread.isAlive()) {
+ try {
+ thread.join(checkInterval);
+ } catch (InterruptedException e) {
+ log.info(e.toString());
+ }
+ logStatus();
+ }
+ if (exception!=null) {
+ break;
+ }
+ }
+
+ if (exception!=null) {
+ throw new Exception("thread threw: "+exception.getMessage(), exception);
+ } else {
+ log.info(finished+" executions in "+getMeasuredTime());
+ }
+ }
+
+ public class ProcessExecutor extends Thread {
+ public void run() {
+ try {
+ for (int i=0; i<processes; i++) {
+ executeProcess();
+ }
+ } catch (Throwable t) {
+ exception = t;
+ }
+ }
+ public void executeProcess() {
+ Execution execution = executionService.startExecutionByKey("Process");
+ assertEquals("c", execution.getActivityName());
+ String executionId = execution.getId();
+ execution = executionService.signalExecutionById(executionId);
+ assertTrue(execution.isEnded());
+ processFinished();
+ }
+ }
+
+ public synchronized void processFinished() {
+ finished++;
+ }
+}
Property changes on: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/executions/ProcessExecutionTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/AddCommentCmd.java (from rev 3816, jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/AddCommentMessage.java)
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/AddCommentCmd.java (rev 0)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/AddCommentCmd.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.load.messages;
+
+import org.hibernate.Session;
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.pvm.internal.model.CommentImpl;
+
+/**
+ * @author Tom Baeyens
+ */
+public class AddCommentCmd implements Command<Void> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String message;
+
+ public Void execute(Environment environment) throws Exception {
+ CommentImpl comment = new CommentImpl(message);
+ Session session = environment.get(Session.class);
+ session.save(comment);
+ MessageProcessingTest.commentAdded();
+ return null;
+ }
+}
Copied: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/MessageProcessingTest.java (from rev 3816, jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/MessageProcessingTest.java)
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/MessageProcessingTest.java (rev 0)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/messages/MessageProcessingTest.java 2009-02-11 12:12:09 UTC (rev 3830)
@@ -0,0 +1,138 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.load.messages;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hibernate.Session;
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.log.Log;
+import org.jbpm.model.Comment;
+import org.jbpm.pvm.internal.cmd.CompositeCmd;
+import org.jbpm.pvm.internal.cmd.SendMessageCmd;
+import org.jbpm.pvm.internal.job.CommandMessage;
+import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
+import org.jbpm.pvm.internal.model.CommentImpl;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.StringDescriptor;
+import org.jbpm.test.load.LoadTestCase;
+
+/**
+ * @author Tom Baeyens
+ * @author Guillaume Porcher
+ */
+public class MessageProcessingTest extends LoadTestCase {
+
+ private static final Log log = Log.getLog(MessageProcessingTest.class.getName());
+
+ static long nbrOfTestMessages = 1000; // nbrOfTestMessages must be dividable by insertGroupSize
+ static long insertGroupSize = 100;
+
+ static int commentsAdded = 0;
+
+ public static synchronized void commentAdded() {
+ commentsAdded++;
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ if ( (nbrOfTestMessages % insertGroupSize) != 0 ) {
+ fail("nbrOfTestMessages ("+nbrOfTestMessages+") is not dividable by insertGroupSize ("+insertGroupSize+")");
+ }
+ }
+
+ protected void logColumnTitles() {
+ logFileWriter.println("Used Memory\tProcessed Messages\tTime");
+ }
+
+ public void logStatus() {
+ String measuredTime = getMeasuredTime();
+ logFileWriter.println(getUsedMemory()+"\t"+commentsAdded+"\t"+measuredTime);
+ logFileWriter.flush();
+ log.info(commentsAdded+" msgs in "+measuredTime);
+ }
+
+ public void testMessageProcessing() throws Exception {
+ JobExecutor jobExecutor = processEngine.get(JobExecutor.class);
+
+ try {
+ int messageIndex = 0;
+ // insert ${nbrOfTestMessages} messages...
+ for (int i = 0; i < nbrOfTestMessages; i+=insertGroupSize) {
+ CompositeCmd compositeCmd = new CompositeCmd();
+ // ...in groups of ${insertGroupSize}
+ for (int j = 0; j <insertGroupSize ; j++) {
+ String messageText = Integer.toString(messageIndex);
+
+ ObjectDescriptor cmdDescriptor = new ObjectDescriptor(AddCommentCmd.class);
+ cmdDescriptor.addInjection("message", new StringDescriptor(messageText));
+ CommandMessage commandMessage = new CommandMessage(cmdDescriptor);
+ SendMessageCmd sendMessageCmd = new SendMessageCmd(commandMessage);
+
+ compositeCmd.addCommand(sendMessageCmd);
+
+ messageIndex++;
+ }
+ commandService.execute(compositeCmd);
+
+ log.info("added "+messageIndex+" messages");
+ }
+
+ startMeasuringTime();
+
+ jobExecutor.start();
+
+ // wait till all messages are processed
+ waitTillNoMoreMessages(jobExecutor);
+
+ } finally {
+ stopMeasuringTime();
+
+ jobExecutor.stop(true);
+ }
+
+ log.info("processing "+nbrOfTestMessages+" messages took "+getMeasuredTime());
+
+ List<Integer> processedMessageNumbers = commandService.execute(new Command<List<Integer>>() {
+ public List<Integer> execute(Environment environment) {
+ List<Integer> processedMessageNumbers = new ArrayList<Integer>();
+ Session session = environment.get(Session.class);
+ List<Comment> comments = session.createCriteria(CommentImpl.class).list();
+ for (Comment comment: comments) {
+ int processedMessageNumber = Integer.parseInt(comment.getMessage());
+ processedMessageNumbers.add(processedMessageNumber);
+ // make sure the db stays clean
+ session.delete(comment);
+ }
+ return processedMessageNumbers;
+ }
+ });
+
+ for (int i = 0; i < nbrOfTestMessages; i++) {
+ assertTrue("message " + i + " is not processed: " + processedMessageNumbers, processedMessageNumbers.contains(i));
+ }
+ }
+
+}
Modified: jbpm4/trunk/modules/test-load/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/resources/jbpm.cfg.xml 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/test-load/src/test/resources/jbpm.cfg.xml 2009-02-11 12:12:09 UTC (rev 3830)
@@ -24,16 +24,7 @@
<standard-transaction-interceptor />
</command-service>
- <hibernate-configuration>
- <properties resource="hibernate.properties" />
- <mapping resource="jbpm.pvm.typedefs.hbm.xml" />
- <mapping resource="jbpm.pvm.wire.hbm.xml" />
- <mapping resource="jbpm.pvm.definition.hbm.xml" />
- <mapping resource="jbpm.pvm.execution.hbm.xml" />
- <mapping resource="jbpm.pvm.variable.hbm.xml" />
- <mapping resource="jbpm.pvm.job.hbm.xml" />
- <mapping resource="jbpm.jpdl.hbm.xml" />
- <mapping resource="jbpm.load.hbm.xml" />
+ <hibernate-configuration resource="hibernate.cfg.xml">
<cache-configuration resource="jbpm.pvm.cache.xml"
usage="nonstrict-read-write" />
</hibernate-configuration>
Copied: jbpm4/trunk/modules/test-load/src/test/resources/org/jbpm/test/load/executions/process.jpdl.xml (from rev 3816, jbpm4/trunk/modules/test-load/src/test/resources/org/jbpm/test/load/process.jpdl.xml)
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/resources/org/jbpm/test/load/executions/process.jpdl.xml (rev 0)
+++ jbpm4/trunk/modules/test-load/src/test/resources/org/jbpm/test/load/executions/process.jpdl.xml 2009-02-11 12:12:09 UTC (rev 3830)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="Process" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="a" />
+ </start>
+
+ <java name="a"
+ class="org.jbpm.test.load.executions.Automatic"
+ method="doNothing">
+ <flow to="b" />
+ </java>
+
+ <java name="b"
+ class="org.jbpm.test.load.executions.Automatic"
+ method="doNothing">
+ <flow to="c" />
+ </java>
+
+ <state name="c">
+ <flow to="d" />
+ </state>
+
+ <java name="d"
+ class="org.jbpm.test.load.executions.Automatic"
+ method="doNothing">
+ <flow to="e" />
+ </java>
+
+ <java name="e"
+ class="org.jbpm.test.load.executions.Automatic"
+ method="doNothing">
+ <flow to="end" />
+ </java>
+
+ <end name="end" />
+
+</process>
Property changes on: jbpm4/trunk/modules/test-load/src/test/resources/org/jbpm/test/load/executions/process.jpdl.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/test-load/src/test/resources/org/jbpm/test/load/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/resources/org/jbpm/test/load/process.jpdl.xml 2009-02-11 09:49:06 UTC (rev 3829)
+++ jbpm4/trunk/modules/test-load/src/test/resources/org/jbpm/test/load/process.jpdl.xml 2009-02-11 12:12:09 UTC (rev 3830)
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<process name="Process" xmlns="http://jbpm.org/4/jpdl">
-
- <start>
- <flow to="a" />
- </start>
-
- <java name="a"
- class="org.jbpm.test.load.Automatic"
- method="doNothing">
- <flow to="b" />
- </java>
-
- <java name="b"
- class="org.jbpm.test.load.Automatic"
- method="doNothing">
- <flow to="c" />
- </java>
-
- <state name="c">
- <flow to="d" />
- </state>
-
- <java name="d"
- class="org.jbpm.test.load.Automatic"
- method="doNothing">
- <flow to="e" />
- </java>
-
- <java name="e"
- class="org.jbpm.test.load.Automatic"
- method="doNothing">
- <flow to="end" />
- </java>
-
- <end name="end" />
-
-</process>
17 years, 2 months