[jbpm-commits] JBoss JBPM SVN: r5119 - in projects/gwt-console/trunk: gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Jun 25 07:45:04 EDT 2009


Author: heiko.braun at jboss.com
Date: 2009-06-25 07:45:04 -0400 (Thu, 25 Jun 2009)
New Revision: 5119

Modified:
   projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java
   projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDetailView.java
   projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateDefinitionsAction.java
   projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
   projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java
Log:
Add definition status

Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java	2009-06-25 10:12:15 UTC (rev 5118)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java	2009-06-25 11:45:04 UTC (rev 5119)
@@ -99,31 +99,6 @@
           )
       );
 
-     /*
-     drools currently doesn't use it and jbpm uses the DeploymentEditor
-     
-     toolBar.addSeparator();
-
-      toolBar.add(
-          new ToolButton("Delete", new ClickListener() {
-            public void onClick(Widget sender) {
-              // force loading
-              ProcessDefinitionRef definitionRef = getSelection();
-              if(definitionRef!=null)
-              {
-                controller.handleEvent(
-                    new Event(DeleteDefinitionAction.ID, definitionRef)
-                );
-              }
-              else
-              {
-                MessageBox.alert("Missing selection", "Please select a process definition");
-              }
-            }
-          }
-          )
-      );  */
-
       toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
 
       this.definitionList.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
@@ -150,7 +125,7 @@
     final ListBox<ProcessDefinitionRef> listBox =
         new ListBox<ProcessDefinitionRef>(
             new String[] {
-                "Process ID", "Version", "Name"}
+                "Process ID", "Version", "Name", "Suspended"}
         );
 
 
@@ -167,6 +142,9 @@
           case 2:
             listBox.setText(row, column, item.getName());
             break;
+           case 3:
+            listBox.setText(row, column, String.valueOf(item.isSuspended()));
+            break;
           default:
             throw new RuntimeException("Unexpected column size");
         }

Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDetailView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDetailView.java	2009-06-25 10:12:15 UTC (rev 5118)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDetailView.java	2009-06-25 11:45:04 UTC (rev 5119)
@@ -32,6 +32,7 @@
 import org.jboss.bpm.console.client.common.PropertyGrid;
 import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
 import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.ServerPlugins;
 
 /**
  * @author Heiko.Braun <heiko.braun at jboss.com>
@@ -48,13 +49,15 @@
 
   private DeploymentPanel deploymentPanel;
 
+  private boolean showDeployment;
+
   public ProcessDetailView()
   {
     super("Process details");
-    super.setStyleName("bpm-detail-panel");
-
+    super.setStyleName("bpm-detail-panel");    
+    
     grid = new PropertyGrid(
-        new String[] {"ID:", "Key:", "Name:", "Package:", "Description:"}
+        new String[] {"ID:", "Key:", "Name:", "Suspended:", "Package:", "Description:"}
     );
 
 
@@ -62,16 +65,19 @@
     final DeckLayoutPanel deck = new DeckLayoutPanel();
     deck.add(grid);
 
-    // deployment info
-    deploymentPanel = new DeploymentPanel();
-
-    deck.add(deploymentPanel);
-
     // selection
     final com.google.gwt.user.client.ui.ListBox dropBox = new com.google.gwt.user.client.ui.ListBox(false);
     dropBox.setStyleName("bpm-operation-ui");
     dropBox.addItem("Properties");
-    dropBox.addItem("Deployment");
+
+    // deployment info
+    if(ServerPlugins.has("org.jboss.bpm.console.server.plugin.DeploymentPlugin"))
+    {
+      dropBox.addItem("Deployment");
+      deploymentPanel = new DeploymentPanel();
+      deck.add(deploymentPanel);
+    }
+
     dropBox.addChangeListener(new ChangeListener() {
       public void onChange(Widget sender) {
         deck.showWidget(dropBox.getSelectedIndex());
@@ -102,6 +108,7 @@
         process.getId(),
         process.getKey(),
         process.getName(),
+        String.valueOf(process.isSuspended()),
         process.getPackageName(),
         process.getDescription()
     };

Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateDefinitionsAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateDefinitionsAction.java	2009-06-25 10:12:15 UTC (rev 5118)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/UpdateDefinitionsAction.java	2009-06-25 11:45:04 UTC (rev 5119)
@@ -66,13 +66,15 @@
 
   public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
   {
-    JSONValue json = JSONParser.parse(response.getText());
-    List<ProcessDefinitionRef> definitions = DTOParser.parseProcessDefinitions(json);
-
     DefinitionListView view = (DefinitionListView) controller.getView(DefinitionListView.ID);
-    view.update(definitions);
+    if(view!=null) // may not be initialized (lazy)
+    {
+      JSONValue json = JSONParser.parse(response.getText());
+      List<ProcessDefinitionRef> definitions = DTOParser.parseProcessDefinitions(json);
 
-    ConsoleLog.info("Loaded " + definitions.size() + " process definitions");
+      view.update(definitions);
 
+      ConsoleLog.info("Loaded " + definitions.size() + " process definitions");
+    }
   }
 }

Modified: projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
===================================================================
--- projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java	2009-06-25 10:12:15 UTC (rev 5118)
+++ projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java	2009-06-25 11:45:04 UTC (rev 5119)
@@ -53,10 +53,12 @@
     String id = JSONWalk.on(root).next("id").asString();
     Long version = JSONWalk.on(root).next("version").asLong();
     String name = JSONWalk.on(root).next("name").asString();
+    boolean isSuspended = JSONWalk.on(root).next("suspended").asBool();
 
     String dplId = JSONWalk.on(root).next("deploymentId").asString();
     ProcessDefinitionRef ref = new ProcessDefinitionRef(id, name, version);
     ref.setDeploymentId(dplId);
+    ref.setSuspended(isSuspended);
     return ref;
   }
 

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-06-25 10:12:15 UTC (rev 5118)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionRef.java	2009-06-25 11:45:04 UTC (rev 5119)
@@ -39,7 +39,8 @@
   private String packageName;
 
   private String deploymentId;
-  
+  private boolean suspended;
+
   public ProcessDefinitionRef()
   {
   }
@@ -128,6 +129,16 @@
     this.deploymentId = deploymentId;
   }
 
+  public boolean isSuspended()
+  {
+    return suspended;
+  }
+
+  public void setSuspended(boolean suspended)
+  {
+    this.suspended = suspended;
+  }
+
   public boolean equals(Object o)
   {
     if (this == o) return true;




More information about the jbpm-commits mailing list