[jbpm-commits] JBoss JBPM SVN: r3849 - in projects/gwt-console/trunk: plugin-api and 13 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Thu Feb 12 08:19:13 EST 2009
Author: heiko.braun at jboss.com
Date: 2009-02-12 08:19:13 -0500 (Thu, 12 Feb 2009)
New Revision: 3849
Modified:
projects/gwt-console/trunk/plugin-api/plugin.iml
projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java
projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
projects/gwt-console/trunk/pom.xml
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/ProcessInstanceRef.java
projects/gwt-console/trunk/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ProcessManagement.java
projects/gwt-console/trunk/server/gwt-server.iml
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/TestFacade.java
projects/gwt-console/trunk/server/src/main/webapp/index.html
projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/BaseTC.java
projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/ProcessManagementTest.java
projects/gwt-console/trunk/war/gwt-war.iml
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/java/org/jboss/bpm/console/client/process/ProcessInstanceDetailForm.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java
projects/gwt-console/trunk/war/src/main/resources/jmaki/xhp/xhp.json
projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestDTOParser.java
Log:
Migrate to string based entity ID's
Modified: projects/gwt-console/trunk/plugin-api/plugin.iml
===================================================================
--- projects/gwt-console/trunk/plugin-api/plugin.iml 2009-02-12 09:19:18 UTC (rev 3848)
+++ projects/gwt-console/trunk/plugin-api/plugin.iml 2009-02-12 13:19:13 UTC (rev 3849)
@@ -10,6 +10,7 @@
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="gwt-parent" />
+ <orderEntry type="module" module-name="gwt-rpc" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: com.gwtext:gwtext:jar:2.0.5:compile">
<CLASSES>
Modified: projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java
===================================================================
--- projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java 2009-02-12 09:19:18 UTC (rev 3848)
+++ projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java 2009-02-12 13:19:13 UTC (rev 3849)
@@ -48,9 +48,10 @@
return getConsoleServerUrl() + "/rs/process/definitions";
}
- public String getProcessInstancesURL(long processId)
+ public String getProcessInstancesURL(String processId)
{
- return getConsoleServerUrl() + "/rs/process/definitions/" + processId + "/instances";
+ String encodedId = URL.encode(processId);
+ return getConsoleServerUrl() + "/rs/process/definitions/" + encodedId + "/instances";
}
public String getUserInRoleURL(String[] possibleRoles)
@@ -66,34 +67,33 @@
}
@Deprecated
- public String getRemoveDefinitionURL(long processId)
+ public String getRemoveDefinitionURL(String processId)
{
- return getConsoleServerUrl() + "/rs/process/definitions/" + processId + "/remove";
+ String encodedId = URL.encode(processId);
+ return getConsoleServerUrl() + "/rs/process/definitions/" + encodedId+ "/remove";
}
- public String getProcessImageURL(long processId)
+ public String getProcessImageURL(String processId)
{
- return getConsoleServerUrl() + "/rs/jbpm3/definitions/" + processId + "/image";
+ String encodedId = URL.encode(processId);
+ return getConsoleServerUrl() + "/rs/jbpm3/definitions/" + encodedId+ "/image";
}
- public String getDiagramInfoURL(long processId)
+ public String getActiveNodeInfoURL(String instanceId)
{
- return getConsoleServerUrl() + "/rs/jbpm3/definitions/" + processId + "/diagramInfo";
- }
-
- public String getActiveNodeInfoURL(long instanceId)
- {
return getConsoleServerUrl() + "/rs/jbpm3/instances/" + instanceId + "/activeNodeInfo";
}
- public String getStateChangeURL(long instanceId, ProcessInstanceRef.STATE state)
+ public String getStateChangeURL(String instanceId, ProcessInstanceRef.STATE state)
{
- return getConsoleServerUrl() + "/rs/process/instances/" + instanceId + "/state/" + state;
+ String encodedId = URL.encode(instanceId);
+ return getConsoleServerUrl() + "/rs/process/instances/" + encodedId + "/state/" + state;
}
- public String getStartNewInstanceURL(long processId)
+ public String getStartNewInstanceURL(String processId)
{
- return getConsoleServerUrl() + "/rs/process/definitions/" + processId + "/instances/new";
+ String encodedID = URL.encode(processId);
+ return getConsoleServerUrl() + "/rs/process/definitions/" + encodedID + "/instances/new";
}
public String getUploadDefinitionURL()
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-12 09:19:18 UTC (rev 3848)
+++ projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2009-02-12 13:19:13 UTC (rev 3849)
@@ -43,7 +43,7 @@
public static ProcessDefinitionRef parseProcessDefinition(String json)
{
JSONValue root = JSONParser.parse(json);
- long id = JSONWalk.on(root).next("processId").asLong();
+ String id = JSONWalk.on(root).next("id").asString();
Long version = JSONWalk.on(root).next("version").asLong();
String name = JSONWalk.on(root).next("name").asString();
@@ -197,8 +197,8 @@
{
ConsoleLog.debug("parse " + root);
- long id = JSONWalk.on(root).next("instanceId").asLong();
- long parentId = JSONWalk.on(root).next("parentId").asLong();
+ String id = JSONWalk.on(root).next("id").asString();
+ String definitionId = JSONWalk.on(root).next("definitionId").asString();
Date start = JSONWalk.on(root).next("startDate").asDate();
JSONWalk.JSONWrapper endDateJSON = JSONWalk.on(root).next("endDate");
@@ -209,7 +209,7 @@
boolean suspended = JSONWalk.on(root).next("suspended").asBool();
ProcessInstanceRef processInstance = new ProcessInstanceRef(
- id, parentId,
+ id, definitionId,
start, end,
suspended
);
Modified: projects/gwt-console/trunk/pom.xml
===================================================================
--- projects/gwt-console/trunk/pom.xml 2009-02-12 09:19:18 UTC (rev 3848)
+++ projects/gwt-console/trunk/pom.xml 2009-02-12 13:19:13 UTC (rev 3849)
@@ -38,7 +38,7 @@
<module>server-integration</module>
<module>server</module>
<module>war</module>
- <module>plugin-api/</module>
+ <module>plugin-api</module>
<module>plugin-example</module>
</modules>
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-12 09:19:18 UTC (rev 3848)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java 2009-02-12 13:19:13 UTC (rev 3849)
@@ -21,8 +21,6 @@
*/
package org.jboss.bpm.console.client.model;
-import com.google.gwt.user.client.rpc.IsSerializable;
-
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@@ -32,7 +30,8 @@
@XmlRootElement(name="processDefinition")
public class ProcessDefinitionRef
{
- private long processId;
+ private String id;
+
private String name;
private long version;
private String key;
@@ -43,22 +42,22 @@
{
}
- public ProcessDefinitionRef(long id, String name, long version)
+ public ProcessDefinitionRef(String id, String name, long version)
{
- this.processId = id;
+ this.id = id;
this.name = name;
this.version = version;
}
@XmlElement(name = "processId")
- public long getProcessId()
+ public String getId()
{
- return processId;
+ return id;
}
- public void setProcessId(long processId)
+ public void setId(String id)
{
- this.processId = processId;
+ this.id = id;
}
@XmlElement(name = "name")
@@ -84,7 +83,7 @@
public String toString()
{
- return "ProcessDefinitionRef{id="+this.processId +", name="+this.name+", version="+this.version+"}";
+ return "ProcessDefinitionRef{id="+this.id +", name="+this.name+", version="+this.version+"}";
}
public String getKey()
@@ -117,6 +116,7 @@
this.packageName = packageName;
}
+
public boolean equals(Object o)
{
if (this == o) return true;
@@ -124,8 +124,9 @@
ProcessDefinitionRef that = (ProcessDefinitionRef) o;
- if (processId != that.processId) return false;
if (version != that.version) return false;
+ if (id != null ? !id.equals(that.id) : that.id != null) return false;
+ if (key != null ? !key.equals(that.key) : that.key != null) return false;
if (name != null ? !name.equals(that.name) : that.name != null) return false;
return true;
@@ -134,9 +135,10 @@
public int hashCode()
{
int result;
- result = (int) (processId ^ (processId >>> 32));
+ result = (id != null ? id.hashCode() : 0);
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (int) (version ^ (version >>> 32));
+ result = 31 * result + (key != null ? key.hashCode() : 0);
return result;
}
}
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-12 09:19:18 UTC (rev 3848)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceRef.java 2009-02-12 13:19:13 UTC (rev 3849)
@@ -34,283 +34,274 @@
@XmlRootElement(name="processInstance")
public class ProcessInstanceRef
{
- private long instanceId;
- private long definitionId;
+ private String id;
+ private String definitionId;
- private String key;
- public enum STATE {RUNNING, SUSPENDED, ENDED};
+ private String key;
+ public enum STATE {RUNNING, SUSPENDED, ENDED};
- private Date startDate;
- private Date endDate;
+ private Date startDate;
+ private Date endDate;
- private boolean suspended;
+ private boolean suspended;
- private transient Lifecycle lifecycle;
+ private transient Lifecycle lifecycle;
- private TokenReference rootToken;
+ private TokenReference rootToken;
- public ProcessInstanceRef()
- {
- initLifecycle();
- }
+ public ProcessInstanceRef()
+ {
+ initLifecycle();
+ }
- public ProcessInstanceRef(long id, long parentId, Date startDate, Date endDate, boolean suspended)
- {
+ public ProcessInstanceRef(String id, String processDefinitionId, Date startDate, Date endDate, boolean suspended)
+ {
- if(null==startDate)
- throw new IllegalArgumentException("An instance requires a start date");
-
- if(endDate!=null && suspended)
- throw new IllegalArgumentException("An instance cannot be ended and suspended at the same time");
+ if(null==startDate)
+ throw new IllegalArgumentException("An instance requires a start date");
- this.instanceId = id;
- this.definitionId = parentId;
- this.startDate = startDate;
- this.endDate = endDate;
- this.suspended = suspended;
- initLifecycle();
- }
+ if(endDate!=null && suspended)
+ throw new IllegalArgumentException("An instance cannot be ended and suspended at the same time");
- /**
- * If not ENDED or SUSPENDED the instance is RUNNING
- */
- private void initLifecycle()
- {
- if(hasEnded())
- this.lifecycle = new Lifecycle(this, STATE.ENDED);
- else if(isSuspended())
- this.lifecycle = new Lifecycle(this, STATE.SUSPENDED);
- else
- this.lifecycle = new Lifecycle(this, STATE.RUNNING);
- }
+ this.id = id;
+ this.definitionId = processDefinitionId;
+ this.startDate = startDate;
+ this.endDate = endDate;
+ this.suspended = suspended;
+ initLifecycle();
+ }
- @XmlElement(name = "instanceId")
- public long getInstanceId()
- {
- return instanceId;
- }
+ /**
+ * If not ENDED or SUSPENDED the instance is RUNNING
+ */
+ private void initLifecycle()
+ {
+ if(hasEnded())
+ this.lifecycle = new Lifecycle(this, STATE.ENDED);
+ else if(isSuspended())
+ this.lifecycle = new Lifecycle(this, STATE.SUSPENDED);
+ else
+ this.lifecycle = new Lifecycle(this, STATE.RUNNING);
+ }
- public void setInstanceId(long instanceId)
- {
- this.instanceId = instanceId;
- }
+ @XmlElement(name = "instanceId")
+ public String getId()
+ {
+ return id;
+ }
- @XmlElement(name = "parentId")
- public long getDefinitionId()
- {
- return definitionId;
- }
+ public void setId(String id)
+ {
+ this.id = id;
+ }
- public void setDefinitionId(long definitionId)
- {
- this.definitionId = definitionId;
- }
+ @XmlElement(name = "definitionId")
+ public String getDefinitionId()
+ {
+ return definitionId;
+ }
- @XmlElement(name = "key")
- public String getKey()
- {
- return key !=null ? key : "";
- }
+ public void setDefinitionId(String definitionId)
+ {
+ this.definitionId = definitionId;
+ }
- public void setKey(String key)
- {
- this.key = key;
- }
+ @XmlElement(name = "key")
+ public String getKey()
+ {
+ return key !=null ? key : "";
+ }
- @XmlElement(name = "status")
- public STATE getState()
- {
- return this.lifecycle.getState();
- }
+ public void setKey(String key)
+ {
+ this.key = key;
+ }
- public void setState(String nextState)
- {
- setState(STATE.valueOf(nextState));
- }
+ @XmlElement(name = "status")
+ public STATE getState()
+ {
+ return this.lifecycle.getState();
+ }
- public void setState(STATE nextState)
- {
- this.lifecycle = this.lifecycle.transitionTo(nextState);
- }
+ public void setState(String nextState)
+ {
+ setState(STATE.valueOf(nextState));
+ }
- @XmlElement(name = "start")
- public Date getStartDate()
- {
- return startDate;
- }
+ public void setState(STATE nextState)
+ {
+ this.lifecycle = this.lifecycle.transitionTo(nextState);
+ }
- public void setStartDate(Date startDate)
- {
- this.startDate = startDate;
- }
+ @XmlElement(name = "start")
+ public Date getStartDate()
+ {
+ return startDate;
+ }
- @XmlElement(name = "end")
- public Date getEndDate()
- {
- return endDate;
- }
+ public void setStartDate(Date startDate)
+ {
+ this.startDate = startDate;
+ }
- public void setEndDate(Date endDate)
- {
- this.endDate = endDate;
- }
+ @XmlElement(name = "end")
+ public Date getEndDate()
+ {
+ return endDate;
+ }
- public boolean isRunning()
- {
- return this.startDate!=null && !isSuspended();
- }
+ public void setEndDate(Date endDate)
+ {
+ this.endDate = endDate;
+ }
- public boolean hasEnded()
- {
- return this.startDate!=null
+ public boolean isRunning()
+ {
+ return this.startDate!=null && !isSuspended();
+ }
+
+ public boolean hasEnded()
+ {
+ return this.startDate!=null
&& this.endDate!=null;
- }
+ }
- public boolean isSuspended()
- {
- return null==this.endDate && suspended;
- }
-
- private class Lifecycle
- {
- private STATE current;
- private ProcessInstanceRef instance;
+ public boolean isSuspended()
+ {
+ return null==this.endDate && suspended;
+ }
- public Lifecycle(ProcessInstanceRef instance, STATE current)
- {
- this.instance = instance;
- this.current = current;
- }
+ private class Lifecycle
+ {
+ private STATE current;
+ private ProcessInstanceRef instance;
- public Lifecycle transitionTo(STATE next)
- {
- Lifecycle nextLifecycle = null;
+ public Lifecycle(ProcessInstanceRef instance, STATE current)
+ {
+ this.instance = instance;
+ this.current = current;
+ }
- switch(next)
- {
- case SUSPENDED: // only RUNNING instances can be SUSPENDED
- if(STATE.RUNNING.equals(current))
- {
- nextLifecycle = new Lifecycle(instance, next);
- instance.suspended = true;
- break;
- }
- else
- {
- throw new IllegalTransitionException(current, next);
- }
- case ENDED: // both RUNNING and SUSPENDED instances can be ENDED
- if(STATE.RUNNING.equals(current) || STATE.SUSPENDED.equals(current))
- {
- nextLifecycle = new Lifecycle(instance, next);
- instance.suspended = false;
- instance.endDate = new Date();
- break;
- }
- else
- {
- throw new IllegalTransitionException(current, next);
- }
- case RUNNING: // only SUSPENDED instances can become RUNNING
- if(STATE.SUSPENDED.equals(current))
- {
- nextLifecycle = new Lifecycle(instance, next);
- instance.suspended = false;
- break;
- }
- else
- {
- throw new IllegalTransitionException(current, next);
- }
- default:
- throw new IllegalTransitionException(current, next);
- }
+ public Lifecycle transitionTo(STATE next)
+ {
+ Lifecycle nextLifecycle = null;
- return nextLifecycle;
- }
-
- public STATE getState()
+ switch(next)
{
- return current;
+ case SUSPENDED: // only RUNNING instances can be SUSPENDED
+ if(STATE.RUNNING.equals(current))
+ {
+ nextLifecycle = new Lifecycle(instance, next);
+ instance.suspended = true;
+ break;
+ }
+ else
+ {
+ throw new IllegalTransitionException(current, next);
+ }
+ case ENDED: // both RUNNING and SUSPENDED instances can be ENDED
+ if(STATE.RUNNING.equals(current) || STATE.SUSPENDED.equals(current))
+ {
+ nextLifecycle = new Lifecycle(instance, next);
+ instance.suspended = false;
+ instance.endDate = new Date();
+ break;
+ }
+ else
+ {
+ throw new IllegalTransitionException(current, next);
+ }
+ case RUNNING: // only SUSPENDED instances can become RUNNING
+ if(STATE.SUSPENDED.equals(current))
+ {
+ nextLifecycle = new Lifecycle(instance, next);
+ instance.suspended = false;
+ break;
+ }
+ else
+ {
+ throw new IllegalTransitionException(current, next);
+ }
+ default:
+ throw new IllegalTransitionException(current, next);
}
+ return nextLifecycle;
+ }
- public boolean equals(Object o)
- {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
+ public STATE getState()
+ {
+ return current;
+ }
- Lifecycle lifecycle = (Lifecycle) o;
- if (current != lifecycle.current) return false;
+ public boolean equals(Object o)
+ {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
- return true;
- }
+ Lifecycle lifecycle = (Lifecycle) o;
- public int hashCode()
- {
- int result;
- result = (current != null ? current.hashCode() : 0);
- return result;
- }
- }
+ if (current != lifecycle.current) return false;
- private class IllegalTransitionException extends IllegalArgumentException
- {
+ return true;
+ }
- public IllegalTransitionException(STATE current, STATE next)
- {
- super("Illegal transition current " + current + " next " + next);
- }
- }
+ public int hashCode()
+ {
+ int result;
+ result = (current != null ? current.hashCode() : 0);
+ return result;
+ }
+ }
- public TokenReference getRootToken()
- {
- return rootToken;
- }
+ private class IllegalTransitionException extends IllegalArgumentException
+ {
- public void setRootToken(TokenReference rootToken)
- {
- this.rootToken = rootToken;
- }
+ public IllegalTransitionException(STATE current, STATE next)
+ {
+ super("Illegal transition current " + current + " next " + next);
+ }
+ }
- // it's actually just used for unmarshalling, TODO: fix it
- public void setSuspended(boolean suspended)
- {
- this.suspended = suspended;
- initLifecycle();
- }
+ public TokenReference getRootToken()
+ {
+ return rootToken;
+ }
- public boolean equals(Object o)
- {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
+ public void setRootToken(TokenReference rootToken)
+ {
+ this.rootToken = rootToken;
+ }
- ProcessInstanceRef that = (ProcessInstanceRef) o;
+ // it's actually just used for unmarshalling, TODO: fix it
+ public void setSuspended(boolean suspended)
+ {
+ this.suspended = suspended;
+ initLifecycle();
+ }
- if (instanceId != that.instanceId) 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;
- if (lifecycle != null ? !lifecycle.equals(that.lifecycle) : that.lifecycle != null) return false;
- if (rootToken != null ? !rootToken.equals(that.rootToken) : that.rootToken != null) return false;
- if (startDate != null ? !startDate.toString().equals(that.startDate.toString()) : that.startDate != null) return false;
- return true;
- }
+ public boolean equals(Object o)
+ {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
- public int hashCode()
- {
- int result;
- result = (int) (instanceId ^ (instanceId >>> 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);
- result = 31 * result + (suspended ? 1 : 0);
- result = 31 * result + (lifecycle != null ? lifecycle.hashCode() : 0);
- result = 31 * result + (rootToken != null ? rootToken.hashCode() : 0);
- return result;
- }
+ ProcessInstanceRef that = (ProcessInstanceRef) o;
+
+ if (definitionId != null ? !definitionId.equals(that.definitionId) : that.definitionId != null) return false;
+ if (id != null ? !id.equals(that.id) : that.id != null) return false;
+ if (key != null ? !key.equals(that.key) : that.key != null) return false;
+
+ return true;
+ }
+
+ public int hashCode()
+ {
+ int result;
+ result = (id != null ? id.hashCode() : 0);
+ result = 31 * result + (definitionId != null ? definitionId.hashCode() : 0);
+ result = 31 * result + (key != null ? key.hashCode() : 0);
+ return result;
+ }
}
Modified: projects/gwt-console/trunk/server/gwt-server.iml
===================================================================
--- projects/gwt-console/trunk/server/gwt-server.iml 2009-02-12 09:19:18 UTC (rev 3848)
+++ projects/gwt-console/trunk/server/gwt-server.iml 2009-02-12 13:19:13 UTC (rev 3849)
@@ -11,6 +11,8 @@
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="gwt-parent" />
+ <orderEntry type="module" module-name="gwt-rpc" />
+ <orderEntry type="module" module-name="gwt-server-integration" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: org.slf4j:slf4j-simple:jar:1.5.2:compile">
<CLASSES>
Modified: projects/gwt-console/trunk/server/pom.xml
===================================================================
--- projects/gwt-console/trunk/server/pom.xml 2009-02-12 09:19:18 UTC (rev 3848)
+++ projects/gwt-console/trunk/server/pom.xml 2009-02-12 13:19:13 UTC (rev 3849)
@@ -24,12 +24,6 @@
<!-- Module -->
<dependency>
<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>
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-12 09:19:18 UTC (rev 3848)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java 2009-02-12 13:19:13 UTC (rev 3849)
@@ -21,11 +21,7 @@
*/
package org.jboss.bpm.console.server;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
+import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import org.apache.commons.logging.Log;
@@ -77,7 +73,7 @@
@Produces("application/json")
public Response removeDefinitionsJSON(
@PathParam("id")
- long processId
+ String processId
)
{
ProcessDefinitionRefWrapper wrapper =
@@ -90,7 +86,7 @@
@Produces("application/json")
public Response getInstancesJSON(
@PathParam("id")
- long processId
+ String processId
)
{
@@ -104,11 +100,20 @@
@Produces("application/json")
public Response newInstance(
@PathParam("id")
- long processId)
+ String processId)
{
- ProcessInstanceRef instance = getProcessManagement().newInstance(processId);
- return createJsonResponse(instance);
+ ProcessInstanceRef instance = null;
+ try
+ {
+ instance = getProcessManagement().newInstance(processId);
+ return createJsonResponse(instance);
+ }
+ catch (Throwable t)
+ {
+ throw new WebApplicationException(t, 500);
+ }
+
}
@POST
@@ -116,7 +121,7 @@
@Produces("application/json")
public Response changeState(
@PathParam("id")
- long instanceId,
+ String instanceId,
@PathParam("next")
String next)
{
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-12 09:19:18 UTC (rev 3848)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/TestFacade.java 2009-02-12 13:19:13 UTC (rev 3849)
@@ -83,7 +83,7 @@
if(pd.getName().equals("GWT_Test_Harness"))
{
log.info("Remove test harness " +pd);
- getProcessManagement().removeProcessDefinition(pd.getProcessId());
+ getProcessManagement().removeProcessDefinition(pd.getId());
}
}
return Response.ok().build();
Modified: projects/gwt-console/trunk/server/src/main/webapp/index.html
===================================================================
--- projects/gwt-console/trunk/server/src/main/webapp/index.html 2009-02-12 09:19:18 UTC (rev 3848)
+++ projects/gwt-console/trunk/server/src/main/webapp/index.html 2009-02-12 13:19:13 UTC (rev 3849)
@@ -58,7 +58,7 @@
<tr>
<td>GET</td>
- <td><a href="/gwt-console-server/rs/user/roles?roleCheck=admin,user">/rs/user/roles?roleCheck=a,b,c</a></td>
+ <td><a href="/gwt-console-server/rs/identity/user/roles?roleCheck=admin,user">/rs/identity/user/roles?roleCheck=a,b,c</a></td>
<td>A list of assigned roles matching the query parameter (Comma seperated list)</td>
<td>application/json</td>
</tr>
Modified: projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/BaseTC.java
===================================================================
--- projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/BaseTC.java 2009-02-12 09:19:18 UTC (rev 3848)
+++ projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/BaseTC.java 2009-02-12 13:19:13 UTC (rev 3849)
@@ -150,7 +150,7 @@
protected ProcessInstanceRef createNewProcessInstance()
throws Exception
{
- String resource = "/process/definitions/"+testDeploymentRef.getProcessId()+"/instances/new";
+ String resource = "/process/definitions/"+testDeploymentRef.getId()+"/instances/new";
String response = HTTP.post(SERVER_URL + resource, EMPTY, DEFAULT_CREDENTIALS);
// ------- New instance
@@ -163,7 +163,7 @@
protected ProcessInstanceRefWrapper getInstanceList(ProcessDefinitionRef def)
{
String listResponse = HTTP.get(
- SERVER_URL + "/process/definitions/"+def.getProcessId()+"/instances",
+ SERVER_URL + "/process/definitions/"+def.getId()+"/instances",
DEFAULT_CREDENTIALS
);
@@ -171,14 +171,14 @@
return instanceList;
}
- protected ProcessInstanceRef getInstance(ProcessDefinitionRef definitionRef, long instanceId)
+ protected ProcessInstanceRef getInstance(ProcessDefinitionRef definitionRef, String instanceId)
{
ProcessInstanceRef match = null;
ProcessInstanceRefWrapper list = getInstanceList(definitionRef);
for(ProcessInstanceRef i : list.getInstances())
{
- if(i.getInstanceId() == instanceId)
+ if(i.getId().equals(instanceId))
{
match = i;
break;
Modified: projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/ProcessManagementTest.java
===================================================================
--- projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/ProcessManagementTest.java 2009-02-12 09:19:18 UTC (rev 3848)
+++ projects/gwt-console/trunk/server/src/test/java/org/jboss/bpm/console/server/ProcessManagementTest.java 2009-02-12 13:19:13 UTC (rev 3849)
@@ -69,7 +69,7 @@
// ------- Suspend it
newInstanceRef.setState(ProcessInstanceRef.STATE.SUSPENDED);
- HTTP.post(SERVER_URL + "/process/instances/" + newInstanceRef.getInstanceId() + "/state/" + newInstanceRef.getState(), EMPTY, DEFAULT_CREDENTIALS);
+ HTTP.post(SERVER_URL + "/process/instances/" + newInstanceRef.getId() + "/state/" + newInstanceRef.getState(), EMPTY, DEFAULT_CREDENTIALS);
// ------- Verify
@@ -92,7 +92,7 @@
// end and verify
newInstanceRef.setState(ProcessInstanceRef.STATE.ENDED);
- HTTP.post(SERVER_URL + "/process/instances/" + newInstanceRef.getInstanceId() + "/state/" + newInstanceRef.getState(), EMPTY, DEFAULT_CREDENTIALS);
+ HTTP.post(SERVER_URL + "/process/instances/" + newInstanceRef.getId() + "/state/" + newInstanceRef.getState(), EMPTY, DEFAULT_CREDENTIALS);
// refresh instance list
instanceList = getInstanceList(testDeploymentRef);
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-12 09:19:18 UTC (rev 3848)
+++ projects/gwt-console/trunk/server-integration/src/main/java/org/jboss/bpm/console/server/integration/ProcessManagement.java 2009-02-12 13:19:13 UTC (rev 3849)
@@ -36,17 +36,17 @@
{
List<ProcessDefinitionRef> getProcessDefinitions();
- ProcessDefinitionRef getProcessDefinition(long procDefId);
+ ProcessDefinitionRef getProcessDefinition(String definitionId);
- List<ProcessDefinitionRef> removeProcessDefinition(long procDefId);
+ List<ProcessDefinitionRef> removeProcessDefinition(String definitionId);
- List<ProcessInstanceRef> getProcessInstances(long procDefId);
+ List<ProcessInstanceRef> getProcessInstances(String definitionId);
- ProcessInstanceRef getProcessInstance(long procId);
+ ProcessInstanceRef getProcessInstance(String instanceId);
- ProcessInstanceRef newInstance(long procDefId);
+ ProcessInstanceRef newInstance(String instanceId);
- void setProcessState(long procId, STATE nextState);
+ void setProcessState(String instanceId, STATE nextState);
void signalToken(long tokenId, String signal);
Modified: projects/gwt-console/trunk/war/gwt-war.iml
===================================================================
--- projects/gwt-console/trunk/war/gwt-war.iml 2009-02-12 09:19:18 UTC (rev 3848)
+++ projects/gwt-console/trunk/war/gwt-war.iml 2009-02-12 13:19:13 UTC (rev 3849)
@@ -104,6 +104,7 @@
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module" module-name="gwt-rpc" />
<orderEntryProperties />
</component>
</module>
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-12 09:19:18 UTC (rev 3848)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java 2009-02-12 13:19:13 UTC (rev 3849)
@@ -63,7 +63,7 @@
final ColumnModel columnModel = new ColumnModel(
new ColumnConfig[]
{
- new ColumnConfig("Process ID", "processId", 75, true),
+ new ColumnConfig("Process ID", "id", 75, true),
new ColumnConfig("Name", "name", 300, true, null, "expand"),
new ColumnConfig("Version", "version", 75, true)
}
@@ -75,7 +75,7 @@
{
final RecordDef recordDef = new RecordDef(
new FieldDef[]{
- new IntegerFieldDef("processId"),
+ new StringFieldDef("id"),
new StringFieldDef("name"),
new StringFieldDef("version")
}
@@ -84,7 +84,7 @@
final JsonReader reader = new JsonReader(recordDef);
reader.setRoot("definitions");
reader.setTotalProperty("totalCount");
- reader.setId("processId");
+ reader.setId("id");
return reader;
}
@@ -121,7 +121,7 @@
if ("yes".equals(btnID))
{
ProcessDefinitionRef proc = (ProcessDefinitionRef) row2ProcessMap.get(row);
- String url = view.getUrlBuilder().getRemoveDefinitionURL(proc.getProcessId());
+ String url = view.getUrlBuilder().getRemoveDefinitionURL(proc.getId());
RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url);
try
@@ -166,7 +166,7 @@
int i = 0;
for (Record r : records)
{
- Long id = Long.valueOf(r.getAsString("processId"));
+ String id = r.getAsString("id");
ProcessDefinitionRef pd = new ProcessDefinitionRef(
id,
r.getAsString("name"),
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-12 09:19:18 UTC (rev 3848)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessImageComponent.java 2009-02-12 13:19:13 UTC (rev 3849)
@@ -90,7 +90,7 @@
private void loadActiveNodeInfo()
{
- String url = view.getUrlBuilder().getActiveNodeInfoURL(this.instance.getInstanceId());
+ String url = view.getUrlBuilder().getActiveNodeInfoURL(this.instance.getId());
ConsoleLog.debug("Loading activeNodeInfo: " + url);
JSONRequest.get(url,
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceDetailForm.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceDetailForm.java 2009-02-12 09:19:18 UTC (rev 3848)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceDetailForm.java 2009-02-12 13:19:13 UTC (rev 3849)
@@ -119,7 +119,7 @@
private void persistStateChange()
{
String url = mainView.getUrlBuilder().getStateChangeURL(
- selectedInstance.getInstanceId(), selectedInstance.getState()
+ selectedInstance.getId(), selectedInstance.getState()
);
RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url);
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java 2009-02-12 09:19:18 UTC (rev 3848)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java 2009-02-12 13:19:13 UTC (rev 3849)
@@ -57,7 +57,7 @@
public ProcessInstanceList(ModelModificationCallback callback, ProcessDefinitionRef procDef, String titleName, ApplicationContext view)
{
- super(callback, titleName, view, getResourceUrl(view, procDef.getProcessId()));
+ super(callback, titleName, view, getResourceUrl(view, procDef.getId()));
this.parent = procDef;
}
@@ -69,7 +69,7 @@
public void onExamine(final int row)
{
ProcessInstanceRef instance = row2InstanceMap.get(row);
- String id = ProcessInstanceView.ID + "." + instance.getInstanceId();
+ String id = ProcessInstanceView.ID + "." + instance.getId();
Editor editor = (Editor) ComponentMgr.getComponent(ProcessEditor.ID);
if (editor.hasView(id))
editor.showView(id);
@@ -93,11 +93,11 @@
{
ProcessInstanceRef instance = row2InstanceMap.get(row);
instance.setState(ProcessInstanceRef.STATE.ENDED);
- String url = view.getUrlBuilder().getStateChangeURL(instance.getInstanceId(), instance.getState());
+ String url = view.getUrlBuilder().getStateChangeURL(instance.getId(), instance.getState());
RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url);
try
- {
+ {
rb.sendRequest("",
new RequestCallback()
{
@@ -140,7 +140,7 @@
{
if ("yes".equals(btnID))
{
- String url = view.getUrlBuilder().getStartNewInstanceURL(parent.getProcessId());
+ String url = view.getUrlBuilder().getStartNewInstanceURL(parent.getId());
RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url);
try
@@ -240,8 +240,8 @@
{
final RecordDef recordDef = new RecordDef(
new FieldDef[]{
- new IntegerFieldDef("instanceId"),
- new IntegerFieldDef("parentId"),
+ new StringFieldDef("instanceId"),
+ new StringFieldDef("definitionId"),
new StringFieldDef("key"),
new StringFieldDef("state"),
new DateFieldDef("startDate", UIConstants.DATE_FORMAT),
@@ -258,7 +258,7 @@
return reader;
}
- private static String getResourceUrl(ApplicationContext view, long parentId)
+ private static String getResourceUrl(ApplicationContext view, String parentId)
{
return view.getUrlBuilder().getProcessInstancesURL(parentId);
}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceView.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceView.java 2009-02-12 09:19:18 UTC (rev 3848)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceView.java 2009-02-12 13:19:13 UTC (rev 3849)
@@ -47,13 +47,13 @@
public ProcessInstanceView(final ProcessDefinitionRef proc, final ProcessInstanceRef instance, final ApplicationContext view)
{
super(view);
- this.setId(ID + "." + instance.getInstanceId());
+ this.setId(ID + "." + instance.getId());
this.processDefinition = proc;
this.processInstance = instance;
this.mainView = view;
- this.setTitle("# " + instance.getInstanceId());
+ this.setTitle("# " + instance.getId());
// ----------------------------------
@@ -101,12 +101,12 @@
public String getViewId()
{
- return ID + "." + processInstance.getInstanceId();
+ return ID + "." + processInstance.getId();
}
public String getTitle()
{
- return "#" + processInstance.getInstanceId() + " (" + processDefinition.getName() + ")";
+ return "#" + processInstance.getId() + " (" + processDefinition.getName() + ")";
}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java 2009-02-12 09:19:18 UTC (rev 3848)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java 2009-02-12 13:19:13 UTC (rev 3849)
@@ -134,7 +134,7 @@
final RecordDef recordDef = new RecordDef(
new FieldDef[]{
- new IntegerFieldDef("processId"),
+ new IntegerFieldDef("id"),
new StringFieldDef("name"),
new StringFieldDef("version")
}
@@ -143,7 +143,7 @@
final JsonReader reader = new JsonReader(recordDef);
reader.setRoot("definitions");
reader.setTotalProperty("totalCount");
- reader.setId("processId");
+ reader.setId("id");
DataProxy dataProxy = new ScriptTagProxy(
appContext.getUrlBuilder().getProcessDefinitionsURL(), 1000 * 10);
Modified: projects/gwt-console/trunk/war/src/main/resources/jmaki/xhp/xhp.json
===================================================================
--- projects/gwt-console/trunk/war/src/main/resources/jmaki/xhp/xhp.json 2009-02-12 09:19:18 UTC (rev 3848)
+++ projects/gwt-console/trunk/war/src/main/resources/jmaki/xhp/xhp.json 2009-02-12 13:19:13 UTC (rev 3849)
@@ -4,8 +4,8 @@
{"id": "default",
"url":"http://localhost:8080/gwt-console-server",
"passthrough":true,
- "username":"manager",
- "password":"manager"
+ "username":"admin",
+ "password":"admin"
},
{"id": "birt",
"url":"http://localhost:8080/report",
Modified: projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestDTOParser.java
===================================================================
--- projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestDTOParser.java 2009-02-12 09:19:18 UTC (rev 3848)
+++ projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestDTOParser.java 2009-02-12 13:19:13 UTC (rev 3849)
@@ -46,7 +46,7 @@
public void testTaskRefParsing()
{
- String json = "{\"tasks\":[{\"id\":14,\"tokenId\":6,\"processInstanceId\":4,\"processId\":2,\"name\":\"manager evaluation\",\"actor\":\"manager\",\"isBlocking\":false,\"isSignalling\":true,\"transitionNames\":[\"reject\",\"approve\"],\"pooledActors\":[\"hr\",\"sales\"]}]}";
+ String json = "{\"tasks\":[{\"id\":14,\"tokenId\":6,\"processInstanceId\":4,\"id\":2,\"name\":\"manager evaluation\",\"actor\":\"manager\",\"isBlocking\":false,\"isSignalling\":true,\"transitionNames\":[\"reject\",\"approve\"],\"pooledActors\":[\"hr\",\"sales\"]}]}";
List<TaskRef> result = DTOParser.parseTaskReferenceList(json);
assertTrue("Failed to parse TaskReferenceList", result.size()==1);
assertTrue("Failed to parse transitionNames", result.get(0).getTransitionNames().size()==2);
More information about the jbpm-commits
mailing list