JBoss JBPM SVN: r3485 - in jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec: service and 1 other directory.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-12-20 09:33:15 -0500 (Sat, 20 Dec 2008)
New Revision: 3485
Modified:
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/jpdl32/DialectHandlerImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/ContextServiceImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/DeploymentServiceImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/DialectHandlerServiceImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/IdentityServiceImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/ProcessDefinitionServiceImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/ProcessInstanceServiceImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/TaskInstanceServiceImpl.java
Log:
Enable ProcessDefinition/InstanceTest
Modified: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/jpdl32/DialectHandlerImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/jpdl32/DialectHandlerImpl.java 2008-12-20 14:32:41 UTC (rev 3484)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/jpdl32/DialectHandlerImpl.java 2008-12-20 14:33:15 UTC (rev 3485)
@@ -31,8 +31,8 @@
import org.jboss.bpm.api.NotImplementedException;
import org.jboss.bpm.api.model.ProcessDefinition;
-import org.jboss.bpm.api.service.AbstractDialectHandler;
import org.jboss.bpm.api.service.DialectHandler;
+import org.jboss.bpm.api.service.internal.AbstractDialectHandler;
import org.jbpm.integration.spec.model.ProcessDefinitionImpl;
/**
Modified: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/ContextServiceImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/ContextServiceImpl.java 2008-12-20 14:32:41 UTC (rev 3484)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/ContextServiceImpl.java 2008-12-20 14:33:15 UTC (rev 3485)
@@ -27,9 +27,9 @@
import org.jboss.bpm.api.runtime.BasicAttachments;
import org.jboss.bpm.api.runtime.Context;
-import org.jboss.bpm.api.service.AbstractService;
import org.jboss.bpm.api.service.ContextService;
import org.jboss.bpm.api.service.ProcessEngine;
+import org.jboss.bpm.api.service.internal.AbstractService;
import org.jbpm.JbpmContext;
import org.jbpm.signal.EventService;
import org.jbpm.svc.ServiceFactory;
Modified: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/DeploymentServiceImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/DeploymentServiceImpl.java 2008-12-20 14:32:41 UTC (rev 3484)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/DeploymentServiceImpl.java 2008-12-20 14:33:15 UTC (rev 3485)
@@ -30,10 +30,10 @@
import org.jboss.bpm.api.deployment.Deployment;
import org.jboss.bpm.api.model.ProcessDefinition;
-import org.jboss.bpm.api.service.AbstractService;
import org.jboss.bpm.api.service.DeploymentService;
import org.jboss.bpm.api.service.ProcessDefinitionService;
import org.jboss.bpm.api.service.ProcessEngine;
+import org.jboss.bpm.api.service.internal.AbstractService;
import org.jbpm.integration.spec.deployment.PARDeployment;
import org.jbpm.integration.spec.deployment.XMLDeployment;
import org.slf4j.Logger;
Modified: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/DialectHandlerServiceImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/DialectHandlerServiceImpl.java 2008-12-20 14:32:41 UTC (rev 3484)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/DialectHandlerServiceImpl.java 2008-12-20 14:33:15 UTC (rev 3485)
@@ -26,9 +26,9 @@
import java.net.URI;
import java.util.Map;
-import org.jboss.bpm.api.service.AbstractDialectHandlerService;
import org.jboss.bpm.api.service.DialectHandler;
import org.jboss.bpm.api.service.ProcessEngine;
+import org.jboss.bpm.api.service.internal.AbstractDialectHandlerService;
/**
* A registry that maps namespaceURI to a {@link DialectHandler}
Modified: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/IdentityServiceImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/IdentityServiceImpl.java 2008-12-20 14:32:41 UTC (rev 3484)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/IdentityServiceImpl.java 2008-12-20 14:33:15 UTC (rev 3485)
@@ -28,8 +28,8 @@
import java.util.Set;
import org.jboss.bpm.api.NotImplementedException;
-import org.jboss.bpm.api.service.AbstractService;
import org.jboss.bpm.api.service.ProcessEngine;
+import org.jboss.bpm.api.service.internal.AbstractService;
import org.jboss.bpm.incubator.service.IdentityService;
import org.jbpm.JbpmConfiguration;
import org.jbpm.JbpmContext;
Modified: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/ProcessDefinitionServiceImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/ProcessDefinitionServiceImpl.java 2008-12-20 14:32:41 UTC (rev 3484)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/ProcessDefinitionServiceImpl.java 2008-12-20 14:33:15 UTC (rev 3485)
@@ -31,10 +31,10 @@
import org.jboss.bpm.api.model.ProcessDefinition;
import org.jboss.bpm.api.runtime.Context;
-import org.jboss.bpm.api.service.AbstractProcessDefinitionService;
import org.jboss.bpm.api.service.ContextService;
import org.jboss.bpm.api.service.ProcessEngine;
import org.jboss.bpm.api.service.ProcessInstanceService;
+import org.jboss.bpm.api.service.internal.AbstractProcessDefinitionService;
import org.jbpm.JbpmContext;
import org.jbpm.db.GraphSession;
import org.jbpm.integration.spec.model.ProcessDefinitionImpl;
Modified: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/ProcessInstanceServiceImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/ProcessInstanceServiceImpl.java 2008-12-20 14:32:41 UTC (rev 3484)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/ProcessInstanceServiceImpl.java 2008-12-20 14:33:15 UTC (rev 3485)
@@ -35,11 +35,11 @@
import org.jboss.bpm.api.model.ProcessInstance;
import org.jboss.bpm.api.model.ProcessInstance.ProcessStatus;
import org.jboss.bpm.api.runtime.Context;
-import org.jboss.bpm.api.service.AbstractService;
import org.jboss.bpm.api.service.ContextService;
import org.jboss.bpm.api.service.ProcessDefinitionService;
import org.jboss.bpm.api.service.ProcessEngine;
import org.jboss.bpm.api.service.ProcessInstanceService;
+import org.jboss.bpm.api.service.internal.AbstractService;
import org.jbpm.JbpmContext;
import org.jbpm.db.GraphSession;
import org.jbpm.integration.spec.model.ProcessDefinitionImpl;
Modified: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/TaskInstanceServiceImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/TaskInstanceServiceImpl.java 2008-12-20 14:32:41 UTC (rev 3484)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/TaskInstanceServiceImpl.java 2008-12-20 14:33:15 UTC (rev 3485)
@@ -31,10 +31,10 @@
import org.jboss.bpm.api.model.ProcessInstance;
import org.jboss.bpm.api.runtime.Context;
-import org.jboss.bpm.api.service.AbstractService;
import org.jboss.bpm.api.service.ContextService;
import org.jboss.bpm.api.service.ProcessEngine;
import org.jboss.bpm.api.service.ProcessInstanceService;
+import org.jboss.bpm.api.service.internal.AbstractService;
import org.jboss.bpm.incubator.service.TaskInstanceService;
import org.jboss.bpm.incubator.task.TaskInstance;
import org.jbpm.JbpmContext;
17 years, 4 months
JBoss JBPM SVN: r3484 - in projects/spec/trunk/modules: api/src/main/java/org/jboss/bpm/api/service/internal and 3 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-12-20 09:32:41 -0500 (Sat, 20 Dec 2008)
New Revision: 3484
Added:
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/internal/
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/internal/AbstractDialectHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/internal/AbstractDialectHandlerService.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/internal/AbstractProcessDefinitionService.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/internal/AbstractService.java
Removed:
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/AbstractDialectHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/AbstractDialectHandlerService.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/AbstractProcessDefinitionService.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/AbstractService.java
Modified:
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/MessageBuilderService.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/MessageService.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/SignalBuilderService.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/SignalService.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/TokenService.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/service/PersistenceService.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/service/ProcessBuilderService.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/service/ThreadingService.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/gateway/exclusive/ExclusiveGatewaySplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/service/ProcessDefinitionServiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/service/ProcessInstanceServiceTest.java
Log:
Enable ProcessDefinition/InstanceTest
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/AbstractDialectHandler.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/AbstractDialectHandler.java 2008-12-20 13:33:37 UTC (rev 3483)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/AbstractDialectHandler.java 2008-12-20 14:32:41 UTC (rev 3484)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.api.service;
-
-//$Id$
-
-
-
-/**
- * The DialectHandler converts a supported dialect to the ProcessDefinition model.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public abstract class AbstractDialectHandler implements DialectHandler
-{
- private ProcessEngine engine;
-
- public ProcessEngine getProcessEngine()
- {
- return engine;
- }
-
- // Do not expose through the API
- protected void setProcessEngine(ProcessEngine engine)
- {
- this.engine = engine;
- }
-}
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/AbstractDialectHandlerService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/AbstractDialectHandlerService.java 2008-12-20 13:33:37 UTC (rev 3483)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/AbstractDialectHandlerService.java 2008-12-20 14:32:41 UTC (rev 3484)
@@ -1,56 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.api.service;
-
-//$Id$
-
-import java.net.URI;
-import java.util.Map;
-
-
-
-/**
- * A registry that maps namespaceURI to a {@link DialectHandler}
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jul-2008
- */
-public abstract class AbstractDialectHandlerService extends AbstractService implements DialectHandlerService
-{
- // Maps namespaceURI to a DialectHandler
- protected Map<URI, DialectHandler> dialectHandlers;
-
- public DialectHandler getDialectHandler(URI nsURI)
- {
- DialectHandler dialectHandler = dialectHandlers.get(nsURI);
- if (dialectHandler == null)
- throw new IllegalStateException("No dialect handler registered for: " + nsURI);
-
- if (dialectHandler instanceof AbstractDialectHandler)
- {
- AbstractDialectHandler absHandler = (AbstractDialectHandler)dialectHandler;
- absHandler.setProcessEngine(getProcessEngine());
- }
-
- return dialectHandler;
- }
-}
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/AbstractProcessDefinitionService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/AbstractProcessDefinitionService.java 2008-12-20 13:33:37 UTC (rev 3483)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/AbstractProcessDefinitionService.java 2008-12-20 14:32:41 UTC (rev 3484)
@@ -1,108 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.api.service;
-
-//$Id$
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.jboss.bpm.api.model.ProcessDefinition;
-import org.jboss.bpm.api.service.DialectHandler;
-import org.jboss.bpm.api.service.DialectHandlerService;
-import org.jboss.bpm.api.service.ProcessDefinitionService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * The ProcessDefinitionService is the entry point to create, find and otherwise manage process definitions.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 25-Sep-2008
- */
-public abstract class AbstractProcessDefinitionService extends AbstractService implements ProcessDefinitionService
-{
- // Provide logging
- final static Logger log = LoggerFactory.getLogger(AbstractProcessDefinitionService.class);
-
- // Hide public constructor
- protected AbstractProcessDefinitionService()
- {
- }
-
- @Override
- public final ProcessDefinition parseProcessDefinition(String pXML)
- {
- URI nsURI = getNamespaceURI(new ByteArrayInputStream(pXML.getBytes()));
- DialectHandlerService dhService = getProcessEngine().getService(DialectHandlerService.class);
- DialectHandler dialectHandler = dhService.getDialectHandler(nsURI);
- if (dialectHandler == null)
- throw new IllegalStateException("Cannot obtain DialectHandler for: " + nsURI);
-
- ProcessDefinition procDef = dialectHandler.parseProcessDefinition(pXML);
- return procDef;
- }
-
- @Override
- public final ProcessDefinition parseProcessDefinition(URL pURL) throws IOException
- {
- URI nsURI = getNamespaceURI(pURL.openStream());
- DialectHandlerService dhService = getProcessEngine().getService(DialectHandlerService.class);
- DialectHandler dialectHandler = dhService.getDialectHandler(nsURI);
- if (dialectHandler == null)
- throw new IllegalStateException("Cannot obtain DialectHandler for: " + nsURI);
-
- ProcessDefinition procDef = dialectHandler.parseProcessDefinition(pURL);
- return procDef;
- }
-
- private URI getNamespaceURI(InputStream procXML)
- {
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- dbf.setNamespaceAware(true);
- Document doc;
- try
- {
- DocumentBuilder db = dbf.newDocumentBuilder();
- doc = db.parse(procXML);
- }
- catch (Exception ex)
- {
- throw new IllegalStateException("Cannot parse process descriptor", ex);
- }
-
- Element root = doc.getDocumentElement();
- String nsURI = root.getNamespaceURI();
- if (nsURI == null)
- throw new IllegalStateException("Cannot get namespace URI from root element");
-
- return URI.create(nsURI);
- }
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/AbstractService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/AbstractService.java 2008-12-20 13:33:37 UTC (rev 3483)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/AbstractService.java 2008-12-20 14:32:41 UTC (rev 3484)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.api.service;
-
-// $Id$
-
-
-/**
- * An abstract Service that gives access to the ProcessEngine
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public class AbstractService implements Service, ProcessEngineSupport
-{
- private ProcessEngine engine;
-
- public ProcessEngine getProcessEngine()
- {
- return engine;
- }
-
- // Do not expose through the API
- protected void setProcessEngine(ProcessEngine engine)
- {
- this.engine = engine;
- }
-}
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/MessageBuilderService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/MessageBuilderService.java 2008-12-20 13:33:37 UTC (rev 3483)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/MessageBuilderService.java 2008-12-20 14:32:41 UTC (rev 3484)
@@ -26,6 +26,7 @@
import org.jboss.bpm.api.config.Configuration;
import org.jboss.bpm.api.model.Message;
import org.jboss.bpm.api.model.builder.MessageBuilder;
+import org.jboss.bpm.api.service.internal.AbstractService;
/**
* The MessageBuilder can be used to build a {@link Message} dynamically.
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/MessageService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/MessageService.java 2008-12-20 13:33:37 UTC (rev 3483)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/MessageService.java 2008-12-20 14:32:41 UTC (rev 3484)
@@ -37,6 +37,7 @@
import org.jboss.bpm.api.model.Node;
import org.jboss.bpm.api.model.Participant;
import org.jboss.bpm.api.model.ProcessInstance;
+import org.jboss.bpm.api.service.internal.AbstractService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/SignalBuilderService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/SignalBuilderService.java 2008-12-20 13:33:37 UTC (rev 3483)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/SignalBuilderService.java 2008-12-20 14:32:41 UTC (rev 3484)
@@ -25,6 +25,7 @@
import org.jboss.bpm.api.model.Signal;
import org.jboss.bpm.api.model.builder.SignalBuilder;
+import org.jboss.bpm.api.service.internal.AbstractService;
/**
* The SignalBuilder can be used to build a {@link Signal} dynamically.
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/SignalService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/SignalService.java 2008-12-20 13:33:37 UTC (rev 3483)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/SignalService.java 2008-12-20 14:32:41 UTC (rev 3484)
@@ -29,6 +29,7 @@
import org.jboss.bpm.api.model.Signal;
import org.jboss.bpm.api.model.SignalListener;
+import org.jboss.bpm.api.service.internal.AbstractService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/TokenService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/TokenService.java 2008-12-20 13:33:37 UTC (rev 3483)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/TokenService.java 2008-12-20 14:32:41 UTC (rev 3484)
@@ -28,10 +28,11 @@
import javax.management.ObjectName;
import org.jboss.bpm.api.runtime.Token;
+import org.jboss.bpm.api.service.internal.AbstractService;
/**
- * The ExecutionService manages Tokens
+ * The TokenService manages Tokens
*
* @author thomas.diesler(a)jboss.com
* @since 28-Nov-2008
Copied: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/internal/AbstractDialectHandler.java (from rev 3449, projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/AbstractDialectHandler.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/internal/AbstractDialectHandler.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/internal/AbstractDialectHandler.java 2008-12-20 14:32:41 UTC (rev 3484)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.api.service.internal;
+
+//$Id$
+
+import org.jboss.bpm.api.service.DialectHandler;
+import org.jboss.bpm.api.service.ProcessEngine;
+
+/**
+ * The DialectHandler converts a supported dialect to the ProcessDefinition model.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public abstract class AbstractDialectHandler implements DialectHandler
+{
+ private ProcessEngine engine;
+
+ public ProcessEngine getProcessEngine()
+ {
+ return engine;
+ }
+
+ // Do not expose through the API
+ protected void setProcessEngine(ProcessEngine engine)
+ {
+ this.engine = engine;
+ }
+}
Copied: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/internal/AbstractDialectHandlerService.java (from rev 3449, projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/AbstractDialectHandlerService.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/internal/AbstractDialectHandlerService.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/internal/AbstractDialectHandlerService.java 2008-12-20 14:32:41 UTC (rev 3484)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.api.service.internal;
+
+//$Id$
+
+import java.net.URI;
+import java.util.Map;
+
+import org.jboss.bpm.api.service.DialectHandler;
+import org.jboss.bpm.api.service.DialectHandlerService;
+
+/**
+ * A registry that maps namespaceURI to a {@link DialectHandler}
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jul-2008
+ */
+public abstract class AbstractDialectHandlerService extends AbstractService implements DialectHandlerService
+{
+ // Maps namespaceURI to a DialectHandler
+ protected Map<URI, DialectHandler> dialectHandlers;
+
+ public DialectHandler getDialectHandler(URI nsURI)
+ {
+ DialectHandler dialectHandler = dialectHandlers.get(nsURI);
+ if (dialectHandler == null)
+ throw new IllegalStateException("No dialect handler registered for: " + nsURI);
+
+ if (dialectHandler instanceof AbstractDialectHandler)
+ {
+ AbstractDialectHandler absHandler = (AbstractDialectHandler)dialectHandler;
+ absHandler.setProcessEngine(getProcessEngine());
+ }
+
+ return dialectHandler;
+ }
+}
Copied: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/internal/AbstractProcessDefinitionService.java (from rev 3465, projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/AbstractProcessDefinitionService.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/internal/AbstractProcessDefinitionService.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/internal/AbstractProcessDefinitionService.java 2008-12-20 14:32:41 UTC (rev 3484)
@@ -0,0 +1,108 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.api.service.internal;
+
+//$Id$
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URL;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.service.DialectHandler;
+import org.jboss.bpm.api.service.DialectHandlerService;
+import org.jboss.bpm.api.service.ProcessDefinitionService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * The ProcessDefinitionService is the entry point to create, find and otherwise manage process definitions.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 25-Sep-2008
+ */
+public abstract class AbstractProcessDefinitionService extends AbstractService implements ProcessDefinitionService
+{
+ // Provide logging
+ final static Logger log = LoggerFactory.getLogger(AbstractProcessDefinitionService.class);
+
+ // Hide public constructor
+ protected AbstractProcessDefinitionService()
+ {
+ }
+
+ @Override
+ public final ProcessDefinition parseProcessDefinition(String pXML)
+ {
+ URI nsURI = getNamespaceURI(new ByteArrayInputStream(pXML.getBytes()));
+ DialectHandlerService dhService = getProcessEngine().getService(DialectHandlerService.class);
+ DialectHandler dialectHandler = dhService.getDialectHandler(nsURI);
+ if (dialectHandler == null)
+ throw new IllegalStateException("Cannot obtain DialectHandler for: " + nsURI);
+
+ ProcessDefinition procDef = dialectHandler.parseProcessDefinition(pXML);
+ return procDef;
+ }
+
+ @Override
+ public final ProcessDefinition parseProcessDefinition(URL pURL) throws IOException
+ {
+ URI nsURI = getNamespaceURI(pURL.openStream());
+ DialectHandlerService dhService = getProcessEngine().getService(DialectHandlerService.class);
+ DialectHandler dialectHandler = dhService.getDialectHandler(nsURI);
+ if (dialectHandler == null)
+ throw new IllegalStateException("Cannot obtain DialectHandler for: " + nsURI);
+
+ ProcessDefinition procDef = dialectHandler.parseProcessDefinition(pURL);
+ return procDef;
+ }
+
+ private URI getNamespaceURI(InputStream procXML)
+ {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ Document doc;
+ try
+ {
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ doc = db.parse(procXML);
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Cannot parse process descriptor", ex);
+ }
+
+ Element root = doc.getDocumentElement();
+ String nsURI = root.getNamespaceURI();
+ if (nsURI == null)
+ throw new IllegalStateException("Cannot get namespace URI from root element");
+
+ return URI.create(nsURI);
+ }
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/internal/AbstractService.java (from rev 3449, projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/AbstractService.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/internal/AbstractService.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/internal/AbstractService.java 2008-12-20 14:32:41 UTC (rev 3484)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.api.service.internal;
+
+//$Id$
+
+import org.jboss.bpm.api.service.ProcessEngine;
+import org.jboss.bpm.api.service.ProcessEngineSupport;
+import org.jboss.bpm.api.service.Service;
+
+/**
+ * An abstract Service that gives access to the ProcessEngine
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public class AbstractService implements Service, ProcessEngineSupport
+{
+ private ProcessEngine engine;
+
+ public ProcessEngine getProcessEngine()
+ {
+ return engine;
+ }
+
+ // Do not expose through the API
+ protected void setProcessEngine(ProcessEngine engine)
+ {
+ this.engine = engine;
+ }
+}
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/service/PersistenceService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/service/PersistenceService.java 2008-12-20 13:33:37 UTC (rev 3483)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/service/PersistenceService.java 2008-12-20 14:32:41 UTC (rev 3484)
@@ -29,7 +29,7 @@
import org.jboss.bpm.api.model.Node;
import org.jboss.bpm.api.model.ProcessDefinition;
import org.jboss.bpm.api.model.ProcessInstance;
-import org.jboss.bpm.api.service.AbstractService;
+import org.jboss.bpm.api.service.internal.AbstractService;
/**
* The persistence service.
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/service/ProcessBuilderService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/service/ProcessBuilderService.java 2008-12-20 13:33:37 UTC (rev 3483)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/service/ProcessBuilderService.java 2008-12-20 14:32:41 UTC (rev 3484)
@@ -24,7 +24,7 @@
//$Id$
import org.jboss.bpm.api.model.ProcessInstance;
-import org.jboss.bpm.api.service.AbstractService;
+import org.jboss.bpm.api.service.internal.AbstractService;
import org.jboss.bpm.incubator.model.builder.ProcessBuilder;
/**
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/service/ThreadingService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/service/ThreadingService.java 2008-12-20 13:33:37 UTC (rev 3483)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/service/ThreadingService.java 2008-12-20 14:32:41 UTC (rev 3484)
@@ -29,7 +29,7 @@
import org.jboss.bpm.api.model.ProcessInstance;
import org.jboss.bpm.api.model.ProcessInstance.ProcessStatus;
import org.jboss.bpm.api.runtime.Attachments;
-import org.jboss.bpm.api.service.AbstractService;
+import org.jboss.bpm.api.service.internal.AbstractService;
import org.jboss.bpm.incubator.model.StartEvent;
/**
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/gateway/exclusive/ExclusiveGatewaySplitTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/gateway/exclusive/ExclusiveGatewaySplitTest.java 2008-12-20 13:33:37 UTC (rev 3483)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/gateway/exclusive/ExclusiveGatewaySplitTest.java 2008-12-20 14:32:41 UTC (rev 3484)
@@ -40,7 +40,7 @@
* @author thomas.diesler(a)jboss.com
* @since 06-Aug-2008
*/
-public abstract class ExclusiveGatewaySplitTest extends CTSTestCase
+public abstract class ExclusiveGatewaySplitTest extends CTSTestCase
{
public void testGateA() throws Exception
{
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/service/ProcessDefinitionServiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/service/ProcessDefinitionServiceTest.java 2008-12-20 13:33:37 UTC (rev 3483)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/service/ProcessDefinitionServiceTest.java 2008-12-20 14:32:41 UTC (rev 3484)
@@ -24,6 +24,7 @@
// $Id$
import java.io.IOException;
+import java.net.URL;
import java.util.Set;
import javax.management.ObjectName;
@@ -41,7 +42,7 @@
* @author thomas.diesler(a)jboss.com
* @since 24-Sep-2008
*/
-public abstract class ProcessDefinitionServiceTest extends CTSTestCase
+public class ProcessDefinitionServiceTest extends CTSTestCase
{
public void testBasicProcess() throws Exception
{
@@ -87,6 +88,9 @@
protected ProcessDefinition getProcessDefinition() throws IOException
{
- return null;
+ URL pdURL = getResourceURL("cts/common/simple-sequence-" + getDialect() + ".xml");
+ ProcessDefinitionService pdService = getProcessEngine().getService(ProcessDefinitionService.class);
+ ProcessDefinition procDef = pdService.parseProcessDefinition(pdURL);
+ return procDef;
}
}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/service/ProcessInstanceServiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/service/ProcessInstanceServiceTest.java 2008-12-20 13:33:37 UTC (rev 3483)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/service/ProcessInstanceServiceTest.java 2008-12-20 14:32:41 UTC (rev 3484)
@@ -24,6 +24,7 @@
// $Id$
import java.io.IOException;
+import java.net.URL;
import javax.management.ObjectName;
@@ -40,7 +41,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public abstract class ProcessInstanceServiceTest extends CTSTestCase
+public class ProcessInstanceServiceTest extends CTSTestCase
{
public void testRegisterProcess() throws Exception
{
@@ -93,6 +94,9 @@
protected ProcessDefinition getProcessDefinition() throws IOException
{
- return null;
+ URL pdURL = getResourceURL("cts/common/simple-sequence-" + getDialect() + ".xml");
+ ProcessDefinitionService pdService = getProcessEngine().getService(ProcessDefinitionService.class);
+ ProcessDefinition procDef = pdService.parseProcessDefinition(pdURL);
+ return procDef;
}
}
17 years, 4 months
JBoss JBPM SVN: r3483 - jbpm3/trunk/modules/integration.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-12-20 08:33:37 -0500 (Sat, 20 Dec 2008)
New Revision: 3483
Modified:
jbpm3/trunk/modules/integration/pom.xml
Log:
Exclude incubator tests
Modified: jbpm3/trunk/modules/integration/pom.xml
===================================================================
--- jbpm3/trunk/modules/integration/pom.xml 2008-12-20 13:15:35 UTC (rev 3482)
+++ jbpm3/trunk/modules/integration/pom.xml 2008-12-20 13:33:37 UTC (rev 3483)
@@ -211,8 +211,7 @@
</property>
</systemProperties>
<excludes>
- <exclude>org/jboss/bpm/test/incubator/**/*Test.java</exclude>
- <exclude>org/jboss/bpm/test/pattern/**/*Test.java</exclude>
+ <exclude>org/jboss/bpm/incubator/**/*Test.java</exclude>
</excludes>
</configuration>
</plugin>
17 years, 4 months
JBoss JBPM SVN: r3482 - jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-12-20 08:15:35 -0500 (Sat, 20 Dec 2008)
New Revision: 3482
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/GraphElement.java
Log:
Prevent NPE when services is not there. Is this a valid condition?
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/GraphElement.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/GraphElement.java 2008-12-20 13:12:41 UTC (rev 3481)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/GraphElement.java 2008-12-20 13:15:35 UTC (rev 3482)
@@ -199,10 +199,14 @@
JbpmContext jbpmContext = executionContext.getJbpmContext();
if (jbpmContext != null)
{
- EventService evService = (EventService)jbpmContext.getServices().getService(EventService.SERVICE_NAME);
- if (evService != null)
+ Services services = jbpmContext.getServices();
+ if (services != null)
{
- evService.fireEvent(eventType, this, executionContext);
+ EventService evService = (EventService)services.getService(EventService.SERVICE_NAME);
+ if (evService != null)
+ {
+ evService.fireEvent(eventType, this, executionContext);
+ }
}
}
17 years, 4 months
JBoss JBPM SVN: r3481 - jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-12-20 08:12:41 -0500 (Sat, 20 Dec 2008)
New Revision: 3481
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/GraphElement.java
Log:
Prevent NPE when jbpmContext is not there. Is this a valid condition?
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/GraphElement.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/GraphElement.java 2008-12-20 12:56:31 UTC (rev 3480)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/GraphElement.java 2008-12-20 13:12:41 UTC (rev 3481)
@@ -31,6 +31,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jbpm.JbpmContext;
import org.jbpm.JbpmException;
import org.jbpm.graph.exe.ExecutionContext;
import org.jbpm.graph.exe.RuntimeAction;
@@ -194,11 +195,15 @@
{
executionContext.setEventSource(this);
- Services services = executionContext.getJbpmContext().getServices();
- EventService evService = (EventService)services.getService(EventService.SERVICE_NAME);
- if (evService != null)
+ // TODO: Is is a valid condition that the jbpmContext is not there?
+ JbpmContext jbpmContext = executionContext.getJbpmContext();
+ if (jbpmContext != null)
{
- evService.fireEvent(eventType, this, executionContext);
+ EventService evService = (EventService)jbpmContext.getServices().getService(EventService.SERVICE_NAME);
+ if (evService != null)
+ {
+ evService.fireEvent(eventType, this, executionContext);
+ }
}
fireAndPropagateEvent(eventType, executionContext);
17 years, 4 months
JBoss JBPM SVN: r3480 - in projects/spec/trunk/modules: cts and 9 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-12-20 07:56:31 -0500 (Sat, 20 Dec 2008)
New Revision: 3480
Added:
projects/spec/trunk/modules/cts/src/test/resources/cts/common/
projects/spec/trunk/modules/cts/src/test/resources/cts/common/simple-sequence-jbpm3.xml
Removed:
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/pattern/control/sequence/SequencePersistenceTest.java
Modified:
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/SignalBuilderService.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/SignalService.java
projects/spec/trunk/modules/cts/pom.xml
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/gateway/exclusive/ExclusiveGatewaySplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/service/ProcessDefinitionServiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/service/ProcessInstanceServiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/pattern/control/exclusivechoice/ExclusiveChoiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/pattern/control/sequence/SequenceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/incubator/service/signal/SignalMultithreadTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/incubator/service/signal/SignalServiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/incubator/startevent/StartEventSignalTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/incubator/task/receive/ReceiveTaskTest.java
Log:
Add jbpm3 signal support
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/SignalBuilderService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/SignalBuilderService.java 2008-12-20 12:55:32 UTC (rev 3479)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/SignalBuilderService.java 2008-12-20 12:56:31 UTC (rev 3480)
@@ -23,7 +23,6 @@
//$Id$
-import org.jboss.bpm.api.config.Configuration;
import org.jboss.bpm.api.model.Signal;
import org.jboss.bpm.api.model.builder.SignalBuilder;
@@ -36,16 +35,6 @@
public abstract class SignalBuilderService extends AbstractService
{
/**
- * Locate the default SignalBuilder
- */
- public static SignalBuilder locateSignalBuilder()
- {
- ProcessEngine engine = Configuration.getProcessEngine();
- SignalBuilderService builderService = engine.getService(SignalBuilderService.class);
- return builderService.getSignalBuilder();
- }
-
- /**
* Get the SignalBuilder
*/
public abstract SignalBuilder getSignalBuilder();
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/SignalService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/SignalService.java 2008-12-20 12:55:32 UTC (rev 3479)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/service/SignalService.java 2008-12-20 12:56:31 UTC (rev 3480)
@@ -27,7 +27,6 @@
import java.util.HashSet;
import java.util.Set;
-import org.jboss.bpm.api.config.Configuration;
import org.jboss.bpm.api.model.Signal;
import org.jboss.bpm.api.model.SignalListener;
import org.slf4j.Logger;
@@ -49,15 +48,6 @@
private Set<SignalListener> listeners = new HashSet<SignalListener>();
/**
- * Locate the default SignalService
- */
- public static SignalService locateSignalService()
- {
- ProcessEngine engine = Configuration.getProcessEngine();
- return engine.getService(SignalService.class);
- }
-
- /**
* Add a SignalListener for a given source
*/
public void addSignalListener(SignalListener listener)
Modified: projects/spec/trunk/modules/cts/pom.xml
===================================================================
--- projects/spec/trunk/modules/cts/pom.xml 2008-12-20 12:55:32 UTC (rev 3479)
+++ projects/spec/trunk/modules/cts/pom.xml 2008-12-20 12:56:31 UTC (rev 3480)
@@ -85,10 +85,9 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <excludes>
- <exclude>org/jboss/bpm/test/incubator/**/*Test.java</exclude>
- <exclude>org/jboss/bpm/test/pattern/**/*Test.java</exclude>
- </excludes>
+ <includes>
+ <include>org/jboss/bpm/cts/**/*Test.java</include>
+ </includes>
</configuration>
</plugin>
</plugins>
@@ -105,7 +104,7 @@
<id>no-impl</id>
<activation>
<property>
- <name>!impl</name>
+ <name>_impl</name>
</property>
</activation>
<build>
@@ -128,8 +127,8 @@
<id>impl-jbpm3</id>
<activation>
<property>
- <name>impl</name>
- <value>jbpm3</value>
+ <name>!impl</name>
+ <!-- value>jbpm3</value -->
</property>
</activation>
<dependencies>
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/gateway/exclusive/ExclusiveGatewaySplitTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/gateway/exclusive/ExclusiveGatewaySplitTest.java 2008-12-20 12:55:32 UTC (rev 3479)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/gateway/exclusive/ExclusiveGatewaySplitTest.java 2008-12-20 12:56:31 UTC (rev 3480)
@@ -40,7 +40,7 @@
* @author thomas.diesler(a)jboss.com
* @since 06-Aug-2008
*/
-public abstract class ExclusiveGatewaySplitTest extends CTSTestCase
+public abstract class ExclusiveGatewaySplitTest extends CTSTestCase
{
public void testGateA() throws Exception
{
@@ -95,5 +95,8 @@
}
}
- protected abstract ProcessDefinition getProcessDefinition() throws IOException;
+ protected ProcessDefinition getProcessDefinition() throws IOException
+ {
+ return null;
+ }
}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/service/ProcessDefinitionServiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/service/ProcessDefinitionServiceTest.java 2008-12-20 12:55:32 UTC (rev 3479)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/service/ProcessDefinitionServiceTest.java 2008-12-20 12:56:31 UTC (rev 3480)
@@ -85,5 +85,8 @@
assertTrue("ProcessDefinition unregistered", success);
}
- protected abstract ProcessDefinition getProcessDefinition() throws IOException;
+ protected ProcessDefinition getProcessDefinition() throws IOException
+ {
+ return null;
+ }
}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/service/ProcessInstanceServiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/service/ProcessInstanceServiceTest.java 2008-12-20 12:55:32 UTC (rev 3479)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/feature/service/ProcessInstanceServiceTest.java 2008-12-20 12:56:31 UTC (rev 3480)
@@ -23,6 +23,8 @@
// $Id$
+import java.io.IOException;
+
import javax.management.ObjectName;
import org.jboss.bpm.api.model.ProcessDefinition;
@@ -89,5 +91,8 @@
assertNull("ProcessDefinition unregistered", procDefService.getProcessDefinition(procDef.getKey()));
}
- protected abstract ProcessDefinition getProcessDefinition();
+ protected ProcessDefinition getProcessDefinition() throws IOException
+ {
+ return null;
+ }
}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/pattern/control/exclusivechoice/ExclusiveChoiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/pattern/control/exclusivechoice/ExclusiveChoiceTest.java 2008-12-20 12:55:32 UTC (rev 3479)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/pattern/control/exclusivechoice/ExclusiveChoiceTest.java 2008-12-20 12:56:31 UTC (rev 3480)
@@ -44,7 +44,7 @@
* @author thomas.diesler(a)jboss.com
* @since 06-Aug-2008
*/
-public class ExclusiveChoiceTest extends CTSTestCase
+public abstract class ExclusiveChoiceTest extends CTSTestCase
{
public void testGateA() throws Exception
{
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/pattern/control/sequence/SequencePersistenceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/pattern/control/sequence/SequencePersistenceTest.java 2008-12-20 12:55:32 UTC (rev 3479)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/pattern/control/sequence/SequencePersistenceTest.java 2008-12-20 12:56:31 UTC (rev 3480)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.cts.pattern.control.sequence;
-
-// $Id$
-
-import java.io.IOException;
-
-import javax.management.ObjectName;
-
-import org.jboss.bpm.api.model.ProcessDefinition;
-import org.jboss.bpm.incubator.service.PersistenceService;
-
-/**
- * Test the basic execution sequence
- *
- * @author thomas.diesler(a)jboss.com
- * @since 03-Jul-2008
- */
-public class SequencePersistenceTest extends SequenceTest
-{
- public ProcessDefinition getProcessDefinition() throws IOException
- {
- ProcessDefinition procDef = super.getProcessDefinition();
-
- // Save the process definition
- PersistenceService service = getProcessEngine().getService(PersistenceService.class);
- ObjectName procDefID = service.saveProcessDefinition(procDef);
-
- // Reload the process defintion
- return service.loadProcessDefinition(procDefID);
- }
-}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/pattern/control/sequence/SequenceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/pattern/control/sequence/SequenceTest.java 2008-12-20 12:55:32 UTC (rev 3479)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/pattern/control/sequence/SequenceTest.java 2008-12-20 12:56:31 UTC (rev 3480)
@@ -24,15 +24,17 @@
// $Id$
import java.io.IOException;
+import java.net.URL;
import java.util.List;
import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.model.ProcessInstance;
import org.jboss.bpm.api.model.Signal;
+import org.jboss.bpm.api.model.ProcessInstance.ProcessStatus;
import org.jboss.bpm.api.model.Signal.SignalType;
+import org.jboss.bpm.api.runtime.Token;
+import org.jboss.bpm.api.service.ProcessDefinitionService;
import org.jboss.bpm.api.test.CTSTestCase;
-import org.jboss.bpm.incubator.client.ProcessInstanceExt;
-import org.jboss.bpm.incubator.model.builder.ProcessBuilderExt;
-import org.jboss.bpm.incubator.service.ProcessBuilderService;
/**
* Test the basic execution sequence
@@ -46,12 +48,16 @@
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstanceExt proc = (ProcessInstanceExt)procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
- // Start the Process
- proc.startProcessAsync();
- proc.waitForEnd();
-
+ Token token = proc.startProcess();
+ assertEquals("Node name", "a", token.getNode().getName());
+
+ token.signal();
+ assertEquals("Node name", "end", token.getNode().getName());
+
+ assertEquals(ProcessStatus.Completed, proc.getProcessStatus());
+
// Validate received signals
List<Signal> signals = getSignals();
assertEquals(SignalType.SYSTEM_PROCESS_ENTER, signals.get(0).getSignalType());
@@ -60,16 +66,18 @@
assertEquals(SignalType.SYSTEM_TASK_ENTER, signals.get(3).getSignalType());
assertEquals(SignalType.SYSTEM_TASK_EXIT, signals.get(4).getSignalType());
assertEquals(SignalType.SYSTEM_END_EVENT_ENTER, signals.get(5).getSignalType());
- assertEquals(SignalType.SYSTEM_END_EVENT_EXIT, signals.get(6).getSignalType());
- assertEquals(SignalType.SYSTEM_PROCESS_EXIT, signals.get(7).getSignalType());
+
+ // TODO: Discuss whether SYSTEM_END_EVENT_EXIT should be emmited
+ //assertEquals(SignalType.SYSTEM_END_EVENT_EXIT, signals.get(6).getSignalType());
+
+ assertEquals(SignalType.SYSTEM_PROCESS_EXIT, signals.get(6).getSignalType());
}
public ProcessDefinition getProcessDefinition() throws IOException
{
- ProcessBuilderService pbService = getProcessEngine().getService(ProcessBuilderService.class);
- ProcessBuilderExt procBuilder = (ProcessBuilderExt)pbService.getProcessBuilder();
- procBuilder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("Task");
- procBuilder.addTaskExt("Task").addSequenceFlow("End").addEndEvent("End");
- return procBuilder.getProcessDefinition();
+ URL pdURL = getResourceURL("cts/common/simple-sequence-" + getDialect() + ".xml");
+ ProcessDefinitionService pdService = getProcessEngine().getService(ProcessDefinitionService.class);
+ ProcessDefinition procDef = pdService.parseProcessDefinition(pdURL);
+ return procDef;
}
}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/incubator/service/signal/SignalMultithreadTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/incubator/service/signal/SignalMultithreadTest.java 2008-12-20 12:55:32 UTC (rev 3479)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/incubator/service/signal/SignalMultithreadTest.java 2008-12-20 12:56:31 UTC (rev 3480)
@@ -37,7 +37,7 @@
*/
public class SignalMultithreadTest extends CTSTestCase
{
- final SignalService sigService = SignalService.locateSignalService();
+ final SignalService sigService = getProcessEngine().getService(SignalService.class);
final Signal sigA = newSignal(getTestID(), SignalType.USER_SIGNAL, "A");
final Signal sigB = newSignal(getTestID(), SignalType.USER_SIGNAL, "B");
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/incubator/service/signal/SignalServiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/incubator/service/signal/SignalServiceTest.java 2008-12-20 12:55:32 UTC (rev 3479)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/incubator/service/signal/SignalServiceTest.java 2008-12-20 12:56:31 UTC (rev 3480)
@@ -43,7 +43,7 @@
*/
public void testSignalListener() throws Exception
{
- SignalService sigService = SignalService.locateSignalService();
+ SignalService sigService = getProcessEngine().getService(SignalService.class);
Signal signal = newSignal(getTestID(), SignalType.USER_SIGNAL, "HelloWorld");
sigService.throwSignal(signal);
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/incubator/startevent/StartEventSignalTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/incubator/startevent/StartEventSignalTest.java 2008-12-20 12:55:32 UTC (rev 3479)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/incubator/startevent/StartEventSignalTest.java 2008-12-20 12:56:31 UTC (rev 3480)
@@ -76,7 +76,7 @@
}
// Send start trigger signal
- SignalService sigService = SignalService.locateSignalService();
+ SignalService sigService = getProcessEngine().getService(SignalService.class);
sigService.throwSignal(newSignal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "A"));
// Get the just started process
@@ -128,7 +128,7 @@
{
if (nextSignal != null)
{
- SignalService sigService = SignalService.locateSignalService();
+ SignalService sigService = null; //getProcessEngine().getService(SignalService.class);
sigService.throwSignal(nextSignal);
nextSignal = null;
}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/incubator/task/receive/ReceiveTaskTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/incubator/task/receive/ReceiveTaskTest.java 2008-12-20 12:55:32 UTC (rev 3479)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/incubator/task/receive/ReceiveTaskTest.java 2008-12-20 12:56:31 UTC (rev 3480)
@@ -141,7 +141,7 @@
}
}
};
- SignalService sigManager = SignalService.locateSignalService();
+ SignalService sigManager = getProcessEngine().getService(SignalService.class);
sigManager.addSignalListener(sigListener);
try
Added: projects/spec/trunk/modules/cts/src/test/resources/cts/common/simple-sequence-jbpm3.xml
===================================================================
--- projects/spec/trunk/modules/cts/src/test/resources/cts/common/simple-sequence-jbpm3.xml (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/resources/cts/common/simple-sequence-jbpm3.xml 2008-12-20 12:56:31 UTC (rev 3480)
@@ -0,0 +1,10 @@
+<process-definition name="simpleSequence" xmlns="urn:jbpm.org:jpdl-3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jbpm.org:jpdl-3.2 http://jbpm.org/xsd/jpdl-3.2.xsd">
+ <start-state name='start'>
+ <transition to='a' />
+ </start-state>
+ <state name='a'>
+ <transition to='end' />
+ </state>
+ <end-state name='end' />
+</process-definition>
Property changes on: projects/spec/trunk/modules/cts/src/test/resources/cts/common/simple-sequence-jbpm3.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 4 months
JBoss JBPM SVN: r3479 - in jbpm3/trunk/modules: core/src/main/java/org/jbpm/graph/def and 8 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-12-20 07:55:32 -0500 (Sat, 20 Dec 2008)
New Revision: 3479
Added:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/signal/
jbpm3/trunk/modules/core/src/main/java/org/jbpm/signal/EventService.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/EventServiceFactory.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/SignalBuilderServiceImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/SignalServiceImpl.java
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/GraphElement.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/exe/ExecutionContext.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/svc/Service.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/svc/Services.java
jbpm3/trunk/modules/core/src/main/resources/org/jbpm/default.jbpm.cfg.xml
jbpm3/trunk/modules/integration/.classpath
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/model/ExclusiveGatewayImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/model/ProcessInstanceImpl.java
jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/ContextServiceImpl.java
jbpm3/trunk/modules/integration/src/main/resources/bpm-spec-jbpm3-beans.xml
Log:
Add bpm-spec signal support
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/GraphElement.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/GraphElement.java 2008-12-20 12:06:16 UTC (rev 3478)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/GraphElement.java 2008-12-20 12:55:32 UTC (rev 3479)
@@ -39,11 +39,13 @@
import org.jbpm.instantiation.UserCodeInterceptorConfig;
import org.jbpm.job.ExecuteActionJob;
import org.jbpm.msg.MessageService;
+import org.jbpm.signal.EventService;
+import org.jbpm.svc.Service;
import org.jbpm.svc.Services;
import org.jbpm.util.EqualsUtil;
-public abstract class GraphElement implements Identifiable, Serializable {
-
+public abstract class GraphElement implements Identifiable, Serializable
+{
private static final long serialVersionUID = 1L;
long id = 0;
@@ -53,67 +55,82 @@
protected Map events = null;
protected List exceptionHandlers = null;
- public GraphElement() {
+ public GraphElement()
+ {
}
-
- public GraphElement( String name ) {
- setName( name );
+
+ public GraphElement(String name)
+ {
+ setName(name);
}
// events ///////////////////////////////////////////////////////////////////
/**
- * indicative set of event types supported by this graph element.
- * this is currently only used by the process designer to know which
- * event types to show on a given graph element. in process definitions
- * and at runtime, there are no contstraints on the event-types.
+ * indicative set of event types supported by this graph element. this is currently only used by the process designer
+ * to know which event types to show on a given graph element. in process definitions and at runtime, there are no
+ * contstraints on the event-types.
*/
public abstract String[] getSupportedEventTypes();
/**
* gets the events, keyd by eventType (java.lang.String).
*/
- public Map getEvents() {
+ public Map getEvents()
+ {
return events;
}
- public boolean hasEvents() {
- return ( (events!=null)
- && (events.size()>0) );
+ public boolean hasEvents()
+ {
+ return ((events != null) && (events.size() > 0));
}
- public Event getEvent(String eventType) {
+ public Event getEvent(String eventType)
+ {
Event event = null;
- if (events!=null) {
- event = (Event) events.get(eventType);
+ if (events != null)
+ {
+ event = (Event)events.get(eventType);
}
return event;
}
-
- public boolean hasEvent(String eventType) {
+
+ public boolean hasEvent(String eventType)
+ {
boolean hasEvent = false;
- if (events!=null) {
+ if (events != null)
+ {
hasEvent = events.containsKey(eventType);
}
return hasEvent;
}
-
- public Event addEvent(Event event) {
- if (event == null) throw new IllegalArgumentException("can't add a null event to a graph element");
- if (event.getEventType() == null) throw new IllegalArgumentException("can't add an event without an eventType to a graph element");
- if (events == null) events = new HashMap();
+
+ public Event addEvent(Event event)
+ {
+ if (event == null)
+ throw new IllegalArgumentException("can't add a null event to a graph element");
+ if (event.getEventType() == null)
+ throw new IllegalArgumentException("can't add an event without an eventType to a graph element");
+ if (events == null)
+ events = new HashMap();
events.put(event.getEventType(), event);
event.graphElement = this;
return event;
}
-
- public Event removeEvent(Event event) {
+
+ public Event removeEvent(Event event)
+ {
Event removedEvent = null;
- if (event == null) throw new IllegalArgumentException("can't remove a null event from a graph element");
- if (event.getEventType() == null) throw new IllegalArgumentException("can't remove an event without an eventType from a graph element");
- if (events != null) {
- removedEvent = (Event) events.remove(event.getEventType());
- if (removedEvent!=null) {
+ if (event == null)
+ throw new IllegalArgumentException("can't remove a null event from a graph element");
+ if (event.getEventType() == null)
+ throw new IllegalArgumentException("can't remove an event without an eventType from a graph element");
+ if (events != null)
+ {
+ removedEvent = (Event)events.remove(event.getEventType());
+ if (removedEvent != null)
+ {
event.graphElement = null;
}
}
@@ -125,98 +142,130 @@
/**
* is the list of exception handlers associated to this graph element.
*/
- public List getExceptionHandlers() {
+ public List getExceptionHandlers()
+ {
return exceptionHandlers;
}
-
- public ExceptionHandler addExceptionHandler(ExceptionHandler exceptionHandler) {
- if (exceptionHandler == null) throw new IllegalArgumentException("can't add a null exceptionHandler to a graph element");
- if (exceptionHandlers == null) exceptionHandlers = new ArrayList();
+
+ public ExceptionHandler addExceptionHandler(ExceptionHandler exceptionHandler)
+ {
+ if (exceptionHandler == null)
+ throw new IllegalArgumentException("can't add a null exceptionHandler to a graph element");
+ if (exceptionHandlers == null)
+ exceptionHandlers = new ArrayList();
exceptionHandlers.add(exceptionHandler);
exceptionHandler.graphElement = this;
return exceptionHandler;
}
-
- public void removeExceptionHandler(ExceptionHandler exceptionHandler) {
- if (exceptionHandler == null) throw new IllegalArgumentException("can't remove a null exceptionHandler from an graph element");
- if (exceptionHandlers != null) {
- if (exceptionHandlers.remove(exceptionHandler)) {
+
+ public void removeExceptionHandler(ExceptionHandler exceptionHandler)
+ {
+ if (exceptionHandler == null)
+ throw new IllegalArgumentException("can't remove a null exceptionHandler from an graph element");
+ if (exceptionHandlers != null)
+ {
+ if (exceptionHandlers.remove(exceptionHandler))
+ {
exceptionHandler.graphElement = null;
}
}
}
- public void reorderExceptionHandler(int oldIndex, int newIndex) {
- if ( (exceptionHandlers!=null)
- && (Math.min(oldIndex, newIndex)>=0)
- && (Math.max(oldIndex, newIndex)<exceptionHandlers.size()) ) {
+ public void reorderExceptionHandler(int oldIndex, int newIndex)
+ {
+ if ((exceptionHandlers != null) && (Math.min(oldIndex, newIndex) >= 0) && (Math.max(oldIndex, newIndex) < exceptionHandlers.size()))
+ {
Object o = exceptionHandlers.remove(oldIndex);
exceptionHandlers.add(newIndex, o);
- } else {
- throw new IndexOutOfBoundsException("couldn't reorder element from index '"+oldIndex+"' to index '"+newIndex+"' in exceptionHandler-list '"+exceptionHandlers+"'");
}
+ else
+ {
+ throw new IndexOutOfBoundsException("couldn't reorder element from index '" + oldIndex + "' to index '" + newIndex + "' in exceptionHandler-list '"
+ + exceptionHandlers + "'");
+ }
}
// event handling ///////////////////////////////////////////////////////////
- public void fireEvent(String eventType, ExecutionContext executionContext) {
- log.debug( "event '"+eventType+"' on '"+this+"' for '"+executionContext.getToken()+"'" );
- try {
+ public void fireEvent(String eventType, ExecutionContext executionContext)
+ {
+ log.debug("event '" + eventType + "' on '" + this + "' for '" + executionContext.getToken() + "'");
+ try
+ {
executionContext.setEventSource(this);
+
+ Services services = executionContext.getJbpmContext().getServices();
+ EventService evService = (EventService)services.getService(EventService.SERVICE_NAME);
+ if (evService != null)
+ {
+ evService.fireEvent(eventType, this, executionContext);
+ }
+
fireAndPropagateEvent(eventType, executionContext);
- } finally {
+ }
+ finally
+ {
executionContext.setEventSource(null);
}
}
- public void fireAndPropagateEvent(String eventType, ExecutionContext executionContext) {
+ public void fireAndPropagateEvent(String eventType, ExecutionContext executionContext)
+ {
// calculate if the event was fired on this element or if it was a propagated event
boolean isPropagated = !(this.equals(executionContext.getEventSource()));
-
- // execute static actions
+
+ // execute static actions
Event event = getEvent(eventType);
- if (event!=null) {
+ if (event != null)
+ {
// update the context
executionContext.setEvent(event);
// execute the static actions specified in the process definition
executeActions(event.getActions(), executionContext, isPropagated);
}
-
+
// execute the runtime actions
List runtimeActions = getRuntimeActionsForEvent(executionContext, eventType);
executeActions(runtimeActions, executionContext, isPropagated);
// remove the event from the context
executionContext.setEvent(null);
-
+
// propagate the event to the parent element
GraphElement parent = getParent();
- if (parent!=null) {
+ if (parent != null)
+ {
parent.fireAndPropagateEvent(eventType, executionContext);
}
}
- void executeActions(List actions, ExecutionContext executionContext, boolean isPropagated) {
- if (actions!=null) {
+ void executeActions(List actions, ExecutionContext executionContext, boolean isPropagated)
+ {
+ if (actions != null)
+ {
Iterator iter = actions.iterator();
- while (iter.hasNext()) {
- Action action = (Action) iter.next();
- if ( action.acceptsPropagatedEvents()
- || (!isPropagated)
- ) {
- if (action.isAsync()) {
+ while (iter.hasNext())
+ {
+ Action action = (Action)iter.next();
+ if (action.acceptsPropagatedEvents() || (!isPropagated))
+ {
+ if (action.isAsync())
+ {
ExecuteActionJob job = createAsyncActionExecutionJob(executionContext.getToken(), action);
- MessageService messageService = (MessageService) Services.getCurrentService(Services.SERVICENAME_MESSAGE);
+ MessageService messageService = (MessageService)Services.getCurrentService(Services.SERVICENAME_MESSAGE);
messageService.send(job);
- } else {
+ }
+ else
+ {
executeAction(action, executionContext);
}
}
}
}
}
-
- protected ExecuteActionJob createAsyncActionExecutionJob(Token token, Action action) {
+
+ protected ExecuteActionJob createAsyncActionExecutionJob(Token token, Action action)
+ {
ExecuteActionJob job = new ExecuteActionJob(token);
job.setAction(action);
job.setDueDate(new Date());
@@ -224,85 +273,106 @@
return job;
}
- public void executeAction(Action action, ExecutionContext executionContext) {
+ public void executeAction(Action action, ExecutionContext executionContext)
+ {
Token token = executionContext.getToken();
// create action log
ActionLog actionLog = new ActionLog(action);
token.startCompositeLog(actionLog);
- // if this is an action being executed in an event,
- // the token needs to be locked. if this is an action
- // being executed as the node behaviour or if the token
+ // if this is an action being executed in an event,
+ // the token needs to be locked. if this is an action
+ // being executed as the node behaviour or if the token
// is already locked, the token doesn't need to be locked.
- boolean actionMustBeLocked = (executionContext.getEvent()!=null)
- && (!token.isLocked());
+ boolean actionMustBeLocked = (executionContext.getEvent() != null) && (!token.isLocked());
- try {
+ try
+ {
// update the execution context
executionContext.setAction(action);
// execute the action
- log.debug("executing action '"+action+"'");
- String lockOwnerId = "token["+token.getId()+"]";
- try {
- if (actionMustBeLocked) {
+ log.debug("executing action '" + action + "'");
+ String lockOwnerId = "token[" + token.getId() + "]";
+ try
+ {
+ if (actionMustBeLocked)
+ {
token.lock(lockOwnerId);
}
-
- if (UserCodeInterceptorConfig.userCodeInterceptor!=null) {
+
+ if (UserCodeInterceptorConfig.userCodeInterceptor != null)
+ {
UserCodeInterceptorConfig.userCodeInterceptor.executeAction(action, executionContext);
- } else {
+ }
+ else
+ {
action.execute(executionContext);
}
- } finally {
- if (actionMustBeLocked) {
+ }
+ finally
+ {
+ if (actionMustBeLocked)
+ {
token.unlock(lockOwnerId);
}
}
-
- } catch (Exception exception) {
+
+ }
+ catch (Exception exception)
+ {
// NOTE that Error's are not caught because that might halt the JVM and mask the original Error.
- log.error("action threw exception: "+exception.getMessage(), exception);
-
- // log the action exception
+ log.error("action threw exception: " + exception.getMessage(), exception);
+
+ // log the action exception
actionLog.setException(exception);
// If an exception is already set we are in an action of an exception handler
// in this case don't give the exception to the handlers but throw it to the client
// see https://jira.jboss.org/jira/browse/JBPM-1887
- if (executionContext.getException()==null) {
+ if (executionContext.getException() == null)
+ {
// if an exception handler is available
raiseException(exception, executionContext);
}
- else {
- // if there is no parent we need to throw an action exception to the client
- if (exception instanceof JbpmException) {
- throw (JbpmException) exception;
- } else {
- throw new DelegationException(exception, executionContext);
- }
- }
- } finally {
+ else
+ {
+ // if there is no parent we need to throw an action exception to the client
+ if (exception instanceof JbpmException)
+ {
+ throw (JbpmException)exception;
+ }
+ else
+ {
+ throw new DelegationException(exception, executionContext);
+ }
+ }
+ }
+ finally
+ {
executionContext.setAction(null);
token.endCompositeLog();
}
}
- List getRuntimeActionsForEvent(ExecutionContext executionContext, String eventType) {
+ List getRuntimeActionsForEvent(ExecutionContext executionContext, String eventType)
+ {
List runtimeActionsForEvent = null;
List runtimeActions = executionContext.getProcessInstance().getRuntimeActions();
- if (runtimeActions!=null) {
+ if (runtimeActions != null)
+ {
Iterator iter = runtimeActions.iterator();
- while (iter.hasNext()) {
- RuntimeAction runtimeAction = (RuntimeAction) iter.next();
+ while (iter.hasNext())
+ {
+ RuntimeAction runtimeAction = (RuntimeAction)iter.next();
// if the runtime-action action is registered on this element and this eventType
- if ( (this.equals(runtimeAction.getGraphElement()))
- && (eventType.equals(runtimeAction.getEventType()))
- ) {
- // ... add its action to the list of runtime actions
- if (runtimeActionsForEvent==null) runtimeActionsForEvent = new ArrayList();
+ if ((this.equals(runtimeAction.getGraphElement())) && (eventType.equals(runtimeAction.getEventType())))
+ {
+ // ... add its action to the list of runtime actions
+ if (runtimeActionsForEvent == null)
+ runtimeActionsForEvent = new ArrayList();
runtimeActionsForEvent.add(runtimeAction.getAction());
}
}
@@ -310,117 +380,118 @@
return runtimeActionsForEvent;
}
-/*
- // the next instruction merges the actions specified in the process definition with the runtime actions
- List actions = event.collectActions(executionContext);
-
- // loop over all actions of this event
- Iterator iter = actions.iterator();
- while (iter.hasNext()) {
- Action action = (Action) iter.next();
- executionContext.setAction(action);
-
- if ( (!isPropagated)
- || (action.acceptsPropagatedEvents() ) ) {
-
- // create action log
- ActionLog actionLog = new ActionLog(action);
- executionContext.getToken().startCompositeLog(actionLog);
-
- try {
- // execute the action
- action.execute(executionContext);
-
- } catch (Exception exception) {
- // NOTE that Error's are not caught because that might halt the JVM and mask the original Error.
- Event.log.error("action threw exception: "+exception.getMessage(), exception);
-
- // log the action exception
- actionLog.setException(exception);
-
- // if an exception handler is available
- event.graphElement.raiseException(exception, executionContext);
- } finally {
- executionContext.getToken().endCompositeLog();
- }
- }
- }
- }
-*/
+ /*
+ * // the next instruction merges the actions specified in the process definition with the runtime actions List
+ * actions = event.collectActions(executionContext);
+ *
+ * // loop over all actions of this event Iterator iter = actions.iterator(); while (iter.hasNext()) { Action action =
+ * (Action) iter.next(); executionContext.setAction(action);
+ *
+ * if ( (!isPropagated) || (action.acceptsPropagatedEvents() ) ) {
+ *
+ * // create action log ActionLog actionLog = new ActionLog(action);
+ * executionContext.getToken().startCompositeLog(actionLog);
+ *
+ * try { // execute the action action.execute(executionContext);
+ *
+ * } catch (Exception exception) { // NOTE that Error's are not caught because that might halt the JVM and mask the
+ * original Error. Event.log.error("action threw exception: "+exception.getMessage(), exception);
+ *
+ * // log the action exception actionLog.setException(exception);
+ *
+ * // if an exception handler is available event.graphElement.raiseException(exception, executionContext); } finally {
+ * executionContext.getToken().endCompositeLog(); } } } }
+ */
/**
- * throws an ActionException if no applicable exception handler is found.
- * An ExceptionHandler is searched for in this graph element and then recursively up the
- * parent hierarchy.
- * If an exception handler is found, it is applied. If the exception handler does not
- * throw an exception, the exception is considered handled. Otherwise the search for
- * an applicable exception handler continues where it left of with the newly thrown
- * exception.
+ * throws an ActionException if no applicable exception handler is found. An ExceptionHandler is searched for in this
+ * graph element and then recursively up the parent hierarchy. If an exception handler is found, it is applied. If the
+ * exception handler does not throw an exception, the exception is considered handled. Otherwise the search for an
+ * applicable exception handler continues where it left of with the newly thrown exception.
*/
- public void raiseException(Throwable exception, ExecutionContext executionContext) throws DelegationException {
+ public void raiseException(Throwable exception, ExecutionContext executionContext) throws DelegationException
+ {
boolean isHandled = false;
- if (exceptionHandlers!=null) {
- try {
+ if (exceptionHandlers != null)
+ {
+ try
+ {
ExceptionHandler exceptionHandler = findExceptionHandler(exception);
- if (exceptionHandler!=null) {
+ if (exceptionHandler != null)
+ {
executionContext.setException(exception);
exceptionHandler.handleException(this, executionContext);
isHandled = true;
}
- } catch (Exception e) {
+ }
+ catch (Exception e)
+ {
// NOTE that Error's are not caught because that might halt the JVM and mask the original Error.
exception = e;
}
}
- if (!isHandled) {
+ if (!isHandled)
+ {
GraphElement parent = getParent();
// if this graph element has a parent
- if ( (parent!=null)
- && (parent!=this) ){
+ if ((parent != null) && (parent != this))
+ {
// action to the parent
parent.raiseException(exception, executionContext);
- } else {
+ }
+ else
+ {
// rollback the actions
// rollbackActions(executionContext);
-
+
// if there is no parent we need to throw an action exception to the client
- if (exception instanceof JbpmException) {
- throw (JbpmException) exception;
- } else {
+ if (exception instanceof JbpmException)
+ {
+ throw (JbpmException)exception;
+ }
+ else
+ {
throw new DelegationException(exception, executionContext);
}
}
}
}
- protected ExceptionHandler findExceptionHandler(Throwable exception) {
+ protected ExceptionHandler findExceptionHandler(Throwable exception)
+ {
ExceptionHandler exceptionHandler = null;
-
- if (exceptionHandlers!=null) {
+
+ if (exceptionHandlers != null)
+ {
Iterator iter = exceptionHandlers.iterator();
- while (iter.hasNext() && (exceptionHandler==null)) {
- ExceptionHandler candidate = (ExceptionHandler) iter.next();
- if (candidate.matches(exception)) {
+ while (iter.hasNext() && (exceptionHandler == null))
+ {
+ ExceptionHandler candidate = (ExceptionHandler)iter.next();
+ if (candidate.matches(exception))
+ {
exceptionHandler = candidate;
}
}
}
-
+
return exceptionHandler;
}
- public GraphElement getParent() {
+ public GraphElement getParent()
+ {
return processDefinition;
}
/**
* @return all the parents of this graph element ordered by age.
*/
- public List getParents() {
+ public List getParents()
+ {
List parents = new ArrayList();
- GraphElement parent = getParent();
- if (parent!=null) {
+ GraphElement parent = getParent();
+ if (parent != null)
+ {
parent.addParentChain(parents);
}
return parents;
@@ -429,62 +500,83 @@
/**
* @return this graph element plus all the parents ordered by age.
*/
- public List getParentChain() {
+ public List getParentChain()
+ {
List parents = new ArrayList();
this.addParentChain(parents);
return parents;
}
- void addParentChain(List parentChain) {
+ void addParentChain(List parentChain)
+ {
parentChain.add(this);
GraphElement parent = getParent();
- if (parent!=null) {
+ if (parent != null)
+ {
parent.addParentChain(parentChain);
}
}
-
- public String toString() {
- String className = getClass().getName();
- className = className.substring(className.lastIndexOf('.')+1);
- if (name!=null) {
- className = className+"("+name+")";
- } else {
- className = className+"("+Integer.toHexString(System.identityHashCode(this))+")";
+
+ public String toString()
+ {
+ String className = getClass().getName();
+ className = className.substring(className.lastIndexOf('.') + 1);
+ if (name != null)
+ {
+ className = className + "(" + name + ")";
}
+ else
+ {
+ className = className + "(" + Integer.toHexString(System.identityHashCode(this)) + ")";
+ }
return className;
}
// equals ///////////////////////////////////////////////////////////////////
// hack to support comparing hibernate proxies against the real objects
// since this always falls back to ==, we don't need to overwrite the hashcode
- public boolean equals(Object o) {
+ public boolean equals(Object o)
+ {
return EqualsUtil.equals(this, o);
}
-
+
// getters and setters //////////////////////////////////////////////////////
-
- public long getId() {
+
+ public long getId()
+ {
return id;
}
- public String getName() {
+
+ public String getName()
+ {
return name;
}
- public void setName( String name ) {
+
+ public void setName(String name)
+ {
this.name = name;
}
- public String getDescription() {
+
+ public String getDescription()
+ {
return description;
}
- public void setDescription(String description) {
+
+ public void setDescription(String description)
+ {
this.description = description;
}
- public ProcessDefinition getProcessDefinition() {
+
+ public ProcessDefinition getProcessDefinition()
+ {
return processDefinition;
}
- public void setProcessDefinition(ProcessDefinition processDefinition) {
+
+ public void setProcessDefinition(ProcessDefinition processDefinition)
+ {
this.processDefinition = processDefinition;
}
-
+
// logger ///////////////////////////////////////////////////////////////////
private static final Log log = LogFactory.getLog(GraphElement.class);
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/exe/ExecutionContext.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/exe/ExecutionContext.java 2008-12-20 12:06:16 UTC (rev 3478)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/exe/ExecutionContext.java 2008-12-20 12:55:32 UTC (rev 3479)
@@ -39,11 +39,12 @@
import org.jbpm.taskmgmt.exe.TaskInstance;
import org.jbpm.taskmgmt.exe.TaskMgmtInstance;
-public class ExecutionContext {
-
+public class ExecutionContext
+{
+
protected Token token = null;
protected Event event = null;
- protected GraphElement eventSource = null;
+ protected GraphElement eventSource = null;
protected Action action = null;
protected Throwable exception = null;
protected Transition transition = null;
@@ -53,38 +54,46 @@
protected TaskInstance taskInstance = null;
protected ProcessInstance subProcessInstance = null;
- public ExecutionContext( Token token ) {
+ public ExecutionContext(Token token)
+ {
this.token = token;
}
- public ExecutionContext(ExecutionContext other) {
+ public ExecutionContext(ExecutionContext other)
+ {
this.token = other.token;
this.event = other.event;
this.action = other.action;
}
- public Node getNode() {
+ public Node getNode()
+ {
return token.getNode();
}
- public ProcessDefinition getProcessDefinition() {
+ public ProcessDefinition getProcessDefinition()
+ {
ProcessInstance processInstance = getProcessInstance();
- return ( processInstance!=null ? processInstance.getProcessDefinition() : null );
+ return (processInstance != null ? processInstance.getProcessDefinition() : null);
}
- public void setAction(Action action) {
+ public void setAction(Action action)
+ {
this.action = action;
- if (action!=null) {
+ if (action != null)
+ {
this.event = action.getEvent();
}
}
-
- public ProcessInstance getProcessInstance() {
+
+ public ProcessInstance getProcessInstance()
+ {
return token.getProcessInstance();
}
-
- public String toString() {
- return "ExecutionContext["+ token + "]";
+
+ public String toString()
+ {
+ return "ExecutionContext[" + token + "]";
}
// convenience methods //////////////////////////////////////////////////////
@@ -92,160 +101,224 @@
/**
* set a process variable.
*/
- public void setVariable(String name, Object value) {
- if (taskInstance!=null) {
+ public void setVariable(String name, Object value)
+ {
+ if (taskInstance != null)
+ {
taskInstance.setVariable(name, value);
- } else {
+ }
+ else
+ {
getContextInstance().setVariable(name, value, token);
}
}
-
+
/**
* get a process variable.
*/
- public Object getVariable(String name) {
- if (taskInstance!=null) {
+ public Object getVariable(String name)
+ {
+ if (taskInstance != null)
+ {
return taskInstance.getVariable(name);
- } else {
+ }
+ else
+ {
return getContextInstance().getVariable(name, token);
}
}
-
+
/**
- * leave this node over the default transition. This method is only available
- * on node actions. Not on actions that are executed on events. Actions on
- * events cannot change the flow of execution.
+ * leave this node over the default transition. This method is only available on node actions. Not on actions that are
+ * executed on events. Actions on events cannot change the flow of execution.
*/
- public void leaveNode() {
+ public void leaveNode()
+ {
getNode().leave(this);
}
+
/**
- * leave this node over the given transition. This method is only available
- * on node actions. Not on actions that are executed on events. Actions on
- * events cannot change the flow of execution.
+ * leave this node over the given transition. This method is only available on node actions. Not on actions that are
+ * executed on events. Actions on events cannot change the flow of execution.
*/
- public void leaveNode(String transitionName) {
+ public void leaveNode(String transitionName)
+ {
getNode().leave(this, transitionName);
}
+
/**
- * leave this node over the given transition. This method is only available
- * on node actions. Not on actions that are executed on events. Actions on
- * events cannot change the flow of execution.
+ * leave this node over the given transition. This method is only available on node actions. Not on actions that are
+ * executed on events. Actions on events cannot change the flow of execution.
*/
- public void leaveNode(Transition transition) {
+ public void leaveNode(Transition transition)
+ {
getNode().leave(this, transition);
}
-
- public ModuleDefinition getDefinition(Class clazz) {
+
+ public ModuleDefinition getDefinition(Class clazz)
+ {
return getProcessDefinition().getDefinition(clazz);
}
- public ModuleInstance getInstance(Class clazz) {
- ProcessInstance processInstance = (token!=null ? token.getProcessInstance() : null);
- return (processInstance!=null ? processInstance.getInstance(clazz): null);
+ public ModuleInstance getInstance(Class clazz)
+ {
+ ProcessInstance processInstance = (token != null ? token.getProcessInstance() : null);
+ return (processInstance != null ? processInstance.getInstance(clazz) : null);
}
-
- public ContextInstance getContextInstance() {
- return (ContextInstance) getInstance(ContextInstance.class);
+
+ public ContextInstance getContextInstance()
+ {
+ return (ContextInstance)getInstance(ContextInstance.class);
}
- public TaskMgmtInstance getTaskMgmtInstance() {
- return (TaskMgmtInstance) getInstance(TaskMgmtInstance.class);
+ public TaskMgmtInstance getTaskMgmtInstance()
+ {
+ return (TaskMgmtInstance)getInstance(TaskMgmtInstance.class);
}
- public JbpmContext getJbpmContext() {
+ public JbpmContext getJbpmContext()
+ {
return JbpmContext.getCurrentJbpmContext();
}
// getters and setters //////////////////////////////////////////////////////
-
- public void setTaskInstance(TaskInstance taskInstance) {
+
+ public void setTaskInstance(TaskInstance taskInstance)
+ {
this.taskInstance = taskInstance;
- this.task = (taskInstance!=null ? taskInstance.getTask() : null);
+ this.task = (taskInstance != null ? taskInstance.getTask() : null);
}
- public Token getToken() {
+ public Token getToken()
+ {
return token;
}
- public Action getAction() {
+
+ public Action getAction()
+ {
return action;
}
- public Event getEvent() {
+
+ public Event getEvent()
+ {
return event;
}
- public void setEvent(Event event) {
+
+ public void setEvent(Event event)
+ {
this.event = event;
}
- public Throwable getException() {
+
+ public Throwable getException()
+ {
return exception;
}
- public void setException(Throwable exception) {
+
+ public void setException(Throwable exception)
+ {
this.exception = exception;
}
- public Transition getTransition() {
+
+ public Transition getTransition()
+ {
return transition;
}
- public void setTransition(Transition transition) {
+
+ public void setTransition(Transition transition)
+ {
this.transition = transition;
}
- public Node getTransitionSource() {
+
+ public Node getTransitionSource()
+ {
return transitionSource;
}
- public void setTransitionSource(Node transitionSource) {
+
+ public void setTransitionSource(Node transitionSource)
+ {
this.transitionSource = transitionSource;
}
- public GraphElement getEventSource() {
+
+ public GraphElement getEventSource()
+ {
return eventSource;
}
- public void setEventSource(GraphElement eventSource) {
+
+ public void setEventSource(GraphElement eventSource)
+ {
this.eventSource = eventSource;
}
- public Task getTask() {
+
+ public Task getTask()
+ {
return task;
}
- public void setTask(Task task) {
+
+ public void setTask(Task task)
+ {
this.task = task;
}
- public TaskInstance getTaskInstance() {
+
+ public TaskInstance getTaskInstance()
+ {
return taskInstance;
}
- public ProcessInstance getSubProcessInstance() {
+
+ public ProcessInstance getSubProcessInstance()
+ {
return subProcessInstance;
}
- public void setSubProcessInstance(ProcessInstance subProcessInstance) {
+
+ public void setSubProcessInstance(ProcessInstance subProcessInstance)
+ {
this.subProcessInstance = subProcessInstance;
}
- public Timer getTimer() {
+
+ public Timer getTimer()
+ {
return timer;
}
- public void setTimer(Timer timer) {
+
+ public void setTimer(Timer timer)
+ {
this.timer = timer;
}
// thread local execution context
-
+
static ThreadLocal threadLocalContextStack = new ThreadLocal();
- static Stack getContextStack() {
- Stack stack = (Stack) threadLocalContextStack.get();
- if (stack==null) {
+
+ static Stack getContextStack()
+ {
+ Stack stack = (Stack)threadLocalContextStack.get();
+ if (stack == null)
+ {
stack = new Stack();
threadLocalContextStack.set(stack);
}
return stack;
}
- public static void pushCurrentContext(ExecutionContext executionContext) {
+
+ public static void pushCurrentContext(ExecutionContext executionContext)
+ {
getContextStack().push(executionContext);
}
- public static void popCurrentContext(ExecutionContext executionContext) {
- if (getContextStack().pop()!=executionContext) {
+
+ public static void popCurrentContext(ExecutionContext executionContext)
+ {
+ if (getContextStack().pop() != executionContext)
+ {
throw new JbpmException("current execution context mismatch. make sure that every pushed context gets popped");
}
}
- public static ExecutionContext currentExecutionContext() {
+
+ public static ExecutionContext currentExecutionContext()
+ {
ExecutionContext executionContext = null;
Stack stack = getContextStack();
- if (! stack.isEmpty()) {
- executionContext = (ExecutionContext) stack.peek();
+ if (!stack.isEmpty())
+ {
+ executionContext = (ExecutionContext)stack.peek();
}
return executionContext;
}
Added: jbpm3/trunk/modules/core/src/main/java/org/jbpm/signal/EventService.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/signal/EventService.java (rev 0)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/signal/EventService.java 2008-12-20 12:55:32 UTC (rev 3479)
@@ -0,0 +1,18 @@
+package org.jbpm.signal;
+
+import org.jbpm.graph.def.GraphElement;
+import org.jbpm.graph.exe.ExecutionContext;
+import org.jbpm.svc.Service;
+
+/**
+ * An extension to the jBPM event architecture
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 20-Dec-2008
+ */
+public interface EventService extends Service
+{
+ static String SERVICE_NAME = "event";
+
+ void fireEvent(String eventType, GraphElement graphElement, ExecutionContext executionContext);
+}
Property changes on: jbpm3/trunk/modules/core/src/main/java/org/jbpm/signal/EventService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/svc/Service.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/svc/Service.java 2008-12-20 12:06:16 UTC (rev 3478)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/svc/Service.java 2008-12-20 12:55:32 UTC (rev 3479)
@@ -23,7 +23,7 @@
import java.io.Serializable;
-public interface Service extends Serializable {
-
+public interface Service extends Serializable
+{
void close();
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/svc/Services.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/svc/Services.java 2008-12-20 12:06:16 UTC (rev 3478)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/svc/Services.java 2008-12-20 12:55:32 UTC (rev 3479)
@@ -50,233 +50,307 @@
import org.jbpm.svc.save.SaveOperation;
import org.jbpm.tx.TxService;
-public class Services implements Serializable {
-
+public class Services implements Serializable
+{
private static final long serialVersionUID = 1L;
- public static final String SERVICENAME_AUTHENTICATION = "authentication";
- public static final String SERVICENAME_AUTHORIZATION = "authorization";
- public static final String SERVICENAME_TX = "tx";
- public static final String SERVICENAME_LOGGING = "logging";
- public static final String SERVICENAME_MESSAGE = "message";
- public static final String SERVICENAME_PERSISTENCE = "persistence";
- public static final String SERVICENAME_SCHEDULER = "scheduler";
- public static final String SERVICENAME_JCR = "jcr";
+ public static final String SERVICENAME_AUTHENTICATION = "authentication";
+ public static final String SERVICENAME_AUTHORIZATION = "authorization";
+ public static final String SERVICENAME_TX = "tx";
+ public static final String SERVICENAME_LOGGING = "logging";
+ public static final String SERVICENAME_MESSAGE = "message";
+ public static final String SERVICENAME_PERSISTENCE = "persistence";
+ public static final String SERVICENAME_SCHEDULER = "scheduler";
+ public static final String SERVICENAME_JCR = "jcr";
public static final String SERVICENAME_ADDRESSRESOLVER = "addressresolver";
static final List defaultSaveOperations = createDefaultSaveOperations();
- private static List createDefaultSaveOperations() {
+ private static List createDefaultSaveOperations()
+ {
SaveOperation[] operations = new SaveOperation[4];
operations[0] = new CheckUnpersistableVariablesOperation();
// first we save the runtime data (process instance)
operations[1] = new HibernateSaveOperation();
- // then we insert the logs cause the logs can have references
+ // then we insert the logs cause the logs can have references
// to the runtime data
operations[2] = new SaveLogsOperation();
operations[3] = new CascadeSaveOperation();
return Arrays.asList(operations);
}
- Map serviceFactories = null;
- Map services = null;
+ Map<String, ServiceFactory> serviceFactories;
+ Map<String, Service> services;
List serviceNames = null;
List saveOperations = null;
-
- public static Service getCurrentService(String name) {
- return getCurrentService(name, true);
+
+ public static Service getCurrentService(String name)
+ {
+ return getCurrentService(name, true);
}
-
- public static Service getCurrentService(String name, boolean isRequired) {
+
+ public static Service getCurrentService(String name, boolean isRequired)
+ {
Service service = null;
JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
- if (jbpmContext!=null) {
+ if (jbpmContext != null)
+ {
service = jbpmContext.getServices().getService(name);
}
- if (isRequired && (service==null)) {
- throw new JbpmServiceException("service '"+name+"' unavailable");
+ if (isRequired && (service == null))
+ {
+ throw new JbpmServiceException("service '" + name + "' unavailable");
}
return service;
}
- public Services(Map serviceFactories) {
+ public Services(Map serviceFactories)
+ {
this(serviceFactories, new ArrayList(serviceFactories.keySet()), null);
}
- public Services(Map serviceFactories, List serviceNames, List saveOperations) {
+ public Services(Map serviceFactories, List serviceNames, List saveOperations)
+ {
this.serviceFactories = serviceFactories;
this.serviceNames = serviceNames;
this.saveOperations = saveOperations != null ? saveOperations : defaultSaveOperations;
}
- public void setSaveOperations(List saveOperations) {
- if (saveOperations == null) {
+ public void setSaveOperations(List saveOperations)
+ {
+ if (saveOperations == null)
+ {
throw new IllegalArgumentException("saveOperations cannot be null");
}
this.saveOperations = saveOperations;
}
- public void addSaveOperation(SaveOperation saveOperation) {
- if (saveOperation == null) {
+ public void addSaveOperation(SaveOperation saveOperation)
+ {
+ if (saveOperation == null)
+ {
throw new IllegalArgumentException("saveOperation cannot be null");
}
- if (saveOperations == defaultSaveOperations) {
+ if (saveOperations == defaultSaveOperations)
+ {
saveOperations = new ArrayList(defaultSaveOperations);
}
saveOperations.add(saveOperation);
}
- public Map getServiceFactories() {
- if (serviceFactories==null) {
- serviceFactories = new HashMap();
+ public Map<String, ServiceFactory> getServiceFactories()
+ {
+ if (serviceFactories == null)
+ {
+ serviceFactories = new HashMap<String, ServiceFactory>();
}
return serviceFactories;
}
- public ServiceFactory getServiceFactory(String name) {
- return (ServiceFactory) getServiceFactories().get(name);
+ public ServiceFactory getServiceFactory(String name)
+ {
+ return getServiceFactories().get(name);
}
-
- public boolean hasService(String name) {
+
+ public boolean hasService(String name)
+ {
boolean hasService = false;
- if (services!=null) {
+ if (services != null)
+ {
hasService = services.containsKey(name);
}
return hasService;
}
- public Service getService(String name) {
- if (services==null) {
- services = new HashMap();
+ public Service getService(String name)
+ {
+ if (services == null)
+ {
+ services = new HashMap<String, Service>();
}
- Service service = (Service) services.get(name);
- if (service==null) {
+ Service service = services.get(name);
+ if (service == null)
+ {
ServiceFactory serviceFactory = getServiceFactory(name);
- if (serviceFactory!=null) {
+ if (serviceFactory != null)
+ {
service = serviceFactory.openService();
services.put(name, service);
}
}
return service;
}
-
- public void save(ProcessInstance processInstance, JbpmContext jbpmContext) {
+
+ public void save(ProcessInstance processInstance, JbpmContext jbpmContext)
+ {
Iterator iter = saveOperations.iterator();
-
- if (log.isDebugEnabled()) {
- if (saveOperations==defaultSaveOperations) {
+
+ if (log.isDebugEnabled())
+ {
+ if (saveOperations == defaultSaveOperations)
+ {
log.debug("executing default save operations");
- } else {
+ }
+ else
+ {
log.debug("executing custom save operations");
}
}
-
- while (iter.hasNext()) {
- SaveOperation saveOperation = (SaveOperation) iter.next();
+
+ while (iter.hasNext())
+ {
+ SaveOperation saveOperation = (SaveOperation)iter.next();
saveOperation.save(processInstance, jbpmContext);
}
}
// services /////////////////////////////////////////////////////////////////
-
- public AuthenticationService getAuthenticationService() {
- return (AuthenticationService) getService(SERVICENAME_AUTHENTICATION);
+
+ public AuthenticationService getAuthenticationService()
+ {
+ return (AuthenticationService)getService(SERVICENAME_AUTHENTICATION);
}
- public AuthorizationService getAuthorizationService() {
- return (AuthorizationService) getService(SERVICENAME_AUTHORIZATION);
+
+ public AuthorizationService getAuthorizationService()
+ {
+ return (AuthorizationService)getService(SERVICENAME_AUTHORIZATION);
}
- public LoggingService getLoggingService() {
- return (LoggingService) getService(SERVICENAME_LOGGING);
+
+ public LoggingService getLoggingService()
+ {
+ return (LoggingService)getService(SERVICENAME_LOGGING);
}
- public MessageService getMessageService() {
- return (MessageService) getService(SERVICENAME_MESSAGE);
+
+ public MessageService getMessageService()
+ {
+ return (MessageService)getService(SERVICENAME_MESSAGE);
}
- public PersistenceService getPersistenceService() {
- return (PersistenceService) getService(SERVICENAME_PERSISTENCE);
+
+ public PersistenceService getPersistenceService()
+ {
+ return (PersistenceService)getService(SERVICENAME_PERSISTENCE);
}
- public SchedulerService getSchedulerService() {
- return (SchedulerService) getService(SERVICENAME_SCHEDULER);
+
+ public SchedulerService getSchedulerService()
+ {
+ return (SchedulerService)getService(SERVICENAME_SCHEDULER);
}
- public TxService getTxService() {
- return (TxService) getService(SERVICENAME_TX);
+
+ public TxService getTxService()
+ {
+ return (TxService)getService(SERVICENAME_TX);
}
- public void setAuthenticationService(AuthenticationService authenticationService) {
+ public void setAuthenticationService(AuthenticationService authenticationService)
+ {
services.put(SERVICENAME_AUTHENTICATION, authenticationService);
}
- public void setAuthorizationService(AuthorizationService authorizationService) {
+
+ public void setAuthorizationService(AuthorizationService authorizationService)
+ {
services.put(SERVICENAME_AUTHORIZATION, authorizationService);
}
- public void setLoggingService(LoggingService loggingService) {
+
+ public void setLoggingService(LoggingService loggingService)
+ {
services.put(SERVICENAME_LOGGING, loggingService);
}
- public void setMessageService(MessageService messageService) {
+
+ public void setMessageService(MessageService messageService)
+ {
services.put(SERVICENAME_MESSAGE, messageService);
}
- public void setPersistenceService(PersistenceService persistenceService) {
+
+ public void setPersistenceService(PersistenceService persistenceService)
+ {
services.put(SERVICENAME_PERSISTENCE, persistenceService);
}
- public void setSchedulerService(SchedulerService schedulerService) {
+
+ public void setSchedulerService(SchedulerService schedulerService)
+ {
services.put(SERVICENAME_SCHEDULER, schedulerService);
}
- public void setTxService(TxService txService) {
+
+ public void setTxService(TxService txService)
+ {
services.put(SERVICENAME_TX, txService);
}
- public void close() {
- if (services!=null) {
+ public void close()
+ {
+ if (services != null)
+ {
Exception firstException = null;
Iterator iter = serviceNames.iterator();
- while (iter.hasNext()) {
- String serviceName = (String) iter.next();
- Service service = (Service) services.get(serviceName);
- if (service!=null) {
- try {
- log.debug("closing service '"+serviceName+"': "+service);
+ while (iter.hasNext())
+ {
+ String serviceName = (String)iter.next();
+ Service service = (Service)services.get(serviceName);
+ if (service != null)
+ {
+ try
+ {
+ log.debug("closing service '" + serviceName + "': " + service);
service.close();
- } catch (JbpmPersistenceException e) {
+ }
+ catch (JbpmPersistenceException e)
+ {
// if this is a stale state exception, the jbpm configuration has control over the logging
- if (isCausedByStaleState(e)) {
- log.info("problem closing service '"+serviceName+"': optimistic locking failed");
- StaleObjectLogConfigurer.getStaleObjectExceptionsLog().error("problem closing service '"+serviceName+"': optimistic locking failed", e);
- } else {
- log.error("problem closing service '"+serviceName+"'", e);
+ if (isCausedByStaleState(e))
+ {
+ log.info("problem closing service '" + serviceName + "': optimistic locking failed");
+ StaleObjectLogConfigurer.getStaleObjectExceptionsLog().error("problem closing service '" + serviceName + "': optimistic locking failed", e);
}
- if (firstException==null) {
+ else
+ {
+ log.error("problem closing service '" + serviceName + "'", e);
+ }
+ if (firstException == null)
+ {
firstException = e;
}
- } catch (Exception e) {
+ }
+ catch (Exception e)
+ {
// NOTE that Error's are not caught because that might halt the JVM and mask the original Error.
- log.error("problem closing service '"+serviceName+"'", e);
- if (firstException==null) {
+ log.error("problem closing service '" + serviceName + "'", e);
+ if (firstException == null)
+ {
firstException = e;
}
}
}
}
- if (firstException != null) {
- if (firstException instanceof JbpmException) {
- throw (JbpmException) firstException;
+ if (firstException != null)
+ {
+ if (firstException instanceof JbpmException)
+ {
+ throw (JbpmException)firstException;
}
throw new JbpmException("problem closing services", firstException);
}
}
}
- public static boolean isCausedByStaleState(JbpmPersistenceException persistenceException) {
- for (Throwable cause = persistenceException.getCause(); cause != null; cause = cause.getCause()) {
+ public static boolean isCausedByStaleState(JbpmPersistenceException persistenceException)
+ {
+ for (Throwable cause = persistenceException.getCause(); cause != null; cause = cause.getCause())
+ {
if (cause instanceof StaleStateException)
return true;
}
return false;
}
- public static void assignId(Object object) {
+ public static void assignId(Object object)
+ {
JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
- if (jbpmContext!=null) {
+ if (jbpmContext != null)
+ {
// give this process instance an id
Services services = jbpmContext.getServices();
- if (services.hasService(Services.SERVICENAME_PERSISTENCE)) {
+ if (services.hasService(Services.SERVICENAME_PERSISTENCE))
+ {
PersistenceService persistenceService = services.getPersistenceService();
persistenceService.assignId(object);
}
Modified: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/default.jbpm.cfg.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/default.jbpm.cfg.xml 2008-12-20 12:06:16 UTC (rev 3478)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/default.jbpm.cfg.xml 2008-12-20 12:55:32 UTC (rev 3479)
@@ -9,12 +9,12 @@
-->
<jbpm-context>
+ <service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
+ <service name="logging" factory="org.jbpm.logging.db.DbLoggingServiceFactory" />
+ <service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" />
<service name="persistence" factory="org.jbpm.persistence.db.DbPersistenceServiceFactory" />
+ <service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
<service name="tx" factory="org.jbpm.tx.TxServiceFactory" />
- <service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" />
- <service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
- <service name="logging" factory="org.jbpm.logging.db.DbLoggingServiceFactory" />
- <service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
</jbpm-context>
<!-- configuration property used by persistence service impl org.jbpm.persistence.db.DbPersistenceServiceFactory -->
Modified: jbpm3/trunk/modules/integration/.classpath
===================================================================
--- jbpm3/trunk/modules/integration/.classpath 2008-12-20 12:06:16 UTC (rev 3478)
+++ jbpm3/trunk/modules/integration/.classpath 2008-12-20 12:55:32 UTC (rev 3479)
@@ -2,9 +2,6 @@
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/cts/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Modified: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/model/ExclusiveGatewayImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/model/ExclusiveGatewayImpl.java 2008-12-20 12:06:16 UTC (rev 3478)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/model/ExclusiveGatewayImpl.java 2008-12-20 12:55:32 UTC (rev 3479)
@@ -34,7 +34,6 @@
import org.jbpm.graph.exe.ExecutionContext;
import org.jbpm.graph.node.Decision;
import org.jbpm.graph.node.DecisionHandler;
-import org.jbpm.instantiation.Delegation;
import org.jbpm.integration.spec.runtime.ExpressionEvaluator;
import org.jbpm.integration.spec.runtime.TokenImpl;
@@ -51,8 +50,8 @@
public ExclusiveGatewayImpl(ProcessEngine engine, ProcessDefinition procDef, Node oldDecision)
{
super(engine, procDef, Decision.class, oldDecision);
- ExclusiveGatewayDecisionHandler decisionHandler = new ExclusiveGatewayDecisionHandler();
- getDelegate().setDecisionDelegation(new Delegation(decisionHandler));
+ //ExclusiveGatewayDecisionHandler decisionHandler = new ExclusiveGatewayDecisionHandler();
+ //getDelegate().setDecisionDelegation(new Delegation(decisionHandler));
}
// @Override
Modified: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/model/ProcessInstanceImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/model/ProcessInstanceImpl.java 2008-12-20 12:06:16 UTC (rev 3478)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/model/ProcessInstanceImpl.java 2008-12-20 12:55:32 UTC (rev 3479)
@@ -21,7 +21,8 @@
*/
package org.jbpm.integration.spec.model;
-// $Idimport java.util.Date;
+// $Id$
+
import java.util.Date;
import java.util.HashSet;
import java.util.List;
Modified: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/ContextServiceImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/ContextServiceImpl.java 2008-12-20 12:06:16 UTC (rev 3478)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/ContextServiceImpl.java 2008-12-20 12:55:32 UTC (rev 3479)
@@ -23,12 +23,17 @@
// $Id$
+import java.util.Map;
+
import org.jboss.bpm.api.runtime.BasicAttachments;
import org.jboss.bpm.api.runtime.Context;
import org.jboss.bpm.api.service.AbstractService;
import org.jboss.bpm.api.service.ContextService;
import org.jboss.bpm.api.service.ProcessEngine;
import org.jbpm.JbpmContext;
+import org.jbpm.signal.EventService;
+import org.jbpm.svc.ServiceFactory;
+import org.jbpm.svc.Services;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -82,6 +87,15 @@
{
this.jbpmContext = jbpmContext;
addAttachment(JbpmContext.class, jbpmContext);
+
+ // Add the event service
+ Services services = jbpmContext.getServices();
+ ServiceFactory serviceFactory = services.getServiceFactory(EventService.SERVICE_NAME);
+ if (serviceFactory == null)
+ {
+ Map<String, ServiceFactory> factories = services.getServiceFactories();
+ factories.put(EventService.SERVICE_NAME, new EventServiceFactory(getProcessEngine()));
+ }
}
public void close()
Added: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/EventServiceFactory.java
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/EventServiceFactory.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/EventServiceFactory.java 2008-12-20 12:55:32 UTC (rev 3479)
@@ -0,0 +1,147 @@
+package org.jbpm.integration.spec.service;
+
+import javax.management.ObjectName;
+
+import org.jboss.bpm.api.model.Node;
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.model.Signal;
+import org.jboss.bpm.api.model.Signal.SignalType;
+import org.jboss.bpm.api.model.builder.SignalBuilder;
+import org.jboss.bpm.api.service.ProcessDefinitionService;
+import org.jboss.bpm.api.service.ProcessEngine;
+import org.jboss.bpm.api.service.SignalBuilderService;
+import org.jboss.bpm.api.service.SignalService;
+import org.jbpm.graph.def.Event;
+import org.jbpm.graph.def.GraphElement;
+import org.jbpm.graph.def.Node.NodeType;
+import org.jbpm.graph.exe.ExecutionContext;
+import org.jbpm.integration.spec.model.ProcessDefinitionImpl;
+import org.jbpm.signal.EventService;
+import org.jbpm.svc.Service;
+import org.jbpm.svc.ServiceFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class EventServiceFactory implements ServiceFactory
+{
+ // provide logging
+ final static Logger log = LoggerFactory.getLogger(EventServiceFactory.class);
+
+ private static final long serialVersionUID = 1L;
+
+ private ProcessEngine engine;
+
+ public EventServiceFactory(ProcessEngine engine)
+ {
+ this.engine = engine;
+ }
+
+ public Service openService()
+ {
+ return new EventServiceImpl();
+ }
+
+ public void close()
+ {
+ }
+
+ class EventServiceImpl implements EventService
+ {
+ private static final long serialVersionUID = 1L;
+
+ public void fireEvent(String eventType, GraphElement graphElement, ExecutionContext executionContext)
+ {
+ SignalBuilderService sigBuilderService = engine.getService(SignalBuilderService.class);
+ SignalService sigService = engine.getService(SignalService.class);
+
+ if (sigBuilderService != null && sigService != null)
+ {
+ SignalBuilder sigBuilder = sigBuilderService.getSignalBuilder();
+
+ SignalType sigType = getSignalType(eventType, graphElement);
+ ObjectName fromRef = getFromRef(graphElement);
+ if (sigType != null && fromRef != null)
+ {
+ Signal signal = sigBuilder.newSignal(sigType, fromRef, null);
+ sigService.throwSignal(signal);
+ }
+ else
+ {
+ log.debug("Cannot map to signal: [" + eventType + "," + graphElement + "]");
+ }
+ }
+ }
+
+ private ObjectName getFromRef(GraphElement graphElement)
+ {
+ ObjectName fromRef = null;
+
+ ProcessDefinitionService pdService = engine.getService(ProcessDefinitionService.class);
+ org.jbpm.graph.def.ProcessDefinition oldProcDef = graphElement.getProcessDefinition();
+ ObjectName pdKey = ProcessDefinitionImpl.getKey(oldProcDef);
+ ProcessDefinition procDef = pdService.getProcessDefinition(pdKey);
+
+ if (graphElement instanceof org.jbpm.graph.def.ProcessDefinition)
+ {
+ fromRef = pdKey;
+ }
+ else if (graphElement instanceof org.jbpm.graph.def.Node)
+ {
+ org.jbpm.graph.def.Node oldNode = (org.jbpm.graph.def.Node)graphElement;
+ Node node = procDef.getNode(oldNode.getNameExt());
+ fromRef = node.getKey();
+ }
+
+ return fromRef;
+ }
+
+ private SignalType getSignalType(String eventType, GraphElement graphElement)
+ {
+ NodeType nodeType = null;
+ if (graphElement instanceof org.jbpm.graph.def.Node)
+ {
+ org.jbpm.graph.def.Node oldNode = (org.jbpm.graph.def.Node)graphElement;
+ nodeType = oldNode.getNodeType();
+ }
+
+ SignalType sigType = null;
+ if (Event.EVENTTYPE_PROCESS_START.equals(eventType))
+ {
+ sigType = SignalType.SYSTEM_PROCESS_ENTER;
+ }
+ else if (Event.EVENTTYPE_PROCESS_END.equals(eventType))
+ {
+ sigType = SignalType.SYSTEM_PROCESS_EXIT;
+ }
+ else if (Event.EVENTTYPE_BEFORE_SIGNAL.equals(eventType) && nodeType == NodeType.StartState)
+ {
+ sigType = SignalType.SYSTEM_START_EVENT_ENTER;
+ }
+ else if (Event.EVENTTYPE_NODE_LEAVE.equals(eventType) && nodeType == NodeType.StartState)
+ {
+ sigType = SignalType.SYSTEM_START_EVENT_EXIT;
+ }
+ else if (Event.EVENTTYPE_NODE_ENTER.equals(eventType) && nodeType == NodeType.EndState)
+ {
+ sigType = SignalType.SYSTEM_END_EVENT_ENTER;
+ }
+ else if (Event.EVENTTYPE_NODE_LEAVE.equals(eventType) && nodeType == NodeType.EndState)
+ {
+ sigType = SignalType.SYSTEM_END_EVENT_EXIT;
+ }
+ else if (Event.EVENTTYPE_NODE_ENTER.equals(eventType) && nodeType == NodeType.State)
+ {
+ sigType = SignalType.SYSTEM_TASK_ENTER;
+ }
+ else if (Event.EVENTTYPE_NODE_LEAVE.equals(eventType) && nodeType == NodeType.State)
+ {
+ sigType = SignalType.SYSTEM_TASK_EXIT;
+ }
+ return sigType;
+ }
+
+ public void close()
+ {
+ }
+ }
+}
Property changes on: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/EventServiceFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/SignalBuilderServiceImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/SignalBuilderServiceImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/SignalBuilderServiceImpl.java 2008-12-20 12:55:32 UTC (rev 3479)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.spec.service;
+
+// $Id$
+
+import javax.management.ObjectName;
+
+import org.jboss.bpm.api.model.Signal;
+import org.jboss.bpm.api.model.Signal.SignalType;
+import org.jboss.bpm.api.model.builder.SignalBuilder;
+import org.jboss.bpm.api.service.ProcessEngine;
+import org.jboss.bpm.api.service.SignalBuilderService;
+
+/**
+ * The SignalBuilder can be used to build a {@link Signal} dynamically.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public class SignalBuilderServiceImpl extends SignalBuilderService implements MutableService
+{
+ public void setProcessEngine(ProcessEngine engine)
+ {
+ super.setProcessEngine(engine);
+ }
+
+ @Override
+ public SignalBuilder getSignalBuilder()
+ {
+ SignalBuilder sigBuilder = new SignalBuilder()
+ {
+ public Signal newSignal(SignalType sigType, ObjectName fromRef, String message)
+ {
+ return new SignalImpl(sigType, fromRef, message);
+ }
+ };
+ return sigBuilder;
+ }
+
+ class SignalImpl implements Signal
+ {
+ private static final long serialVersionUID = 1L;
+
+ private ObjectName fromRef;
+ private SignalType sigType;
+ private String message;
+
+ public SignalImpl(SignalType sigType, ObjectName fromRef, String message)
+ {
+ this.sigType = sigType;
+ this.fromRef = fromRef;
+ this.message = message;
+ }
+
+ public SignalType getSignalType()
+ {
+ return sigType;
+ }
+
+ public ObjectName getFromRef()
+ {
+ return fromRef;
+ }
+
+ public String getMessage()
+ {
+ return message;
+ }
+
+ public String toString()
+ {
+ return "[" + sigType + ",from=" + fromRef + ",msg=" + message + "]";
+ }
+ }
+}
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/SignalBuilderServiceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/SignalServiceImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/SignalServiceImpl.java (rev 0)
+++ jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/SignalServiceImpl.java 2008-12-20 12:55:32 UTC (rev 3479)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.spec.service;
+
+// $Id$
+
+import org.jboss.bpm.api.model.Signal;
+import org.jboss.bpm.api.model.SignalListener;
+import org.jboss.bpm.api.service.ProcessEngine;
+import org.jboss.bpm.api.service.SignalService;
+
+/**
+ * A {@link Signal} is like an undirected flare shot up
+ * into the air. A component can register a {@link SignalListener} with the SignalService.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public class SignalServiceImpl extends SignalService implements MutableService
+{
+ public void setProcessEngine(ProcessEngine engine)
+ {
+ super.setProcessEngine(engine);
+ }
+}
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/integration/src/main/java/org/jbpm/integration/spec/service/SignalServiceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm3/trunk/modules/integration/src/main/resources/bpm-spec-jbpm3-beans.xml
===================================================================
--- jbpm3/trunk/modules/integration/src/main/resources/bpm-spec-jbpm3-beans.xml 2008-12-20 12:06:16 UTC (rev 3478)
+++ jbpm3/trunk/modules/integration/src/main/resources/bpm-spec-jbpm3-beans.xml 2008-12-20 12:55:32 UTC (rev 3479)
@@ -19,6 +19,8 @@
<inject bean="BPMIdentityService"/>
<inject bean="BPMProcessDefinitionService"/>
<inject bean="BPMProcessInstanceService"/>
+ <inject bean="BPMSignalBuilderService"/>
+ <inject bean="BPMSignalService"/>
<inject bean="BPMTaskInstanceService"/>
<inject bean="BPMTokenService"/>
</set>
@@ -41,6 +43,8 @@
<bean name="BPMIdentityService" class="org.jbpm.integration.spec.service.IdentityServiceImpl" />
<bean name="BPMProcessDefinitionService" class="org.jbpm.integration.spec.service.ProcessDefinitionServiceImpl" />
<bean name="BPMProcessInstanceService" class="org.jbpm.integration.spec.service.ProcessInstanceServiceImpl"/>
+ <bean name="BPMSignalBuilderService" class="org.jbpm.integration.spec.service.SignalBuilderServiceImpl" />
+ <bean name="BPMSignalService" class="org.jbpm.integration.spec.service.SignalServiceImpl" />
<bean name="BPMTaskInstanceService" class="org.jbpm.integration.spec.service.TaskInstanceServiceImpl" />
<bean name="BPMTokenService" class="org.jbpm.integration.spec.service.TokenServiceImpl" />
17 years, 4 months
JBoss JBPM SVN: r3478 - in jbpm3/trunk: modules/core/src/main/resources and 1 other directory.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-12-20 07:06:16 -0500 (Sat, 20 Dec 2008)
New Revision: 3478
Modified:
jbpm3/trunk/modules/core/src/main/resources/hibernate.properties.oracle.xml
jbpm3/trunk/pom.xml
Log:
added oracle profile
Modified: jbpm3/trunk/modules/core/src/main/resources/hibernate.properties.oracle.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/hibernate.properties.oracle.xml 2008-12-20 11:33:54 UTC (rev 3477)
+++ jbpm3/trunk/modules/core/src/main/resources/hibernate.properties.oracle.xml 2008-12-20 12:06:16 UTC (rev 3478)
@@ -5,8 +5,8 @@
<!-- JDBC connection properties (begin) -->
<!-- fetch driver from http://www.oracle.com -->
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
- <property name="hibernate.connection.url"></property>
- <property name="hibernate.connection.username"></property>
- <property name="hibernate.connection.password"></property>
+ <property name="hibernate.connection.url">${jdbc.oracle.url}</property>
+ <property name="hibernate.connection.username">${jdbc.oracle.username}</property>
+ <property name="hibernate.connection.password">${jdbc.oracle.password}</property>
<!-- JDBC connection properties (end) -->
Modified: jbpm3/trunk/pom.xml
===================================================================
--- jbpm3/trunk/pom.xml 2008-12-20 11:33:54 UTC (rev 3477)
+++ jbpm3/trunk/pom.xml 2008-12-20 12:06:16 UTC (rev 3478)
@@ -617,5 +617,31 @@
</dependency>
</dependencies>
</profile>
+
+ <!-- -Ddatabase=oracle -->
+ <profile>
+ <id>oracle</id>
+ <activation>
+ <property>
+ <name>database</name>
+ <value>oracle</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.oracle</groupId>
+ <artifactId>ojdbc14</artifactId>
+ <version>10.0.2.0</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <repositories>
+ <repository>
+ <id>qa.jboss.com</id>
+ <url>http://www.qa.jboss.com/jdbc-drivers/maven2</url>
+ </repository>
+ </repositories>
+ </profile>
+
</profiles>
</project>
17 years, 4 months
JBoss JBPM SVN: r3477 - jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/concurrency/graphbased.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-12-20 06:33:54 -0500 (Sat, 20 Dec 2008)
New Revision: 3477
Modified:
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/concurrency/graphbased/process.jpdl.xml
Log:
updated process layout of example concurrency graphbased
Modified: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/concurrency/graphbased/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/concurrency/graphbased/process.jpdl.xml 2008-12-20 10:10:16 UTC (rev 3476)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/concurrency/graphbased/process.jpdl.xml 2008-12-20 11:33:54 UTC (rev 3477)
@@ -2,40 +2,40 @@
<process name="ConcurrencyGraphBased" xmlns="http://jbpm.org/4/jpdl">
- <start g="14,199,48,48">
- <flow to="fork" />
- </start>
+ <start g="16,102,48,48">
+ <flow to="fork"/>
+ </start>
+
+ <fork name="fork" g="96,102,48,48">
+ <flow to="send invoice" g="120,41"/>
+ <flow to="load truck"/>
+ <flow to="print shipping documents" g="120,213"/>
+ </fork>
+
+ <state name="send invoice" g="176,16,149,52">
+ <flow to="final join" g="606,41"/>
+ </state>
+
+ <state name="load truck" g="176,100,149,52">
+ <flow to="shipping join" g="377,126"/>
+ </state>
+
+ <state name="print shipping documents" g="176,184,149,58">
+ <flow to="shipping join" g="378,213"/>
+ </state>
+
+ <join name="shipping join" g="353,145,48,48">
+ <flow to="drive truck to destination"/>
+ </join>
+
+ <state name="drive truck to destination" g="431,140,148,52">
+ <flow to="final join" g="607,165"/>
+ </state>
+
+ <join name="final join" g="583,73,48,48">
+ <flow to="end"/>
+ </join>
+
+ <end name="end" g="666,74,48,48"/>
- <fork name="fork" g="106,199,48,48">
- <flow to="send invoice" g="130,116"/>
- <flow to="load truck" />
- <flow to="print shipping documents" g="130,339"/>
- </fork>
-
- <state name="send invoice" g="244,92,115,52">
- <flow to="final join" g="889,118"/>
- </state>
-
- <state name="load truck" g="247,197,110,52">
- <flow to="shipping join" />
- </state>
-
- <state name="print shipping documents" g="185,307,234,58">
- <flow to="shipping join" g="467,333"/>
- </state>
-
- <join name="shipping join" g="442,199,48,48">
- <flow to="drive truck to destination" />
- </join>
-
- <state name="drive truck to destination" g="561,197,216,52">
- <flow to="final join" />
- </state>
-
- <join name="final join" g="863,199,48,48">
- <flow to="end" />
- </join>
-
- <end name="end" g="996,199,48,48"/>
-
-</process>
+</process>
\ No newline at end of file
17 years, 4 months
JBoss JBPM SVN: r3476 - in jbpm4/trunk: modules/api/src/main/resources and 13 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-12-20 05:10:16 -0500 (Sat, 20 Dec 2008)
New Revision: 3476
Added:
jbpm4/trunk/modules/db/.classpath
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/EsbTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/JbpmMockCourier.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/esb/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/esb/process.jpdl.xml
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EsbActivity.java
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EsbBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionEvaluator.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ExpressionDescriptor.java
Removed:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionCondition.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ExpressionConditionDescriptor.java
Modified:
jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
jbpm4/trunk/modules/db/pom.xml
jbpm4/trunk/modules/examples/.classpath
jbpm4/trunk/modules/jpdl/.classpath
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveBinding.java
jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.activities.xml
jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.hbm.xml
jbpm4/trunk/modules/pvm/pom.xml
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.wire.hbm.xml
jbpm4/trunk/pom.xml
Log:
added esb node
Modified: jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
===================================================================
--- jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd 2008-12-20 10:01:26 UTC (rev 3475)
+++ jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd 2008-12-20 10:10:16 UTC (rev 3476)
@@ -218,6 +218,21 @@
</complexContent>
</complexType>
</element>
+
+ <element name="esb">
+ <annotation><documentation>Invokes a service over the ESB.
+ </documentation></annotation>
+ <complexType>
+ <complexContent>
+ <extension base="tns:esbType">
+ <sequence>
+ <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ <attributeGroup ref="tns:nodeAttributes" />
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
<!--
<element name="process-state">
@@ -312,6 +327,32 @@
-->
</choice>
</group>
+
+ <group name="wireObjectGroup">
+ <choice>
+ <element name="string">
+ <complexType>
+ <attribute name="name">
+ <annotation><documentation>the name of the string object</documentation></annotation>
+ </attribute>
+ <attribute name="value">
+ <annotation><documentation>the actual string value</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+ <element name="object">
+ <complexType>
+ <attribute name="name">
+ <annotation><documentation>the name of the string object</documentation></annotation>
+ </attribute>
+ <attribute name="class">
+ <annotation><documentation>the fully qualified classname</documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+ </choice>
+ </group>
+
<complexType name="javaType">
<sequence>
@@ -364,6 +405,38 @@
</attribute>
</complexType>
+ <complexType name="esbType">
+ <sequence>
+ <element name="part" minOccurs="0" maxOccurs="unbounded">
+ <annotation><documentation>The content of this expression element
+ is the script text that will be evaluated. This is mutually
+ exclusive with the expression attribute.</documentation></annotation>
+ <complexType>
+ <choice minOccurs="0">
+ <group ref="tns:wireObjectGroup" />
+ </choice>
+ <attribute name="name" type="string">
+ <annotation><documentation>The name of the message body part.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="expr" type="string">
+ <annotation><documentation>The script text that will be evaluated and
+ used and the object in this message body part.
+ </documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+ </sequence>
+ <attribute name="category" type="string">
+ <annotation><documentation>The category of the service in the esb.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="service" type="string">
+ <annotation><documentation>The name of the service in the esb.
+ </documentation></annotation>
+ </attribute>
+ </complexType>
+
<attributeGroup name="nodeAttributes">
<attribute name="name" type="string">
<annotation><documentation>The id of this activity. The name should be unique
Added: jbpm4/trunk/modules/db/.classpath
===================================================================
--- jbpm4/trunk/modules/db/.classpath (rev 0)
+++ jbpm4/trunk/modules/db/.classpath 2008-12-20 10:10:16 UTC (rev 3476)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Modified: jbpm4/trunk/modules/db/pom.xml
===================================================================
--- jbpm4/trunk/modules/db/pom.xml 2008-12-20 10:01:26 UTC (rev 3475)
+++ jbpm4/trunk/modules/db/pom.xml 2008-12-20 10:10:16 UTC (rev 3476)
@@ -32,38 +32,21 @@
<artifactId>jbpm-api</artifactId>
<version>${version}</version>
</dependency>
-
<dependency>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-test-base</artifactId>
<version>${version}</version>
</dependency>
-
<dependency>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-jpdl</artifactId>
<version>${version}</version>
</dependency>
-
<dependency>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm-pvm</artifactId>
<version>${version}</version>
</dependency>
-
- <!--
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>net.sourceforge.jtds</groupId>
- <artifactId>jtds</artifactId>
- <scope>runtime</scope>
- </dependency>
- -->
</dependencies>
<!-- Plugins -->
Modified: jbpm4/trunk/modules/examples/.classpath
===================================================================
--- jbpm4/trunk/modules/examples/.classpath 2008-12-20 10:01:26 UTC (rev 3475)
+++ jbpm4/trunk/modules/examples/.classpath 2008-12-20 10:10:16 UTC (rev 3476)
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="output" path="target/test-classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/test-classes"/>
+</classpath>
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/EsbTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/EsbTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/EsbTest.java 2008-12-20 10:10:16 UTC (rev 3476)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.examples.esb;
+
+import java.net.URI;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
+import org.jboss.internal.soa.esb.services.registry.MockRegistry;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.message.Message;
+import org.jbpm.Execution;
+import org.jbpm.test.DbTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class EsbTest extends DbTestCase {
+
+ public JbpmMockCourier courier;
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ MockCourierFactory.install();
+ MockRegistry.install();
+ EPR epr = new EPR(new URI("epr"));
+ courier = new JbpmMockCourier();
+ MockRegistry.register("orderProcessing", "bookSold", epr, courier);
+ }
+
+ public void testJavaInstantiate() {
+ deployJpdlResource("org/jbpm/examples/esb/process.jpdl.xml");
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("title", "Internetworking with TCP/IP");
+
+ Execution execution = executionService.startExecutionByKey("Esb", variables);
+
+ Message message = courier.getMessage();
+ Body body = message.getBody();
+ assertEquals("Internetworking with TCP/IP", body.get("bookTitle"));
+ assertEquals("deliver asap", body.get("goal"));
+ }
+
+}
Property changes on: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/EsbTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/JbpmMockCourier.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/JbpmMockCourier.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/JbpmMockCourier.java 2008-12-20 10:10:16 UTC (rev 3476)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.examples.esb;
+
+import org.jboss.internal.soa.esb.couriers.MockCourier;
+import org.jboss.soa.esb.message.Message;
+
+public class JbpmMockCourier extends MockCourier {
+
+ public JbpmMockCourier() {
+ super(true);
+ }
+
+ public Message getMessage() {
+ return message;
+ }
+}
Property changes on: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/esb/JbpmMockCourier.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/esb/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/esb/process.jpdl.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/esb/process.jpdl.xml 2008-12-20 10:10:16 UTC (rev 3476)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="Esb" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="invoke esb service" />
+ </start>
+
+ <esb name="invoke esb service"
+ category="orderProcessing"
+ service="bookSold">
+
+ <part name="bookTitle" expr="#{title}" />
+ <part name="goal">
+ <string value="deliver asap" />
+ </part>
+
+ <flow to="wait" />
+ </esb>
+
+ <state name="wait" />
+
+</process>
Property changes on: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/esb/process.jpdl.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/jpdl/.classpath
===================================================================
--- jbpm4/trunk/modules/jpdl/.classpath 2008-12-20 10:01:26 UTC (rev 3475)
+++ jbpm4/trunk/modules/jpdl/.classpath 2008-12-20 10:10:16 UTC (rev 3476)
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EsbActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EsbActivity.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EsbActivity.java 2008-12-20 10:10:16 UTC (rev 3476)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.activity;
+
+import org.jboss.soa.esb.client.ServiceInvoker;
+import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jbpm.activity.ActivityExecution;
+import org.jbpm.log.Log;
+import org.jbpm.pvm.internal.model.ExpressionEvaluator;
+import org.jbpm.pvm.internal.wire.Descriptor;
+import org.jbpm.pvm.internal.wire.WireContext;
+import org.jbpm.pvm.internal.wire.descriptor.ListDescriptor;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class EsbActivity extends JpdlActivity {
+
+ private static final long serialVersionUID = 1L;
+
+ private static Log log = Log.getLog(EsbActivity.class.getName());
+
+ protected String category = null;
+ protected String service = null;
+ protected ListDescriptor partsListDescriptor = null;
+
+ public void execute(ActivityExecution execution) throws Exception {
+ Message message = MessageFactory.getInstance().getMessage();
+ Body body = message.getBody();
+
+ if (partsListDescriptor!=null) {
+ WireContext wireContext = new WireContext();
+ for (Descriptor descriptor: partsListDescriptor.getValueDescriptors()) {
+ String name = descriptor.getName();
+
+ Object object = wireContext.create(descriptor, true);
+ if (object instanceof ExpressionEvaluator) {
+ ExpressionEvaluator expressionEvaluator = (ExpressionEvaluator) object;
+ object = expressionEvaluator.evaluateExpression(execution);
+ }
+ body.add(name, object);
+ }
+ }
+
+ ServiceInvoker invoker = new ServiceInvoker(category, service);
+ log.debug("sending "+message.getBody()+" to service "+service+" in category "+category+" over the esb");
+ invoker.deliverAsync(message);
+ }
+
+ public void setCategory(String category) {
+ this.category = category;
+ }
+ public void setService(String service) {
+ this.service = service;
+ }
+ public void setPartsListDescriptor(ListDescriptor partsListDescriptor) {
+ this.partsListDescriptor = partsListDescriptor;
+ }
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EsbActivity.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EsbBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EsbBinding.java (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EsbBinding.java 2008-12-20 10:10:16 UTC (rev 3476)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.activity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jbpm.pvm.internal.util.XmlUtil;
+import org.jbpm.pvm.internal.wire.Descriptor;
+import org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.ExpressionDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.ListDescriptor;
+import org.jbpm.pvm.internal.wire.xml.WireParser;
+import org.jbpm.pvm.internal.xml.Parse;
+import org.jbpm.pvm.internal.xml.Parser;
+import org.w3c.dom.Element;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class EsbBinding extends JpdlActivityBinding {
+
+ public static final String TAG = "esb";
+ private static final WireParser wireParser = WireParser.getInstance();
+
+ public EsbBinding() {
+ super(TAG);
+ }
+
+ public Object parse(Element element, Parse parse, Parser parser) {
+ EsbActivity esbActivity = new EsbActivity();
+
+ String category = XmlUtil.attribute(element, "category", true, parse);
+ esbActivity.setCategory(category);
+
+ String service = XmlUtil.attribute(element, "service", true, parse);
+ esbActivity.setService(service);
+
+ List<Descriptor> partDescriptors = new ArrayList<Descriptor>();
+ List<Element> partElements = XmlUtil.elements(element, "part");
+ for (Element partElement: partElements) {
+ String name = XmlUtil.attribute(partElement, "name", true, parse);
+ AbstractDescriptor partDescriptor = getPartDescriptor(partElement, parse);
+ partDescriptor.setName(name);
+ partDescriptors.add(partDescriptor);
+ }
+ ListDescriptor partsListDescriptor = new ListDescriptor();
+ if (!partDescriptors.isEmpty()) {
+ partsListDescriptor.setValueDescriptors(partDescriptors);
+ }
+ esbActivity.setPartsListDescriptor(partsListDescriptor);
+
+ return esbActivity;
+ }
+
+ public AbstractDescriptor getPartDescriptor(Element partElement, Parse parse) {
+ String expression = XmlUtil.attribute(partElement, "expr");
+ Element descriptorElement = XmlUtil.element(partElement);
+
+ if ( ( (expression==null) && (descriptorElement==null) )
+ ||
+ ( (expression!=null) && (descriptorElement!=null) )
+ ) {
+ parse.addProblem("in <"+TAG+"...> an expr or exactly one child element is expected");
+ }
+
+ if (expression!=null) {
+ return new ExpressionDescriptor(expression, null);
+ }
+
+ AbstractDescriptor descriptor = (AbstractDescriptor) wireParser.parseElement(descriptorElement, parse, WireParser.CATEGORY_DESCRIPTOR);
+ return descriptor;
+ }
+
+}
Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EsbBinding.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveBinding.java 2008-12-20 10:01:26 UTC (rev 3475)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveBinding.java 2008-12-20 10:10:16 UTC (rev 3476)
@@ -23,12 +23,12 @@
import java.util.List;
-import org.jbpm.pvm.internal.model.ExpressionCondition;
+import org.jbpm.pvm.internal.model.ExpressionEvaluator;
import org.jbpm.pvm.internal.model.NodeImpl;
import org.jbpm.pvm.internal.model.TransitionImpl;
import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.pvm.internal.wire.binding.ObjectBinding;
-import org.jbpm.pvm.internal.wire.descriptor.ExpressionConditionDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.ExpressionDescriptor;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
import org.jbpm.pvm.internal.wire.descriptor.ReferenceDescriptor;
import org.jbpm.pvm.internal.wire.xml.WireParser;
@@ -89,8 +89,8 @@
if (conditionElement.hasAttribute("expr")) {
String expr = conditionElement.getAttribute("expr");
String lang = XmlUtil.attribute(conditionElement, "expr-lang");
- ExpressionConditionDescriptor expressionConditionDescriptor = new ExpressionConditionDescriptor(expr, lang);
- transition.setConditionDescriptor(expressionConditionDescriptor);
+ ExpressionDescriptor expressionDescriptor = new ExpressionDescriptor(expr, lang);
+ transition.setConditionDescriptor(expressionDescriptor);
} else if (conditionElement.hasAttribute("ref")) {
String expr = conditionElement.getAttribute("ref");
Modified: jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.activities.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.activities.xml 2008-12-20 10:01:26 UTC (rev 3475)
+++ jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.activities.xml 2008-12-20 10:10:16 UTC (rev 3476)
@@ -10,4 +10,5 @@
<activity binding="org.jbpm.jpdl.activity.SqlBinding" />
<activity binding="org.jbpm.jpdl.activity.JavaBinding" />
<activity binding="org.jbpm.jpdl.activity.ScriptBinding" />
+ <activity binding="org.jbpm.jpdl.activity.EsbBinding" />
</activities>
Modified: jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.hbm.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.hbm.xml 2008-12-20 10:01:26 UTC (rev 3475)
+++ jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.hbm.xml 2008-12-20 10:10:16 UTC (rev 3476)
@@ -72,6 +72,16 @@
<property name="language" column="TEXT2_" />
<property name="variableName" column="TEXT3_" />
</subclass>
+ <subclass name="org.jbpm.jpdl.activity.EsbActivity" discriminator-value="esb">
+ <property name="service" column="TEXT_" />
+ <property name="category" column="TEXT2_" />
+ <many-to-one name="partsListDescriptor"
+ column="PARTSDESCR_"
+ cascade="all"
+ class="org.jbpm.pvm.internal.wire.descriptor.ListDescriptor"
+ foreign-key="FK_ACT_PARTSDESCR"
+ index="IDX_ACT_PARTSDESCR" />
+ </subclass>
</class>
</hibernate-mapping>
\ No newline at end of file
Modified: jbpm4/trunk/modules/pvm/pom.xml
===================================================================
--- jbpm4/trunk/modules/pvm/pom.xml 2008-12-20 10:01:26 UTC (rev 3475)
+++ jbpm4/trunk/modules/pvm/pom.xml 2008-12-20 10:10:16 UTC (rev 3476)
@@ -89,38 +89,6 @@
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
-
-<!--
- <dependency>
- <groupId>com.cenqua.clover</groupId>
- <artifactId>clover</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam</artifactId>
- <exclusions>
- <exclusion>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.el</groupId>
- <artifactId>jboss-el</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>cactus</groupId>
- <artifactId>cactus</artifactId>
- <scope>test</scope>
- </dependency>
- -->
-
</dependencies>
<!-- Plugins -->
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionCondition.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionCondition.java 2008-12-20 10:01:26 UTC (rev 3475)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionCondition.java 2008-12-20 10:10:16 UTC (rev 3476)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.model;
-
-import org.jbpm.model.Condition;
-import org.jbpm.model.OpenExecution;
-import org.jbpm.pvm.internal.script.ScriptManager;
-
-/**
- * @author Tom Baeyens
- */
-public class ExpressionCondition implements Condition {
-
- private static final long serialVersionUID = 1L;
-
- protected String expr;
- protected String lang;
-
- public ExpressionCondition(String expr, String lang) {
- this.expr = expr;
- this.lang = lang;
- }
-
- public boolean evaluate(OpenExecution execution) {
- ScriptManager scriptManager = ScriptManager.getScriptManager();
- return (Boolean) scriptManager.evaluateExpression(expr, execution, lang);
- }
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionEvaluator.java (from rev 3439, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionCondition.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionEvaluator.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionEvaluator.java 2008-12-20 10:10:16 UTC (rev 3476)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.model;
+
+import org.jbpm.model.Condition;
+import org.jbpm.model.OpenExecution;
+import org.jbpm.pvm.internal.script.ScriptManager;
+
+/**
+ * @author Tom Baeyens
+ */
+public class ExpressionEvaluator implements Condition {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String name;
+ protected String expr;
+ protected String lang;
+
+ public ExpressionEvaluator(String name, String expr, String lang) {
+ this.name = name;
+ this.expr = expr;
+ this.lang = lang;
+ }
+
+ public boolean evaluate(OpenExecution execution) {
+ return (Boolean) evaluateExpression(execution);
+ }
+
+ public Object evaluateExpression(OpenExecution execution) {
+ ScriptManager scriptManager = ScriptManager.getScriptManager();
+ return scriptManager.evaluateExpression(expr, execution, lang);
+ }
+
+ public String getName() {
+ return name;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionEvaluator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ExpressionConditionDescriptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ExpressionConditionDescriptor.java 2008-12-20 10:01:26 UTC (rev 3475)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ExpressionConditionDescriptor.java 2008-12-20 10:10:16 UTC (rev 3476)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.wire.descriptor;
-
-import org.jbpm.pvm.internal.model.ExpressionCondition;
-import org.jbpm.pvm.internal.wire.WireContext;
-
-
-/**
- * @author Tom Baeyens
- */
-public class ExpressionConditionDescriptor extends AbstractDescriptor {
-
- private static final long serialVersionUID = 1L;
-
- String expr;
- String lang;
-
- public ExpressionConditionDescriptor() {
- }
-
- public ExpressionConditionDescriptor(String expr, String lang) {
- this.expr = expr;
- this.lang = lang;
- }
-
- public Object construct(WireContext wireContext) {
- return new ExpressionCondition(expr, lang);
- }
-
-}
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ExpressionDescriptor.java (from rev 3439, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ExpressionConditionDescriptor.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ExpressionDescriptor.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ExpressionDescriptor.java 2008-12-20 10:10:16 UTC (rev 3476)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.wire.descriptor;
+
+import org.jbpm.pvm.internal.model.ExpressionEvaluator;
+import org.jbpm.pvm.internal.wire.WireContext;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ExpressionDescriptor extends AbstractDescriptor {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String expr;
+ protected String lang;
+
+ public ExpressionDescriptor() {
+ }
+
+ public ExpressionDescriptor(String expr, String lang) {
+ this.expr = expr;
+ this.lang = lang;
+ }
+
+ public Object construct(WireContext wireContext) {
+ return new ExpressionEvaluator(getName(), expr, lang);
+ }
+
+}
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.wire.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.wire.hbm.xml 2008-12-20 10:01:26 UTC (rev 3475)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.wire.hbm.xml 2008-12-20 10:10:16 UTC (rev 3476)
@@ -124,7 +124,7 @@
</list>
</subclass>
- <subclass name="ExpressionConditionDescriptor" discriminator-value="expr">
+ <subclass name="ExpressionDescriptor" discriminator-value="expr">
<property name="expr" column="TEXT_" />
<property name="lang" column="METHOD_" />
</subclass>
Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml 2008-12-20 10:01:26 UTC (rev 3475)
+++ jbpm4/trunk/pom.xml 2008-12-20 10:10:16 UTC (rev 3476)
@@ -40,7 +40,6 @@
<module>modules/task</module>
<module>modules/test-base</module>
<module>modules/test-db</module>
- <module>modules/test-load</module>
<module>modules/test-pojo</module>
</modules>
@@ -158,28 +157,6 @@
<artifactId>cactus</artifactId>
<version>${cactus.version}</version>
</dependency>
-
-<!--
- <dependency>
- <groupId>com.cenqua.clover</groupId>
- <artifactId>clover</artifactId>
- <version>${clover.version}</version>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam</artifactId>
- <version>${jboss.seam.version}</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>${slf4j.version}</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>${slf4j.version}</version>
- </dependency>
- -->
</dependencies>
</dependencyManagement>
@@ -313,6 +290,14 @@
</profile>
<profile>
+ <id>load</id>
+ <modules>
+ <module>modules/db</module>
+ <module>modules/test-load</module>
+ </modules>
+ </profile>
+
+ <profile>
<id>skiptests</id>
<build>
<plugins>
@@ -458,7 +443,7 @@
</repository>
</repositories>
</profile>
-
+
<!-- -Ddatabase=mysql -->
<profile>
<id>mysql</id>
17 years, 4 months