[jbpm-commits] JBoss JBPM SVN: r1672 - in api/trunk: modules/api/src/main/java/org/jboss/bpm/client and 10 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Thu Jul 17 15:25:24 EDT 2008
Author: thomas.diesler at jboss.com
Date: 2008-07-17 15:25:24 -0400 (Thu, 17 Jul 2008)
New Revision: 1672
Added:
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/DialectRegistry.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SupportingElement.java
api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBBPMNElement.java
api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBGraphicalElement.java
api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBSupportingElement.java
api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/BPMNElementImpl.java
api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/GraphicalElementImpl.java
api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/SupportingElementImpl.java
Removed:
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SuportingElement.java
api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/ProcessAdapter.java
api/trunk/modules/dialects/stp/src/main/java/org/jboss/bpm/dialect/stp/BpmnDiagramAdapter.java
Modified:
api/trunk/.classpath
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/BPMNElement.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Flow.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowObject.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Signal.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java
api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/DialectHandlerImpl.java
api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/ProcessUnmarshaller.java
api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBFlow.java
api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBFlowObject.java
api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBProcess.java
api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBSubProcess.java
api/trunk/modules/dialects/stp/src/main/java/org/jboss/bpm/dialect/stp/ProcessUnmarshaller.java
api/trunk/modules/dialects/stp/src/test/java/org/jboss/bpm/dialect/stp/sequence/SequenceTest.java
api/trunk/modules/dialects/stp/src/test/resources/jbpm-beans.xml
api/trunk/modules/impl/src/main/java/org/jboss/bpm/client/internal/ProcessManagerImpl.java
api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/FlowImpl.java
api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/FlowObjectImpl.java
api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/ProcessImpl.java
api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/SubProcessImpl.java
api/trunk/modules/testsuite/pom.xml
api/trunk/modules/testsuite/src/test/resources/jbpm-beans.xml
Log:
More work on stp bpmn dialect
Modified: api/trunk/.classpath
===================================================================
--- api/trunk/.classpath 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/.classpath 2008-07-17 19:25:24 UTC (rev 1672)
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="modules/api/target/classes" path="modules/api/src/main/java"/>
+ <classpathentry kind="src" path="modules/dialects/api10/src/main/java"/>
<classpathentry kind="src" path="modules/dialects/stp/src/test/java"/>
<classpathentry kind="src" path="modules/dialects/stp/src/main/java"/>
<classpathentry kind="src" path="modules/dialects/xpdl21/src/main/java"/>
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/DialectRegistry.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/DialectRegistry.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/DialectRegistry.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -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.client;
+
+//$Id$
+
+import java.util.Map;
+
+/**
+ * A registry that Maps namespaceURI to dialect Id
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 18-Jul-2008
+ */
+public class DialectRegistry
+{
+ public static final Object BEAN_NAME = "jBPMDialectRegistry";
+
+ // Maps namespaceURI to dialect Id
+ private Map<String,String> registry;
+
+ public void setRegistry(Map<String, String> registry)
+ {
+ this.registry = registry;
+ }
+
+ public String getDialect(String nsURI)
+ {
+ return registry.get(nsURI);
+ }
+}
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/DialectRegistry.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -23,18 +23,24 @@
// $Id$
+import java.io.ByteArrayInputStream;
import java.io.IOException;
+import java.io.InputStream;
import java.net.URL;
import java.util.Collections;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.EngineShutdownException;
import org.jboss.bpm.model.Process;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
/**
* The process manager is the entry point to create, find and otherwise manage processes.
@@ -50,7 +56,9 @@
// Injected through the MC
protected ProcessEngine engine;
// The map of registerd dialect handlers
- protected Map<String, DialectHandler> dialectHandlers = new HashMap<String, DialectHandler>();
+ protected Map<String, DialectHandler> dialectHandlers;
+ // The dialect registry
+ protected DialectRegistry dialectRegistry;
// The set of process definitions
private Set<Process> procs = new HashSet<Process>();
@@ -82,12 +90,13 @@
/**
* Create a Process from a XML string in one of the supported formats
*/
- public final Process createProcess(String procDescriptor)
+ public final Process createProcess(String pXML)
{
if (engine.isPrepareForShutdown())
throw new EngineShutdownException("Cannot create new Process while engine is shutting down");
- Process proc = getDialectHandler().createProcess(procDescriptor);
+ String nsURI = getNamespaceURI(new ByteArrayInputStream(pXML.getBytes()));
+ Process proc = getDialectHandler(nsURI).createProcess(pXML);
registerProcess(proc);
return proc;
}
@@ -95,12 +104,13 @@
/**
* Create a Process from an URL to a XML descritor in one of the supported formats
*/
- public final Process createProcess(URL procURL) throws IOException
+ public final Process createProcess(URL pURL) throws IOException
{
if (engine.isPrepareForShutdown())
throw new EngineShutdownException("Cannot create new Process while engine is shutting down");
- Process proc = getDialectHandler().createProcess(procURL);
+ String nsURI = getNamespaceURI(pURL.openStream());
+ Process proc = getDialectHandler(nsURI).createProcess(pURL);
registerProcess(proc);
return proc;
}
@@ -148,13 +158,39 @@
procs.remove(proc.getName());
}
+ private String getNamespaceURI(InputStream inStream)
+ {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ Document doc;
+ try
+ {
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ doc = db.parse(inStream);
+ }
+ 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 nsURI;
+ }
+
// Get the handler for the current dialect
- private DialectHandler getDialectHandler()
+ private DialectHandler getDialectHandler(String nsURI)
{
- String dialect = System.getProperty("jbpm.dialect", "api10");
- DialectHandler dialectHandler = dialectHandlers.get(dialect);
+ String dialectId = dialectRegistry.getDialect(nsURI);
+ if (dialectId == null)
+ throw new IllegalStateException("No dialect registered for: " + nsURI);
+
+ DialectHandler dialectHandler = dialectHandlers.get(dialectId);
if (dialectHandler == null)
- throw new IllegalStateException("No dialect handler registered for: " + dialect);
+ throw new IllegalStateException("No dialect handler registered for: " + dialectId);
return dialectHandler;
}
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/BPMNElement.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/BPMNElement.java 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/BPMNElement.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -24,15 +24,20 @@
//$Id$
/**
- * The
+ * The parrent of all BPMN elements
*
* @author thomas.diesler at jboss.com
* @since 08-Jul-2008
*/
public interface BPMNElement
{
+ /**
+ * Get the associated Process
+ */
+ Process getProcess();
+
/**
* Get the ID of this element
*/
- //String getID();
+ String getID();
}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Flow.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Flow.java 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Flow.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -33,7 +33,7 @@
* @author thomas.diesler at jboss.com
* @since 08-Jul-2008
*/
-public interface Flow
+public interface Flow extends SupportingElement
{
/**
* Get the optional name
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowObject.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowObject.java 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowObject.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -32,8 +32,4 @@
*/
public interface FlowObject extends GraphicalElement
{
- /**
- * Get the associated Process
- */
- Process getProcess();
}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -34,7 +34,7 @@
* @author thomas.diesler at jboss.com
* @since 08-Jul-2008
*/
-public interface Process extends Activity, NamedFlowObject
+public interface Process extends GraphicalElement, NamedFlowObject
{
/**
* Defines the state a {@link Process} can be in
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Signal.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Signal.java 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Signal.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -48,13 +48,13 @@
}
private Type type;
- private FlowObject flowObject;
+ private BPMNElement srcElement;
private String message;
/** Create the signal for a given process */
- public Signal(FlowObject flowObject, Type type)
+ public Signal(BPMNElement srcElement, Type type)
{
- this.flowObject = flowObject;
+ this.srcElement = srcElement;
this.type = type;
validateSignal();
}
@@ -62,7 +62,7 @@
/** Create the signal for a given process */
public Signal(FlowObject flowObject, Type type, String message)
{
- this.flowObject = flowObject;
+ this.srcElement = flowObject;
this.type = type;
this.message = message;
validateSignal();
@@ -71,7 +71,7 @@
/** Get the proccess name */
public String getProcessName()
{
- return flowObject.getProcess().getName();
+ return srcElement.getProcess().getName();
}
public Type getType()
@@ -81,7 +81,7 @@
public String getFlowObject()
{
- return flowObject.toString();
+ return srcElement.toString();
}
public String getMessage()
@@ -91,7 +91,7 @@
private void validateSignal()
{
- if (flowObject == null)
+ if (srcElement == null)
throw new IllegalArgumentException("FlowObject cannot be null");
if (type == null)
throw new IllegalArgumentException("SignalType cannot be null");
@@ -100,9 +100,9 @@
public String toString()
{
StringBuilder string = new StringBuilder(type + "[" + getProcessName());
- if (flowObject instanceof Process == false)
+ if (srcElement instanceof Process == false)
{
- string.append(":" + flowObject);
+ string.append(":" + srcElement);
}
if (message != null)
{
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -30,6 +30,6 @@
* @author thomas.diesler at jboss.com
* @since 08-Jul-2008
*/
-public interface SubProcess extends Process, SingleInFlowSupport, SingleOutFlowSupport
+public interface SubProcess extends Activity, SingleInFlowSupport, SingleOutFlowSupport
{
}
\ No newline at end of file
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SuportingElement.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SuportingElement.java 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SuportingElement.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -1,34 +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.model;
-
-//$Id$
-
-/**
- * A graphical BPMN element
- *
- * @author thomas.diesler at jboss.com
- * @since 08-Jul-2008
- */
-public interface SuportingElement extends BPMNElement
-{
-}
\ No newline at end of file
Copied: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SupportingElement.java (from rev 1671, api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SuportingElement.java)
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SupportingElement.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SupportingElement.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -0,0 +1,34 @@
+/*
+ * 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.model;
+
+//$Id$
+
+/**
+ * A graphical BPMN element
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface SupportingElement extends BPMNElement
+{
+}
\ No newline at end of file
Modified: api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/DialectHandlerImpl.java
===================================================================
--- api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/DialectHandlerImpl.java 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/DialectHandlerImpl.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -32,7 +32,6 @@
import org.jboss.bpm.InvalidProcessException;
import org.jboss.bpm.client.DialectHandler;
-import org.jboss.bpm.dialect.api10.model.JAXBProcess;
import org.jboss.bpm.model.Process;
/**
@@ -49,8 +48,7 @@
try
{
ProcessUnmarshaller unmarschaller = new ProcessUnmarshaller();
- JAXBProcess jaxbProc = unmarschaller.unmarshallProcess(new StringReader(pXML));
- Process proc = new ProcessAdapter().adaptProcess(jaxbProc);
+ Process proc = unmarschaller.unmarshallProcess(new StringReader(pXML));
return proc;
}
catch (JAXBException ex)
@@ -64,8 +62,7 @@
try
{
ProcessUnmarshaller unmarschaller = new ProcessUnmarshaller();
- JAXBProcess jaxbProc = unmarschaller.unmarshallProcess(new InputStreamReader(pURL.openStream()));
- Process proc = new ProcessAdapter().adaptProcess(jaxbProc);
+ Process proc = unmarschaller.unmarshallProcess(new InputStreamReader(pURL.openStream()));
return proc;
}
catch (JAXBException ex)
Deleted: api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/ProcessAdapter.java
===================================================================
--- api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/ProcessAdapter.java 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/ProcessAdapter.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -1,176 +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.dialect.api10;
-
-// $Id$
-
-import org.jboss.bpm.InvalidProcessException;
-import org.jboss.bpm.NotImplementedException;
-import org.jboss.bpm.dialect.api10.model.JAXBComplexGateway;
-import org.jboss.bpm.dialect.api10.model.JAXBEndEvent;
-import org.jboss.bpm.dialect.api10.model.JAXBExclusiveGateway;
-import org.jboss.bpm.dialect.api10.model.JAXBFlow;
-import org.jboss.bpm.dialect.api10.model.JAXBFlowObject;
-import org.jboss.bpm.dialect.api10.model.JAXBHandler;
-import org.jboss.bpm.dialect.api10.model.JAXBInclusiveGateway;
-import org.jboss.bpm.dialect.api10.model.JAXBIntermediateEvent;
-import org.jboss.bpm.dialect.api10.model.JAXBParallelGateway;
-import org.jboss.bpm.dialect.api10.model.JAXBProcess;
-import org.jboss.bpm.dialect.api10.model.JAXBStartEvent;
-import org.jboss.bpm.dialect.api10.model.JAXBSubProcess;
-import org.jboss.bpm.dialect.api10.model.JAXBTask;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-
-/**
- * Adapt the JAXBProcess to the API Process
- *
- * @author thomas.diesler at jboss.com
- * @since 18-Jun-2008
- */
-public class ProcessAdapter
-{
- public Process adaptProcess(JAXBProcess jaxbProc)
- {
- ProcessBuilder builder = ProcessBuilderFactory.newInstance().newProcessBuilder(jaxbProc.getName());
- for (JAXBFlowObject jaxbFlowObject : jaxbProc.getFlowObjects())
- {
- if (jaxbFlowObject instanceof JAXBStartEvent)
- {
- adaptStartEvent(builder, (JAXBStartEvent)jaxbFlowObject);
- }
- else if (jaxbFlowObject instanceof JAXBIntermediateEvent)
- {
- adaptIntermediateEvent(builder, (JAXBIntermediateEvent)jaxbFlowObject);
- }
- else if (jaxbFlowObject instanceof JAXBEndEvent)
- {
- adaptEndEvent(builder, (JAXBEndEvent)jaxbFlowObject);
- }
- else if (jaxbFlowObject instanceof JAXBSubProcess)
- {
- adaptSubProcess(builder, (JAXBSubProcess)jaxbFlowObject);
- }
- else if (jaxbFlowObject instanceof JAXBTask)
- {
- adaptTask(builder, (JAXBTask)jaxbFlowObject);
- }
- else if (jaxbFlowObject instanceof JAXBExclusiveGateway)
- {
- adaptExclusiveGateway(builder, (JAXBExclusiveGateway)jaxbFlowObject);
- }
- else if (jaxbFlowObject instanceof JAXBInclusiveGateway)
- {
- adaptInclusiveGateway(builder, (JAXBInclusiveGateway)jaxbFlowObject);
- }
- else if (jaxbFlowObject instanceof JAXBComplexGateway)
- {
- adaptComplexGateway(builder, (JAXBComplexGateway)jaxbFlowObject);
- }
- else if (jaxbFlowObject instanceof JAXBParallelGateway)
- {
- adaptParallelGateway(builder, (JAXBParallelGateway)jaxbFlowObject);
- }
- else
- {
- throw new InvalidProcessException("Unsupported type: " + jaxbFlowObject);
- }
- }
-
- Process proc = builder.getProcess();
- return proc;
- }
-
- private void adaptExclusiveGateway(ProcessBuilder builder, JAXBExclusiveGateway jaxb)
- {
- builder.addExclusiveGateway(jaxb.getName());
- for(JAXBFlow flow : jaxb.getOutFlows())
- builder.addSequenceFlow(flow.getTargetName());
- }
-
- private void adaptInclusiveGateway(ProcessBuilder builder, JAXBInclusiveGateway jaxb)
- {
- builder.addInclusiveGateway(jaxb.getName());
- for(JAXBFlow flow : jaxb.getOutFlows())
- builder.addSequenceFlow(flow.getTargetName());
- }
-
- private void adaptComplexGateway(ProcessBuilder builder, JAXBComplexGateway jaxb)
- {
- builder.addComplexGateway(jaxb.getName());
- for(JAXBFlow flow : jaxb.getOutFlows())
- builder.addSequenceFlow(flow.getTargetName());
- }
-
- private void adaptParallelGateway(ProcessBuilder builder, JAXBParallelGateway jaxb)
- {
- builder.addParallelGateway(jaxb.getName());
- for(JAXBFlow flow : jaxb.getOutFlows())
- builder.addSequenceFlow(flow.getTargetName());
- }
-
- private void adaptTask(ProcessBuilder builder, JAXBTask jaxb)
- {
- String targetName = jaxb.getOutFlow().getTargetName();
- builder.addTask(jaxb.getName()).addSequenceFlow(targetName);
-
- JAXBHandler jaxbHandler = jaxb.getExecutionHandler();
- if (jaxbHandler != null)
- builder.addExecutionHandler(loadHandler(jaxbHandler.getClassName()));
- }
-
- private void adaptStartEvent(ProcessBuilder builder, JAXBStartEvent jaxb)
- {
- String targetName = jaxb.getOutFlow().getTargetName();
- builder.addStartEvent().addSequenceFlow(targetName);
- }
-
- private void adaptIntermediateEvent(ProcessBuilder builder, JAXBIntermediateEvent jaxb)
- {
- String targetName = jaxb.getOutFlow().getTargetName();
- builder.addItermediateEvent(jaxb.getName()).addSequenceFlow(targetName);
- }
-
- private void adaptEndEvent(ProcessBuilder builder, JAXBEndEvent jaxb)
- {
- builder.addEndEvent(jaxb.getName());
- }
-
- private void adaptSubProcess(ProcessBuilder builder, JAXBSubProcess jaxb)
- {
- throw new NotImplementedException();
- }
-
- private Class<?> loadHandler(String className)
- {
- try
- {
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- return ctxLoader.loadClass(className);
- }
- catch (ClassNotFoundException e)
- {
- throw new IllegalStateException("Cannot load handler class: " + className);
- }
- }
-}
Modified: api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/ProcessUnmarshaller.java
===================================================================
--- api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/ProcessUnmarshaller.java 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/ProcessUnmarshaller.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -29,8 +29,25 @@
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
+import org.jboss.bpm.InvalidProcessException;
+import org.jboss.bpm.NotImplementedException;
+import org.jboss.bpm.dialect.api10.model.JAXBComplexGateway;
+import org.jboss.bpm.dialect.api10.model.JAXBEndEvent;
+import org.jboss.bpm.dialect.api10.model.JAXBExclusiveGateway;
+import org.jboss.bpm.dialect.api10.model.JAXBFlow;
+import org.jboss.bpm.dialect.api10.model.JAXBFlowObject;
+import org.jboss.bpm.dialect.api10.model.JAXBHandler;
+import org.jboss.bpm.dialect.api10.model.JAXBInclusiveGateway;
+import org.jboss.bpm.dialect.api10.model.JAXBIntermediateEvent;
+import org.jboss.bpm.dialect.api10.model.JAXBParallelGateway;
import org.jboss.bpm.dialect.api10.model.JAXBProcess;
+import org.jboss.bpm.dialect.api10.model.JAXBStartEvent;
+import org.jboss.bpm.dialect.api10.model.JAXBSubProcess;
+import org.jboss.bpm.dialect.api10.model.JAXBTask;
import org.jboss.bpm.dialect.api10.model.ObjectFactory;
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.ProcessBuilder;
+import org.jboss.bpm.model.ProcessBuilderFactory;
/**
@@ -41,12 +58,137 @@
*/
public class ProcessUnmarshaller
{
- public JAXBProcess unmarshallProcess(Reader xml) throws JAXBException
+ public Process unmarshallProcess(Reader xml) throws JAXBException
{
JAXBContext jaxbContext = JAXBContext.newInstance(ObjectFactory.class);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
unmarshaller.setProperty("com.sun.xml.bind.ObjectFactory",new ObjectFactory());
- JAXBProcess proc = (JAXBProcess)unmarshaller.unmarshal(xml);
+ JAXBProcess jaxbProc = (JAXBProcess)unmarshaller.unmarshal(xml);
+ Process proc = adaptProcess(jaxbProc);
return proc;
}
+
+ private Process adaptProcess(JAXBProcess jaxbProc)
+ {
+ ProcessBuilder builder = ProcessBuilderFactory.newInstance().newProcessBuilder(jaxbProc.getName());
+ for (JAXBFlowObject jaxbFlowObject : jaxbProc.getFlowObjects())
+ {
+ if (jaxbFlowObject instanceof JAXBStartEvent)
+ {
+ adaptStartEvent(builder, (JAXBStartEvent)jaxbFlowObject);
+ }
+ else if (jaxbFlowObject instanceof JAXBIntermediateEvent)
+ {
+ adaptIntermediateEvent(builder, (JAXBIntermediateEvent)jaxbFlowObject);
+ }
+ else if (jaxbFlowObject instanceof JAXBEndEvent)
+ {
+ adaptEndEvent(builder, (JAXBEndEvent)jaxbFlowObject);
+ }
+ else if (jaxbFlowObject instanceof JAXBSubProcess)
+ {
+ adaptSubProcess(builder, (JAXBSubProcess)jaxbFlowObject);
+ }
+ else if (jaxbFlowObject instanceof JAXBTask)
+ {
+ adaptTask(builder, (JAXBTask)jaxbFlowObject);
+ }
+ else if (jaxbFlowObject instanceof JAXBExclusiveGateway)
+ {
+ adaptExclusiveGateway(builder, (JAXBExclusiveGateway)jaxbFlowObject);
+ }
+ else if (jaxbFlowObject instanceof JAXBInclusiveGateway)
+ {
+ adaptInclusiveGateway(builder, (JAXBInclusiveGateway)jaxbFlowObject);
+ }
+ else if (jaxbFlowObject instanceof JAXBComplexGateway)
+ {
+ adaptComplexGateway(builder, (JAXBComplexGateway)jaxbFlowObject);
+ }
+ else if (jaxbFlowObject instanceof JAXBParallelGateway)
+ {
+ adaptParallelGateway(builder, (JAXBParallelGateway)jaxbFlowObject);
+ }
+ else
+ {
+ throw new InvalidProcessException("Unsupported type: " + jaxbFlowObject);
+ }
+ }
+
+ Process proc = builder.getProcess();
+ return proc;
+ }
+
+ private void adaptExclusiveGateway(ProcessBuilder builder, JAXBExclusiveGateway jaxb)
+ {
+ builder.addExclusiveGateway(jaxb.getName());
+ for(JAXBFlow flow : jaxb.getOutFlows())
+ builder.addSequenceFlow(flow.getTargetName());
+ }
+
+ private void adaptInclusiveGateway(ProcessBuilder builder, JAXBInclusiveGateway jaxb)
+ {
+ builder.addInclusiveGateway(jaxb.getName());
+ for(JAXBFlow flow : jaxb.getOutFlows())
+ builder.addSequenceFlow(flow.getTargetName());
+ }
+
+ private void adaptComplexGateway(ProcessBuilder builder, JAXBComplexGateway jaxb)
+ {
+ builder.addComplexGateway(jaxb.getName());
+ for(JAXBFlow flow : jaxb.getOutFlows())
+ builder.addSequenceFlow(flow.getTargetName());
+ }
+
+ private void adaptParallelGateway(ProcessBuilder builder, JAXBParallelGateway jaxb)
+ {
+ builder.addParallelGateway(jaxb.getName());
+ for(JAXBFlow flow : jaxb.getOutFlows())
+ builder.addSequenceFlow(flow.getTargetName());
+ }
+
+ private void adaptTask(ProcessBuilder builder, JAXBTask jaxb)
+ {
+ String targetName = jaxb.getOutFlow().getTargetName();
+ builder.addTask(jaxb.getName()).addSequenceFlow(targetName);
+
+ JAXBHandler jaxbHandler = jaxb.getExecutionHandler();
+ if (jaxbHandler != null)
+ builder.addExecutionHandler(loadHandler(jaxbHandler.getClassName()));
+ }
+
+ private void adaptStartEvent(ProcessBuilder builder, JAXBStartEvent jaxb)
+ {
+ String targetName = jaxb.getOutFlow().getTargetName();
+ builder.addStartEvent().addSequenceFlow(targetName);
+ }
+
+ private void adaptIntermediateEvent(ProcessBuilder builder, JAXBIntermediateEvent jaxb)
+ {
+ String targetName = jaxb.getOutFlow().getTargetName();
+ builder.addItermediateEvent(jaxb.getName()).addSequenceFlow(targetName);
+ }
+
+ private void adaptEndEvent(ProcessBuilder builder, JAXBEndEvent jaxb)
+ {
+ builder.addEndEvent(jaxb.getName());
+ }
+
+ private void adaptSubProcess(ProcessBuilder builder, JAXBSubProcess jaxb)
+ {
+ throw new NotImplementedException();
+ }
+
+ private Class<?> loadHandler(String className)
+ {
+ try
+ {
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ return ctxLoader.loadClass(className);
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new IllegalStateException("Cannot load handler class: " + className);
+ }
+ }
}
Added: api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBBPMNElement.java
===================================================================
--- api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBBPMNElement.java (rev 0)
+++ api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBBPMNElement.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -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.dialect.api10.model;
+
+//$Id$
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+ at XmlType(name = "BPMNElement")
+public class JAXBBPMNElement
+{
+ private String id;
+
+ public String getId()
+ {
+ return id;
+ }
+
+ @XmlAttribute(name = "ID", required = false)
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+}
\ No newline at end of file
Property changes on: api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBBPMNElement.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBFlow.java
===================================================================
--- api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBFlow.java 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBFlow.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -36,7 +36,7 @@
* @since 08-Jul-2008
*/
@XmlType(name = "Flow")
-public class JAXBFlow
+public class JAXBFlow extends JAXBSupportingElement
{
private String name;
private String targetName;
Modified: api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBFlowObject.java
===================================================================
--- api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBFlowObject.java 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBFlowObject.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -33,6 +33,6 @@
* @since 08-Jul-2008
*/
@XmlType(name = "FlowObject")
-public class JAXBFlowObject
+public class JAXBFlowObject extends JAXBGraphicalElement
{
}
\ No newline at end of file
Added: api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBGraphicalElement.java
===================================================================
--- api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBGraphicalElement.java (rev 0)
+++ api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBGraphicalElement.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -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.jboss.bpm.dialect.api10.model;
+
+//$Id$
+
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+ at XmlType(name = "GraphicalElement")
+public class JAXBGraphicalElement
+{
+}
\ No newline at end of file
Property changes on: api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBGraphicalElement.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBProcess.java
===================================================================
--- api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBProcess.java 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBProcess.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -26,6 +26,7 @@
import java.util.ArrayList;
import java.util.List;
+import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlRootElement;
@@ -39,8 +40,9 @@
*/
@XmlType(name = "Process")
@XmlRootElement(name = "process")
-public class JAXBProcess extends JAXBActivity
+public class JAXBProcess extends JAXBSupportingElement
{
+ private String name;
@XmlElements( {
@XmlElement(name = "start", type = JAXBStartEvent.class),
@XmlElement(name = "event", type = JAXBIntermediateEvent.class),
@@ -53,7 +55,18 @@
@XmlElement(name = "end", type = JAXBEndEvent.class)
})
private List<JAXBFlowObject> flowObjects = new ArrayList<JAXBFlowObject>();
+
+ public String getName()
+ {
+ return name;
+ }
+ @XmlAttribute(required = true)
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
/**
* Get the list of flow objects
*/
Modified: api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBSubProcess.java
===================================================================
--- api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBSubProcess.java 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBSubProcess.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -35,7 +35,7 @@
* @since 08-Jul-2008
*/
@XmlType(name = "SubProcess")
-public class JAXBSubProcess extends JAXBProcess
+public class JAXBSubProcess extends JAXBActivity
{
private JAXBExecutionHandler executionHandler;
private JAXBFlowHandler flowHandler;
Added: api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBSupportingElement.java
===================================================================
--- api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBSupportingElement.java (rev 0)
+++ api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBSupportingElement.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -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.jboss.bpm.dialect.api10.model;
+
+//$Id$
+
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+ at XmlType(name = "SupportingElement")
+public class JAXBSupportingElement
+{
+}
\ No newline at end of file
Property changes on: api/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/model/JAXBSupportingElement.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: api/trunk/modules/dialects/stp/src/main/java/org/jboss/bpm/dialect/stp/BpmnDiagramAdapter.java
===================================================================
--- api/trunk/modules/dialects/stp/src/main/java/org/jboss/bpm/dialect/stp/BpmnDiagramAdapter.java 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/dialects/stp/src/main/java/org/jboss/bpm/dialect/stp/BpmnDiagramAdapter.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -1,78 +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.dialect.stp;
-
-// $Id$
-
-import java.util.List;
-
-import org.jboss.bpm.InvalidProcessException;
-import org.jboss.bpm.dialect.stp.model.Activity;
-import org.jboss.bpm.dialect.stp.model.ActivityType;
-import org.jboss.bpm.dialect.stp.model.BpmnDiagram;
-import org.jboss.bpm.dialect.stp.model.Pool;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-
-/**
- * Adapt the jpdl-3.2 ProcessDefinition to the API Process
- *
- * @author thomas.diesler at jboss.com
- * @since 18-Jun-2008
- */
-public class BpmnDiagramAdapter
-{
- public ProcessBuilder adaptBpmnDiagram(BpmnDiagram bpmnDiagram)
- {
- List<Pool> stpPools = bpmnDiagram.getPools();
- if (stpPools == null || stpPools.size() == 0)
- throw new IllegalStateException("Expected at least one Pool");
- if (stpPools.size() > 1)
- throw new IllegalStateException("Multiple Pools not supported");
-
- Pool stpPool = stpPools.get(0);
- ProcessBuilder builder = ProcessBuilderFactory.newInstance().newProcessBuilder(stpPool.getId());
-
- return builder;
- }
-
- public void adaptActivity(ProcessBuilder builder, Activity stpActivity, String name)
- {
- ActivityType activityType = stpActivity.getActivityType();
- if (activityType == ActivityType.EVENT_START_EMPTY)
- {
- builder.addStartEvent();
- }
- else if (activityType == ActivityType.EVENT_END_EMPTY)
- {
- builder.addEndEvent(name);
- }
- else if (activityType == ActivityType.TASK)
- {
- builder.addTask(name);
- }
- else
- {
- throw new InvalidProcessException("Unsupported activity type: " + activityType);
- }
- }
-}
Modified: api/trunk/modules/dialects/stp/src/main/java/org/jboss/bpm/dialect/stp/ProcessUnmarshaller.java
===================================================================
--- api/trunk/modules/dialects/stp/src/main/java/org/jboss/bpm/dialect/stp/ProcessUnmarshaller.java 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/dialects/stp/src/main/java/org/jboss/bpm/dialect/stp/ProcessUnmarshaller.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -24,7 +24,9 @@
// $Id$
import java.io.InputStream;
+import java.util.ArrayList;
import java.util.Iterator;
+import java.util.List;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
@@ -33,11 +35,16 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
+import org.jboss.bpm.InvalidProcessException;
import org.jboss.bpm.dialect.stp.model.Activity;
+import org.jboss.bpm.dialect.stp.model.ActivityType;
import org.jboss.bpm.dialect.stp.model.BpmnDiagram;
import org.jboss.bpm.dialect.stp.model.ObjectFactory;
+import org.jboss.bpm.dialect.stp.model.Pool;
+import org.jboss.bpm.dialect.stp.model.SequenceEdge;
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.ProcessBuilder;
+import org.jboss.bpm.model.ProcessBuilderFactory;
import org.jboss.util.xml.DOMUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -51,15 +58,20 @@
public class ProcessUnmarshaller
{
public static final String NAMESPACE_URI = "http://stp.eclipse.org/bpmn";
-
+
+ private BpmnDiagram diagram;
+ private List<SequenceEdge> sequenceEdges;
+ private List<Activity> activities = new ArrayList<Activity>();
+
+ @SuppressWarnings("unchecked")
public Process unmarshallProcess(InputStream xml) throws JAXBException
{
JAXBContext jaxbContext = JAXBContext.newInstance(ObjectFactory.class);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
unmarshaller.setProperty("com.sun.xml.bind.ObjectFactory", new ObjectFactory());
- // We need to unmarshall the elements one by one because the generated STP BPMN
- // file does not contain xsd:type declarations so that JACB cannot createt the types
+ // We need to unmarshall the elements one by one because the generated STP BPMN
+ // file does not contain xsd:type declarations so that JAXB cannot createt the types
// automatically
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
@@ -75,30 +87,121 @@
}
Element root = doc.getDocumentElement();
- BpmnDiagram bpmnDiagram = unmarshaller.unmarshal(root, BpmnDiagram.class).getValue();
-
- BpmnDiagramAdapter bpmnAdapter = new BpmnDiagramAdapter();
- ProcessBuilder builder = bpmnAdapter.adaptBpmnDiagram(bpmnDiagram);
-
- Element stpEl = (Element)DOMUtils.getChildElements(root, "pools").next();
- Iterator itEl = DOMUtils.getChildElements(stpEl, "vertices");
+ diagram = unmarshaller.unmarshal(root, BpmnDiagram.class).getValue();
+ ProcessBuilder builder = adaptDiagram(diagram);
+
+ // Initialize the list of sequence edges
+ Element poolEl = (Element)DOMUtils.getChildElements(root, "pools").next();
+ Pool pool = unmarshaller.unmarshal(poolEl, Pool.class).getValue();
+ sequenceEdges = pool.getSequenceEdges();
+
+ // Iterate over all 'verticies'
+ Iterator<Element> itEl = DOMUtils.getChildElements(poolEl, "vertices");
while (itEl.hasNext())
{
- stpEl = (Element)itEl.next();
+ Element stpEl = itEl.next();
String xmiType = DOMUtils.getAttributeValue(stpEl, new QName("http://www.omg.org/XMI", "type"));
if ("bpmn:Activity".equals(xmiType))
{
- Activity bpmnActivity = unmarshaller.unmarshal(stpEl, Activity.class).getValue();
+ Activity stpActivity = unmarshaller.unmarshal(stpEl, Activity.class).getValue();
String name = DOMUtils.getAttributeValue(stpEl, "name");
- name = (name != null ? name : bpmnActivity.getId());
- bpmnAdapter.adaptActivity(builder, bpmnActivity, name);
+ name = (name != null ? name : stpActivity.getId());
+ stpActivity.setLabel(name);
+
+ // Fall back to the attribute if JAXB did not initialize it
+ List<String> outEdges = stpActivity.getOutgoingEdges();
+ if (outEdges.size() == 0)
+ {
+ String edgeStr = DOMUtils.getAttributeValue(stpEl, "outgoingEdges");
+ if (edgeStr != null && edgeStr.length() > 0)
+ outEdges.add(edgeStr);
+ }
+
+ activities.add(stpActivity);
}
else
{
throw new IllegalStateException("Unsupported xmi:type: " + xmiType);
}
}
-
+
+ // Build the activities
+ for (Activity stpActivity : activities)
+ {
+ adaptActivity(builder, stpActivity);
+ }
+
return builder.getProcess();
}
+
+ private ProcessBuilder adaptDiagram(BpmnDiagram bpmnDiagram)
+ {
+ List<Pool> stpPools = bpmnDiagram.getPools();
+ if (stpPools == null || stpPools.size() == 0)
+ throw new IllegalStateException("Expected at least one Pool");
+ if (stpPools.size() > 1)
+ throw new IllegalStateException("Multiple Pools not supported");
+
+ Pool stpPool = stpPools.get(0);
+ ProcessBuilder builder = ProcessBuilderFactory.newInstance().newProcessBuilder(stpPool.getId());
+
+ return builder;
+ }
+
+ private void adaptActivity(ProcessBuilder builder, Activity stpActivity)
+ {
+ ActivityType activityType = stpActivity.getActivityType();
+ if (activityType == ActivityType.EVENT_START_EMPTY)
+ {
+ builder.addStartEvent();
+ adaptOutgoingEdges(builder, stpActivity);
+ }
+ else if (activityType == ActivityType.EVENT_END_EMPTY)
+ {
+ String name = stpActivity.getLabel();
+ builder.addEndEvent(name);
+ }
+ else if (activityType == ActivityType.TASK)
+ {
+ String name = stpActivity.getLabel();
+ builder.addTask(name);
+ adaptOutgoingEdges(builder, stpActivity);
+ }
+ else
+ {
+ throw new InvalidProcessException("Unsupported activity type: " + activityType);
+ }
+ }
+
+ private void adaptOutgoingEdges(ProcessBuilder builder, Activity stpActivity)
+ {
+ for (String edgeId : stpActivity.getOutgoingEdges())
+ {
+ SequenceEdge seqEdge = getSequenceEdgeById(edgeId);
+ String targetId = seqEdge.getTarget();
+ Activity targetAct = getActivityById(targetId);
+ String targetName = targetAct.getLabel();
+ builder.addSequenceFlow(targetName);
+ }
+ }
+
+ private SequenceEdge getSequenceEdgeById(String edgeId)
+ {
+ for (SequenceEdge seqEdge : sequenceEdges)
+ {
+ if (seqEdge.getId().equals(edgeId))
+ return seqEdge;
+ }
+ return null;
+ }
+
+ private Activity getActivityById(String id)
+ {
+ for (Activity act : activities)
+ {
+ if (act.getId().equals(id))
+ return act;
+ }
+ return null;
+ }
}
Modified: api/trunk/modules/dialects/stp/src/test/java/org/jboss/bpm/dialect/stp/sequence/SequenceTest.java
===================================================================
--- api/trunk/modules/dialects/stp/src/test/java/org/jboss/bpm/dialect/stp/sequence/SequenceTest.java 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/dialects/stp/src/test/java/org/jboss/bpm/dialect/stp/sequence/SequenceTest.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -26,8 +26,8 @@
import java.net.URL;
import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.dialect.stp.AbstractSTPDialectTest;
import org.jboss.bpm.model.Process;
+import org.jboss.bpm.test.DefaultEngineTestCase;
/**
* Test the basic execution sequence
@@ -35,7 +35,7 @@
* @author thomas.diesler at jboss.com
* @since 03-Jul-2008
*/
-public class SequenceTest extends AbstractSTPDialectTest
+public class SequenceTest extends DefaultEngineTestCase
{
/**
* Test a basic sequence
@@ -47,5 +47,6 @@
// Create a Process through the ProcessManager
ProcessManager pm = ProcessManager.locateProcessManager();
Process proc = pm.createProcess(jpdlURL);
+ assertNotNull(proc);
}
}
Modified: api/trunk/modules/dialects/stp/src/test/resources/jbpm-beans.xml
===================================================================
--- api/trunk/modules/dialects/stp/src/test/resources/jbpm-beans.xml 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/dialects/stp/src/test/resources/jbpm-beans.xml 2008-07-17 19:25:24 UTC (rev 1672)
@@ -16,6 +16,7 @@
<!-- The ProcessManager -->
<bean name="jBPMProcessManager" class="org.jboss.bpm.client.internal.ProcessManagerImpl">
<property name="processEngine"><inject bean="jBPMProcessEngine" state="Instantiated"/></property>
+ <property name="dialectRegistry"><inject bean="jBPMDialectRegistry"/></property>
<property name="dialectHandlers">
<map keyClass="java.lang.String" valueClass="org.jboss.bpm.client.DialectHandler">
<entry><key>stp</key><value><inject bean="jBPMDialectHandlerSTP"/></value></entry>
@@ -24,6 +25,15 @@
</bean>
<bean name="jBPMDialectHandlerSTP" class="org.jboss.bpm.dialect.stp.DialectHandlerImpl"/>
+ <!-- The DialectRegistry -->
+ <bean name="jBPMDialectRegistry" class="org.jboss.bpm.client.DialectRegistry">
+ <property name="registry">
+ <map keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry><key>http://stp.eclipse.org/bpmn</key><value>stp</value></entry>
+ </map>
+ </property>
+ </bean>
+
<!-- The ExecutionManager -->
<bean name="jBPMExecutionManager" class="org.jboss.bpm.client.internal.ExecutionManagerImpl">
<property name="processEngine"><inject bean="jBPMProcessEngine" state="Instantiated"/></property>
Modified: api/trunk/modules/impl/src/main/java/org/jboss/bpm/client/internal/ProcessManagerImpl.java
===================================================================
--- api/trunk/modules/impl/src/main/java/org/jboss/bpm/client/internal/ProcessManagerImpl.java 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/impl/src/main/java/org/jboss/bpm/client/internal/ProcessManagerImpl.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -26,6 +26,7 @@
import java.util.Map;
import org.jboss.bpm.client.DialectHandler;
+import org.jboss.bpm.client.DialectRegistry;
import org.jboss.bpm.client.ProcessEngine;
import org.jboss.bpm.client.ProcessManager;
@@ -46,4 +47,9 @@
{
this.dialectHandlers = dialectHandlers;
}
+
+ public void setDialectRegistry(DialectRegistry dialectRegistry)
+ {
+ this.dialectRegistry = dialectRegistry;
+ }
}
Added: api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/BPMNElementImpl.java
===================================================================
--- api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/BPMNElementImpl.java (rev 0)
+++ api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/BPMNElementImpl.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -0,0 +1,66 @@
+/*
+ * 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.model.internal;
+
+//$Id$
+
+import org.jboss.bpm.model.BPMNElement;
+import org.jboss.bpm.model.Process;
+
+/**
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public class BPMNElementImpl implements BPMNElement
+{
+ private String id;
+ private Process process;
+
+ public Process getProcess()
+ {
+ return process;
+ }
+
+ public void setProcess(Process process)
+ {
+ this.process = process;
+ }
+
+ public String getID()
+ {
+ return id;
+ }
+
+ public void setID(String id)
+ {
+ this.id = id;
+ }
+
+ /**
+ * Initialize the flow object
+ */
+ protected void initialize(Process proc)
+ {
+ setProcess(proc);
+ }
+}
\ No newline at end of file
Property changes on: api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/BPMNElementImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/FlowImpl.java
===================================================================
--- api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/FlowImpl.java 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/FlowImpl.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -33,7 +33,7 @@
* @author thomas.diesler at jboss.com
* @since 08-Jul-2008
*/
-public abstract class FlowImpl implements Flow
+public abstract class FlowImpl extends SupportingElementImpl implements Flow
{
private String name;
private String targetName;
Modified: api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/FlowObjectImpl.java
===================================================================
--- api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/FlowObjectImpl.java 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/FlowObjectImpl.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -40,27 +40,14 @@
* @author thomas.diesler at jboss.com
* @since 08-Jul-2008
*/
-public abstract class FlowObjectImpl implements FlowObject
+public abstract class FlowObjectImpl extends GraphicalElementImpl implements FlowObject
{
- private Process process;
-
-
- public Process getProcess()
- {
- return process;
- }
-
- public void setProcess(Process process)
- {
- this.process = process;
- }
-
/**
* Initialize the flow object
*/
protected void initialize(ProcessImpl proc)
{
- setProcess(proc);
+ super.initialize(proc);
if (this instanceof NamedFlowObject)
{
Added: api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/GraphicalElementImpl.java
===================================================================
--- api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/GraphicalElementImpl.java (rev 0)
+++ api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/GraphicalElementImpl.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -0,0 +1,35 @@
+/*
+ * 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.model.internal;
+
+//$Id$
+
+import org.jboss.bpm.model.GraphicalElement;
+
+/**
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public abstract class GraphicalElementImpl extends BPMNElementImpl implements GraphicalElement
+{
+}
\ No newline at end of file
Property changes on: api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/GraphicalElementImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/ProcessImpl.java
===================================================================
--- api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/ProcessImpl.java 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/ProcessImpl.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -45,17 +45,23 @@
* @author thomas.diesler at jboss.com
* @since 08-Jul-2008
*/
-public class ProcessImpl extends ActivityImpl implements Process
+public class ProcessImpl extends SupportingElementImpl implements Process
{
+ private String name;
private List<FlowObject> flowObjects = new ArrayList<FlowObject>();
private ProcessState processState = ProcessState.CREATED;
public ProcessImpl(String name)
{
- super(name);
+ this.name = name;
setProcess(this);
}
+ public String getName()
+ {
+ return name;
+ }
+
public void addFlowObject(FlowObject flowObject)
{
flowObjects.add(flowObject);
@@ -150,7 +156,7 @@
if (getName() == null)
{
ProcessManager pm = ProcessManager.locateProcessManager();
- setName("AnonymousProcess#" + pm.getProcesses().size());
+ this.name = "AnonymousProcess#" + pm.getProcesses().size();
}
if (getStartEvent() == null)
Modified: api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/SubProcessImpl.java
===================================================================
--- api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/SubProcessImpl.java 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/SubProcessImpl.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -23,6 +23,7 @@
//$Id$
+import org.jboss.bpm.NotImplementedException;
import org.jboss.bpm.model.Flow;
import org.jboss.bpm.model.FlowObject;
import org.jboss.bpm.model.Signal;
@@ -40,7 +41,7 @@
* @author thomas.diesler at jboss.com
* @since 08-Jul-2008
*/
-public class SubProcessImpl extends ProcessImpl implements SubProcess, HandlerSetterSupport, SingleInFlowSetterSupport, SingleOutFlowSetterSupport
+public class SubProcessImpl extends ActivityImpl implements SubProcess, HandlerSetterSupport, SingleInFlowSetterSupport, SingleOutFlowSetterSupport
{
private Flow inFlow;
private Flow outFlow;
@@ -82,7 +83,7 @@
{
public void execute(Token token)
{
- startProcess(token.getExecutionContext());
+ throw new NotImplementedException();
}
};
}
Added: api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/SupportingElementImpl.java
===================================================================
--- api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/SupportingElementImpl.java (rev 0)
+++ api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/SupportingElementImpl.java 2008-07-17 19:25:24 UTC (rev 1672)
@@ -0,0 +1,35 @@
+/*
+ * 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.model.internal;
+
+//$Id$
+
+import org.jboss.bpm.model.SupportingElement;
+
+/**
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public abstract class SupportingElementImpl extends BPMNElementImpl implements SupportingElement
+{
+}
\ No newline at end of file
Property changes on: api/trunk/modules/impl/src/main/java/org/jboss/bpm/model/internal/SupportingElementImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/trunk/modules/testsuite/pom.xml
===================================================================
--- api/trunk/modules/testsuite/pom.xml 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/testsuite/pom.xml 2008-07-17 19:25:24 UTC (rev 1672)
@@ -66,6 +66,18 @@
<version>${version}</version>
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.jbpm</groupId>
+ <artifactId>jbpm-api-dialect-stp</artifactId>
+ <version>${version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.jbpm</groupId>
+ <artifactId>jbpm-api-dialect-xpdl21</artifactId>
+ <version>${version}</version>
+ <scope>runtime</scope>
+ </dependency>
</dependencies>
<!-- Plugins -->
Modified: api/trunk/modules/testsuite/src/test/resources/jbpm-beans.xml
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/jbpm-beans.xml 2008-07-17 16:48:54 UTC (rev 1671)
+++ api/trunk/modules/testsuite/src/test/resources/jbpm-beans.xml 2008-07-17 19:25:24 UTC (rev 1672)
@@ -16,12 +16,13 @@
<!-- The ProcessManager -->
<bean name="jBPMProcessManager" class="org.jboss.bpm.client.internal.ProcessManagerImpl">
<property name="processEngine"><inject bean="jBPMProcessEngine" state="Instantiated"/></property>
+ <property name="dialectRegistry"><inject bean="jBPMDialectRegistry"/></property>
<property name="dialectHandlers">
<map keyClass="java.lang.String" valueClass="org.jboss.bpm.client.DialectHandler">
<entry><key>api10</key><value><inject bean="jBPMDialectHandlerAPI10"/></value></entry>
<entry><key>jpdl32</key><value><inject bean="jBPMDialectHandlerJPDL32"/></value></entry>
<entry><key>stp</key><value><inject bean="jBPMDialectHandlerSTP"/></value></entry>
- <entry><key>xpdl32</key><value><inject bean="jBPMDialectHandlerXPDL21"/></value></entry>
+ <entry><key>xpdl21</key><value><inject bean="jBPMDialectHandlerXPDL21"/></value></entry>
</map>
</property>
</bean>
@@ -30,6 +31,18 @@
<bean name="jBPMDialectHandlerSTP" class="org.jboss.bpm.dialect.stp.DialectHandlerImpl"/>
<bean name="jBPMDialectHandlerXPDL21" class="org.jboss.bpm.dialect.xpdl21.DialectHandlerImpl"/>
+ <!-- The DialectRegistry -->
+ <bean name="jBPMDialectRegistry" class="org.jboss.bpm.client.DialectRegistry">
+ <property name="registry">
+ <map keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry><key>urn:api.bpm.jboss:jpdl-0.1</key><value>api10</value></entry>
+ <entry><key>urn:jbpm.org:jpdl-3.2</key><value>jpdl32</value></entry>
+ <entry><key>http://stp.eclipse.org/bpmn</key><value>stp</value></entry>
+ <entry><key>http://www.wfmc.org/2008/XPDL2.1</key><value>xpdl21</value></entry>
+ </map>
+ </property>
+ </bean>
+
<!-- The ExecutionManager -->
<bean name="jBPMExecutionManager" class="org.jboss.bpm.client.internal.ExecutionManagerImpl">
<property name="processEngine"><inject bean="jBPMProcessEngine" state="Instantiated"/></property>
More information about the jbpm-commits
mailing list