JBoss JBPM SVN: r5156 - in jbpm4/trunk/modules/distro/src/main/files: gpd and 1 other directory.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-06-29 10:51:06 -0400 (Mon, 29 Jun 2009)
New Revision: 5156
Modified:
jbpm4/trunk/modules/distro/src/main/files/examples/build.xml
jbpm4/trunk/modules/distro/src/main/files/gpd/build.xml
Log:
JBPM-2367 added copying of examples.jar to jboss userlib dir in standalone distro script
Modified: jbpm4/trunk/modules/distro/src/main/files/examples/build.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/examples/build.xml 2009-06-29 13:47:09 UTC (rev 5155)
+++ jbpm4/trunk/modules/distro/src/main/files/examples/build.xml 2009-06-29 14:51:06 UTC (rev 5156)
@@ -12,6 +12,11 @@
<property name="jboss.version" value="5.0.0.GA" />
<property name="jbpm.home" value="${jbpm.parent.dir}/jbpm-${jbpm.version}" />
+ <property name="jboss.parent.dir" value="${jbpm.home}" />
+ <property name="jboss.home" value="${jboss.parent.dir}/jboss-${jboss.version}" />
+ <property name="jboss.server.configuration" value="default" />
+ <property name="jboss.server.config.dir" value="${jboss.home}/server/${jboss.server.configuration}" />
+
<!-- JDBC PROPERTIES -->
<property file="${user.home}/.jbpm4/jdbc/${database}.properties" />
<property file="${jbpm.home}/db/jdbc/${database}.properties" />
@@ -70,6 +75,11 @@
classname="org.jbpm.pvm.internal.ant.JbpmDeployTask"
classpathref="jbpm.libs.incl.dependencies" />
<jbpm-deploy file="${jbpm.home}/examples/target/examples.bar" />
+
+ <mkdir dir="${jboss.server.config.dir}/deploy/jbpm/userlibs" />
+ <copy file="${jbpm.home}/examples/target/examples.jar"
+ todir="${jboss.server.config.dir}/deploy/jbpm/userlibs"
+ overwrite="true" />
</target>
<target name="examples.jar" depends="jbpm.libs.path">
Modified: jbpm4/trunk/modules/distro/src/main/files/gpd/build.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/gpd/build.xml 2009-06-29 13:47:09 UTC (rev 5155)
+++ jbpm4/trunk/modules/distro/src/main/files/gpd/build.xml 2009-06-29 14:51:06 UTC (rev 5156)
@@ -1,102 +1,104 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="jbpm.eclipse.install">
-
+
<!-- USER SPECIFIC CONFIGURATIONS -->
<property file="${user.home}/.jbpm4/build.properties" />
-
+
<!-- OS PROPERTIES -->
<condition property="isWindows">
<os family="windows"/>
- </condition>
+ </condition>
+ <condition property="isNotWindows">
+ <not>
+ <isset property="isWindows" />
+ </not>
+ </condition>
<!-- DEFAULT PROPERTY VALUES -->
<property name="jbpm.parent.dir" value="../.." />
<property name="jbpm.version" value="4.0-SNAPSHOT" />
- <property name="jbpm.home" value="${jbpm.parent.dir}/jbpm-${jbpm.version}" /> <!-- jbpm.home should not be configured. change jbpm.parent.dir instead -->
-
- <!-- Eclipse version is dependent on OS -->
+ <!-- jbpm.home should not be configured. change jbpm.parent.dir instead -->
+ <property name="jbpm.home" value="${jbpm.parent.dir}/jbpm-${jbpm.version}" />
+
+ <!-- eclipse.filename -->
<condition property="eclipse.filename" value="eclipse-jee-ganymede-SR2-win32.zip">
- <contains string="${os.name}" casesensitive="false" substring="win"/>
+ <contains string="${os.name}" casesensitive="false" substring="win" />
</condition>
<condition property="eclipse.filename" value="eclipse-jee-ganymede-SR2-macosx-carbon.tar.gz">
- <contains string="${os.name}" casesensitive="false" substring="mac"/>
- </condition>
+ <contains string="${os.name}" casesensitive="false" substring="mac" />
+ </condition>
<condition property="eclipse.filename" value="eclipse-jee-ganymede-SR2-linux-gtk.tar.gz">
<and>
- <contains string="${os.name}" casesensitive="false" substring="linux"/>
- <not>
- <contains string="${os.arch}" casesensitive="false" substring="64" />
+ <contains string="${os.name}" casesensitive="false" substring="linux" />
+ <not>
+ <contains string="${os.arch}" casesensitive="false" substring="64" />
</not>
- </and>
- </condition>
+ </and>
+ </condition>
<condition property="eclipse.filename" value="eclipse-jee-ganymede-SR2-linux-gtk-x86_64.tar.gz">
- <and>
- <contains string="${os.name}" casesensitive="false" substring="linux"/>
- <contains string="${os.arch}" casesensitive="false" substring="64" />
- </and>
+ <and>
+ <contains string="${os.name}" casesensitive="false" substring="linux" />
+ <contains string="${os.arch}" casesensitive="false" substring="64" />
+ </and>
</condition>
-
+ <!-- general eclipse properties -->
<property name="eclipse.distro.url" value="http://mirror.cc.vt.edu/pub/eclipse/technology/epp/downloads/release/gany..." />
<property name="eclipse.distro.dir" value="${jbpm.home}/downloads" />
<property name="eclipse.parent.dir" value="${jbpm.home}" />
<property name="eclipse.distro.path" value="${eclipse.distro.dir}/${eclipse.filename}" />
+
<!-- ### LOG PROPERTIES ################################################# -->
<target name="log.properties">
<echo message="jbpm.version......... ${jbpm.version}" />
<echo message="jbpm.home............ ${jbpm.home}" />
<echo message="eclipse.distro.path.. ${eclipse.distro.path}" />
- </target>
+ </target>
- <!-- ### INSTALL ECLIPSE ################################################ -->
+ <!-- ### INSTALL ECLIPSE ################################################ -->
<target name="install.eclipse"
- depends="log.properties, get.eclipse"
- description="unzips eclipse, downloads eclipse if it is not available in ${eclipse.distro.dir}">
- <unzip dest="${jbpm.home}" overwrite="true">
- <fileset dir="${eclipse.distro.dir}">
- <filename name="*eclipse*.zip" casesensitive="false" />
- </fileset>
- </unzip>
- <gunzip>
- <fileset dir="${eclipse.distro.dir}">
- <filename name="**eclipse*.tar.gz" casesensitive="false" />
- </fileset>
- </gunzip>
- <untar dest="${jbpm.home}" overwrite="true">
- <fileset dir="${eclipse.distro.dir}">
- <filename name="**eclipse*.tar" casesensitive="false" />
- </fileset>
- </untar>
+ depends="log.properties, get.eclipse"
+ description="unzips eclipse, downloads eclipse if it is not available in ${eclipse.distro.dir}">
+ <antcall target="internal.install.eclipse.windows" />
+ <antcall target="internal.install.eclipse.non.windows" />
</target>
+ <target name="internal.install.eclipse.windows" if="isWindows">
+ <unzip src="${eclipse.distro.dir}/${eclipse.filename}" dest="${jbpm.home}" overwrite="true" />
+ </target>
+
+ <target name="internal.install.eclipse.non.windows" if="isNotWindows">
+ <gunzip src="${eclipse.distro.dir}/${eclipse.filename}" dest="${jbpm.home}" />
+ </target>
+
<!-- ### GET ECLIPSE ##################################################### -->
<condition property="is.eclipse.distro.available">
<available file="${eclipse.distro.path}" />
</condition>
- <target name="get.eclipse"
- unless="is.eclipse.distro.available"
- description="downloads eclipse to ${eclipse.distro.dir}">
+ <target name="get.eclipse"
+ unless="is.eclipse.distro.available"
+ description="downloads eclipse to ${eclipse.distro.dir}">
<mkdir dir="${eclipse.distro.dir}" />
- <get src="${eclipse.distro.url}" dest="${eclipse.distro.path}" />
- </target>
+ <get src="${eclipse.distro.url}" dest="${eclipse.distro.path}" />
+ </target>
<!-- ### START ECLIPSE ################################################## -->
<target name="start.eclipse"
- description="starts eclipse">
- <!-- Windows -->
+ description="starts eclipse">
+ <!-- Windows -->
<exec executable="cmd" os="Windows Vista, Windows XP,Windows 2000,Windows 98">
<arg line="/C start "${jbpm.home}/eclipse/eclipse.exe" "-data" "${jbpm.home}/workspace"" />
</exec>
- <!-- Unix -->
- <chmod perm="+x">
- <fileset dir="${jbpm.home}/eclipse">
- <filename name="eclipse"/>
- </fileset>
- </chmod>
- <exec executable="/bin/bash" os="Linux,Mac OS X">
- <arg line="-c "${jbpm.home}/eclipse/eclipse" "-data" "${jbpm.home}/workspace"" />
- </exec>
+ <!-- Unix -->
+ <chmod perm="+x">
+ <fileset dir="${jbpm.home}/eclipse">
+ <filename name="eclipse"/>
+ </fileset>
+ </chmod>
+ <exec executable="/bin/bash" os="Linux,Mac OS X">
+ <arg line="-c "${jbpm.home}/eclipse/eclipse" "-data" "${jbpm.home}/workspace"" />
+ </exec>
</target>
</project>
14 years, 11 months
JBoss JBPM SVN: r5155 - in jbpm4/trunk/modules/integration: form-plugin/src/main/java/org/jbpm/integration/console/forms and 1 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-06-29 09:47:09 -0400 (Mon, 29 Jun 2009)
New Revision: 5155
Modified:
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java
jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java
jbpm4/trunk/modules/integration/graphView-plugin/src/main/java/org/jbpm/integration/console/graphView/GraphViewerPluginImpl.java
Log:
Fix JBPM-2295: Highlight multiple activities in GraphViewer
Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java 2009-06-29 13:28:24 UTC (rev 5154)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java 2009-06-29 13:47:09 UTC (rev 5155)
@@ -109,7 +109,7 @@
}
}
- public void assignTask(long taskId, String idRef)
+ public void assignTask(long taskId, String idRef, String performingUser)
{
Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
@@ -123,7 +123,7 @@
}
}
- public void releaseTask(long taskId)
+ public void releaseTask(long taskId, String performingUser)
{
Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
@@ -137,7 +137,7 @@
}
}
- public void completeTask(long taskId, Map data)
+ public void completeTask(long taskId, Map data, String performingUser)
{
Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
@@ -154,7 +154,7 @@
}
}
- public void completeTask(long taskId, String outcome, Map data)
+ public void completeTask(long taskId, String outcome, Map data, String performingUser)
{
Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
Modified: jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java 2009-06-29 13:28:24 UTC (rev 5154)
+++ jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java 2009-06-29 13:47:09 UTC (rev 5155)
@@ -223,7 +223,7 @@
public String getContentType()
{
- return "*/*";
+ return "application/octet-stream";
}
public String getName()
Modified: jbpm4/trunk/modules/integration/graphView-plugin/src/main/java/org/jbpm/integration/console/graphView/GraphViewerPluginImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/graphView-plugin/src/main/java/org/jbpm/integration/console/graphView/GraphViewerPluginImpl.java 2009-06-29 13:28:24 UTC (rev 5154)
+++ jbpm4/trunk/modules/integration/graphView-plugin/src/main/java/org/jbpm/integration/console/graphView/GraphViewerPluginImpl.java 2009-06-29 13:47:09 UTC (rev 5155)
@@ -24,6 +24,8 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.util.List;
+import java.util.ArrayList;
import javax.naming.InitialContext;
@@ -106,8 +108,11 @@
throw new RuntimeException("Not implemented");
}
- public ActiveNodeInfo getActiveNodeInfo(String instanceId)
+ public List<ActiveNodeInfo> getActiveNodeInfo(String instanceId)
{
+
+ List<ActiveNodeInfo> results = new ArrayList<ActiveNodeInfo>();
+
Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
try
@@ -125,13 +130,15 @@
processInstance.getProcessDefinitionId(), currentActivity
);
- return new ActiveNodeInfo(
+
+ results.add(new ActiveNodeInfo(
coords.getWidth(), coords.getHeight(),
new DiagramNodeInfo(
currentActivity,
coords.getX(), coords.getY(),
coords.getWidth(), coords.getHeight()
)
+ )
);
}
@@ -139,6 +146,8 @@
{
env.close();
}
+
+ return results;
}
protected void initializeProcessEngine()
14 years, 11 months
JBoss JBPM SVN: r5154 - in projects/gwt-console/trunk: gui/war/src/main/java/org/jboss/bpm/console/client/process/events and 3 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-06-29 09:28:24 -0400 (Mon, 29 Jun 2009)
New Revision: 5154
Modified:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ActivityDiagramView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/LoadActivityDiagramAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/events/ActivityDiagramResultEvent.java
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java
projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/TaskManagement.java
projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/GraphViewerPlugin.java
Log:
Fix JBPM-2295: Highlight multiple activities. Thanks for the patch Kris.
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ActivityDiagramView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ActivityDiagramView.java 2009-06-29 12:38:48 UTC (rev 5153)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ActivityDiagramView.java 2009-06-29 13:28:24 UTC (rev 5154)
@@ -21,16 +21,17 @@
*/
package org.jboss.bpm.console.client.process;
-import org.jboss.bpm.console.client.model.DiagramNodeInfo;
+import java.util.List;
+
+import org.gwt.mosaic.ui.client.ScrollLayoutPanel;
import org.jboss.bpm.console.client.model.ActiveNodeInfo;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
import org.jboss.bpm.console.client.model.ProcessInstanceRef;
-import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
import org.jboss.bpm.console.client.process.events.ActivityDiagramResultEvent;
-import org.gwt.mosaic.ui.client.layout.LayoutPanel;
-import org.gwt.mosaic.ui.client.ScrollLayoutPanel;
+
import com.google.gwt.user.client.ui.HTML;
+import com.mvc4g.client.Controller;
import com.mvc4g.client.ViewInterface;
-import com.mvc4g.client.Controller;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -61,8 +62,7 @@
public void update(ActivityDiagramResultEvent event)
{
- ActiveNodeInfo activeNodeInfo = event.getActiveNodeInfo();
- DiagramNodeInfo activeNode = activeNodeInfo.getActiveNode();
+ List<ActiveNodeInfo> activeNodeInfos = event.getActiveNodeInfo();
String imageUrl = event.getImageUrl();
// remove contents
@@ -81,16 +81,18 @@
"</div></div>"
);*/
-
- HTML html = new HTML(
+ String s =
"<div style='width:1024px; height:768px; background-color:#ffffff;'>" +
- "<div id=\"imageContainer\" style=\"position:relative;top:-1;left:-1;height:"+activeNodeInfo.getHeight()+"px;width:"+activeNodeInfo.getWidth()+"px;\">" +
- "<img src=\""+imageUrl+"\" style=\"position:absolute;top:0;left:0\" />" +
- "<div class=\"bpm-graphView-activityImage\" style=\"position:absolute;top:"+ (activeNode.getY()-8) +"px;left:"+(activeNode.getX()-8)+"px;width:50px;height:50px; z-index:1000;\"></div>" +
- "</div>" +
- "</div>"
- );
+ "<div id=\"imageContainer\" style=\"position:relative;top:-1;left:-1;\">" +
+ "<img src=\""+imageUrl+"\" style=\"position:absolute;top:0;left:0\" />";
+ for (ActiveNodeInfo activeNodeInfo: activeNodeInfos) {
+ s+= "<div class=\"bpm-graphView-activityImage\" style=\"position:absolute;top:"+ (activeNodeInfo.getActiveNode().getY()-8) +"px;left:"+(activeNodeInfo.getActiveNode().getX()-8)+"px;width:50px;height:50px; z-index:1000;\"></div>";
+ }
+ s+= "</div>" +
+ "</div>";
+ HTML html = new HTML(s);
+
this.add(html);
invalidate();
}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/LoadActivityDiagramAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/LoadActivityDiagramAction.java 2009-06-29 12:38:48 UTC (rev 5153)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/LoadActivityDiagramAction.java 2009-06-29 13:28:24 UTC (rev 5154)
@@ -21,19 +21,25 @@
*/
package org.jboss.bpm.console.client.process;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.common.AbstractRESTAction;
-import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.model.ActiveNodeInfo;
+import org.jboss.bpm.console.client.model.DiagramNodeInfo;
+import org.jboss.bpm.console.client.model.ProcessInstanceRef;
import org.jboss.bpm.console.client.process.events.ActivityDiagramResultEvent;
+import org.jboss.bpm.console.client.util.ConsoleLog;
import org.jboss.bpm.console.client.util.JSONWalk;
-import org.jboss.bpm.console.client.util.ConsoleLog;
-import org.jboss.bpm.console.client.model.ProcessInstanceRef;
-import org.jboss.bpm.console.client.model.DiagramNodeInfo;
-import org.jboss.bpm.console.client.model.ActiveNodeInfo;
+import org.jboss.bpm.console.client.util.JSONWalk.JSONWrapper;
+
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.Response;
+import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
+import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONValue;
-import com.google.gwt.json.client.JSONParser;
import com.mvc4g.client.Controller;
/**
@@ -76,28 +82,38 @@
//int diagramWidth = JSONWalk.on(root).next("diagramWidth").asInt();
//int diagramHeight = JSONWalk.on(root).next("diagramHeight").asInt();
- JSONObject activeNode = JSONWalk.on(root).next("activeNode").asObject();
-
- int x = JSONWalk.on(activeNode).next("x").asInt();
- int y = JSONWalk.on(activeNode).next("y").asInt();
-
- int width = JSONWalk.on(activeNode).next("width").asInt();
- int height = JSONWalk.on(activeNode).next("height").asInt();
- String name = JSONWalk.on(activeNode).next("name").asString();
-
- ActiveNodeInfo activeNodeInfo =
- new ActiveNodeInfo(
- -1, -1,
- new DiagramNodeInfo(name, x, y, width, height)
- );
-
- // update view
- ActivityDiagramView view = (ActivityDiagramView) controller.getView(ActivityDiagramView.ID);
- view.update(
- new ActivityDiagramResultEvent(
- appContext.getUrlBuilder().getProcessImageURL(inst.getDefinitionId()),
- activeNodeInfo
- )
- );
+ if (root instanceof JSONArray) {
+ JSONArray array = (JSONArray) root;
+ List<ActiveNodeInfo> activeNodeInfos = new ArrayList<ActiveNodeInfo>();
+ for (int i = 0; i < array.size(); i++) {
+ JSONWalk walk = JSONWalk.on(array.get(i));
+ JSONWrapper wrapper = walk.next("activeNode");
+ JSONObject activeNode = wrapper.asObject();
+
+ int x = JSONWalk.on(activeNode).next("x").asInt();
+ int y = JSONWalk.on(activeNode).next("y").asInt();
+
+ int width = JSONWalk.on(activeNode).next("width").asInt();
+ int height = JSONWalk.on(activeNode).next("height").asInt();
+ String name = JSONWalk.on(activeNode).next("name").asString();
+
+ activeNodeInfos.add(
+ new ActiveNodeInfo(
+ -1, -1,
+ new DiagramNodeInfo(name, x, y, width, height)
+ )
+ );
+ wrapper = walk.next("activeNode");
+ }
+
+ // update view
+ ActivityDiagramView view = (ActivityDiagramView) controller.getView(ActivityDiagramView.ID);
+ view.update(
+ new ActivityDiagramResultEvent(
+ appContext.getUrlBuilder().getProcessImageURL(inst.getDefinitionId()),
+ activeNodeInfos
+ )
+ );
+ }
}
}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/events/ActivityDiagramResultEvent.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/events/ActivityDiagramResultEvent.java 2009-06-29 12:38:48 UTC (rev 5153)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/events/ActivityDiagramResultEvent.java 2009-06-29 13:28:24 UTC (rev 5154)
@@ -21,6 +21,8 @@
*/
package org.jboss.bpm.console.client.process.events;
+import java.util.List;
+
import org.jboss.bpm.console.client.model.ActiveNodeInfo;
/**
@@ -29,13 +31,13 @@
public class ActivityDiagramResultEvent
{
private String imageUrl;
- private ActiveNodeInfo activeNodeInfo;
+ private List<ActiveNodeInfo> activeNodeInfo;
public ActivityDiagramResultEvent()
{
}
- public ActivityDiagramResultEvent(String imageUrl, ActiveNodeInfo activeNodeInfo)
+ public ActivityDiagramResultEvent(String imageUrl, List<ActiveNodeInfo> activeNodeInfo)
{
this.imageUrl = imageUrl;
this.activeNodeInfo = activeNodeInfo;
@@ -51,12 +53,12 @@
this.imageUrl = imageUrl;
}
- public ActiveNodeInfo getActiveNodeInfo()
+ public List<ActiveNodeInfo> getActiveNodeInfo()
{
return activeNodeInfo;
}
- public void setActiveNodeInfo(ActiveNodeInfo activeNodeInfo)
+ public void setActiveNodeInfo(List<ActiveNodeInfo> activeNodeInfo)
{
this.activeNodeInfo = activeNodeInfo;
}
Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java 2009-06-29 12:38:48 UTC (rev 5153)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java 2009-06-29 13:28:24 UTC (rev 5154)
@@ -297,7 +297,7 @@
GraphViewerPlugin plugin = getProcessGraphViewPlugin();
if(plugin !=null)
{
- ActiveNodeInfo info = plugin.getActiveNodeInfo(id);
+ List<ActiveNodeInfo> info = plugin.getActiveNodeInfo(id);
return createJsonResponse(info);
}
Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java 2009-06-29 12:38:48 UTC (rev 5153)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/TaskMgmtFacade.java 2009-06-29 13:28:24 UTC (rev 5154)
@@ -32,7 +32,9 @@
import javax.activation.DataHandler;
import javax.activation.DataSource;
+import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.*;
+import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.HashMap;
@@ -90,6 +92,8 @@
@Path("{taskId}/assign/{ifRef}")
@Produces("application/json")
public Response assignTask(
+ @Context
+ HttpServletRequest request,
@PathParam("taskId")
long taskId,
@PathParam("ifRef")
@@ -97,7 +101,7 @@
)
{
log.debug("Assign task " + taskId + " to '" + idRef +"'");
- getTaskManagement().assignTask(taskId, idRef);
+ getTaskManagement().assignTask(taskId, idRef, request.getRemoteUser());
return Response.ok().build();
}
@@ -105,12 +109,14 @@
@Path("{taskId}/release")
@Produces("application/json")
public Response releaseTask(
+ @Context
+ HttpServletRequest request,
@PathParam("taskId")
long taskId
)
{
log.debug("Release task " + taskId);
- getTaskManagement().assignTask(taskId, null);
+ getTaskManagement().assignTask(taskId, null, request.getRemoteUser());
return Response.ok().build();
}
@@ -118,12 +124,14 @@
@Path("{taskId}/close")
@Produces("application/json")
public Response closeTask(
+ @Context
+ HttpServletRequest request,
@PathParam("taskId")
long taskId
)
{
log.debug("Close task " + taskId );
- getTaskManagement().completeTask(taskId, null);
+ getTaskManagement().completeTask(taskId, null, request.getRemoteUser());
return Response.ok().build();
}
@@ -131,6 +139,8 @@
@Path("{taskId}/close/{outcome}")
@Produces("application/json")
public Response closeTaskWithSignal(
+ @Context
+ HttpServletRequest request,
@PathParam("taskId")
long taskId,
@QueryParam("outcome")
@@ -138,7 +148,7 @@
)
{
log.debug("Close task " + taskId + " outcome " + outcome);
- getTaskManagement().completeTask(taskId, outcome, null);
+ getTaskManagement().completeTask(taskId, outcome, null, request.getRemoteUser());
return Response.ok().build();
}
@@ -164,6 +174,8 @@
@Produces("text/html")
@Consumes("multipart/form-data")
public Response closeWithUI(
+ @Context
+ HttpServletRequest request,
@PathParam("taskId")
long taskId,
MultipartFormDataInput payload
@@ -230,9 +242,9 @@
TaskManagement tm = getTaskManagement();
if(null==outcome)
- tm.completeTask(taskId, processVars);
+ tm.completeTask(taskId, processVars, request.getRemoteUser());
else
- tm.completeTask(taskId, outcome, processVars);
+ tm.completeTask(taskId, outcome, processVars, request.getRemoteUser());
return Response.ok("Successfully processed task UI").build();
Modified: projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/TaskManagement.java
===================================================================
--- projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/TaskManagement.java 2009-06-29 12:38:48 UTC (rev 5153)
+++ projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/integration/TaskManagement.java 2009-06-29 13:28:24 UTC (rev 5154)
@@ -39,22 +39,22 @@
/**
* assign user to task
*/
- void assignTask(long taskId, String idRef);
+ void assignTask(long taskId, String idRef, String userId);
/**
* unset a task assignment
*/
- void releaseTask(long taskId);
+ void releaseTask(long taskId, String userId);
/**
* complete a task
*/
- void completeTask(long taskId, Map data);
+ void completeTask(long taskId, Map data, String userId);
/**
* complete a task with a given outcome (trigger)
*/
- void completeTask(long taskId, String outcome, Map data);
+ void completeTask(long taskId, String outcome, Map data, String userId);
/**
* get tasks assingned to a user
Modified: projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/GraphViewerPlugin.java
===================================================================
--- projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/GraphViewerPlugin.java 2009-06-29 12:38:48 UTC (rev 5153)
+++ projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/GraphViewerPlugin.java 2009-06-29 13:28:24 UTC (rev 5154)
@@ -21,6 +21,8 @@
*/
package org.jboss.bpm.console.server.plugin;
+import java.util.List;
+
import org.jboss.bpm.console.client.model.ActiveNodeInfo;
import org.jboss.bpm.console.client.model.DiagramInfo;
@@ -35,5 +37,5 @@
DiagramInfo getDiagramInfo(String processId);
- ActiveNodeInfo getActiveNodeInfo(String instanceId);
+ List<ActiveNodeInfo> getActiveNodeInfo(String instanceId);
}
14 years, 11 months
JBoss JBPM SVN: r5153 - in jbpm4/trunk/modules: test-db/src/test/java/org/jbpm/test/activities and 1 other directory.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-06-29 08:38:48 -0400 (Mon, 29 Jun 2009)
New Revision: 5153
Added:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/SubProcessTest.java
Modified:
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java
Log:
Fix for JBPM-2335: 1-1 relation was only nullified at one side, but nullification is needed at both sides.
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java 2009-06-29 12:21:09 UTC (rev 5152)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java 2009-06-29 12:38:48 UTC (rev 5153)
@@ -106,7 +106,9 @@
}
try {
+ subProcessInstance.setSuperProcessExecution(null);
executionImpl.setSubProcessInstance(null);
+
for (SubProcessOutParameterImpl outParameter: outParameters) {
outParameter.consume(executionImpl, subProcessInstance);
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/SubProcessTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/SubProcessTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/SubProcessTest.java 2009-06-29 12:38:48 UTC (rev 5153)
@@ -0,0 +1,88 @@
+/*
+ * 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.activities;
+
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.task.Task;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Joram Barrez
+ */
+public class SubProcessTest extends JbpmTestCase {
+
+ private static final String MAIN_PROCESS =
+ "<process name='mainProcess'>" +
+ " <start>" +
+ " <transition to='review' />" +
+ " </start>" +
+ " <sub-process name='review' sub-process-key='SubProcessReview'>" +
+ " <transition name='ok' to='next step'/>" +
+ " <transition name='nok' to='update'/>" +
+ " <transition name='reject' to='close'/>" +
+ " </sub-process>" +
+ " <state name='next step'/>" +
+ " <state name='update'/>" +
+ " <end name='close'/>" +
+ "</process>";
+
+ private static final String SUB_PROCESS =
+ "<process name='SubProcessReview'>" +
+ " <start>" +
+ " <transition to='get approval'/>" +
+ " </start>" +
+ " <task name='get approval' assignee='johndoe'>" +
+ " <transition name='ok' to='ok'/>" +
+ " <transition name='nok' to='nok'/>" +
+ " <transition name='reject' to='reject'/>" +
+ " </task>" +
+ " <end name='ok' />" +
+ " <end name='nok' />" +
+ " <end name='reject' />" +
+ "</process>";
+
+ public void testSubProcessOutcomeToState() {
+ deployJpdlXmlString(SUB_PROCESS);
+ deployJpdlXmlString(MAIN_PROCESS);
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("mainProcess");
+ Task task = taskService.findPersonalTasks("johndoe").get(0);
+ taskService.completeTask(task.getId(), "nok");
+ assertExecutionInActivity(processInstance.getId(), "update");
+ }
+
+
+ public void testSubProcessOutcomeToEnd() {
+ deployJpdlXmlString(SUB_PROCESS);
+ deployJpdlXmlString(MAIN_PROCESS);
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("mainProcess");
+ Task task = taskService.findPersonalTasks("johndoe").get(0);
+ taskService.completeTask(task.getId(), "reject");
+ assertProcessInstanceEnded(processInstance);
+ }
+
+}
14 years, 11 months
JBoss JBPM SVN: r5152 - jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/execution.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-06-29 08:21:09 -0400 (Mon, 29 Jun 2009)
New Revision: 5152
Modified:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/execution/FindExecutionTest.java
Log:
Added check for process instance end in test case
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/execution/FindExecutionTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/execution/FindExecutionTest.java 2009-06-29 12:17:14 UTC (rev 5151)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/execution/FindExecutionTest.java 2009-06-29 12:21:09 UTC (rev 5152)
@@ -45,5 +45,8 @@
processInstance = executionService.findProcessInstanceById(processInstance.getId());
assertNotNull(processInstance);
assertTrue(processInstance.isActive("a"));
+
+ executionService.endProcessInstance(processInstance.getId(), "ended");
+ assertNull(executionService.findExecutionById(processInstance.getId()));
}
}
14 years, 11 months
JBoss JBPM SVN: r5151 - jbpm4/trunk/modules/pvm/src/main/resources.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-06-29 08:17:14 -0400 (Mon, 29 Jun 2009)
New Revision: 5151
Modified:
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml
Log:
Fix for JBPM-2357
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml 2009-06-29 12:16:21 UTC (rev 5150)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml 2009-06-29 12:17:14 UTC (rev 5151)
@@ -340,7 +340,6 @@
select execution
from org.jbpm.pvm.internal.model.ExecutionImpl as execution
where execution.id = :id
- and execution.state != 'suspended'
]]>
</query>
14 years, 11 months
JBoss JBPM SVN: r5150 - in jbpm4/trunk/modules: test-db/src/test/java/org/jbpm/test/activities and 1 other directory.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-06-29 08:16:21 -0400 (Mon, 29 Jun 2009)
New Revision: 5150
Modified:
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkToTaskTest.java
Log:
Added test case for JBPM-2303
Modified: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2009-06-29 11:52:28 UTC (rev 5149)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2009-06-29 12:16:21 UTC (rev 5150)
@@ -36,6 +36,7 @@
import org.jbpm.api.ProcessInstance;
import org.jbpm.api.RepositoryService;
import org.jbpm.api.TaskService;
+import org.jbpm.api.history.HistoryProcessInstance;
import org.jbpm.api.task.Task;
/** base class for persistent jBPM tests.
@@ -191,6 +192,10 @@
executionService.findProcessInstanceById(processInstanceId));
}
+ public void assertProcessInstanceEnded(String processInstanceId) {
+ assertExecutionEnded(processInstanceId);
+ }
+
public void assertProcessInstanceEnded(ProcessInstance processInstance) {
assertExecutionEnded(processInstance.getId());
}
@@ -198,15 +203,23 @@
public void assertActiveActivity(String activityName, String executionId) {
Execution execution = executionService.findExecutionById(executionId);
assertTrue("The given execution (or any child execution) isn't in the activity '" + activityName
- + "' (current activities : " + listAllActiveActivites(execution) + ")",
+ + "' (current activities : " + listAllActiveActivites(executionId) + ")",
execution.isActive(activityName));
}
- private String listAllActiveActivites(Execution execution) {
+ public void assertExecutionInActivity(String executionId, String activityName) {
+ assertTrue("The execution with id '" + executionId +
+ "' is not active in the activity '" + activityName + "'." +
+ "Current activitites are: " + listAllActiveActivites(executionId),
+ executionService.findExecutionById(executionId).isActive(activityName));
+ }
+
+ private String listAllActiveActivites(String executionId) {
+ Execution execution = executionService.findExecutionById(executionId);
Set<String> activeActivities = execution.findActiveActivityNames();
StringBuilder result = new StringBuilder();
for (String activeActivity : activeActivities) {
- result.append(activeActivity + ", ");
+ result.append("'" + activeActivity + "', ");
}
result.setLength(result.length() - 2); // remove the last ', '
return result.toString();
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkToTaskTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkToTaskTest.java 2009-06-29 11:52:28 UTC (rev 5149)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/activities/ForkToTaskTest.java 2009-06-29 12:16:21 UTC (rev 5150)
@@ -62,32 +62,32 @@
executionService.startProcessInstanceByKey("ForkToTasks");
}
- public void testFork() {
+ public void testForkWithUnfinishedPath() {
deployJpdlXmlString(
"<process name='forkTest'>" +
- " <start g='0,252,48,48' name='start1'>" +
- " <transition to='fork1'/>" +
+ " <start name='start1'>" +
+ " <transition to='fork'/>" +
" </start>" +
- " <fork g='96,252,48,48' name='fork1'>" +
- " <transition g='-53,-18' name='review1' to='review1'/>" +
- " <transition g='-49,-18' name='review2' to='review2'/>" +
- " <transition g='-53,-18' name='control1' to='control1'/>" +
+ " <fork name='fork'>" +
+ " <transition name='review1' to='review1'/>" +
+ " <transition name='review2' to='review2'/>" +
+ " <transition name='control1' to='control'/>" +
" </fork>" +
- " <task candidate-users='requester' g='300,372,193,52' name='review1'>" +
- " <transition g='-41,-18' name='Approve' to='join1'/>" +
- " <transition g='-54,-18' name='Reject' to='rejected1'/>" +
+ " <task candidate-users='requester' name='review1'>" +
+ " <transition name='Approve' to='join'/>" +
+ " <transition name='Reject' to='rejected1'/>" +
" </task>" +
- " <task candidate-users='requester' g='300,132,193,52' name='review2'>" +
- " <transition g='-41,-18' name='Approve' to='join1'/>" +
- " <transition g='-54,-18' name='Reject' to='rejected2'/>" +
+ " <task candidate-users='requester' name='review2'>" +
+ " <transition name='Approve' to='join'/>" +
+ " <transition name='Reject' to='rejected2'/>" +
" </task>" +
- " <task candidate-groups='control' g='300,252,193,52' name='control1' />" +
- " <join g='756,252,48,48' name='join1'>" +
- " <transition to='end1'/>" +
+ " <task candidate-groups='control' name='control' />" +
+ " <join name='join'>" +
+ " <transition to='end'/>" +
" </join>" +
- " <end g='972,252,48,48' name='end1'/>" +
- " <end-cancel g='600,132,48,48' name='rejected2'/>" +
- " <end-cancel g='600,372,48,48' name='rejected1'/>" +
+ " <end name='end'/>" +
+ " <end-cancel name='rejected2'/>" +
+ " <end-cancel name='rejected1'/>" +
"</process>"
);
@@ -99,14 +99,11 @@
List<Task> tasksForRequester = taskService.findGroupTasks(requester);
assertEquals(2, tasksForRequester.size());
- // Uncomment these lines to make the test fail
for (Task task : tasksForRequester) {
taskService.takeTask(task.getId(), requester);
taskService.completeTask(task.getId(), "Approve");
}
- // Adding a state after joing and executing these lines works ...
- //String id = executionService.findExecutionById(processInstanceId).findActiveExecutionIn("test").getId();
- //executionService.signalExecutionById(id);
+ assertProcessInstanceEnded(processInstanceId);
}
}
14 years, 11 months
JBoss JBPM SVN: r5149 - projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-06-29 07:52:28 -0400 (Mon, 29 Jun 2009)
New Revision: 5149
Added:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/jobs.png
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/runtime.png
Log:
Added missing icons
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/jobs.png
===================================================================
(Binary files differ)
Property changes on: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/jobs.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/runtime.png
===================================================================
(Binary files differ)
Property changes on: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/runtime.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
14 years, 11 months
JBoss JBPM SVN: r5148 - in projects/gwt-console/trunk: gui/war/src/main/java/org/jboss/bpm/console/client/process and 2 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-06-29 07:43:05 -0400 (Mon, 29 Jun 2009)
New Revision: 5148
Added:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ExecuteJobAction.java
Modified:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDetailView.java
projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/EngineFacade.java
Log:
Enable job execution from within the console
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java 2009-06-29 11:00:18 UTC (rev 5147)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java 2009-06-29 11:43:05 UTC (rev 5148)
@@ -108,6 +108,7 @@
controller.addAction(DeleteDeploymentAction.ID, new DeleteDeploymentAction(appContext));
controller.addAction(SuspendDeploymentAction.ID, new SuspendDeploymentAction(appContext));
controller.addAction(ResumeDeploymentAction.ID, new ResumeDeploymentAction(appContext));
+ controller.addAction(ExecuteJobAction.ID, new ExecuteJobAction(appContext));
// display tab, needs to visible for correct rendering
tabPanel.selectTab( view2index.get(DeploymentListView.ID ));
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ExecuteJobAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ExecuteJobAction.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ExecuteJobAction.java 2009-06-29 11:43:05 UTC (rev 5148)
@@ -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.client.engine;
+
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.ApplicationContext;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class ExecuteJobAction extends AbstractRESTAction
+{
+
+ public final static String ID = ExecuteJobAction.class.getName();
+
+ public ExecuteJobAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ String id = (String)event;
+ return appContext.getUrlBuilder().getExecuteJobURL(id);
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.POST;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ String id = (String)event;
+
+ // reload job list
+ controller.handleEvent(
+ new Event(UpdateJobsAction.ID, null)
+ );
+ }
+}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListView.java 2009-06-29 11:00:18 UTC (rev 5147)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListView.java 2009-06-29 11:43:05 UTC (rev 5148)
@@ -30,11 +30,13 @@
import org.gwt.mosaic.ui.client.ListBox;
import org.gwt.mosaic.ui.client.ToolBar;
import org.gwt.mosaic.ui.client.ToolButton;
+import org.gwt.mosaic.ui.client.MessageBox;
import org.gwt.mosaic.ui.client.layout.*;
import org.gwt.mosaic.ui.client.list.DefaultListModel;
import org.jboss.bpm.console.client.common.AbstractView;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
import org.jboss.bpm.console.client.model.JobRef;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
import org.jboss.bpm.console.client.model.util.SimpleDateFormat;
import org.jboss.bpm.console.client.ApplicationContext;
@@ -168,6 +170,28 @@
}
)
);
+
+ toolBar.addSeparator();
+
+ toolBar.add(
+ new ToolButton("Execute", new ClickListener() {
+ public void onClick(Widget sender) {
+ JobRef selection = getSelection();
+ if(null==selection)
+ {
+ MessageBox.alert("Missing selection", "Please select a job!");
+ }
+ else
+ {
+ controller.handleEvent(
+ new Event(ExecuteJobAction.ID, selection.getId())
+ );
+ }
+ }
+ }
+ )
+ );
+
toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
// filter
@@ -271,4 +295,12 @@
); */
}
}
+
+ public JobRef getSelection()
+ {
+ JobRef selection = null;
+ if(isInitialized() && listBox.getSelectedIndex()!=-1)
+ selection = listBox.getItem( listBox.getSelectedIndex());
+ return selection;
+ }
}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDetailView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDetailView.java 2009-06-29 11:00:18 UTC (rev 5147)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDetailView.java 2009-06-29 11:43:05 UTC (rev 5148)
@@ -37,6 +37,7 @@
import org.gwt.mosaic.ui.client.layout.LayoutPanel;
import org.jboss.bpm.console.client.common.PropertyGrid;
import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+import org.jboss.bpm.console.client.model.util.SimpleDateFormat;
import org.jboss.bpm.console.client.util.WindowUtil;
import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.ServerPlugins;
@@ -64,6 +65,8 @@
private boolean hasDiagramPlugin;
+ private SimpleDateFormat dateFormat = new SimpleDateFormat();
+
public InstanceDetailView(ApplicationContext appContext)
{
super("Instance details");
@@ -73,12 +76,12 @@
super.setLayout(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
grid = new PropertyGrid(
- new String[] {"ID:", "Key:", "State", "Start Date:"}
+ new String[] {"ID:", "Key:", "State", "Start Date:", "Activity:"}
);
this.add(grid, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
- activityBtn = new Button("Activity",
+ activityBtn = new Button("Diagram",
new ClickListener()
{
public void onClick(Widget widget)
@@ -157,7 +160,8 @@
instance.getId(),
instance.getKey(),
String.valueOf( instance.getState() ),
- String.valueOf( instance.getStartDate() )
+ dateFormat.format(instance.getStartDate()),
+ instance.getRootToken().getCurrentNodeName()
};
grid.update(values);
Modified: projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java
===================================================================
--- projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java 2009-06-29 11:00:18 UTC (rev 5147)
+++ projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java 2009-06-29 11:43:05 UTC (rev 5148)
@@ -219,4 +219,10 @@
{
return config.getConsoleServerUrl() + "/rs/engine/jobs";
}
+
+ public String getExecuteJobURL(String id)
+ {
+ String encodedId = URL.encode(id);
+ return config.getConsoleServerUrl() + "/rs/engine/job/"+encodedId+"/execute";
+ }
}
Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/EngineFacade.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/EngineFacade.java 2009-06-29 11:00:18 UTC (rev 5147)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/EngineFacade.java 2009-06-29 11:43:05 UTC (rev 5148)
@@ -163,6 +163,29 @@
}
+ @POST
+ @Path("job/{id}/execute")
+ @Produces("application/json")
+ public Response executeJob(
+ @PathParam("id")
+ String id
+ )
+ {
+
+ ProcessEnginePlugin dplPlugin = getDeploymentPlugin();
+ if(processEnginePlugin !=null)
+ {
+ dplPlugin.executeJob(id);
+ return Response.ok().build();
+ }
+ else
+ {
+ log.error("ProcessEnginePlugin not available");
+ return Response.serverError().build();
+ }
+
+ }
+
private Response createJsonResponse(Object wrapper)
{
Gson gson = GsonFactory.createInstance();
14 years, 11 months
JBoss JBPM SVN: r5147 - in jbpm4/trunk/modules/integration/console/src/main: resources/META-INF/services and 1 other directory.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-06-29 07:00:18 -0400 (Mon, 29 Jun 2009)
New Revision: 5147
Added:
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessEnginePluginImpl.java
jbpm4/trunk/modules/integration/console/src/main/resources/META-INF/services/org.jboss.bpm.console.server.plugin.ProcessEnginePlugin
Removed:
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/DeploymentPluginImpl.java
jbpm4/trunk/modules/integration/console/src/main/resources/META-INF/services/org.jboss.bpm.console.server.plugin.DeploymentPlugin
Modified:
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java
Log:
Rename deployment plugin to process engine plugin. Changes to the model adaptor for managing jobs
Deleted: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/DeploymentPluginImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/DeploymentPluginImpl.java 2009-06-29 10:20:29 UTC (rev 5146)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/DeploymentPluginImpl.java 2009-06-29 11:00:18 UTC (rev 5147)
@@ -1,128 +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.jbpm.integration.console;
-
-import org.jboss.bpm.console.client.model.DeploymentRef;
-import org.jboss.bpm.console.server.plugin.DeploymentPlugin;
-import org.jbpm.api.*;
-import org.jbpm.pvm.internal.env.EnvironmentFactory;
-import org.jbpm.pvm.internal.env.Environment;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class DeploymentPluginImpl extends JBPMIntegration
- implements DeploymentPlugin
-{
-
- public DeploymentPluginImpl()
- {
- initializeProcessEngine();
- }
-
- public List<DeploymentRef> getDeployments()
- {
- List<DeploymentRef> results = new ArrayList<DeploymentRef>();
-
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
-
- try
- {
- RepositoryService repositoryService = this.processEngine.getRepositoryService();
- DeploymentQuery dquery = repositoryService.createDeploymentQuery();
-
- List<Deployment> dpls = dquery.list();
-
- for(Deployment dpl : dpls)
- {
- DeploymentRef ref = ModelAdaptor.adoptDeployment(dpl);
-
- // active processes
- ProcessDefinitionQuery pdQuery = repositoryService.createProcessDefinitionQuery();
- pdQuery.deploymentId(dpl.getId());
- List<ProcessDefinition> activePds = pdQuery.list();
-
- for(ProcessDefinition p : activePds)
- {
- ref.getDefinitions().add(p.getId());
- }
-
- // suspended processes
- ProcessDefinitionQuery pdQuery2 = repositoryService.createProcessDefinitionQuery();
- pdQuery2.deploymentId(dpl.getId());
- pdQuery2.suspended();
- List<ProcessDefinition> suspendedPds = pdQuery2.list();
-
- for(ProcessDefinition p : suspendedPds)
- {
- ref.getDefinitions().add(p.getId());
- }
-
- results.add(ref);
- }
-
- return results;
- }
- finally
- {
- env.close();
- }
- }
-
- public void deleteDeployment(String id)
- {
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
-
- try
- {
- RepositoryService repositoryService = this.processEngine.getRepositoryService();
- repositoryService.deleteDeploymentCascade(id);
- }
- finally
- {
- env.close();
- }
-
- }
-
- public void setSuspended(String id, boolean isSuspended)
- {
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
-
- try
- {
- RepositoryService repositoryService = this.processEngine.getRepositoryService();
- if(isSuspended)
- repositoryService.suspendDeployment(id);
- else
- repositoryService.resumeDeployment(id);
- }
- finally
- {
- env.close();
- }
-
- }
-}
Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java 2009-06-29 10:20:29 UTC (rev 5146)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java 2009-06-29 11:00:18 UTC (rev 5147)
@@ -24,6 +24,7 @@
import org.jboss.bpm.console.client.model.*;
import org.jbpm.api.Deployment;
import org.jbpm.api.ProcessDefinition;
+import org.jbpm.api.job.Job;
import org.jbpm.api.task.Participation;
import org.jbpm.api.task.Task;
import org.jbpm.pvm.internal.model.ExecutionImpl;
@@ -188,4 +189,20 @@
return dRef;
}
+
+ public static JobRef adoptJob(Job j)
+ {
+ JobRef job = new JobRef();
+ job.setId(String.valueOf(j.getId()));
+ if(j.getDueDate()!=null)
+ {
+ job.setTimestamp(j.getDueDate().getTime());
+ }
+ if(j.getException()!=null)
+ {
+ job.setErrMsg(j.getException());
+ }
+
+ return job;
+ }
}
Copied: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessEnginePluginImpl.java (from rev 5124, jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/DeploymentPluginImpl.java)
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessEnginePluginImpl.java (rev 0)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessEnginePluginImpl.java 2009-06-29 11:00:18 UTC (rev 5147)
@@ -0,0 +1,186 @@
+/*
+ * 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.integration.console;
+
+import org.jboss.bpm.console.client.model.DeploymentRef;
+import org.jboss.bpm.console.client.model.JobRef;
+import org.jboss.bpm.console.server.plugin.ProcessEnginePlugin;
+import org.jbpm.api.*;
+import org.jbpm.api.job.Job;
+import org.jbpm.pvm.internal.env.EnvironmentFactory;
+import org.jbpm.pvm.internal.env.Environment;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class ProcessEnginePluginImpl extends JBPMIntegration
+ implements ProcessEnginePlugin
+{
+
+ public ProcessEnginePluginImpl()
+ {
+ initializeProcessEngine();
+ }
+
+ public List<DeploymentRef> getDeployments()
+ {
+ List<DeploymentRef> results = new ArrayList<DeploymentRef>();
+
+ Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+
+ try
+ {
+ RepositoryService repositoryService = this.processEngine.getRepositoryService();
+ DeploymentQuery dquery = repositoryService.createDeploymentQuery();
+
+ List<Deployment> dpls = dquery.list();
+
+ for(Deployment dpl : dpls)
+ {
+ DeploymentRef ref = ModelAdaptor.adoptDeployment(dpl);
+
+ // active processes
+ ProcessDefinitionQuery pdQuery = repositoryService.createProcessDefinitionQuery();
+ pdQuery.deploymentId(dpl.getId());
+ List<ProcessDefinition> activePds = pdQuery.list();
+
+ for(ProcessDefinition p : activePds)
+ {
+ ref.getDefinitions().add(p.getId());
+ }
+
+ // suspended processes
+ ProcessDefinitionQuery pdQuery2 = repositoryService.createProcessDefinitionQuery();
+ pdQuery2.deploymentId(dpl.getId());
+ pdQuery2.suspended();
+ List<ProcessDefinition> suspendedPds = pdQuery2.list();
+
+ for(ProcessDefinition p : suspendedPds)
+ {
+ ref.getDefinitions().add(p.getId());
+ }
+
+ results.add(ref);
+ }
+
+ return results;
+ }
+ finally
+ {
+ env.close();
+ }
+ }
+
+ public void deleteDeployment(String id)
+ {
+ Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+
+ try
+ {
+ RepositoryService repositoryService = this.processEngine.getRepositoryService();
+ repositoryService.deleteDeploymentCascade(id);
+ }
+ finally
+ {
+ env.close();
+ }
+
+ }
+
+ public void suspendDeployment(String id, boolean isSuspended)
+ {
+ Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+
+ try
+ {
+ RepositoryService repositoryService = this.processEngine.getRepositoryService();
+ if(isSuspended)
+ repositoryService.suspendDeployment(id);
+ else
+ repositoryService.resumeDeployment(id);
+ }
+ finally
+ {
+ env.close();
+ }
+
+ }
+
+ public List<JobRef> getJobs()
+ {
+ List<JobRef> results = new ArrayList<JobRef>();
+
+ Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+
+ try
+ {
+ ManagementService mgmtService = this.processEngine.getManagementService();
+
+ // jobs
+ JobQuery timerQuery = mgmtService.createJobQuery();
+ timerQuery.timers();
+ List<Job> timers = timerQuery.list();
+ for(Job t : timers)
+ {
+ JobRef ref = ModelAdaptor.adoptJob(t);
+ ref.setType("timer");
+ results.add(ref);
+ }
+
+ // messages
+ JobQuery msgQuery= mgmtService.createJobQuery();
+ msgQuery.messages();
+ List<Job> msgs = msgQuery.list();
+ for(Job t : msgs)
+ {
+ JobRef ref = ModelAdaptor.adoptJob(t);
+ ref.setType("message");
+ results.add(ref);
+ }
+ }
+ finally
+ {
+ env.close();
+ }
+
+ return results;
+ }
+
+
+ public void executeJob(String jobId)
+ {
+ Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+
+ try
+ {
+ ManagementService mgmtService = this.processEngine.getManagementService();
+ mgmtService.executeJob(jobId);
+ }
+ finally
+ {
+ env.close();
+ }
+ }
+}
Deleted: jbpm4/trunk/modules/integration/console/src/main/resources/META-INF/services/org.jboss.bpm.console.server.plugin.DeploymentPlugin
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/resources/META-INF/services/org.jboss.bpm.console.server.plugin.DeploymentPlugin 2009-06-29 10:20:29 UTC (rev 5146)
+++ jbpm4/trunk/modules/integration/console/src/main/resources/META-INF/services/org.jboss.bpm.console.server.plugin.DeploymentPlugin 2009-06-29 11:00:18 UTC (rev 5147)
@@ -1 +0,0 @@
-org.jbpm.integration.console.DeploymentPluginImpl
\ No newline at end of file
Copied: jbpm4/trunk/modules/integration/console/src/main/resources/META-INF/services/org.jboss.bpm.console.server.plugin.ProcessEnginePlugin (from rev 5124, jbpm4/trunk/modules/integration/console/src/main/resources/META-INF/services/org.jboss.bpm.console.server.plugin.DeploymentPlugin)
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/resources/META-INF/services/org.jboss.bpm.console.server.plugin.ProcessEnginePlugin (rev 0)
+++ jbpm4/trunk/modules/integration/console/src/main/resources/META-INF/services/org.jboss.bpm.console.server.plugin.ProcessEnginePlugin 2009-06-29 11:00:18 UTC (rev 5147)
@@ -0,0 +1 @@
+org.jbpm.integration.console.ProcessEnginePluginImpl
\ No newline at end of file
14 years, 11 months