[jbpm-commits] JBoss JBPM SVN: r5076 - in jbpm4/trunk/modules/integration/console/src/main: resources/META-INF/services and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Jun 22 09:50:05 EDT 2009


Author: heiko.braun at jboss.com
Date: 2009-06-22 09:50:05 -0400 (Mon, 22 Jun 2009)
New Revision: 5076

Added:
   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:
DeploymentPlugin for the console, first cut

Added: 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	                        (rev 0)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/DeploymentPluginImpl.java	2009-06-22 13:50:05 UTC (rev 5076)
@@ -0,0 +1,84 @@
+/*
+ * 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.Deployment;
+import org.jbpm.api.RepositoryService;
+import org.jbpm.api.DeploymentQuery;
+import org.jbpm.api.env.Environment;
+import org.jbpm.api.env.EnvironmentFactory;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun at 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)
+      {
+        results.add( ModelAdaptor.adoptDeployment(dpl) );
+      }
+
+      return results;
+    }
+    finally
+    {
+      env.close();
+    }
+
+
+  }
+
+  public void deleteDeployment(String id)
+  {
+
+  }
+
+  public void setSuspended(String id, boolean isSuspended)
+  {
+
+  }
+}

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-22 13:40:41 UTC (rev 5075)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java	2009-06-22 13:50:05 UTC (rev 5076)
@@ -21,25 +21,21 @@
  */
 package org.jbpm.integration.console;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
-
-import org.jboss.bpm.console.client.model.ParticipantRef;
-import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
-import org.jboss.bpm.console.client.model.ProcessInstanceRef;
-import org.jboss.bpm.console.client.model.TaskRef;
-import org.jboss.bpm.console.client.model.TokenReference;
-import org.jbpm.api.Execution;
+import org.jboss.bpm.console.client.model.*;
+import org.jbpm.api.Deployment;
 import org.jbpm.api.ProcessDefinition;
-import org.jbpm.api.model.OpenExecution;
 import org.jbpm.api.model.Transition;
 import org.jbpm.api.task.Participation;
 import org.jbpm.api.task.Task;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.repository.DeploymentImpl;
 import org.jbpm.pvm.internal.task.TaskImpl;
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+
 /**
  * @author Heiko.Braun <heiko.braun at jboss.com>
  */
@@ -165,4 +161,14 @@
     
     return task;
   }
+
+  public static DeploymentRef adoptDeployment(Deployment dpl)
+  {
+    DeploymentImpl d0 = (DeploymentImpl)dpl;
+    DeploymentRef dRef = new DeploymentRef(
+        String.valueOf(dpl.getDbid()), d0.isSuspended() 
+    );
+
+    return dRef; 
+  }
 }

Added: 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	                        (rev 0)
+++ jbpm4/trunk/modules/integration/console/src/main/resources/META-INF/services/org.jboss.bpm.console.server.plugin.DeploymentPlugin	2009-06-22 13:50:05 UTC (rev 5076)
@@ -0,0 +1 @@
+org.jbpm.integration.console.DeploymentPluginImpl
\ No newline at end of file




More information about the jbpm-commits mailing list