[jbpm-commits] JBoss JBPM SVN: r5116 - projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Jun 25 05:51:41 EDT 2009


Author: heiko.braun at jboss.com
Date: 2009-06-25 05:51:41 -0400 (Thu, 25 Jun 2009)
New Revision: 5116

Modified:
   projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/UpdateDeploymentsAction.java
Log:
DeploymentEditor is optional. Handle gracefully

Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/UpdateDeploymentsAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/UpdateDeploymentsAction.java	2009-06-25 09:46:53 UTC (rev 5115)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/UpdateDeploymentsAction.java	2009-06-25 09:51:41 UTC (rev 5116)
@@ -37,7 +37,7 @@
 
 /**
  * Updates a list of deployment and can optionally select a particular one.
- * 
+ *
  * @author Heiko.Braun <heiko.braun at jboss.com>
  */
 public class UpdateDeploymentsAction extends AbstractRESTAction
@@ -69,26 +69,31 @@
   public void handleSuccessfulResponse(
       final Controller controller, final Object event, Response response)
   {
-    JSONValue json = JSONParser.parse(response.getText());
-    List<DeploymentRef> deployments = DTOParser.parseDeploymentRefList(json);
-
     DeploymentListView view = (DeploymentListView)controller.getView(DeploymentListView.ID);
-    if(null==view)
-      throw new RuntimeException("View not initialzed: " + DeploymentListView.ID);
-    
-    view.update(deployments);
 
-    // optional
-    String deploymentId = (String)event;
-    if(deploymentId!=null)
+    // deployment could be disabled
+    if(view!=null)
     {
-      System.out.println("activate " + deploymentId);
-      view.select(deploymentId);
+      JSONValue json = JSONParser.parse(response.getText());
+      List<DeploymentRef> deployments = DTOParser.parseDeploymentRefList(json);
+
+      if(null==view)
+        throw new RuntimeException("View not initialized: " + DeploymentListView.ID);
+
+      view.update(deployments);
+
+      // optional
+      String deploymentId = (String)event;
+      if(deploymentId!=null)
+      {
+        System.out.println("activate " + deploymentId);
+        view.select(deploymentId);
+      }
+
+      // refresh process definitions
+      controller.handleEvent(
+          new Event(UpdateDefinitionsAction.ID, null)
+      );
     }
-
-    // refresh process definitions
-    controller.handleEvent(
-        new Event(UpdateDefinitionsAction.ID, null)
-    );
   }
 }




More information about the jbpm-commits mailing list