JBoss JBPM SVN: r5116 - projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment.
by do-not-reply@jboss.org
Author: heiko.braun(a)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(a)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)
- );
}
}
16 years, 10 months
JBoss JBPM SVN: r5115 - in projects/gwt-console/trunk/gui: profiles/jbpm/src/main/resources/org/jboss/bpm/console and 1 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-06-25 05:46:53 -0400 (Thu, 25 Jun 2009)
New Revision: 5115
Added:
projects/gwt-console/trunk/gui/profiles/drools/src/main/resources/org/jboss/bpm/console/workspace.cfg
projects/gwt-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/workspace.cfg
Modified:
projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg
Log:
Create profile specific workspace config
Added: projects/gwt-console/trunk/gui/profiles/drools/src/main/resources/org/jboss/bpm/console/workspace.cfg
===================================================================
--- projects/gwt-console/trunk/gui/profiles/drools/src/main/resources/org/jboss/bpm/console/workspace.cfg (rev 0)
+++ projects/gwt-console/trunk/gui/profiles/drools/src/main/resources/org/jboss/bpm/console/workspace.cfg 2009-06-25 09:46:53 UTC (rev 5115)
@@ -0,0 +1,4 @@
+org.jboss.bpm.console.client.SettingsEditor
+org.jboss.bpm.console.client.process.ProcessEditor
+org.jboss.bpm.console.client.task.TaskEditor
+org.jboss.bpm.console.client.report.ReportEditor
\ No newline at end of file
Added: projects/gwt-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/workspace.cfg
===================================================================
--- projects/gwt-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/workspace.cfg (rev 0)
+++ projects/gwt-console/trunk/gui/profiles/jbpm/src/main/resources/org/jboss/bpm/console/workspace.cfg 2009-06-25 09:46:53 UTC (rev 5115)
@@ -0,0 +1,5 @@
+org.jboss.bpm.console.client.SettingsEditor
+org.jboss.bpm.console.client.process.ProcessEditor
+org.jboss.bpm.console.client.task.TaskEditor
+org.jboss.bpm.console.client.report.ReportEditor
+org.jboss.bpm.console.client.deployment.DeploymentEditor
\ No newline at end of file
Modified: projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg 2009-06-25 09:39:23 UTC (rev 5114)
+++ projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg 2009-06-25 09:46:53 UTC (rev 5115)
@@ -2,4 +2,4 @@
org.jboss.bpm.console.client.process.ProcessEditor
org.jboss.bpm.console.client.task.TaskEditor
org.jboss.bpm.console.client.report.ReportEditor
-org.jboss.bpm.console.client.deployment.DeploymentEditor
\ No newline at end of file
+#org.jboss.bpm.console.client.deployment.DeploymentEditor
\ No newline at end of file
16 years, 10 months
JBoss JBPM SVN: r5114 - jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-06-25 05:39:23 -0400 (Thu, 25 Jun 2009)
New Revision: 5114
Modified:
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java
Log:
Include resources in deployment view
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-25 09:12:46 UTC (rev 5113)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java 2009-06-25 09:39:23 UTC (rev 5114)
@@ -176,6 +176,7 @@
);
String name = d0.getName();
+ dRef.getResourceNames().addAll(d0.getResourceNames());
// strip path info
if(name.indexOf("/")!=-1)
16 years, 10 months
JBoss JBPM SVN: r5113 - in projects/gwt-console/trunk: gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model and 1 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-06-25 05:12:46 -0400 (Thu, 25 Jun 2009)
New Revision: 5113
Modified:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeploymentDetailView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/ResourcePanel.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/DeploymentRef.java
Log:
View deployment resources
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeploymentDetailView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeploymentDetailView.java 2009-06-25 08:51:30 UTC (rev 5112)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeploymentDetailView.java 2009-06-25 09:12:46 UTC (rev 5113)
@@ -133,10 +133,11 @@
deck.add(propLayout);
// resource info
+ ScrollLayoutPanel scrollPanel = new ScrollLayoutPanel();
resourcePanel = new ResourcePanel();
+ scrollPanel.add(resourcePanel);
+ deck.add(scrollPanel);
- deck.add(resourcePanel);
-
// selection
final com.google.gwt.user.client.ui.ListBox dropBox = new com.google.gwt.user.client.ui.ListBox(false);
dropBox.setStyleName("bpm-operation-ui");
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/ResourcePanel.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/ResourcePanel.java 2009-06-25 08:51:30 UTC (rev 5112)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/ResourcePanel.java 2009-06-25 09:12:46 UTC (rev 5113)
@@ -22,9 +22,11 @@
package org.jboss.bpm.console.client.deployment;
import com.mvc4g.client.Controller;
+import com.google.gwt.user.client.ui.HTML;
import org.gwt.mosaic.ui.client.layout.BoxLayout;
import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.gwt.mosaic.ui.client.ScrollLayoutPanel;
import org.jboss.bpm.console.client.common.PropertyGrid;
import org.jboss.bpm.console.client.model.DeploymentRef;
@@ -44,6 +46,8 @@
private boolean initialized;
+ private LayoutPanel resources = new LayoutPanel();
+
public ResourcePanel()
{
super(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
@@ -55,7 +59,10 @@
if(!initialized)
{
this.propGrid = new PropertyGrid(new String[]{"Deployment ID:"});
- this.add(propGrid, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ this.add(propGrid, new BoxLayoutData(BoxLayoutData.FillStyle.VERTICAL));
+ this.add(resources, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
this.initialized = true;
}
}
@@ -69,6 +76,19 @@
{
initialize();
this.currentDeployment = deployment;
+
+ StringBuffer sb = new StringBuffer();
+ sb.append("<ul>");
+ for(String res : deployment.getResourceNames())
+ {
+ sb.append("<li>").append(res);
+ }
+ sb.append("</ul>");
+
+ HTML html = new HTML(sb.toString());
+ resources.clear();
+ resources.add(html);
+
propGrid.update(new String[]{deployment.getId()});
}
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 08:51:30 UTC (rev 5112)
+++ projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2009-06-25 09:12:46 UTC (rev 5113)
@@ -342,14 +342,22 @@
ref.setName(name);
ref.setTimestamp(ts);
- // todo: parse definitions
+ // defintions
JSONArray defArr = JSONWalk.on(item).next("definitions").asArray();
for (int c = 0; c < defArr.size(); c++)
{
String defId = defArr.get(c).isString().stringValue();
ref.getDefinitions().add(defId);
}
-
+
+ // resource names
+ JSONArray resArr = JSONWalk.on(item).next("resourceNames").asArray();
+ for (int c = 0; c < resArr.size(); c++)
+ {
+ String resourceName = resArr.get(c).isString().stringValue();
+ ref.getResourceNames().add(resourceName);
+ }
+
result.add(ref);
}
Modified: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRef.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRef.java 2009-06-25 08:51:30 UTC (rev 5112)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/DeploymentRef.java 2009-06-25 09:12:46 UTC (rev 5113)
@@ -39,6 +39,8 @@
private List<String> definitions = new ArrayList<String>();
+ private List<String> resourceNames = new ArrayList<String>();
+
public DeploymentRef()
{
}
@@ -93,4 +95,9 @@
{
this.timestamp = timestamp;
}
+
+ public List<String> getResourceNames()
+ {
+ return resourceNames;
+ }
}
16 years, 10 months
JBoss JBPM SVN: r5112 - in projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client: deployment and 1 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-06-25 04:51:30 -0400 (Thu, 25 Jun 2009)
New Revision: 5112
Added:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/UpdateDeploymentsAction.java
Removed:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/UpdateDeploymentListAction.java
Modified:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeleteDeploymentAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeploymentEditor.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeploymentListView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/ResumeDeploymentAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/SuspendDeploymentAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/ViewDeploymentAction.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeploymentPanel.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java
Log:
Refresh process definitions when deployments are changed
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2009-06-25 08:41:15 UTC (rev 5111)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2009-06-25 08:51:30 UTC (rev 5112)
@@ -37,7 +37,8 @@
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
import org.jboss.bpm.console.client.util.WindowUtil;
import org.jboss.bpm.console.client.deployment.ViewDeploymentAction;
-import org.jboss.bpm.console.client.deployment.UpdateDeploymentListAction;
+import org.jboss.bpm.console.client.deployment.UpdateDeploymentsAction;
+import org.jboss.bpm.console.client.process.UpdateDefinitionsAction;
/**
* The main composite that assembles the gwt console application.
@@ -118,14 +119,8 @@
// workspace
workspace = createWorkspace();
layoutPanel.add(workspace, new BorderLayoutData(Region.CENTER, false));
+ registerGlobalViewsAndActions();
-
- // register global views and actions, available across editors
- controller.addView(Header.ID, header);
- controller.addAction(LoadingStatusAction.ID, new LoadingStatusAction());
- controller.addAction(ViewDeploymentAction.ID, new ViewDeploymentAction(this));
- controller.addAction(UpdateDeploymentListAction.ID, new UpdateDeploymentListAction(this));
-
// message Panel
final CaptionLayoutPanel messagePanel = createMessagePanel(layoutPanel);
messagePanel.add(Log.getDivLogger().getWidget());
@@ -143,6 +138,19 @@
}
+ /**
+ * Views and actions accessible from any component
+ */
+ private void registerGlobalViewsAndActions()
+ {
+ // register global views and actions, available across editors
+ controller.addView(Header.ID, header);
+ controller.addAction(LoadingStatusAction.ID, new LoadingStatusAction());
+ controller.addAction(ViewDeploymentAction.ID, new ViewDeploymentAction(this));
+ controller.addAction(UpdateDeploymentsAction.ID, new UpdateDeploymentsAction(this));
+ controller.addAction(UpdateDefinitionsAction.ID, new UpdateDefinitionsAction(this));
+ }
+
private CaptionLayoutPanel createMessagePanel(final LayoutPanel layoutPanel)
{
final CaptionLayoutPanel messagePanel = new CaptionLayoutPanel("Messages", true);
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeleteDeploymentAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeleteDeploymentAction.java 2009-06-25 08:41:15 UTC (rev 5111)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeleteDeploymentAction.java 2009-06-25 08:51:30 UTC (rev 5112)
@@ -61,7 +61,7 @@
{
// refresh view
controller.handleEvent(
- new Event(UpdateDeploymentListAction.ID, null)
+ new Event(UpdateDeploymentsAction.ID, null)
);
}
}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeploymentEditor.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeploymentEditor.java 2009-06-25 08:41:15 UTC (rev 5111)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeploymentEditor.java 2009-06-25 08:51:30 UTC (rev 5112)
@@ -95,7 +95,7 @@
registerView(DeploymentListView.ID, new DeploymentListView());
// create and register actions
- controller.addAction(UpdateDeploymentListAction.ID, new UpdateDeploymentListAction(appContext));
+ controller.addAction(UpdateDeploymentsAction.ID, new UpdateDeploymentsAction(appContext));
controller.addAction(UpdateDeploymentDetailAction.ID, new UpdateDeploymentDetailAction());
controller.addAction(DeleteDeploymentAction.ID, new DeleteDeploymentAction(appContext));
controller.addAction(SuspendDeploymentAction.ID, new SuspendDeploymentAction(appContext));
@@ -106,7 +106,7 @@
// force loading
super.controller.handleEvent(
- new Event(UpdateDeploymentListAction.ID, null)
+ new Event(UpdateDeploymentsAction.ID, null)
);
isInitialized = true;
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeploymentListView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeploymentListView.java 2009-06-25 08:41:15 UTC (rev 5111)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/DeploymentListView.java 2009-06-25 08:51:30 UTC (rev 5112)
@@ -36,8 +36,10 @@
import org.jboss.bpm.console.client.common.AbstractView;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
import org.jboss.bpm.console.client.model.DeploymentRef;
+import org.jboss.bpm.console.client.model.util.SimpleDateFormat;
import java.util.List;
+import java.util.Date;
/**
* List of deployments
@@ -57,6 +59,8 @@
private DeploymentRef selection = null;
+ private SimpleDateFormat dateFormat = new SimpleDateFormat();
+
public DeploymentListView()
{
super();
@@ -72,7 +76,7 @@
final ListBox<DeploymentRef> listBox =
new ListBox<DeploymentRef>(
new String[] {
- "ID", "Name", "Suspended"}
+ "ID", "Name", "Timestamp", "Suspended"}
);
@@ -87,6 +91,9 @@
listBox.setText(row, column, item.getName());
break;
case 2:
+ listBox.setText(row, column, dateFormat.format(new Date(item.getTimestamp())));
+ break;
+ case 3:
listBox.setText(row, column, String.valueOf(item.isSuspended()));
break;
default:
@@ -145,7 +152,7 @@
public void onClick(Widget sender) {
// force loading
controller.handleEvent(
- new Event(UpdateDeploymentListAction.ID, null)
+ new Event(UpdateDeploymentsAction.ID, null)
);
}
}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/ResumeDeploymentAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/ResumeDeploymentAction.java 2009-06-25 08:41:15 UTC (rev 5111)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/ResumeDeploymentAction.java 2009-06-25 08:51:30 UTC (rev 5112)
@@ -60,7 +60,7 @@
{
// refresh view
controller.handleEvent(
- new Event(UpdateDeploymentListAction.ID, null)
+ new Event(UpdateDeploymentsAction.ID, null)
);
}
}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/SuspendDeploymentAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/SuspendDeploymentAction.java 2009-06-25 08:41:15 UTC (rev 5111)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/SuspendDeploymentAction.java 2009-06-25 08:51:30 UTC (rev 5112)
@@ -60,7 +60,7 @@
{
// refresh view
controller.handleEvent(
- new Event(UpdateDeploymentListAction.ID, null)
+ new Event(UpdateDeploymentsAction.ID, null)
);
}
}
Deleted: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/UpdateDeploymentListAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/UpdateDeploymentListAction.java 2009-06-25 08:41:15 UTC (rev 5111)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/UpdateDeploymentListAction.java 2009-06-25 08:51:30 UTC (rev 5112)
@@ -1,89 +0,0 @@
-/*
- * 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.jboss.bpm.console.client.deployment;
-
-import org.jboss.bpm.console.client.common.AbstractRESTAction;
-import org.jboss.bpm.console.client.ApplicationContext;
-import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
-import org.jboss.bpm.console.client.model.DTOParser;
-import org.jboss.bpm.console.client.model.DeploymentRef;
-import com.google.gwt.http.client.RequestBuilder;
-import com.google.gwt.http.client.Response;
-import com.google.gwt.json.client.JSONValue;
-import com.google.gwt.json.client.JSONParser;
-import com.mvc4g.client.Controller;
-
-import java.util.List;
-
-/**
- * Updates a list of deployment and can optionally select a particular one.
- *
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class UpdateDeploymentListAction extends AbstractRESTAction
-{
-
- public final static String ID = UpdateDeploymentListAction.class.getName();
-
-
- public UpdateDeploymentListAction(ApplicationContext appContext)
- {
- super(appContext);
- }
-
- public String getId()
- {
- return ID;
- }
-
- public String getUrl(Object event)
- {
- return appContext.getUrlBuilder().getDeploymentsUrl();
- }
-
- public RequestBuilder.Method getRequestMethod()
- {
- return RequestBuilder.GET;
- }
-
- 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)
- {
- System.out.println("activate " + deploymentId);
- view.select(deploymentId);
- }
-
- }
-}
Copied: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/UpdateDeploymentsAction.java (from rev 5097, projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/UpdateDeploymentListAction.java)
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/UpdateDeploymentsAction.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/UpdateDeploymentsAction.java 2009-06-25 08:51:30 UTC (rev 5112)
@@ -0,0 +1,94 @@
+/*
+ * 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.jboss.bpm.console.client.deployment;
+
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.process.UpdateDefinitionsAction;
+import org.jboss.bpm.console.client.model.DTOParser;
+import org.jboss.bpm.console.client.model.DeploymentRef;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.google.gwt.json.client.JSONValue;
+import com.google.gwt.json.client.JSONParser;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+
+import java.util.List;
+
+/**
+ * Updates a list of deployment and can optionally select a particular one.
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class UpdateDeploymentsAction extends AbstractRESTAction
+{
+
+ public final static String ID = UpdateDeploymentsAction.class.getName();
+
+
+ public UpdateDeploymentsAction(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ return appContext.getUrlBuilder().getDeploymentsUrl();
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.GET;
+ }
+
+ 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)
+ {
+ System.out.println("activate " + deploymentId);
+ view.select(deploymentId);
+ }
+
+ // refresh process definitions
+ controller.handleEvent(
+ new Event(UpdateDefinitionsAction.ID, null)
+ );
+ }
+}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/ViewDeploymentAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/ViewDeploymentAction.java 2009-06-25 08:41:15 UTC (rev 5111)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/deployment/ViewDeploymentAction.java 2009-06-25 08:51:30 UTC (rev 5112)
@@ -56,7 +56,7 @@
}
controller.handleEvent(
- new Event(UpdateDeploymentListAction.ID, dplId)
+ new Event(UpdateDeploymentsAction.ID, dplId)
);
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeploymentPanel.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeploymentPanel.java 2009-06-25 08:41:15 UTC (rev 5111)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DeploymentPanel.java 2009-06-25 08:51:30 UTC (rev 5112)
@@ -32,7 +32,6 @@
import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
import org.gwt.mosaic.ui.client.layout.LayoutPanel;
import org.jboss.bpm.console.client.common.PropertyGrid;
-import org.jboss.bpm.console.client.deployment.UpdateDeploymentListAction;
import org.jboss.bpm.console.client.deployment.ViewDeploymentAction;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java 2009-06-25 08:41:15 UTC (rev 5111)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java 2009-06-25 08:51:30 UTC (rev 5112)
@@ -99,7 +99,7 @@
registerView(InstanceListView.ID, new InstanceListView(appContext));
// create and register actions
- registerAction(UpdateDefinitionsAction.ID, new UpdateDefinitionsAction(appContext));
+
registerAction(UpdateInstancesAction.ID, new UpdateInstancesAction(appContext));
registerAction(StartNewInstanceAction.ID, new StartNewInstanceAction(appContext));
registerAction(StateChangeAction.ID, new StateChangeAction(appContext));
16 years, 10 months
JBoss JBPM SVN: r5111 - jbpm4/trunk/modules/api/src/main/java/org/jbpm/api.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-06-25 04:41:15 -0400 (Thu, 25 Jun 2009)
New Revision: 5111
Removed:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/client/
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/cmd/
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/env/
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/session/
Log:
cleaning empty package folders
16 years, 10 months
JBoss JBPM SVN: r5110 - in jbpm4/trunk: modules/distro/src/main/files/jboss and 2 other directories.
by do-not-reply@jboss.org
Author: jeff.yuchang
Date: 2009-06-25 04:31:54 -0400 (Thu, 25 Jun 2009)
New Revision: 5110
Modified:
jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/identity/IdentityTest.java
jbpm4/trunk/pom.xml
jbpm4/trunk/qa/build.xml
Log:
*[JBPM-2172] Update the idm version to 1.0.0.Beta1.
Modified: jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml 2009-06-25 08:23:17 UTC (rev 5109)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml 2009-06-25 08:31:54 UTC (rev 5110)
@@ -22,12 +22,12 @@
<property name="jboss.server.configuration" value="default" />
<property name="jboss.server.config.dir" value="${jboss.home}/server/${jboss.server.configuration}" />
<property name="jboss.server.data.dir" value="${jboss.home}/server/${jboss.server.configuration}/data" />
- <property name="jbossidm.version" value="1.0.0.Alpha8" />
+ <property name="jbossidm.version" value="1.0.0.Beta1" />
<property name="jbossidm.home" value="${jbpm.parent.dir}/jbossidm-${jbossidm.version}" />
<!-- for SNAPSHOT temporarily -->
<property name="jbossidm.distro.url" value="http://repository.jboss.com/maven2/org/jboss/identity/idm/jbossidm/${jbos..." />
- <property name="jbossidm.distro.path" value="${jbpm.parent.dir}/idm-assembly-${jbossidm.version}.zip" />
+ <property name="jbossidm.distro.path" value="${jbpm.parent.dir}/jbossidm-${jbossidm.version}.zip" />
<!-- JDBC PROPERTIES -->
<property file="${user.home}/.jbpm4/jdbc/${database}.properties" />
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/identity/IdentityTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/identity/IdentityTest.java 2009-06-25 08:23:17 UTC (rev 5109)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/identity/IdentityTest.java 2009-06-25 08:31:54 UTC (rev 5110)
@@ -135,9 +135,17 @@
List<User> users = identityService.findUsers();
assertNotNull(users);
- assertEquals(1, users.size());
- User johndoe = users.get(0);
+ User johndoe = null;
+
+ for (User user : users) {
+ if ("johndoe".equals(user.getId())) {
+ johndoe = user;
+ }
+ }
+
+ assertNotNull(johndoe);
+
assertEquals("johndoe", johndoe.getId());
assertEquals("John", johndoe.getGivenName());
assertEquals("Doe", johndoe.getFamilyName());
@@ -145,6 +153,5 @@
identityService.deleteUser("johndoe");
- assertEquals(0, identityService.findUsers().size());
}
}
Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml 2009-06-25 08:23:17 UTC (rev 5109)
+++ jbpm4/trunk/pom.xml 2009-06-25 08:31:54 UTC (rev 5110)
@@ -53,7 +53,7 @@
<slf4j.version>1.5.2</slf4j.version>
<hsqldb.version>1.8.0.7</hsqldb.version>
<izpack.version>4.2.1</izpack.version>
- <jboss.identity.version>1.0.0.Alpha8</jboss.identity.version>
+ <jboss.identity.version>1.0.0.Beta1</jboss.identity.version>
<jboss.j2ee.version>4.2.2.GA</jboss.j2ee.version>
<jboss.client.version>5.0.1.GA</jboss.client.version>
<jsr233.version>2.0.5</jsr233.version>
Modified: jbpm4/trunk/qa/build.xml
===================================================================
--- jbpm4/trunk/qa/build.xml 2009-06-25 08:23:17 UTC (rev 5109)
+++ jbpm4/trunk/qa/build.xml 2009-06-25 08:31:54 UTC (rev 5110)
@@ -25,7 +25,7 @@
<property name="jbpm.distro.path" value="${jbpm.distro.dir}/jbpm-${jbpm.version}.zip" />
<property name="jbpm.home" value="${workspace}/jbpm-${jbpm.version}" />
- <property name="jbossidm.version" value="1.0.0.Alpha8" />
+ <property name="jbossidm.version" value="1.0.0.Beta1" />
<property name="jbossidm.home" value="${jbpm.parent.dir}/jbossidm-${jbossidm.version}" />
<!-- ### LOG PROPERTIES ################################################# -->
16 years, 10 months
JBoss JBPM SVN: r5109 - in jbpm4/trunk/modules: pvm/src/main/java/org/jbpm/pvm/internal/cmd and 3 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-06-25 04:23:17 -0400 (Thu, 25 Jun 2009)
New Revision: 5109
Modified:
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/repository/JpdlDeployer.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SuspendDeploymentCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/SuspendDeploymentTest.java
Log:
JBPM-2355 fixed handling of suspended deployments
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/repository/JpdlDeployer.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/repository/JpdlDeployer.java 2009-06-25 05:42:54 UTC (rev 5108)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/repository/JpdlDeployer.java 2009-06-25 08:23:17 UTC (rev 5109)
@@ -62,6 +62,8 @@
if ((processDefinition != null) && (processDefinition.getName() != null)) {
String processDefinitionName = processDefinition.getName();
+ processDefinition.setSuspended(deployment.isSuspended());
+
String imageResourceName = resourceName.substring(0, resourceName.lastIndexOf(".jpdl.xml"))+".png";
if (deployment.getResourceNames().contains(imageResourceName)) {
processDefinition.setImageResourceName(imageResourceName);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SuspendDeploymentCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SuspendDeploymentCmd.java 2009-06-25 05:42:54 UTC (rev 5108)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SuspendDeploymentCmd.java 2009-06-25 08:23:17 UTC (rev 5109)
@@ -21,9 +21,11 @@
*/
package org.jbpm.pvm.internal.cmd;
-import org.hibernate.Session;
+import org.jbpm.api.JbpmException;
import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.repository.DeploymentImpl;
+import org.jbpm.pvm.internal.repository.RepositoryCache;
+import org.jbpm.pvm.internal.session.DbSession;
/**
@@ -40,9 +42,20 @@
}
public Object execute(Environment environment) throws Exception {
- Session session = environment.get(Session.class);
- DeploymentImpl deployment = (DeploymentImpl) session.load(DeploymentImpl.class, deploymentDbid);
+ DbSession dbSession = environment.get(DbSession.class);
+ DeploymentImpl deployment = (DeploymentImpl) dbSession.get(DeploymentImpl.class, deploymentDbid);
+ if (deployment==null) {
+ throw new JbpmException("deployment "+deploymentDbid+" doesn't exist");
+ }
deployment.suspend();
+
+ // removing deployment from the cache
+ // next time it's used, it will be redeployed
+ // at that time, the suspended property will be propagated to the
+ // process definitions
+ RepositoryCache repositoryCache = environment.get(RepositoryCache.class);
+ repositoryCache.remove(deploymentDbid);
+
return null;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-06-25 05:42:54 UTC (rev 5108)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-06-25 08:23:17 UTC (rev 5109)
@@ -406,6 +406,9 @@
public void signal(String signal, Map<String, ?> parameters) {
checkActive();
+ if (getProcessDefinition().isSuspended()) {
+ throw new JbpmException("process definition "+getProcessDefinition().getId()+" is suspended");
+ }
propagation = Propagation.EXPLICIT;
if (getActivity()!=null) {
performAtomicOperation(new Signal(signal, parameters));
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java 2009-06-25 05:42:54 UTC (rev 5108)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java 2009-06-25 08:23:17 UTC (rev 5109)
@@ -26,6 +26,7 @@
import java.util.Map;
import org.jbpm.api.Execution;
+import org.jbpm.api.JbpmException;
import org.jbpm.api.model.OpenProcessDefinition;
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.client.ClientProcessDefinition;
@@ -65,6 +66,9 @@
/** ref to the deployment */
protected long deploymentDbid;
+ /** propagated from deployment to process definition during deploy */
+ protected boolean isSuspended = false;
+
/** the activity which is executed when the process starts */
protected ActivityImpl initial;
@@ -88,6 +92,10 @@
}
public ClientProcessInstance createProcessInstance(String key, Execution superProcessExecution) {
+ if (isSuspended) {
+ throw new JbpmException("process definition "+id+" is suspended");
+ }
+
ExecutionImpl processInstance = newProcessInstance();
log.debug("creating new execution for process '"+name+"'");
if (superProcessExecution!=null) {
@@ -198,4 +206,10 @@
public void setImageResourceName(String imageResourceName) {
this.imageResourceName = imageResourceName;
}
+ public boolean isSuspended() {
+ return isSuspended;
+ }
+ public void setSuspended(boolean isSuspended) {
+ this.isSuspended = isSuspended;
+ }
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java 2009-06-25 05:42:54 UTC (rev 5108)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java 2009-06-25 08:23:17 UTC (rev 5109)
@@ -21,19 +21,38 @@
*/
package org.jbpm.pvm.internal.repository;
+import java.util.ArrayList;
import java.util.List;
+import org.jbpm.api.JbpmException;
+import org.jbpm.api.Problem;
+import org.jbpm.internal.log.Log;
+import org.jbpm.pvm.internal.env.Environment;
+
/**
* @author Tom Baeyens
*/
public class DeployerManager {
+ private static Log log = Log.getLog(DeployerManager.class.getName());
+
List<Deployer> deployers;
public void deploy(DeploymentImpl deployment) {
+ deployment.setProblems(new ArrayList<Problem>());
+
for (Deployer deployer: deployers) {
deployer.deploy(deployment);
}
+
+ if (deployment.hasErrors()) {
+ JbpmException jbpmException = deployment.getJbpmException();
+ log.info("errors during deployment of "+deployment+": "+jbpmException.getMessage());
+ throw jbpmException;
+ }
+
+ RepositoryCache repositoryCache = Environment.getFromCurrent(RepositoryCache.class);
+ repositoryCache.set(deployment.getDbid(), deployment.getObjects());
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java 2009-06-25 05:42:54 UTC (rev 5108)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java 2009-06-25 08:23:17 UTC (rev 5109)
@@ -248,22 +248,28 @@
if (isSuspended()) {
throw new JbpmException("deployment is already suspended");
}
- RepositorySessionImpl repositorySession = Environment.getFromCurrent(RepositorySessionImpl.class, false);
- if (repositorySession!=null) {
- repositorySession.cascadeDeploymentSuspend(this);
- }
+
state = Deployment.STATE_SUSPENDED;
+
+ RepositorySessionImpl repositorySession = Environment.getFromCurrent(RepositorySessionImpl.class);
+ repositorySession.cascadeDeploymentSuspend(this);
+
+ RepositoryCache repositoryCache = Environment.getFromCurrent(RepositoryCache.class);
+ repositoryCache.remove(dbid);
}
public void resume() {
if (!isSuspended()) {
throw new JbpmException("deployment is not suspended");
}
- RepositorySessionImpl repositorySession = Environment.getFromCurrent(RepositorySessionImpl.class, false);
- if (repositorySession!=null) {
- repositorySession.cascadeDeploymentResume(this);
- }
- state = Deployment.STATE_ACTIVE;
+
+ state = Deployment.STATE_ACTIVE;
+
+ RepositorySessionImpl repositorySession = Environment.getFromCurrent(RepositorySessionImpl.class);
+ repositorySession.cascadeDeploymentResume(this);
+
+ RepositoryCache repositoryCache = Environment.getFromCurrent(RepositoryCache.class);
+ repositoryCache.remove(dbid);
}
public boolean isSuspended() {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java 2009-06-25 05:42:54 UTC (rev 5108)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/RepositorySessionImpl.java 2009-06-25 08:23:17 UTC (rev 5109)
@@ -21,15 +21,14 @@
*/
package org.jbpm.pvm.internal.repository;
-import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.hibernate.Query;
import org.hibernate.Session;
-import org.jbpm.api.NewDeployment;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.NewDeployment;
import org.jbpm.api.Problem;
import org.jbpm.api.ProcessDefinition;
import org.jbpm.api.ProcessDefinitionQuery;
@@ -52,20 +51,11 @@
public long deploy(NewDeployment deployment) {
DeploymentImpl deploymentImpl = (DeploymentImpl) deployment;
+
session.save(deploymentImpl);
- deploymentImpl.setProblems(new ArrayList<Problem>());
-
deployerManager.deploy(deploymentImpl);
- if (deploymentImpl.hasErrors()) {
- JbpmException jbpmException = deploymentImpl.getJbpmException();
- log.info("errors during deployment of "+deployment+": "+jbpmException.getMessage());
- throw jbpmException;
- } else {
- repositoryCache.set(deploymentImpl.getDbid(), deploymentImpl.getObjects());
- }
-
return deploymentImpl.getDbid();
}
@@ -111,8 +101,6 @@
execution.resume();
}
}
-
- deploy(deployment);
}
public DeploymentImpl getDeployment(long deploymentDbid) {
@@ -127,10 +115,7 @@
} else {
log.trace("loading deployment "+deploymentDbid+" from db");
DeploymentImpl deployment = (DeploymentImpl) session.load(DeploymentImpl.class, deploymentDbid);
- if (deployment.isSuspended()) {
- throw new JbpmException("deployment "+deploymentDbid+" is suspended");
- }
- deploy(deployment);
+ deployerManager.deploy(deployment);
object = repositoryCache.get(deploymentDbid, objectName);
if (object==null) {
throw new JbpmException("deployment "+deploymentDbid+" doesn't contain object "+objectName);
Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/SuspendDeploymentTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/SuspendDeploymentTest.java 2009-06-25 05:42:54 UTC (rev 5108)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/deploy/SuspendDeploymentTest.java 2009-06-25 08:23:17 UTC (rev 5109)
@@ -134,6 +134,49 @@
assertEquals(6, processInstances.size());
}
+ public void testQuerySuspendDeployments() {
+ deployJpdlXmlString(
+ "<process name='claim'>" +
+ " <start>" +
+ " <transition to='c' />" +
+ " </start>" +
+ " <state name='c' />" +
+ "</process>"
+ );
+
+ long deploymentHireDbid = deployJpdlXmlString(
+ "<process name='hire'>" +
+ " <start>" +
+ " <transition to='h' />" +
+ " </start>" +
+ " <state name='h' />" +
+ "</process>"
+ );
+
+ long deploymentFireDbid = deployJpdlXmlString(
+ "<process name='fire'>" +
+ " <start>" +
+ " <transition to='f' />" +
+ " </start>" +
+ " <state name='f' />" +
+ "</process>"
+ );
+
+ repositoryService.suspendDeployment(deploymentHireDbid);
+ repositoryService.suspendDeployment(deploymentFireDbid);
+
+ List<ProcessDefinition> processDefinitions = repositoryService
+ .createProcessDefinitionQuery()
+ .suspended()
+ .list();
+
+ Set<String> expectedProcessNames = new HashSet<String>();
+ expectedProcessNames.add("hire");
+ expectedProcessNames.add("fire");
+
+ assertEquals(expectedProcessNames, getProcessDefinitionNames(processDefinitions));
+ }
+
int countProcessInstancesFor(List<ProcessInstance> processInstances, String processDefinitionKey) {
int count = 0;
for (Execution processInstance: processInstances) {
16 years, 10 months
JBoss JBPM SVN: r5108 - in jbpm3/branches/jbpm-3.2-soa/modules/core: src/main/resources and 5 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-06-25 01:42:54 -0400 (Thu, 25 Jun 2009)
New Revision: 5108
Added:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/hibernate.mapping.oracle.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/context/log/VariableLog.oracle.hbm.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/context/log/variableinstance/ByteArrayUpdateLog.oracle.hbm.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/ActionLog.oracle.hbm.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/NodeLog.oracle.hbm.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/SignalLog.oracle.hbm.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/TokenCreateLog.oracle.hbm.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/TokenEndLog.oracle.hbm.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/TransitionLog.oracle.hbm.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/logging/log/ProcessLog.oracle.hbm.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/taskmgmt/log/SwimlaneLog.oracle.hbm.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/taskmgmt/log/TaskLog.oracle.hbm.xml
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/pom.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/context/log/VariableLog.hbm.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/context/log/variableinstance/ByteArrayUpdateLog.hbm.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/ActionLog.hbm.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/ActionLog.sybase.hbm.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/NodeLog.hbm.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/SignalLog.hbm.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/TokenCreateLog.hbm.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/TokenEndLog.hbm.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/TransitionLog.hbm.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/logging/log/ProcessLog.hbm.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/taskmgmt/log/SwimlaneLog.hbm.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/taskmgmt/log/TaskLog.hbm.xml
Log:
JBPM-2115: jBPM testsuite hangs when executed with DB2 (CODING IN PROGRESS)
remove foreign key indices introduced in JBPM-2094 for databases other than oracle
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/pom.xml 2009-06-25 05:31:08 UTC (rev 5107)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/pom.xml 2009-06-25 05:42:54 UTC (rev 5108)
@@ -314,14 +314,6 @@
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- <!-- [JBPM-2094] Unindexed Foreign Keys cause deadlocks in oracle -->
- <exclude>org/jbpm/jbpm2094/JBPM2094Test.java</exclude>
- <exclude>org/jbpm/perf/SimplePerformanceTest.java</exclude>
- <exclude>org/jbpm/job/executor/JobExecutorDbTest.java</exclude>
- </excludes>
- </configuration>
</plugin>
</plugins>
</build>
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/hibernate.mapping.oracle.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/hibernate.mapping.oracle.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/hibernate.mapping.oracle.xml 2009-06-25 05:42:54 UTC (rev 5108)
@@ -0,0 +1,139 @@
+ <!-- ###################### -->
+ <!-- # jbpm mapping files # -->
+ <!-- ###################### -->
+
+ <!-- hql queries -->
+ <mapping resource="org/jbpm/db/hibernate.queries.hbm.xml" />
+
+ <!-- hql queries used in simulation for querying historical data.
+ uncomment if you want to use the GetSimulationInputCommand
+ or you want to use the queries directly.
+ beware: the queries need the stddev function to be enabled in your dialect.
+ for more information, visit:
+ http://www.camunda.com/business_process_simulation_news/mysql_and_stddev.... -->
+ <!--
+ <mapping resource="org/jbpm/sim/bam/hibernate.queries.hbm.xml" />
+ -->
+
+ <!-- graph.action mapping files -->
+ <mapping resource="org/jbpm/graph/action/MailAction.hbm.xml"/>
+
+ <!-- graph.def mapping files -->
+ <mapping resource="org/jbpm/graph/def/ProcessDefinition.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Node.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Transition.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Event.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Action.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/SuperState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/ExceptionHandler.hbm.xml"/>
+ <mapping resource="org/jbpm/instantiation/Delegation.hbm.xml"/>
+
+ <!-- ########################################### -->
+ <!-- # mapping file with external dependencies # -->
+ <!-- ########################################### -->
+ <!-- the following mapping file has a dependency on 'bsh-{version}.jar'.
+ uncomment this if bsh is not in your classpath.
+ the script element will not be available in process definition files.
+ note: this mapping must appear below org/jbpm/graph/def/Action.hbm.xml -->
+ <mapping resource="org/jbpm/graph/action/Script.hbm.xml"/>
+
+ <!-- graph.node mapping files -->
+ <mapping resource="org/jbpm/graph/node/StartState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/EndState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/ProcessState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/Decision.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/Fork.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/Join.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/MailNode.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/State.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/TaskNode.hbm.xml"/>
+
+ <!-- context.def mapping files -->
+ <mapping resource="org/jbpm/context/def/ContextDefinition.hbm.xml"/>
+ <mapping resource="org/jbpm/context/def/VariableAccess.hbm.xml"/>
+
+ <!-- bytes mapping files -->
+ <mapping resource="org/jbpm/bytes/ByteArray.hbm.xml"/>
+
+ <!-- module.def mapping files -->
+ <mapping resource="org/jbpm/module/def/ModuleDefinition.hbm.xml"/>
+
+ <!-- file.def mapping files -->
+ <mapping resource="org/jbpm/file/def/FileDefinition.hbm.xml"/>
+
+ <!-- taskmgmt.def mapping files -->
+ <mapping resource="org/jbpm/taskmgmt/def/TaskMgmtDefinition.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/def/Swimlane.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/def/Task.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/def/TaskController.hbm.xml"/>
+
+ <!-- scheduler.def mapping files -->
+ <mapping resource="org/jbpm/scheduler/def/CreateTimerAction.hbm.xml"/>
+ <mapping resource="org/jbpm/scheduler/def/CancelTimerAction.hbm.xml"/>
+
+ <!-- graph.exe mapping files -->
+ <mapping resource="org/jbpm/graph/exe/Comment.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/exe/ProcessInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/exe/Token.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/exe/RuntimeAction.hbm.xml"/>
+
+ <!-- module.exe mapping files -->
+ <mapping resource="org/jbpm/module/exe/ModuleInstance.hbm.xml"/>
+
+ <!-- context.exe mapping files -->
+ <mapping resource="org/jbpm/context/exe/ContextInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/TokenVariableMap.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/VariableInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/ByteArrayInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/DateInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/DoubleInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/HibernateLongInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/HibernateStringInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/LongInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/NullInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/StringInstance.hbm.xml"/>
+
+ <!-- job mapping files -->
+ <mapping resource="org/jbpm/job/Job.hbm.xml"/>
+ <mapping resource="org/jbpm/job/Timer.hbm.xml"/>
+ <mapping resource="org/jbpm/job/ExecuteNodeJob.hbm.xml"/>
+ <mapping resource="org/jbpm/job/ExecuteActionJob.hbm.xml"/>
+ <mapping resource="org/jbpm/job/CleanUpProcessJob.hbm.xml"/>
+
+ <!-- taskmgmt.exe mapping files -->
+ <mapping resource="org/jbpm/taskmgmt/exe/TaskMgmtInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/exe/PooledActor.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/exe/SwimlaneInstance.hbm.xml"/>
+
+ <!-- logging mapping files -->
+ <mapping resource="org/jbpm/logging/log/ProcessLog.oracle.hbm.xml"/>
+ <mapping resource="org/jbpm/logging/log/MessageLog.hbm.xml"/>
+ <mapping resource="org/jbpm/logging/log/CompositeLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ActionLog.oracle.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/NodeLog.oracle.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ProcessInstanceCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ProcessInstanceEndLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ProcessStateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/SignalLog.oracle.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/TokenCreateLog.oracle.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/TokenEndLog.oracle.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/TransitionLog.oracle.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableLog.oracle.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableDeleteLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/ByteArrayUpdateLog.oracle.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/DateUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/DoubleUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/HibernateLongUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/HibernateStringUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/LongUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/StringUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskLog.oracle.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskAssignLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskEndLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/SwimlaneLog.oracle.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/SwimlaneCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/SwimlaneAssignLog.hbm.xml"/>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/context/log/VariableLog.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/context/log/VariableLog.hbm.xml 2009-06-25 05:31:08 UTC (rev 5107)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/context/log/VariableLog.hbm.xml 2009-06-25 05:42:54 UTC (rev 5108)
@@ -12,8 +12,7 @@
<many-to-one name="variableInstance"
column="VARIABLEINSTANCE_"
- foreign-key="FK_LOG_VARINST"
- index="IDX_LOG_VARINST" />
+ foreign-key="FK_LOG_VARINST" />
</subclass>
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/context/log/VariableLog.oracle.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/context/log/VariableLog.oracle.hbm.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/context/log/VariableLog.oracle.hbm.xml 2009-06-25 05:42:54 UTC (rev 5108)
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping auto-import="false" default-access="field">
+
+ <subclass name="org.jbpm.context.log.VariableLog"
+ extends="org.jbpm.logging.log.ProcessLog"
+ discriminator-value="V">
+
+ <many-to-one name="variableInstance"
+ column="VARIABLEINSTANCE_"
+ foreign-key="FK_LOG_VARINST"
+ index="IDX_LOG_VARINST" />
+
+ </subclass>
+
+</hibernate-mapping>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/context/log/variableinstance/ByteArrayUpdateLog.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/context/log/variableinstance/ByteArrayUpdateLog.hbm.xml 2009-06-25 05:31:08 UTC (rev 5107)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/context/log/variableinstance/ByteArrayUpdateLog.hbm.xml 2009-06-25 05:42:54 UTC (rev 5108)
@@ -14,14 +14,12 @@
class="org.jbpm.bytes.ByteArray"
column="OLDBYTEARRAY_"
cascade="all"
- foreign-key="FK_LOG_OLDBYTES"
- index="IDX_LOG_OLDBYTES" />
+ foreign-key="FK_LOG_OLDBYTES" />
<many-to-one name="newValue"
class="org.jbpm.bytes.ByteArray"
column="NEWBYTEARRAY_"
cascade="all"
- foreign-key="FK_LOG_NEWBYTES"
- index="IDX_LOG_NEWBYTES" />
+ foreign-key="FK_LOG_NEWBYTES" />
</subclass>
</hibernate-mapping>
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/context/log/variableinstance/ByteArrayUpdateLog.oracle.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/context/log/variableinstance/ByteArrayUpdateLog.oracle.hbm.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/context/log/variableinstance/ByteArrayUpdateLog.oracle.hbm.xml 2009-06-25 05:42:54 UTC (rev 5108)
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping auto-import="false" default-access="field">
+
+ <subclass name="org.jbpm.context.log.variableinstance.ByteArrayUpdateLog"
+ extends="org.jbpm.context.log.VariableUpdateLog"
+ discriminator-value="B">
+
+ <many-to-one name="oldValue"
+ class="org.jbpm.bytes.ByteArray"
+ column="OLDBYTEARRAY_"
+ cascade="all"
+ foreign-key="FK_LOG_OLDBYTES"
+ index="IDX_LOG_OLDBYTES" />
+ <many-to-one name="newValue"
+ class="org.jbpm.bytes.ByteArray"
+ column="NEWBYTEARRAY_"
+ cascade="all"
+ foreign-key="FK_LOG_NEWBYTES"
+ index="IDX_LOG_NEWBYTES" />
+ </subclass>
+
+</hibernate-mapping>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/ActionLog.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/ActionLog.hbm.xml 2009-06-25 05:31:08 UTC (rev 5107)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/ActionLog.hbm.xml 2009-06-25 05:42:54 UTC (rev 5108)
@@ -14,8 +14,7 @@
<many-to-one name="action"
column="ACTION_"
- foreign-key="FK_LOG_ACTION"
- index="IDX_LOG_ACTION" />
+ foreign-key="FK_LOG_ACTION" />
</subclass>
</hibernate-mapping>
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/ActionLog.oracle.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/ActionLog.oracle.hbm.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/ActionLog.oracle.hbm.xml 2009-06-25 05:42:54 UTC (rev 5108)
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping auto-import="false" default-access="field">
+
+ <subclass name="org.jbpm.graph.log.ActionLog"
+ extends="org.jbpm.logging.log.CompositeLog"
+ discriminator-value="A">
+
+ <property name="exception" column="EXCEPTION_" type="string" length="4000"/>
+
+ <many-to-one name="action"
+ column="ACTION_"
+ foreign-key="FK_LOG_ACTION"
+ index="IDX_LOG_ACTION" />
+ </subclass>
+
+</hibernate-mapping>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/ActionLog.sybase.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/ActionLog.sybase.hbm.xml 2009-06-25 05:31:08 UTC (rev 5107)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/ActionLog.sybase.hbm.xml 2009-06-25 05:42:54 UTC (rev 5108)
@@ -14,8 +14,7 @@
<many-to-one name="action"
column="ACTION_"
- foreign-key="FK_LOG_ACTION"
- index="IDX_LOG_ACTION" />
+ foreign-key="FK_LOG_ACTION" />
</subclass>
</hibernate-mapping>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/NodeLog.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/NodeLog.hbm.xml 2009-06-25 05:31:08 UTC (rev 5107)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/NodeLog.hbm.xml 2009-06-25 05:42:54 UTC (rev 5108)
@@ -12,8 +12,7 @@
<many-to-one name="node"
column="NODE_"
- foreign-key="FK_LOG_NODE"
- index="IDX_LOG_NODE" />
+ foreign-key="FK_LOG_NODE" />
<property name="enter"
column="ENTER_" />
<property name="leave"
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/NodeLog.oracle.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/NodeLog.oracle.hbm.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/NodeLog.oracle.hbm.xml 2009-06-25 05:42:54 UTC (rev 5108)
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping auto-import="false" default-access="field">
+
+ <subclass name="org.jbpm.graph.log.NodeLog"
+ extends="org.jbpm.logging.log.ProcessLog"
+ discriminator-value="N">
+
+ <many-to-one name="node"
+ column="NODE_"
+ foreign-key="FK_LOG_NODE"
+ index="IDX_LOG_NODE" />
+ <property name="enter"
+ column="ENTER_" />
+ <property name="leave"
+ column="LEAVE_" />
+ <property name="duration"
+ column="DURATION_" />
+
+ </subclass>
+
+</hibernate-mapping>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/SignalLog.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/SignalLog.hbm.xml 2009-06-25 05:31:08 UTC (rev 5107)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/SignalLog.hbm.xml 2009-06-25 05:42:54 UTC (rev 5108)
@@ -12,8 +12,7 @@
<many-to-one name="transition"
column="TRANSITION_"
- foreign-key="FK_LOG_TRANSITION"
- index="IDX_LOG_TRANSITION" />
+ foreign-key="FK_LOG_TRANSITION" />
</subclass>
</hibernate-mapping>
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/SignalLog.oracle.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/SignalLog.oracle.hbm.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/SignalLog.oracle.hbm.xml 2009-06-25 05:42:54 UTC (rev 5108)
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping auto-import="false" default-access="field">
+
+ <subclass name="org.jbpm.graph.log.SignalLog"
+ extends="org.jbpm.logging.log.CompositeLog"
+ discriminator-value="S">
+
+ <many-to-one name="transition"
+ column="TRANSITION_"
+ foreign-key="FK_LOG_TRANSITION"
+ index="IDX_LOG_TRANSITION" />
+ </subclass>
+
+</hibernate-mapping>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/TokenCreateLog.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/TokenCreateLog.hbm.xml 2009-06-25 05:31:08 UTC (rev 5107)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/TokenCreateLog.hbm.xml 2009-06-25 05:42:54 UTC (rev 5108)
@@ -12,8 +12,7 @@
<many-to-one name="child"
column="CHILD_"
- foreign-key="FK_LOG_CHILDTOKEN"
- index="IDX_LOG_CHILDTOKEN" />
+ foreign-key="FK_LOG_CHILDTOKEN" />
</subclass>
</hibernate-mapping>
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/TokenCreateLog.oracle.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/TokenCreateLog.oracle.hbm.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/TokenCreateLog.oracle.hbm.xml 2009-06-25 05:42:54 UTC (rev 5108)
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping auto-import="false" default-access="field">
+
+ <subclass name="org.jbpm.graph.log.TokenCreateLog"
+ extends="org.jbpm.logging.log.ProcessLog"
+ discriminator-value="O">
+
+ <many-to-one name="child"
+ column="CHILD_"
+ foreign-key="FK_LOG_CHILDTOKEN"
+ index="IDX_LOG_CHILDTOKEN" />
+ </subclass>
+
+</hibernate-mapping>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/TokenEndLog.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/TokenEndLog.hbm.xml 2009-06-25 05:31:08 UTC (rev 5107)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/TokenEndLog.hbm.xml 2009-06-25 05:42:54 UTC (rev 5108)
@@ -12,8 +12,7 @@
<many-to-one name="child"
column="CHILD_"
- foreign-key="FK_LOG_CHILDTOKEN"
- index="IDX_LOG_CHILDTOKEN" />
+ foreign-key="FK_LOG_CHILDTOKEN" />
</subclass>
</hibernate-mapping>
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/TokenEndLog.oracle.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/TokenEndLog.oracle.hbm.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/TokenEndLog.oracle.hbm.xml 2009-06-25 05:42:54 UTC (rev 5108)
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping auto-import="false" default-access="field">
+
+ <subclass name="org.jbpm.graph.log.TokenEndLog"
+ extends="org.jbpm.logging.log.ProcessLog"
+ discriminator-value="Y">
+
+ <many-to-one name="child"
+ column="CHILD_"
+ foreign-key="FK_LOG_CHILDTOKEN"
+ index="IDX_LOG_CHILDTOKEN" />
+ </subclass>
+
+</hibernate-mapping>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/TransitionLog.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/TransitionLog.hbm.xml 2009-06-25 05:31:08 UTC (rev 5107)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/TransitionLog.hbm.xml 2009-06-25 05:42:54 UTC (rev 5108)
@@ -12,16 +12,13 @@
<many-to-one name="transition"
column="TRANSITION_"
- foreign-key="FK_LOG_TRANSITION"
- index="IDX_LOG_TRANSITION" />
+ foreign-key="FK_LOG_TRANSITION" />
<many-to-one name="sourceNode"
column="SOURCENODE_"
- foreign-key="FK_LOG_SOURCENODE"
- index="IDX_LOG_SOURCENODE" />
+ foreign-key="FK_LOG_SOURCENODE" />
<many-to-one name="destinationNode"
column="DESTINATIONNODE_"
- foreign-key="FK_LOG_DESTNODE"
- index="IDX_LOG_DESTNODE" />
+ foreign-key="FK_LOG_DESTNODE" />
</subclass>
</hibernate-mapping>
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/TransitionLog.oracle.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/TransitionLog.oracle.hbm.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/graph/log/TransitionLog.oracle.hbm.xml 2009-06-25 05:42:54 UTC (rev 5108)
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping auto-import="false" default-access="field">
+
+ <subclass name="org.jbpm.graph.log.TransitionLog"
+ extends="org.jbpm.logging.log.CompositeLog"
+ discriminator-value="T">
+
+ <many-to-one name="transition"
+ column="TRANSITION_"
+ foreign-key="FK_LOG_TRANSITION"
+ index="IDX_LOG_TRANSITION" />
+ <many-to-one name="sourceNode"
+ column="SOURCENODE_"
+ foreign-key="FK_LOG_SOURCENODE"
+ index="IDX_LOG_SOURCENODE" />
+ <many-to-one name="destinationNode"
+ column="DESTINATIONNODE_"
+ foreign-key="FK_LOG_DESTNODE"
+ index="IDX_LOG_DESTNODE" />
+ </subclass>
+
+</hibernate-mapping>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/logging/log/ProcessLog.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/logging/log/ProcessLog.hbm.xml 2009-06-25 05:31:08 UTC (rev 5107)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/logging/log/ProcessLog.hbm.xml 2009-06-25 05:42:54 UTC (rev 5108)
@@ -48,12 +48,10 @@
<property name="date" column="DATE_" />
<many-to-one name="token"
column="TOKEN_"
- foreign-key="FK_LOG_TOKEN"
- index="IDX_LOG_TOKEN" />
+ foreign-key="FK_LOG_TOKEN" />
<many-to-one name="parent"
column="PARENT_"
- foreign-key="FK_LOG_PARENT"
- index="IDX_LOG_PARENT" />
+ foreign-key="FK_LOG_PARENT" />
</class>
</hibernate-mapping>
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/logging/log/ProcessLog.oracle.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/logging/log/ProcessLog.oracle.hbm.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/logging/log/ProcessLog.oracle.hbm.xml 2009-06-25 05:42:54 UTC (rev 5108)
@@ -0,0 +1,59 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping auto-import="false" default-access="field">
+
+ <class name="org.jbpm.logging.log.ProcessLog"
+ table="JBPM_LOG"
+ discriminator-value="P"
+ lazy="false">
+ <id name="id" column="ID_"><generator class="native" /></id>
+ <!-- A : org.jbpm.graph.log.ActionLog -->
+ <!-- B : org.jbpm.context.log.ByteArrayUpdateLog -->
+ <!-- C : org.jbpm.logging.log.CompositeLog -->
+ <!-- D : org.jbpm.context.log.VariableDeleteLog -->
+ <!-- E : org.jbpm.context.log.DateUpdateLog -->
+ <!-- F : org.jbpm.context.log.HibernateStringUpdateLog -->
+ <!-- G : org.jbpm.context.log.LongUpdateLog -->
+ <!-- H : org.jbpm.context.log.HibernateLongUpdateLog -->
+ <!-- I : org.jbpm.graph.log.ProcessInstanceCreateLog -->
+ <!-- L : org.jbpm.context.log.DoubleUpdateLog -->
+ <!-- M : org.jbpm.logging.log.MessageLog -->
+ <!-- N : org.jbpm.graph.log.NodeLog -->
+ <!-- O : org.jbpm.graph.log.TokenCreateLog -->
+ <!-- P : org.jbpm.logging.log.ProcessLog -->
+ <!-- R : org.jbpm.context.log.VariableCreateLog -->
+ <!-- S : org.jbpm.graph.log.SignalLog -->
+ <!-- T : org.jbpm.graph.log.TransitionLog -->
+ <!-- U : org.jbpm.context.log.StringUpdateLog -->
+ <!-- V : org.jbpm.context.log.VariableLog -->
+ <!-- W : org.jbpm.context.log.VariableUpdateLog -->
+ <!-- X : org.jbpm.graph.log.ProcessInstanceEndLog -->
+ <!-- Y : org.jbpm.graph.log.TokenEndLog -->
+ <!-- Z : org.jbpm.graph.log.ProcessStateLog -->
+ <!-- 0 : org.jbpm.taskmgmt.log.TaskLog -->
+ <!-- 1 : org.jbpm.taskmgmt.log.TaskCreateLog -->
+ <!-- 2 : org.jbpm.taskmgmt.log.TaskAssignLog -->
+ <!-- 3 : org.jbpm.taskmgmt.log.TaskEndLog -->
+ <!-- 4 : org.jbpm.taskmgmt.log.SwimlaneLog -->
+ <!-- 5 : org.jbpm.taskmgmt.log.SwimlaneCreateLog -->
+ <!-- 6 : org.jbpm.taskmgmt.log.SwimlaneAssignLog -->
+
+ <discriminator type="char" column="CLASS_"/>
+
+ <property name="index" column="INDEX_" />
+ <property name="date" column="DATE_" />
+ <many-to-one name="token"
+ column="TOKEN_"
+ foreign-key="FK_LOG_TOKEN"
+ index="IDX_LOG_TOKEN" />
+ <many-to-one name="parent"
+ column="PARENT_"
+ foreign-key="FK_LOG_PARENT"
+ index="IDX_LOG_PARENT" />
+ </class>
+
+</hibernate-mapping>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/taskmgmt/log/SwimlaneLog.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/taskmgmt/log/SwimlaneLog.hbm.xml 2009-06-25 05:31:08 UTC (rev 5107)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/taskmgmt/log/SwimlaneLog.hbm.xml 2009-06-25 05:42:54 UTC (rev 5108)
@@ -12,8 +12,7 @@
<many-to-one name="swimlaneInstance"
column="SWIMLANEINSTANCE_"
- foreign-key="FK_LOG_SWIMINST"
- index="IDX_LOG_SWIMINST" />
+ foreign-key="FK_LOG_SWIMINST" />
</subclass>
</hibernate-mapping>
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/taskmgmt/log/SwimlaneLog.oracle.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/taskmgmt/log/SwimlaneLog.oracle.hbm.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/taskmgmt/log/SwimlaneLog.oracle.hbm.xml 2009-06-25 05:42:54 UTC (rev 5108)
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping auto-import="false" default-access="field">
+
+ <subclass name="org.jbpm.taskmgmt.log.SwimlaneLog"
+ extends="org.jbpm.logging.log.ProcessLog"
+ discriminator-value="4">
+
+ <many-to-one name="swimlaneInstance"
+ column="SWIMLANEINSTANCE_"
+ foreign-key="FK_LOG_SWIMINST"
+ index="IDX_LOG_SWIMINST" />
+ </subclass>
+
+</hibernate-mapping>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/taskmgmt/log/TaskLog.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/taskmgmt/log/TaskLog.hbm.xml 2009-06-25 05:31:08 UTC (rev 5107)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/taskmgmt/log/TaskLog.hbm.xml 2009-06-25 05:42:54 UTC (rev 5108)
@@ -12,8 +12,7 @@
<many-to-one name="taskInstance"
column="TASKINSTANCE_"
- foreign-key="FK_LOG_TASKINST"
- index="IDX_LOG_TASKINST" />
+ foreign-key="FK_LOG_TASKINST" />
</subclass>
</hibernate-mapping>
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/taskmgmt/log/TaskLog.oracle.hbm.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/taskmgmt/log/TaskLog.oracle.hbm.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/resources/org/jbpm/taskmgmt/log/TaskLog.oracle.hbm.xml 2009-06-25 05:42:54 UTC (rev 5108)
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping auto-import="false" default-access="field">
+
+ <subclass name="org.jbpm.taskmgmt.log.TaskLog"
+ extends="org.jbpm.logging.log.ProcessLog"
+ discriminator-value="0">
+
+ <many-to-one name="taskInstance"
+ column="TASKINSTANCE_"
+ foreign-key="FK_LOG_TASKINST"
+ index="IDX_LOG_TASKINST" />
+ </subclass>
+
+</hibernate-mapping>
16 years, 10 months
JBoss JBPM SVN: r5107 - in jbpm3/branches/jbpm-3.2-soa/modules: core/src/main/java/org/jbpm/db and 5 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-06-25 01:31:08 -0400 (Thu, 25 Jun 2009)
New Revision: 5107
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/ant/JbpmSchemaTask.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/JbpmSchema.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/persistence/db/DbPersistenceServiceFactory.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/util/Semaphore.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/perf/SimplePerformanceTest.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/log4j.xml
jbpm3/branches/jbpm-3.2-soa/modules/db/scripts/antrun-jbpmschema.xml
Log:
JBPM-2115: jBPM testsuite hangs when executed with DB2 (CODING IN PROGRESS)
clear warnings in JbpmSchema, replace SchemaExport with JbpmSchema in ant task
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/ant/JbpmSchemaTask.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/ant/JbpmSchemaTask.java 2009-06-24 18:17:43 UTC (rev 5106)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/ant/JbpmSchemaTask.java 2009-06-25 05:31:08 UTC (rev 5107)
@@ -21,9 +21,9 @@
*/
package org.jbpm.ant;
-import java.io.FileOutputStream;
+import java.io.FileWriter;
import java.io.IOException;
-import java.io.PrintStream;
+import java.io.Writer;
import java.util.Iterator;
import java.util.List;
@@ -31,9 +31,9 @@
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.hibernate.cfg.Configuration;
-import org.hibernate.tool.hbm2ddl.SchemaExport;
-import org.hibernate.tool.hbm2ddl.SchemaUpdate;
+import org.jbpm.db.JbpmSchema;
+
public class JbpmSchemaTask extends Task {
String config = "hibernate.cfg.xml";
@@ -43,64 +43,68 @@
String delimiter;
public void execute() throws BuildException {
- List exceptions;
- try {
- Configuration configuration = AntHelper.getConfiguration(config, properties);
- if ("drop".equalsIgnoreCase(action)) {
- SchemaExport schemaExport = getSchemaExport(configuration);
- schemaExport.execute(false, false, true, false);
- exceptions = schemaExport.getExceptions();
+ // Create schema tool
+ JbpmSchema jbpmSchema = getJbpmSchema();
+
+ // Generate script
+ String[] script;
+ if ("create".equalsIgnoreCase(action)) {
+ script = jbpmSchema.getCreateSql();
+ }
+ else if ("update".equalsIgnoreCase(action)) {
+ try {
+ script = jbpmSchema.getUpdateSql();
}
- else if ("create".equalsIgnoreCase(action)) {
- SchemaExport schemaExport = getSchemaExport(configuration);
- schemaExport.execute(false, false, false, true);
- exceptions = schemaExport.getExceptions();
+ catch (RuntimeException e) {
+ e.printStackTrace();
+ throw e;
}
- else if ("update".equalsIgnoreCase(action)) {
- PrintStream fileOut = null;
- PrintStream systemOut = System.out;
- try {
- if (output != null) {
- fileOut = new PrintStream(new FileOutputStream(output));
- System.setOut(fileOut);
- }
- SchemaUpdate schemaUpdate = getSchemaUpdate(configuration);
- schemaUpdate.execute(true, false);
- exceptions = schemaUpdate.getExceptions();
- }
- finally {
- if (fileOut != null) {
- System.setOut(systemOut);
- fileOut.close();
- }
- }
- }
- else {
- throw new IllegalArgumentException("Unsupported action: " + action);
- }
}
- catch (IOException ex) {
- throw new BuildException(ex);
+ else if ("drop".equalsIgnoreCase(action)) {
+ script = jbpmSchema.getDropSql();
}
+ else if ("clean".equalsIgnoreCase(action)) {
+ script = jbpmSchema.getCleanSql();
+ }
+ else {
+ throw new BuildException("Unsupported action: " + action);
+ }
- // Print the exceptions if there are any
- for (Iterator i = exceptions.iterator(); i.hasNext();) {
- Object ex = i.next();
- log(ex.toString(), Project.MSG_ERR);
+ // Print exceptions, if any
+ List exceptions = jbpmSchema.getExceptions();
+ if (!exceptions.isEmpty()) {
+ for (Iterator i = exceptions.iterator(); i.hasNext();) {
+ Object exception = i.next();
+ log(exception.toString(), Project.MSG_ERR);
+ }
}
+
+ // Save script to output file
+ try {
+ saveScript(script, jbpmSchema);
+ }
+ catch (IOException e) {
+ log(e.toString(), Project.MSG_ERR);
+ throw new BuildException("Failed to write script to " + output);
+ }
}
- private SchemaExport getSchemaExport(Configuration configuration) {
- SchemaExport schemaExport = new SchemaExport(configuration);
- schemaExport.setFormat(false);
- if (output != null) schemaExport.setOutputFile(output);
- if (delimiter != null) schemaExport.setDelimiter(delimiter);
- return schemaExport;
+ private JbpmSchema getJbpmSchema() {
+ Configuration configuration = AntHelper.getConfiguration(config, properties);
+
+ JbpmSchema jbpmSchema = new JbpmSchema(configuration);
+ jbpmSchema.setDelimiter(delimiter);
+ return jbpmSchema;
}
- private SchemaUpdate getSchemaUpdate(Configuration configuration) {
- SchemaUpdate schemaUpdate = new SchemaUpdate(configuration);
- return schemaUpdate;
+ private void saveScript(String[] script, JbpmSchema jbpmSchema) throws IOException {
+ Writer writer = new FileWriter(output);
+ try {
+ jbpmSchema.writeSql(writer, script);
+ }
+ finally {
+ writer.close();
+ }
}
public void setAction(String action) {
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/JbpmSchema.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/JbpmSchema.java 2009-06-24 18:17:43 UTC (rev 5106)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/db/JbpmSchema.java 2009-06-25 05:31:08 UTC (rev 5107)
@@ -23,16 +23,18 @@
import java.io.File;
import java.io.FileInputStream;
-import java.io.FileOutputStream;
+import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
-import java.io.PrintStream;
+import java.io.Writer;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
+import java.sql.SQLWarning;
import java.sql.Statement;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -41,12 +43,12 @@
import java.util.Properties;
import java.util.Set;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.hibernate.HibernateException;
import org.hibernate.cfg.Configuration;
-import org.hibernate.cfg.Settings;
+import org.hibernate.cfg.Environment;
import org.hibernate.connection.ConnectionProvider;
import org.hibernate.connection.ConnectionProviderFactory;
+import org.hibernate.dialect.Dialect;
import org.hibernate.mapping.Table;
import org.hibernate.tool.hbm2ddl.DatabaseMetadata;
import org.hibernate.tool.hbm2ddl.TableMetadata;
@@ -60,97 +62,76 @@
public class JbpmSchema {
private final Configuration configuration;
- private final Settings settings;
-
private ConnectionProvider connectionProvider;
- private Connection connection;
-
+ private String delimiter;
private final List exceptions = new ArrayList();
+ private static final String[] EMPTY_STRING_ARRAY = new String[0];
+
public JbpmSchema(Configuration configuration) {
this.configuration = configuration;
- settings = configuration.buildSettings();
}
+ private Dialect getDialect() {
+ return Dialect.getDialect(configuration.getProperties());
+ }
+
+ private String getDefaultCatalog() {
+ return configuration.getProperty(Environment.DEFAULT_CATALOG);
+ }
+
+ private String getDefaultSchema() {
+ return configuration.getProperty(Environment.DEFAULT_SCHEMA);
+ }
+
+ private boolean getShowSql() {
+ return "true".equalsIgnoreCase(configuration.getProperty(Environment.SHOW_SQL));
+ }
+
+ public void setDelimiter(String delimiter) {
+ this.delimiter = delimiter;
+ }
+
+ public List getExceptions() {
+ return exceptions;
+ }
+
public String[] getCreateSql() {
- return configuration.generateSchemaCreationScript(settings.getDialect());
+ return configuration.generateSchemaCreationScript(getDialect());
}
public String[] getDropSql() {
- return configuration.generateDropSchemaScript(settings.getDialect());
+ return configuration.generateDropSchemaScript(getDialect());
}
public String[] getCleanSql() {
return concat(getDropSql(), getCreateSql());
}
- public Set getJbpmTables() {
- Set jbpmTables = new HashSet();
- for (Iterator i = configuration.getTableMappings(); i.hasNext();) {
- Table table = (Table) i.next();
- if (table.isPhysicalTable()) {
- jbpmTables.add(table.getName());
- }
- }
- return jbpmTables;
+ private static String[] concat(String[] array1, String[] array2) {
+ int length1 = array1.length;
+ int length2 = array2.length;
+ String[] result = new String[length1 + length2];
+ System.arraycopy(array1, 0, result, 0, length1);
+ System.arraycopy(array2, 0, result, length1, length2);
+ return result;
}
- public Set getExistingTables() {
+ public String[] getUpdateSql() {
+ Connection connection = null;
try {
- createConnection();
- Set existingTables = new HashSet();
-
- DatabaseMetaData metaData = connection.getMetaData();
- boolean storesLowerCaseIdentifiers = metaData.storesLowerCaseIdentifiers();
- ResultSet resultSet = metaData.getTables(settings.getDefaultCatalogName(), settings.getDefaultSchemaName(), null, new String[] { "TABLE" });
- try {
- while (resultSet.next()) {
- String tableName = resultSet.getString("TABLE_NAME");
- if (storesLowerCaseIdentifiers) {
- tableName = tableName.toUpperCase();
- }
- existingTables.add(tableName);
- }
- }
- finally {
- resultSet.close();
- }
- return existingTables;
+ connection = createConnection();
+ return configuration.generateSchemaUpdateScript(getDialect(), getDatabaseMetadata(connection));
}
catch (SQLException e) {
- throw new JbpmException("could not get available table names", e);
- }
- finally {
- closeConnection();
- }
- }
+ exceptions.add(e);
+ JDBCExceptionReporter.logExceptions(e, "failed to generate update sql");
- public Map getRowsPerTable() {
- Map rowsPerTable = new HashMap();
- try {
- createConnection();
- Statement statement = connection.createStatement();
- for (Iterator i = getJbpmTables().iterator(); i.hasNext();) {
- String tableName = (String) i.next();
- String sql = "SELECT COUNT(*) FROM " + tableName;
- ResultSet resultSet = statement.executeQuery(sql);
- if (!resultSet.next()) throw new JbpmException("empty result set: " + sql);
-
- long count = resultSet.getLong(1);
- if (resultSet.wasNull()) throw new JbpmException("count was null: " + sql);
-
- rowsPerTable.put(tableName, new Long(count));
- resultSet.close();
- }
- statement.close();
+ return EMPTY_STRING_ARRAY;
}
- catch (SQLException e) {
- throw new JbpmException("could not count records", e);
- }
finally {
- closeConnection();
+ closeConnection(connection);
}
- return rowsPerTable;
}
public void dropSchema() {
@@ -158,7 +139,8 @@
execute(getDropSql());
}
catch (SQLException e) {
- throw new JbpmException("could not drop schema", e);
+ exceptions.add(e);
+ JDBCExceptionReporter.logExceptions(e, "failed to drop schema");
}
}
@@ -167,7 +149,8 @@
execute(getCreateSql());
}
catch (SQLException e) {
- throw new JbpmException("could not create schema", e);
+ exceptions.add(e);
+ JDBCExceptionReporter.logExceptions(e, "failed to create schema");
}
}
@@ -176,126 +159,279 @@
execute(getCleanSql());
}
catch (SQLException e) {
- throw new JbpmException("could not clean schema", e);
+ exceptions.add(e);
+ JDBCExceptionReporter.logExceptions(e, "failed to clean schema");
}
}
+ public void updateSchema() {
+ try {
+ execute(getUpdateSql());
+ }
+ catch (SQLException e) {
+ exceptions.add(e);
+ JDBCExceptionReporter.logExceptions(e, "failed to update schema");
+ }
+ }
+
+ private void execute(String[] script) throws SQLException {
+ Connection connection = null;
+ try {
+ connection = createConnection();
+ Statement statement = connection.createStatement();
+ try {
+ final boolean showSql = getShowSql();
+ for (int i = 0; i < script.length; i++) {
+ String sql = script[i];
+ if (showSql) System.out.println(sql);
+ execute(sql, statement);
+ }
+ }
+ finally {
+ statement.close();
+ }
+ }
+ finally {
+ closeConnection(connection);
+ }
+ }
+
+ private void execute(String sql, Statement statement) {
+ try {
+ statement.executeUpdate(sql);
+
+ SQLWarning warning = statement.getWarnings();
+ if (warning != null) {
+ JDBCExceptionReporter.logWarnings(warning);
+ statement.clearWarnings();
+ }
+ }
+ catch (SQLException e) {
+ JDBCExceptionReporter.logExceptions(e, "failed to execute update");
+ exceptions.add(e);
+ }
+ }
+
public void saveSqlScripts(String dir, String prefix) {
+ File path = new File(dir);
+ if (!path.isDirectory()) {
+ throw new JbpmException(path + " is not a directory");
+ }
+
try {
- new File(dir).mkdirs();
- saveSqlScript(dir + "/" + prefix + ".drop.sql", getDropSql());
- saveSqlScript(dir + "/" + prefix + ".create.sql", getCreateSql());
- saveSqlScript(dir + "/" + prefix + ".clean.sql", getCleanSql());
- saveSqlScript(dir + "/" + prefix + ".drop.create.sql", concat(getDropSql(), getCreateSql()));
+ saveSqlScript(new File(path, prefix + ".drop.sql"), getDropSql());
+ saveSqlScript(new File(path, prefix + ".create.sql"), getCreateSql());
+ saveSqlScript(new File(path, prefix + ".clean.sql"), getCleanSql());
}
catch (IOException e) {
- throw new JbpmException("couldn't generate scripts", e);
+ throw new JbpmException("failed to generate scripts", e);
}
}
- private static String[] concat(String[] array1, String[] array2) {
- int length1 = array1.length;
- int length2 = array2.length;
- String[] result = new String[length1 + length2];
- System.arraycopy(array1, 0, result, 0, length1);
- System.arraycopy(array2, 0, result, length1, length2);
- return result;
+ private void saveSqlScript(File file, String[] script) throws IOException {
+ Writer writer = new FileWriter(file);
+ try {
+ writeSql(writer, script);
+ }
+ finally {
+ writer.close();
+ }
}
- public boolean tableExists(String tableName) {
- Table table = findTableMapping(tableName);
+ public void writeSql(Writer writer, String[] script) throws IOException {
+ String lineSeparator = System.getProperty("line.separator");
+ for (int i = 0; i < script.length; i++) {
+ writer.write(script[i]);
+ if (delimiter != null) writer.write(delimiter);
+ writer.write(lineSeparator);
+ }
+ }
+
+ public Set getJbpmTables() {
+ Set jbpmTables = new HashSet();
+ for (Iterator i = configuration.getTableMappings(); i.hasNext();) {
+ Table table = (Table) i.next();
+ if (table.isPhysicalTable()) {
+ jbpmTables.add(table.getName());
+ }
+ }
+ return jbpmTables;
+ }
+
+ public Map getRowsPerTable() {
+ Connection connection = null;
try {
- createConnection();
- return getTableMetadata(table) != null;
+ connection = createConnection();
+ Map rowsPerTable = new HashMap();
+
+ Statement statement = connection.createStatement();
+ try {
+ for (Iterator i = getJbpmTables().iterator(); i.hasNext();) {
+ String tableName = (String) i.next();
+ String sql = "SELECT COUNT(*) FROM " + tableName;
+
+ ResultSet resultSet = statement.executeQuery(sql);
+ if (!resultSet.next()) continue;
+
+ long count = resultSet.getLong(1);
+ if (resultSet.wasNull()) continue;
+
+ rowsPerTable.put(tableName, new Long(count));
+ resultSet.close();
+ }
+ }
+ finally {
+ statement.close();
+ }
+
+ return rowsPerTable;
}
catch (SQLException e) {
- throw new JbpmException("could not tell whether table exists: " + tableName, e);
+ exceptions.add(e);
+ JDBCExceptionReporter.logExceptions(e, "could not count records");
+
+ return Collections.EMPTY_MAP;
}
finally {
- closeConnection();
+ closeConnection(connection);
}
}
- public void createTable(String tableName) {
- Table table = findTableMapping(tableName);
- String sql = table.sqlCreateString(settings.getDialect(), configuration.buildMapping(), settings.getDefaultCatalogName(), settings.getDefaultSchemaName());
+ public Set getExistingTables() {
+ Connection connection = null;
try {
- execute(new String[] { sql });
+ connection = createConnection();
+ Set existingTables = new HashSet();
+
+ DatabaseMetaData metaData = connection.getMetaData();
+ boolean storesLowerCaseIdentifiers = metaData.storesLowerCaseIdentifiers();
+ ResultSet resultSet = metaData.getTables(getDefaultCatalog(), getDefaultSchema(), null,
+ new String[] { "TABLE" });
+ try {
+ while (resultSet.next()) {
+ String tableName = resultSet.getString("TABLE_NAME");
+ if (storesLowerCaseIdentifiers) tableName = tableName.toUpperCase();
+ existingTables.add(tableName);
+ }
+ }
+ finally {
+ resultSet.close();
+ }
+
+ return existingTables;
}
catch (SQLException e) {
- throw new JbpmException("could not create table: " + tableName, e);
+ exceptions.add(e);
+ JDBCExceptionReporter.logExceptions(e, "could not get available table names");
+
+ return Collections.EMPTY_SET;
}
+ finally {
+ closeConnection(connection);
+ }
}
+ public boolean tableExists(String tableName) {
+ Connection connection = null;
+ try {
+ connection = createConnection();
+ Table table = findTableMapping(tableName);
+ return getTableMetadata(connection, table) != null;
+ }
+ catch (SQLException e) {
+ exceptions.add(e);
+ JDBCExceptionReporter.logExceptions(e, "could not determine whether table exists");
+
+ return false;
+ }
+ finally {
+ closeConnection(connection);
+ }
+ }
+
public void updateTable(String tableName) {
- Table table = findTableMapping(tableName);
+ Connection connection = null;
try {
- createConnection();
- Iterator sqls = table.sqlAlterStrings(settings.getDialect(), configuration.buildMapping(), getTableMetadata(table), settings.getDefaultCatalogName(), settings.getDefaultSchemaName());
+ connection = createConnection();
+ Table table = findTableMapping(tableName);
+ Iterator script = table.sqlAlterStrings(getDialect(), configuration.buildMapping(),
+ getTableMetadata(connection, table), getDefaultCatalog(), getDefaultSchema());
+
Statement statement = connection.createStatement();
- while (sqls.hasNext()) {
- String sql = (String) sqls.next();
- statement.executeUpdate(sql);
+ try {
+ while (script.hasNext()) {
+ String sql = (String) script.next();
+ execute(sql, statement);
+ }
}
- statement.close();
+ finally {
+ statement.close();
+ }
}
catch (SQLException e) {
- throw new JbpmException("could not update table: " + tableName, e);
+ exceptions.add(e);
+ JDBCExceptionReporter.logExceptions(e, "failed to update table");
}
finally {
- closeConnection();
+ closeConnection(connection);
}
}
- public List getExceptions() {
- return exceptions;
- }
-
private Table findTableMapping(String tableName) {
for (Iterator i = configuration.getTableMappings(); i.hasNext();) {
Table table = (Table) i.next();
- if (tableName.equals(table.getName())) {
- return table;
- }
+ if (tableName.equals(table.getName())) return table;
}
throw new JbpmException("no mapping found for table: " + tableName);
}
- private TableMetadata getTableMetadata(Table table) throws SQLException {
- DatabaseMetadata databaseMetadata = new DatabaseMetadata(connection, settings.getDialect());
- return databaseMetadata.getTableMetadata(table.getName(), table.getSchema() == null ? settings.getDefaultSchemaName()
- : table.getSchema(), table.getCatalog() == null ? settings.getDefaultCatalogName()
- : table.getCatalog(), table.isQuoted());
+ private DatabaseMetadata getDatabaseMetadata(Connection connection) throws SQLException {
+ return new DatabaseMetadata(connection, getDialect());
}
+ private TableMetadata getTableMetadata(Connection connection, Table table) throws SQLException {
+ String tableSchema = table.getSchema();
+ String tableCatalog = table.getCatalog();
+ return getDatabaseMetadata(connection).getTableMetadata(table.getName(),
+ tableSchema != null ? tableSchema : getDefaultSchema(),
+ tableCatalog != null ? tableCatalog : getDefaultCatalog(), table.isQuoted());
+ }
+
+ public void createTable(String tableName) {
+ Table table = findTableMapping(tableName);
+ String sql = table.sqlCreateString(getDialect(), configuration.buildMapping(),
+ getDefaultCatalog(), getDefaultSchema());
+ try {
+ execute(new String[] { sql });
+ }
+ catch (SQLException e) {
+ exceptions.add(e);
+ JDBCExceptionReporter.logExceptions(e, "failed to create table");
+ }
+ }
+
public static void main(String[] args) {
- if (args.length == 0) syntax();
+ if (args.length > 0) {
+ String action = args[0];
- if ("scripts".equalsIgnoreCase(args[0]) && args.length >= 3 && args.length <= 5) {
- JbpmSchema jbpmSchema = new JbpmSchema(createConfiguration(args, 3));
- jbpmSchema.saveSqlScripts(args[1], args[2]);
- }
- else if (args.length <= 3) {
- if ("create".equalsIgnoreCase(args[0])) {
- JbpmSchema jbpmSchema = new JbpmSchema(createConfiguration(args, 1));
- jbpmSchema.createSchema();
+ if ("create".equalsIgnoreCase(action)) {
+ getJbpmSchema(args, 1).createSchema();
}
- else if ("drop".equalsIgnoreCase(args[0])) {
- JbpmSchema jbpmSchema = new JbpmSchema(createConfiguration(args, 1));
- jbpmSchema.dropSchema();
+ else if ("drop".equalsIgnoreCase(action)) {
+ getJbpmSchema(args, 1).dropSchema();
}
- else if ("clean".equalsIgnoreCase(args[0])) {
- JbpmSchema jbpmSchema = new JbpmSchema(createConfiguration(args, 1));
- jbpmSchema.cleanSchema();
+ else if ("clean".equalsIgnoreCase(action)) {
+ getJbpmSchema(args, 1).cleanSchema();
}
- else {
+ else if ("scripts".equalsIgnoreCase(action) && args.length > 2) {
+ getJbpmSchema(args, 3).saveSqlScripts(args[1], args[2]);
+ }
+ else
syntax();
- }
}
- else {
+ else
syntax();
- }
}
private static void syntax() {
@@ -307,107 +443,68 @@
System.exit(1);
}
- static Configuration createConfiguration(String[] args, int index) {
- String hibernateCfgXml = (args.length > index ? args[index] : "hibernate.cfg.xml");
- String hibernateProperties = (args.length > (index + 1) ? args[index + 1] : null);
-
+ private static JbpmSchema getJbpmSchema(String[] args, int index) {
Configuration configuration = new Configuration();
- configuration.configure(new File(hibernateCfgXml));
- if (hibernateProperties != null) {
- try {
- Properties properties = new Properties();
- InputStream inputStream = new FileInputStream(hibernateProperties);
- properties.load(inputStream);
- configuration.setProperties(properties);
- }
- catch (IOException e) {
- throw new JbpmException("couldn't load hibernate configuration", e);
- }
- }
- return configuration;
- }
+ if (index < args.length) {
+ // read configuration xml file
+ String hibernateCfgXml = args[index];
+ configuration.configure(new File(hibernateCfgXml));
- void saveSqlScript(String fileName, String[] sql) throws IOException {
- PrintStream out = new PrintStream(new FileOutputStream(fileName));
- try {
- for (int i = 0; i < sql.length; i++) {
- out.println(sql[i] + getSqlDelimiter());
+ // read extra properties
+ if (index + 1 < args.length) {
+ String hibernateProperties = args[index + 1];
+ try {
+ InputStream inputStream = new FileInputStream(hibernateProperties);
+ Properties properties = new Properties();
+ properties.load(inputStream);
+ configuration.addProperties(properties);
+ }
+ catch (IOException e) {
+ throw new JbpmException("failed to load hibernate properties", e);
+ }
}
}
- finally {
- out.close();
+ else {
+ // read configuration from default resource
+ configuration.configure();
}
+
+ return new JbpmSchema(configuration);
}
- void execute(String[] sql) throws SQLException {
- boolean showSql = settings.isShowSqlEnabled();
- exceptions.clear();
+ private Connection createConnection() throws SQLException {
try {
- createConnection();
- Statement statement = connection.createStatement();
- for (int i = 0; i < sql.length; i++) {
- String line = sql[i];
- if (showSql) System.out.println(line);
- log.debug(line);
- try {
- statement.executeUpdate(line);
- }
- catch (SQLException e) {
- exceptions.add(e);
- log.debug(e.getMessage());
- }
- }
- statement.close();
+ connectionProvider = ConnectionProviderFactory.newConnectionProvider(configuration.getProperties());
}
- finally {
- closeConnection();
+ catch (HibernateException e) {
+ throw new SQLException(e.getMessage());
}
- }
-
- void createConnection() throws SQLException {
- connectionProvider = ConnectionProviderFactory.newConnectionProvider(configuration.getProperties());
- connection = connectionProvider.getConnection();
+ Connection connection = connectionProvider.getConnection();
if (connection.getAutoCommit() == false) {
connection.commit();
connection.setAutoCommit(true);
}
+ return connection;
}
- void closeConnection() {
- if (connection != null) {
+ private void closeConnection(Connection connection) {
+ if (connectionProvider != null) {
try {
- JDBCExceptionReporter.logAndClearWarnings(connection);
- connectionProvider.closeConnection(connection);
+ if (connection != null) {
+ JDBCExceptionReporter.logAndClearWarnings(connection);
+ connectionProvider.closeConnection(connection);
+ }
}
catch (SQLException e) {
- log.debug("could not close " + connection, e);
+ exceptions.add(e);
+ JDBCExceptionReporter.logExceptions(e);
}
finally {
- connection = null;
-
connectionProvider.close();
connectionProvider = null;
}
}
}
- public Properties getProperties() {
- return configuration.getProperties();
- }
-
- // sql delimiter ////////////////////////////////////////////////////////////
-
- static String sqlDelimiter = null;
-
- synchronized String getSqlDelimiter() {
- if (sqlDelimiter == null) {
- sqlDelimiter = getProperties().getProperty("jbpm.sql.delimiter", ";");
- }
- return sqlDelimiter;
- }
-
- // logger ///////////////////////////////////////////////////////////////////
-
- private static final Log log = LogFactory.getLog(JbpmSchema.class);
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/persistence/db/DbPersistenceServiceFactory.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/persistence/db/DbPersistenceServiceFactory.java 2009-06-24 18:17:43 UTC (rev 5106)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/persistence/db/DbPersistenceServiceFactory.java 2009-06-25 05:31:08 UTC (rev 5107)
@@ -73,6 +73,9 @@
return configuration;
}
+ /**
+ * @deprecated use {@link #getJbpmSchema()} instead
+ */
public synchronized SchemaExport getSchemaExport() {
if (schemaExport == null) {
log.debug("creating schema export");
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/util/Semaphore.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/util/Semaphore.java 2009-06-24 18:17:43 UTC (rev 5106)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/util/Semaphore.java 2009-06-25 05:31:08 UTC (rev 5107)
@@ -3,7 +3,12 @@
import java.io.Serializable;
/**
- * Trivial semaphore which borrows the interface of java.util.concurrent.Semaphore.
+ * A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each
+ * {@linkplain #acquire acquire} blocks if necessary until a permit is available, and then takes it.
+ * Each {@linkplain #release() release} adds a permit, potentially releasing a blocking acquirer.
+ *
+ * @see <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/Semaphore.html">
+ * <code>java.util.concurrent.Semaphore</code></a>
*/
public class Semaphore implements Serializable {
@@ -11,46 +16,114 @@
private static final long serialVersionUID = 1L;
+ /**
+ * Creates a <tt>Semaphore</tt> with the given number of permits.
+ *
+ * @param permits the initial number of permits available. This value may be negative, in which
+ * case releases must occur before any acquires will be granted.
+ */
public Semaphore(int permits) {
this.permits = permits;
}
+ /**
+ * Releases a permit, returning it to the semaphore.
+ */
public void release() {
release(1);
}
- public synchronized void release(int permits) {
- this.permits += permits;
- notifyAll();
+ /**
+ * Releases the given number of permits, returning them to the semaphore.
+ *
+ * @param permits the number of permits to release
+ * @throws IllegalArgumentException if permits less than zero.
+ */
+ public void release(int permits) {
+ if (permits < 0) throw new IllegalArgumentException(Integer.toString(permits));
+
+ synchronized (this) {
+ this.permits += permits;
+ notifyAll();
+ }
}
+ /**
+ * Acquires a permit from this semaphore, blocking until one is available, or the thread is
+ * {@link Thread#interrupt interrupted}.
+ *
+ * @throws InterruptedException if the current thread is interrupted
+ * @see Thread#interrupt
+ */
public void acquire() throws InterruptedException {
acquire(1);
}
- public synchronized void acquire(int permits) throws InterruptedException {
- while (this.permits < permits) {
- wait();
+ /**
+ * Acquires the given number of permits from this semaphore, blocking until all are available, or
+ * the thread is {@link Thread#interrupt interrupted}.
+ *
+ * @param permits the number of permits to acquire
+ * @throws InterruptedException if the current thread is interrupted
+ * @throws IllegalArgumentException if permits less than zero.
+ * @see Thread#interrupt
+ */
+ public void acquire(int permits) throws InterruptedException {
+ if (permits < 0) throw new IllegalArgumentException(Integer.toString(permits));
+
+ synchronized (this) {
+ while (this.permits < permits) {
+ wait();
+ }
+ this.permits -= permits;
}
- this.permits -= permits;
}
+ /**
+ * Acquires a permit from this semaphore, if one becomes available within the given waiting time
+ * and the current thread has not been {@link Thread#interrupt interrupted}.
+ *
+ * @param timeout the maximum time to wait for a permit
+ * @return <tt>true</tt> if a permit was acquired and <tt>false</tt> if the waiting time elapsed
+ * before a permit was acquired.
+ * @throws InterruptedException if the current thread is interrupted
+ * @see Thread#interrupt
+ */
public boolean tryAcquire(long timeout) throws InterruptedException {
return tryAcquire(1, timeout);
}
- public synchronized boolean tryAcquire(int permits, long timeout) throws InterruptedException {
+ /**
+ * Acquires the given number of permits from this semaphore, if all become available within the
+ * given waiting time and the current thread has not been {@link Thread#interrupt interrupted}.
+ *
+ * @param permits the number of permits to acquire
+ * @param timeout the maximum time to wait for the permits
+ * @return <tt>true</tt> if all permits were acquired and <tt>false</tt> if the waiting time
+ * elapsed before all permits were acquired.
+ * @throws InterruptedException if the current thread is interrupted
+ * @throws IllegalArgumentException if permits less than zero.
+ * @see Thread#interrupt
+ */
+ public boolean tryAcquire(int permits, long timeout) throws InterruptedException {
+ if (permits < 0) throw new IllegalArgumentException(Integer.toString(permits));
+
long startTime = System.currentTimeMillis();
- while (this.permits < permits && System.currentTimeMillis() - startTime < timeout) {
- wait(timeout);
- }
- if (this.permits >= permits) {
+ synchronized (this) {
+ while (this.permits < permits) {
+ if (System.currentTimeMillis() - startTime >= timeout) return false;
+ wait(timeout);
+ }
this.permits -= permits;
return true;
}
- return false;
}
+ /**
+ * Acquire and return all permits that are immediately available.
+ *
+ * @return the number of permits
+ */
public synchronized int drainPermits() {
int permits = this.permits;
this.permits = 0;
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/perf/SimplePerformanceTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/perf/SimplePerformanceTest.java 2009-06-24 18:17:43 UTC (rev 5106)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/perf/SimplePerformanceTest.java 2009-06-25 05:31:08 UTC (rev 5107)
@@ -34,7 +34,7 @@
* @see <a href="https://jira.jboss.org/jira/browse/JBPM-2043">JBPM-2043</a>
* @author mvecera(a)redhat.com
* @author pmacik(a)redhat.com
- * @author thomas.diesler(a)jboss.com
+ * @author aguizar(a)redhat.com
* @since 18-Feb-2009
*/
public class SimplePerformanceTest extends AbstractDbTestCase {
@@ -83,15 +83,15 @@
long startTime = System.currentTimeMillis();
launchProcessInstances(MEASUREMENT_INSTANCES);
- long duration = System.currentTimeMillis() - startTime;
+ long duration = (System.currentTimeMillis() - startTime) / 1000;
System.out.println("=== Test finished processing "
+ MEASUREMENT_INSTANCES
+ " instances in "
+ duration
- + "ms ===");
+ + " seconds ===");
System.out.println("=== This is "
- + Math.round(1000f * MEASUREMENT_INSTANCES / duration)
+ + (MEASUREMENT_INSTANCES / duration)
+ " instances per second ===");
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/log4j.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/log4j.xml 2009-06-24 18:17:43 UTC (rev 5106)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/log4j.xml 2009-06-25 05:31:08 UTC (rev 5107)
@@ -36,11 +36,11 @@
<priority value="INFO" />
</category>
+ <!--
<category name="org.hibernate.SQL">
<priority value="DEBUG" />
</category>
- <!--
<category name="org.hibernate.connection">
<priority value="TRACE" />
</category>
Modified: jbpm3/branches/jbpm-3.2-soa/modules/db/scripts/antrun-jbpmschema.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/db/scripts/antrun-jbpmschema.xml 2009-06-24 18:17:43 UTC (rev 5106)
+++ jbpm3/branches/jbpm-3.2-soa/modules/db/scripts/antrun-jbpmschema.xml 2009-06-25 05:31:08 UTC (rev 5107)
@@ -40,11 +40,11 @@
</target>
<target name="update-schema" depends="setup-schema" description="Generate jBPM Database Update Scripts">
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.db2.update322.sql" config="hibernate.cfg.db2.xml" properties="db2.properties" action="update"/>
<jbpmschema output="${scriptsdir}/jbpm.jpdl.mysql.update322.sql" config="hibernate.cfg.mysql.xml" properties="mysql.properties" action="update" delimiter=";"/>
+ <jbpmschema output="${scriptsdir}/jbpm.jpdl.oracle.update322.sql" config="hibernate.cfg.oracle.xml" properties="oracle.properties" action="update" delimiter=";"/>
<jbpmschema output="${scriptsdir}/jbpm.jpdl.postgresql.update322.sql" config="hibernate.cfg.postgresql.xml" properties="postgresql.properties" action="update" delimiter=";"/>
<jbpmschema output="${scriptsdir}/jbpm.jpdl.sybase.update322.sql" config="hibernate.cfg.sybase.xml" properties="sybase.properties" action="update"/>
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.oracle.update322.sql" config="hibernate.cfg.oracle.xml" properties="oracle.properties" action="update" delimiter=";"/>
- <jbpmschema output="${scriptsdir}/jbpm.jpdl.db2.update322.sql" config="hibernate.cfg.db2.xml" properties="db2.properties" action="update"/>
</target>
</project>
16 years, 10 months