Author: heiko.braun(a)jboss.com
Date: 2008-10-10 08:01:01 -0400 (Fri, 10 Oct 2008)
New Revision: 2527
Modified:
jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/dao/internal/MockProcessDAO.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java
Log:
Implement remove process instance on MockProcessDAO
Modified:
jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/dao/internal/MockProcessDAO.java
===================================================================
---
jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/dao/internal/MockProcessDAO.java 2008-10-10
11:41:39 UTC (rev 2526)
+++
jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/dao/internal/MockProcessDAO.java 2008-10-10
12:01:01 UTC (rev 2527)
@@ -81,21 +81,8 @@
public List<ProcessDefinition> removeProcessDefinition(long processId)
{
- /*List<ProcessDefinition> updatedList = new
ArrayList<ProcessDefinition>();
- boolean match = false;
- for(ProcessDefinition pd : defs)
- {
- if(processId != pd.getProcessId())
- updatedList.add(pd);
- else
- match = true;
- }
+ System.out.println("Remove definition " + processId);
- if(!match)
- throw new IllegalArgumentException("No process with id " +
processId);
-
- return updatedList;*/
-
ProcessDefinition toBeRemoved = null;
for(ProcessDefinition pd : defs)
{
@@ -116,22 +103,23 @@
return instances;
}
-
public List<ProcessInstance> removeProcessInstance(long instanceId)
{
- List<ProcessInstance> updatedList = new ArrayList<ProcessInstance>();
- boolean match = false;
- for(ProcessInstance i : instances)
+
+ System.out.println("Remove instance " + instanceId);
+
+ ProcessInstance toBeRemoved = null;
+ for(ProcessInstance instance : instances)
{
- if(instanceId != i.getId())
- updatedList.add(i);
- else
- match = true;
+ if(instanceId == instance.getId())
+ toBeRemoved = instance;
}
- if(!match)
- throw new IllegalArgumentException("No instance with id " +
instanceId);
+ if(null==toBeRemoved)
+ throw new IllegalArgumentException("No process with id " +
instanceId);
+ else
+ instances.remove(toBeRemoved);
- return updatedList;
+ return instances;
}
}
Modified:
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java
===================================================================
---
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java 2008-10-10
11:41:39 UTC (rev 2526)
+++
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java 2008-10-10
12:01:01 UTC (rev 2527)
@@ -78,7 +78,7 @@
{
if("yes".equals( btnID) )
{
- ProcessInstance instance =
(ProcessInstance)row2InstanceMap.get(row);
+ ProcessInstance instance = row2InstanceMap.get(row);
String url =
view.getConfig().getRemoveInstanceURL(instance.getId());
RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url);
Modified:
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java
===================================================================
---
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java 2008-10-10
11:41:39 UTC (rev 2526)
+++
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java 2008-10-10
12:01:01 UTC (rev 2527)
@@ -53,7 +53,7 @@
private Store store;
private PagingToolbar pagingToolbar;
- boolean storeInit = false;
+ private boolean storeInit = false;
public RemoteListView(String titleName, ConsoleView view, String resourceUrl)
{
@@ -194,7 +194,6 @@
*/
public void onLoad(Store store, Record[] records)
{
- System.out.println("onLoad");
onRecordsLoaded(records);
if(!storeInit)
@@ -206,13 +205,6 @@
containerPanel.doLayout();
}
-
- public void onDataChanged(Store store)
- {
- super.onDataChanged(store);
- System.out.println("onDataChanged");
- }
-
public void onLoadException(Throwable throwable)
{
throwable.printStackTrace(System.out);