[jbpm-commits] JBoss JBPM SVN: r2018 - in jbpm3/trunk/modules/jpdl/integration: src/main/java and 6 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Tue Aug 26 11:23:39 EDT 2008
Author: thomas.diesler at jboss.com
Date: 2008-08-26 11:23:39 -0400 (Tue, 26 Aug 2008)
New Revision: 2018
Added:
jbpm3/trunk/modules/jpdl/integration/src/main/java/org/
jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/
jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/
jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/
jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/ExecutionManagerImpl.java
jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/MessageManagerImpl.java
jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/ProcessEngineImpl.java
jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/ProcessManagerImpl.java
jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/SignalManagerImpl.java
jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/
jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/AbstractElementImpl.java
jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/ActivityBuilderImpl.java
jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/EndStateWrapper.java
jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/EventBuilderImpl.java
jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/FlowObjectImpl.java
jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/NodeWrapper.java
jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/ProcessBuilderFactoryImpl.java
jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/ProcessBuilderImpl.java
jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/ProcessImpl.java
jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/SequenceFlowImpl.java
jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/StartStateWrapper.java
jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/StateWrapper.java
jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/TaskBuilderImpl.java
Modified:
jbpm3/trunk/modules/jpdl/integration/.classpath
jbpm3/trunk/modules/jpdl/integration/pom.xml
jbpm3/trunk/modules/jpdl/integration/src/main/resources/jbpm-beans.xml
Log:
Add API Integration
Modified: jbpm3/trunk/modules/jpdl/integration/.classpath
===================================================================
--- jbpm3/trunk/modules/jpdl/integration/.classpath 2008-08-26 12:12:59 UTC (rev 2017)
+++ jbpm3/trunk/modules/jpdl/integration/.classpath 2008-08-26 15:23:39 UTC (rev 2018)
@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/main/resources"/>
+ <classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JDK-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JDK-1.6"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Modified: jbpm3/trunk/modules/jpdl/integration/pom.xml
===================================================================
--- jbpm3/trunk/modules/jpdl/integration/pom.xml 2008-08-26 12:12:59 UTC (rev 2017)
+++ jbpm3/trunk/modules/jpdl/integration/pom.xml 2008-08-26 15:23:39 UTC (rev 2018)
@@ -35,12 +35,6 @@
</dependency>
<dependency>
<groupId>org.jboss.bpm</groupId>
- <artifactId>jboss-bpm-ri</artifactId>
- <version>${jboss.bpm.api.version}</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.bpm</groupId>
<artifactId>jboss-bpm-testsuite</artifactId>
<scope>provided</scope>
<type>zip</type>
Added: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/ExecutionManagerImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/ExecutionManagerImpl.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/ExecutionManagerImpl.java 2008-08-26 15:23:39 UTC (rev 2018)
@@ -0,0 +1,93 @@
+/*
+ * 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.client;
+
+// $Id$
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.bpm.NotImplementedException;
+import org.jboss.bpm.client.ExecutionManager;
+import org.jboss.bpm.client.SignalManager;
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.Signal;
+import org.jboss.bpm.model.StartEvent;
+import org.jboss.bpm.model.Process.ProcessStatus;
+import org.jboss.bpm.model.Signal.SignalType;
+import org.jboss.bpm.runtime.Attachments;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.Execution;
+import org.jbpm.integration.model.ProcessImpl;
+
+/**
+ * The process manager is the entry point to create, find and otherwise manage processes.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 26-Aug-2008
+ */
+public class ExecutionManagerImpl extends ExecutionManager
+{
+ // provide logging
+ private static final Log log = LogFactory.getLog(ExecutionManagerImpl.class);
+
+ @Override
+ public void startProcess(Process proc, Attachments att)
+ {
+ ProcessImpl procImpl = (ProcessImpl)proc;
+ procImpl.setProcessStatus(ProcessStatus.Active);
+ ProcessDefinition jbpmProc = procImpl.getProcessDefinition();
+
+ SignalManager sigManager = SignalManager.locateSignalManager();
+ sigManager.throwSignal(new Signal(proc.getID(), SignalType.SYSTEM_PROCESS_ENTER));
+ try
+ {
+ Execution jbpmEx = new Execution(jbpmProc);
+ while (jbpmEx.hasEnded() == false)
+ {
+ jbpmEx.signal();
+ }
+ }
+ finally
+ {
+ sigManager.throwSignal(new Signal(proc.getID(), SignalType.SYSTEM_PROCESS_EXIT));
+ }
+ procImpl.setProcessStatus(ProcessStatus.Completed);
+ }
+
+ @Override
+ public ProcessStatus waitForEnd(Process proc)
+ {
+ return proc.getProcessStatus();
+ }
+
+ @Override
+ public ProcessStatus waitForEnd(Process proc, long timeout)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ @Override
+ public void startProcess(StartEvent start, Attachments att)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+}
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/ExecutionManagerImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/MessageManagerImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/MessageManagerImpl.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/MessageManagerImpl.java 2008-08-26 15:23:39 UTC (rev 2018)
@@ -0,0 +1,55 @@
+/*
+ * 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.client;
+
+// $Id$
+
+import javax.management.ObjectName;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.bpm.NotImplementedException;
+import org.jboss.bpm.client.MessageManager;
+import org.jboss.bpm.model.Event;
+import org.jboss.bpm.model.Message;
+import org.jboss.bpm.model.Task;
+
+/**
+ * The ProcessEngine sends mesages through the MessageManager.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 18-Jun-2008
+ */
+public class MessageManagerImpl extends MessageManager
+{
+ // provide logging
+ private static final Log log = LogFactory.getLog(MessageManagerImpl.class);
+
+ /**
+ * Send a message to a given {@link Task} or {@link Event}
+ */
+ @Override
+ public void sendMessage(ObjectName procID, String targetName, Message msg)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+}
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/MessageManagerImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/ProcessEngineImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/ProcessEngineImpl.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/ProcessEngineImpl.java 2008-08-26 15:23:39 UTC (rev 2018)
@@ -0,0 +1,60 @@
+/*
+ * 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.client;
+
+//$Id$
+
+import org.jboss.bpm.client.ExecutionManager;
+import org.jboss.bpm.client.MessageManager;
+import org.jboss.bpm.client.ProcessEngine;
+import org.jboss.bpm.client.ProcessManager;
+import org.jboss.bpm.client.SignalManager;
+
+/**
+ * A process engine with public access
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 18-Jun-2008
+ */
+public class ProcessEngineImpl extends ProcessEngine
+{
+ public void setProcessManager(ProcessManager processManager)
+ {
+ this.processManager = processManager;
+ }
+
+ public void setExecutionManager(ExecutionManager executionManager)
+ {
+ this.executionManager = executionManager;
+ }
+
+ public void setSignalManager(SignalManager signalManager)
+ {
+ this.signalManager = signalManager;
+ }
+
+ public void setMessageManager(MessageManager messageManager)
+ {
+ this.messageManager = messageManager;
+ }
+
+}
Property changes on: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/ProcessEngineImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/ProcessManagerImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/ProcessManagerImpl.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/ProcessManagerImpl.java 2008-08-26 15:23:39 UTC (rev 2018)
@@ -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.jbpm.integration.client;
+
+// $Id$
+
+import java.util.Map;
+
+import org.jboss.bpm.client.DialectHandler;
+import org.jboss.bpm.client.DialectRegistry;
+import org.jboss.bpm.client.ProcessManager;
+
+/**
+ * The process manager is the entry point to create, find and otherwise manage processes.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 26-Aug-2008
+ */
+public class ProcessManagerImpl extends ProcessManager
+{
+ public void setDialectHandlers(Map<String, DialectHandler> dialectHandlers)
+ {
+ this.dialectHandlers = dialectHandlers;
+ }
+
+ public void setDialectRegistry(DialectRegistry dialectRegistry)
+ {
+ this.dialectRegistry = dialectRegistry;
+ }
+}
Property changes on: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/ProcessManagerImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/SignalManagerImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/SignalManagerImpl.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/SignalManagerImpl.java 2008-08-26 15:23:39 UTC (rev 2018)
@@ -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.integration.client;
+
+// $Id$
+
+import org.jboss.bpm.client.SignalManager;
+
+/**
+ * The ProcessEngine sends signals through the SignalManager
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 26-Aug-2008
+ */
+public class SignalManagerImpl extends SignalManager
+{
+}
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/client/SignalManagerImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/AbstractElementImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/AbstractElementImpl.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/AbstractElementImpl.java 2008-08-26 15:23:39 UTC (rev 2018)
@@ -0,0 +1,40 @@
+/*
+ * 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.model;
+
+//$Id$
+
+import javax.management.ObjectName;
+
+import org.jboss.bpm.model.AbstractElement;
+
+/**
+ * The parent of all Elements
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 26-Aug-2008
+ */
+ at SuppressWarnings("serial")
+public abstract class AbstractElementImpl implements AbstractElement
+{
+ protected ObjectName id;
+}
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/AbstractElementImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/ActivityBuilderImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/ActivityBuilderImpl.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/ActivityBuilderImpl.java 2008-08-26 15:23:39 UTC (rev 2018)
@@ -0,0 +1,72 @@
+/*
+ * 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.model;
+
+//$Id$
+
+import org.jboss.bpm.NotImplementedException;
+import org.jboss.bpm.model.ActivityBuilder;
+import org.jboss.bpm.model.Expression.ExpressionLanguage;
+
+/**
+ * The EventBuilder can be used to build an Event dynamically.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 26-Aug-2008
+ */
+public class ActivityBuilderImpl extends ProcessBuilderImpl implements ActivityBuilder
+{
+ public ActivityBuilderImpl(ProcessImpl proc, FlowObjectImpl flowObject)
+ {
+ super(proc, flowObject);
+ }
+
+ public ActivityBuilder addIORule(String body, ExpressionLanguage lang)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public ActivityBuilder addInputSet()
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public ActivityBuilder addOutputSet()
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public ActivityBuilder addPropertyInput(String name)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public ActivityBuilder addPropertyOutput(String name, String value)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public ActivityBuilder addProperty(String name, String value)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+}
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/ActivityBuilderImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/EndStateWrapper.java
===================================================================
--- jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/EndStateWrapper.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/EndStateWrapper.java 2008-08-26 15:23:39 UTC (rev 2018)
@@ -0,0 +1,75 @@
+/*
+ * 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.model;
+
+//$Id$
+
+import org.jboss.bpm.client.SignalManager;
+import org.jboss.bpm.model.FlowObject;
+import org.jboss.bpm.model.Signal;
+import org.jboss.bpm.model.Signal.SignalType;
+import org.jbpm.graph.exe.ExecutionContext;
+import org.jbpm.graph.node.EndState;
+
+/**
+ * Override Node methods for signal processing
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 26-Aug-2008
+ */
+ at SuppressWarnings("serial")
+public class EndStateWrapper extends EndState implements NodeWrapper
+{
+ private FlowObject flowObject;
+
+ public EndStateWrapper(String name)
+ {
+ super(name);
+ }
+
+ @Override
+ public FlowObject getFlowObject()
+ {
+ return flowObject;
+ }
+
+ @Override
+ public void setFlowObject(FlowObject flowObject)
+ {
+ this.flowObject = flowObject;
+ }
+
+ @Override
+ public void execute(ExecutionContext executionContext)
+ {
+ SignalManager sigManager = SignalManager.locateSignalManager();
+ sigManager.throwSignal(new Signal(flowObject.getID(), SignalType.SYSTEM_END_EVENT_ENTER));
+ try
+ {
+ super.execute(executionContext);
+ }
+ finally
+ {
+ sigManager.throwSignal(new Signal(flowObject.getID(), SignalType.SYSTEM_END_EVENT_EXIT));
+ }
+ }
+}
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/EndStateWrapper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/EventBuilderImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/EventBuilderImpl.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/EventBuilderImpl.java 2008-08-26 15:23:39 UTC (rev 2018)
@@ -0,0 +1,58 @@
+/*
+ * 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.model;
+
+//$Id$
+
+import org.jboss.bpm.NotImplementedException;
+import org.jboss.bpm.model.EventBuilder;
+import org.jboss.bpm.model.EventDetail.EventDetailType;
+import org.jboss.bpm.model.Signal.SignalType;
+
+/**
+ * The EventBuilder can be used to build an Event dynamically.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 26-Aug-2008
+ */
+public class EventBuilderImpl extends ProcessBuilderImpl implements EventBuilder
+{
+ public EventBuilderImpl(ProcessImpl proc, FlowObjectImpl flowObject)
+ {
+ super(proc, flowObject);
+ }
+
+ public EventBuilder addEventDetail(EventDetailType detailType)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public EventBuilder addMessageRef(String msgName)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public EventBuilder addSignalRef(SignalType signalType, String signalMessage)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+}
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/EventBuilderImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/FlowObjectImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/FlowObjectImpl.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/FlowObjectImpl.java 2008-08-26 15:23:39 UTC (rev 2018)
@@ -0,0 +1,101 @@
+/*
+ * 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.model;
+
+//$Id$
+
+import java.util.List;
+
+import javax.management.ObjectName;
+
+import org.jboss.bpm.NotImplementedException;
+import org.jboss.bpm.model.Assignment;
+import org.jboss.bpm.model.FlowObject;
+import org.jboss.bpm.model.ObjectNameFactory;
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.SequenceFlow;
+import org.jboss.util.id.UID;
+import org.jbpm.graph.def.Node;
+
+/**
+ * A Flow Object is one of the set of following graphical objects: Event, Activity, and Gateway.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 26-Aug-2008
+ */
+ at SuppressWarnings("serial")
+public class FlowObjectImpl extends AbstractElementImpl implements FlowObject
+{
+ private Process proc;
+ private Node jbpmNode;
+ private SequenceFlow outFlow;
+
+ public FlowObjectImpl(Process proc, Node jbpmNode)
+ {
+ this.proc = proc;
+ this.jbpmNode = jbpmNode;
+
+ NodeWrapper nodeWrapper = (NodeWrapper)jbpmNode;
+ nodeWrapper.setFlowObject(this);
+ }
+
+ public Node getNode()
+ {
+ return jbpmNode;
+ }
+
+ public Process getProcess()
+ {
+ return proc;
+ }
+
+ public ObjectName getID()
+ {
+ if (id == null)
+ {
+ StringBuilder str = new StringBuilder("org.jbpm:");
+ str.append("type=Other,name=" + getName() + ",id=" + new UID());
+ id = ObjectNameFactory.create(str.toString());
+ }
+ return id;
+ }
+
+ public String getName()
+ {
+ return jbpmNode.getName();
+ }
+
+ public SequenceFlow getOutFlow()
+ {
+ return outFlow;
+ }
+
+ public void setOutFlow(SequenceFlow outFlow)
+ {
+ this.outFlow = outFlow;
+ }
+
+ public List<Assignment> getAssignments()
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+}
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/FlowObjectImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/NodeWrapper.java
===================================================================
--- jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/NodeWrapper.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/NodeWrapper.java 2008-08-26 15:23:39 UTC (rev 2018)
@@ -0,0 +1,39 @@
+/*
+ * 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.model;
+
+//$Id$
+
+import org.jboss.bpm.model.FlowObject;
+
+/**
+ * Override Node methods for signal processing
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 26-Aug-2008
+ */
+public interface NodeWrapper
+{
+ FlowObject getFlowObject();
+
+ void setFlowObject(FlowObject flowObject);
+}
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/NodeWrapper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/ProcessBuilderFactoryImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/ProcessBuilderFactoryImpl.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/ProcessBuilderFactoryImpl.java 2008-08-26 15:23:39 UTC (rev 2018)
@@ -0,0 +1,43 @@
+/*
+ * 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.model;
+
+//$Id$
+
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.ProcessBuilder;
+import org.jboss.bpm.model.ProcessBuilderFactory;
+
+/**
+ * The ProcessBuilder can be used to dynamically build {@link Process}es.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public class ProcessBuilderFactoryImpl extends ProcessBuilderFactory
+{
+ @Override
+ public ProcessBuilder newProcessBuilder()
+ {
+ return new ProcessBuilderImpl();
+ }
+}
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/ProcessBuilderFactoryImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/ProcessBuilderImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/ProcessBuilderImpl.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/ProcessBuilderImpl.java 2008-08-26 15:23:39 UTC (rev 2018)
@@ -0,0 +1,170 @@
+/*
+ * 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.model;
+
+//$Id$
+
+import org.jboss.bpm.NotImplementedException;
+import org.jboss.bpm.model.EventBuilder;
+import org.jboss.bpm.model.GatewayBuilder;
+import org.jboss.bpm.model.MessageBuilder;
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.ProcessBuilder;
+import org.jboss.bpm.model.TaskBuilder;
+import org.jboss.bpm.model.Assignment.AssignTime;
+import org.jboss.bpm.model.Expression.ExpressionLanguage;
+import org.jboss.bpm.model.Gateway.GatewayType;
+import org.jboss.bpm.model.Task.TaskType;
+import org.jbpm.graph.def.Node;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.def.Transition;
+
+/**
+ * The ProcessBuilder can be used to dynamically build a {@link Process}.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 26-Aug-2008
+ */
+public class ProcessBuilderImpl implements ProcessBuilder
+{
+ protected ProcessImpl proc;
+ protected FlowObjectImpl flowObject;
+
+ public ProcessBuilderImpl()
+ {
+ }
+
+ public ProcessBuilderImpl(ProcessImpl proc, FlowObjectImpl flowObject)
+ {
+ this.proc = proc;
+ this.flowObject = flowObject;
+ }
+
+ public ProcessBuilder addProcess(String name)
+ {
+ ProcessDefinition jbpmProc = new ProcessDefinition(name);
+ proc = new ProcessImpl(jbpmProc);
+ return this;
+ }
+
+ public EventBuilder addStartEvent(String name)
+ {
+ Node jbpmNode = new StartStateWrapper(name);
+ flowObject = new FlowObjectImpl(proc, jbpmNode);
+ proc.addFlowObject(flowObject);
+ ProcessDefinition jbpmProc = proc.getProcessDefinition();
+ jbpmProc.setStartState(jbpmNode);
+ return new EventBuilderImpl(proc, flowObject);
+ }
+
+ public EventBuilder addEndEvent(String name)
+ {
+ Node jbpmNode = new EndStateWrapper(name);
+ flowObject = new FlowObjectImpl(proc, jbpmNode);
+ proc.addFlowObject(flowObject);
+ return new EventBuilderImpl(proc, flowObject);
+ }
+
+ public TaskBuilder addTask(String name)
+ {
+ Node jbpmNode = new StateWrapper(name);
+ flowObject = new FlowObjectImpl(proc, jbpmNode);
+ proc.addFlowObject(flowObject);
+ return new TaskBuilderImpl(proc, flowObject);
+ }
+
+ public ProcessBuilder addSequenceFlow(String targetName)
+ {
+ Node jbpmNode = flowObject.getNode();
+ Transition jbpmTransition = new Transition(targetName);
+ jbpmTransition.setFrom(jbpmNode);
+ jbpmNode.addLeavingTransition(jbpmTransition);
+ flowObject.setOutFlow(new SequenceFlowImpl(jbpmTransition));
+ return this;
+ }
+
+ public Process getProcess()
+ {
+ proc.initialize();
+ return proc;
+ }
+
+ public ProcessBuilder addAssignment(AssignTime time, ExpressionLanguage lang, String fromExpr, String toProp)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public EventBuilder addEvent(String name)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public ProcessBuilder addExecutionHandler(Class<?> clazz)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public ProcessBuilder addFlowHandler(Class<?> clazz)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public GatewayBuilder addGateway(String name, GatewayType type)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public MessageBuilder addMessage(String name)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public ProcessBuilder addMessageFlow(String targetName)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public ProcessBuilder addProcess(Process proc)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public ProcessBuilder addProperty(String name, String value)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public ProcessBuilder addSignalHandler(Class<?> clazz)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public TaskBuilder addTask(String name, TaskType type)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public Process getProcessForInclude()
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+}
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/ProcessBuilderImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/ProcessImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/ProcessImpl.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/ProcessImpl.java 2008-08-26 15:23:39 UTC (rev 2018)
@@ -0,0 +1,226 @@
+/*
+ * 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.model;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.management.ObjectName;
+
+import org.jboss.bpm.NotImplementedException;
+import org.jboss.bpm.client.ExecutionManager;
+import org.jboss.bpm.model.Assignment;
+import org.jboss.bpm.model.FlowObject;
+import org.jboss.bpm.model.InputSet;
+import org.jboss.bpm.model.Message;
+import org.jboss.bpm.model.ObjectNameFactory;
+import org.jboss.bpm.model.OutputSet;
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.Property;
+import org.jboss.bpm.model.SequenceFlow;
+import org.jboss.bpm.runtime.Attachments;
+import org.jboss.util.id.UID;
+import org.jbpm.graph.def.Node;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.def.Transition;
+
+/**
+ * A Process is any Activity performed within a company or organization.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 26-Aug-2008
+ */
+ at SuppressWarnings("serial")
+public class ProcessImpl extends AbstractElementImpl implements Process
+{
+ private ProcessDefinition jbpmProc;
+ private List<FlowObject> flowObjects = new ArrayList<FlowObject>();
+ private ProcessStatus status = ProcessStatus.None;
+
+ public ProcessImpl(ProcessDefinition jbpmProc)
+ {
+ this.jbpmProc = jbpmProc;
+ }
+
+ public ProcessDefinition getProcessDefinition()
+ {
+ return jbpmProc;
+ }
+
+ public ObjectName getID()
+ {
+ if (id == null)
+ {
+ StringBuilder str = new StringBuilder("org.jbpm:");
+ str.append("type=Process,name=" + getName() + ",id=" + new UID());
+ id = ObjectNameFactory.create(str.toString());
+ }
+ return id;
+ }
+
+ public String getName()
+ {
+ return jbpmProc.getName();
+ }
+
+ public ProcessStatus getProcessStatus()
+ {
+ return status;
+ }
+
+ public void setProcessStatus(ProcessStatus status)
+ {
+ this.status = status;
+ }
+
+ public void addFlowObject(FlowObject flowObject)
+ {
+ flowObjects.add(flowObject);
+ }
+
+ public ObjectName startProcess()
+ {
+ ExecutionManager exManager = ExecutionManager.locateExecutionManager();
+ exManager.startProcess(this, null);
+ return getID();
+ }
+
+ public ProcessStatus waitForEnd()
+ {
+ ExecutionManager exManager = ExecutionManager.locateExecutionManager();
+ return exManager.waitForEnd(this);
+ }
+
+ public ProcessStatus waitForEnd(long timeout)
+ {
+ ExecutionManager exManager = ExecutionManager.locateExecutionManager();
+ return exManager.waitForEnd(this, timeout);
+ }
+
+ public List<FlowObject> getFlowObjects()
+ {
+ return Collections.unmodifiableList(flowObjects);
+ }
+
+ public FlowObject getFlowObject(String name)
+ {
+ for (FlowObject fo : getFlowObjects())
+ {
+ if (name.equals(fo.getName()))
+ return fo;
+ }
+ return null;
+ }
+
+ public void initialize()
+ {
+ for (FlowObject fo : getFlowObjects())
+ {
+ FlowObjectImpl foImpl = (FlowObjectImpl)fo;
+ SequenceFlowImpl flowImpl = (SequenceFlowImpl)foImpl.getOutFlow();
+ if (flowImpl != null)
+ {
+ String targetName = flowImpl.getTargetName();
+ FlowObjectImpl targetFO = (FlowObjectImpl)getFlowObject(targetName);
+ Node jbpmTarget = targetFO.getNode();
+ Transition jbpmTransition = flowImpl.getTransition();
+ jbpmTransition.setTo(jbpmTarget);
+ }
+ }
+ }
+
+ // not implemented *******************************************************************
+
+ public List<Assignment> getAssignments()
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public <T extends FlowObject> List<T> getFlowObjects(Class<T> clazz)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public List<InputSet> getInputSets()
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public Message getMessage(String msgName)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public List<Message> getMessages()
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public List<OutputSet> getOutputSets()
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public List<String> getPerformers()
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public ProcessType getProcessType()
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public ObjectName startProcess(Attachments att)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public List<Property> getProperties()
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public Property getProperty(String name)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public List<String> getPropertyNames()
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public Object getPropertyValue(String name)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public <T> T getPropertyValue(Class<T> clazz, String name)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+}
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/ProcessImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/SequenceFlowImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/SequenceFlowImpl.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/SequenceFlowImpl.java 2008-08-26 15:23:39 UTC (rev 2018)
@@ -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.integration.model;
+
+//$Id$
+
+import org.jboss.bpm.NotImplementedException;
+import org.jboss.bpm.model.Expression;
+import org.jboss.bpm.model.FlowObject;
+import org.jboss.bpm.model.SequenceFlow;
+import org.jbpm.graph.def.Transition;
+
+/**
+ * A Sequence Flow is used to show the order that activities will be performed in a Process.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 26-Aug-2008
+ */
+public class SequenceFlowImpl implements SequenceFlow
+{
+ private Transition jbpmTransition;
+
+ public SequenceFlowImpl(Transition jbpmTransition)
+ {
+ this.jbpmTransition = jbpmTransition;
+ }
+
+ public Transition getTransition()
+ {
+ return jbpmTransition;
+ }
+
+ public String getName()
+ {
+ return jbpmTransition.getName();
+ }
+
+ public String getTargetName()
+ {
+ return jbpmTransition.getName();
+ }
+
+ public Expression getConditionExpression()
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public ConditionType getConditionType()
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public FlowObject getSourceRef()
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public FlowObject getTargetRef()
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+}
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/SequenceFlowImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/StartStateWrapper.java
===================================================================
--- jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/StartStateWrapper.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/StartStateWrapper.java 2008-08-26 15:23:39 UTC (rev 2018)
@@ -0,0 +1,75 @@
+/*
+ * 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.model;
+
+//$Id$
+
+import org.jboss.bpm.client.SignalManager;
+import org.jboss.bpm.model.FlowObject;
+import org.jboss.bpm.model.Signal;
+import org.jboss.bpm.model.Signal.SignalType;
+import org.jbpm.graph.exe.ExecutionContext;
+import org.jbpm.graph.node.StartState;
+
+/**
+ * Override Node methods for signal processing
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 26-Aug-2008
+ */
+ at SuppressWarnings("serial")
+public class StartStateWrapper extends StartState implements NodeWrapper
+{
+ private FlowObject flowObject;
+
+ public StartStateWrapper(String name)
+ {
+ super(name);
+ }
+
+ @Override
+ public FlowObject getFlowObject()
+ {
+ return flowObject;
+ }
+
+ @Override
+ public void setFlowObject(FlowObject flowObject)
+ {
+ this.flowObject = flowObject;
+ }
+
+ @Override
+ public void execute(ExecutionContext executionContext)
+ {
+ SignalManager sigManager = SignalManager.locateSignalManager();
+ sigManager.throwSignal(new Signal(flowObject.getID(), SignalType.SYSTEM_START_EVENT_ENTER));
+ try
+ {
+ super.execute(executionContext);
+ }
+ finally
+ {
+ sigManager.throwSignal(new Signal(flowObject.getID(), SignalType.SYSTEM_START_EVENT_EXIT));
+ }
+ }
+}
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/StartStateWrapper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/StateWrapper.java
===================================================================
--- jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/StateWrapper.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/StateWrapper.java 2008-08-26 15:23:39 UTC (rev 2018)
@@ -0,0 +1,75 @@
+/*
+ * 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.model;
+
+//$Id$
+
+import org.jboss.bpm.client.SignalManager;
+import org.jboss.bpm.model.FlowObject;
+import org.jboss.bpm.model.Signal;
+import org.jboss.bpm.model.Signal.SignalType;
+import org.jbpm.graph.exe.ExecutionContext;
+import org.jbpm.graph.node.State;
+
+/**
+ * Override Node methods for signal processing
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 26-Aug-2008
+ */
+ at SuppressWarnings("serial")
+public class StateWrapper extends State implements NodeWrapper
+{
+ private FlowObject flowObject;
+
+ public StateWrapper(String name)
+ {
+ super(name);
+ }
+
+ @Override
+ public FlowObject getFlowObject()
+ {
+ return flowObject;
+ }
+
+ @Override
+ public void setFlowObject(FlowObject flowObject)
+ {
+ this.flowObject = flowObject;
+ }
+
+ @Override
+ public void execute(ExecutionContext executionContext)
+ {
+ SignalManager sigManager = SignalManager.locateSignalManager();
+ sigManager.throwSignal(new Signal(flowObject.getID(), SignalType.SYSTEM_TASK_ENTER));
+ try
+ {
+ super.execute(executionContext);
+ }
+ finally
+ {
+ sigManager.throwSignal(new Signal(flowObject.getID(), SignalType.SYSTEM_TASK_EXIT));
+ }
+ }
+}
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/StateWrapper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/TaskBuilderImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/TaskBuilderImpl.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/TaskBuilderImpl.java 2008-08-26 15:23:39 UTC (rev 2018)
@@ -0,0 +1,74 @@
+/*
+ * 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.model;
+
+//$Id$
+
+import org.jboss.bpm.NotImplementedException;
+import org.jboss.bpm.model.ActivityBuilder;
+import org.jboss.bpm.model.TaskBuilder;
+import org.jboss.bpm.model.Expression.ExpressionLanguage;
+
+/**
+ * The EventBuilder can be used to build an Event dynamically.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 26-Aug-2008
+ */
+public class TaskBuilderImpl extends ActivityBuilderImpl implements TaskBuilder
+{
+ public TaskBuilderImpl(ProcessImpl proc, FlowObjectImpl flowObject)
+ {
+ super(proc, flowObject);
+ }
+
+ public TaskBuilder addMessageRef(String msgName)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public ActivityBuilder addIORule(String body, ExpressionLanguage lang)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public ActivityBuilder addInputSet()
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public ActivityBuilder addOutputSet()
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public ActivityBuilder addPropertyInput(String name)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+ public ActivityBuilder addPropertyOutput(String name, String value)
+ {
+ throw new NotImplementedException("JBPM-1705", "jBPM3 implementation of the API");
+ }
+
+}
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/jpdl/integration/src/main/java/org/jbpm/integration/model/TaskBuilderImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm3/trunk/modules/jpdl/integration/src/main/resources/jbpm-beans.xml
===================================================================
--- jbpm3/trunk/modules/jpdl/integration/src/main/resources/jbpm-beans.xml 2008-08-26 12:12:59 UTC (rev 2017)
+++ jbpm3/trunk/modules/jpdl/integration/src/main/resources/jbpm-beans.xml 2008-08-26 15:23:39 UTC (rev 2018)
@@ -4,11 +4,10 @@
<bean name="KernelLocator" class="org.jboss.kernel.plugins.util.KernelLocator"/>
<!-- The Builder Factories -->
- <bean name="jBPMProcessBuilderFactory" class="org.jboss.bpm.ri.model.impl.ProcessBuilderFactoryImpl"/>
- <bean name="jBPMMessageBuilderFactory" class="org.jboss.bpm.ri.model.impl.MessageBuilderFactoryImpl"/>
+ <bean name="jBPMProcessBuilderFactory" class="org.jbpm.integration.model.ProcessBuilderFactoryImpl"/>
<!-- The ProcessEngine -->
- <bean name="jBPMProcessEngine" class="org.jboss.bpm.ri.client.ProcessEngineImpl">
+ <bean name="jBPMProcessEngine" class="org.jbpm.integration.client.ProcessEngineImpl">
<property name="processManager"><inject bean="jBPMProcessManager"/></property>
<property name="executionManager"><inject bean="jBPMExecutionManager"/></property>
<property name="signalManager"><inject bean="jBPMSignalManager"/></property>
@@ -16,12 +15,12 @@
</bean>
<!-- The Managers -->
- <bean name="jBPMExecutionManager" class="org.jboss.bpm.ri.client.ExecutionManagerImpl"/>
- <bean name="jBPMSignalManager" class="org.jboss.bpm.ri.client.SignalManagerImpl"/>
- <bean name="jBPMMessageManager" class="org.jboss.bpm.ri.client.MessageManagerImpl"/>
+ <bean name="jBPMExecutionManager" class="org.jbpm.integration.client.ExecutionManagerImpl"/>
+ <bean name="jBPMSignalManager" class="org.jbpm.integration.client.SignalManagerImpl"/>
+ <bean name="jBPMMessageManager" class="org.jbpm.integration.client.MessageManagerImpl"/>
<!-- The ProcessManager -->
- <bean name="jBPMProcessManager" class="org.jboss.bpm.ri.client.ProcessManagerImpl">
+ <bean name="jBPMProcessManager" class="org.jbpm.integration.client.ProcessManagerImpl">
<property name="dialectRegistry"><inject bean="jBPMDialectRegistry"/></property>
<property name="dialectHandlers">
<map keyClass="java.lang.String" valueClass="org.jboss.bpm.client.DialectHandler"/>
More information about the jbpm-commits
mailing list