[jboss-svn-commits] JBL Code SVN: r9762 - in labs/jbossesb/trunk/product: core/listeners/src/org/jboss/soa/esb/listeners/message and 7 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Feb 26 08:40:15 EST 2007
Author: estebanschifman
Date: 2007-02-26 08:40:14 -0500 (Mon, 26 Feb 2007)
New Revision: 9762
Added:
labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/Invoker.java
labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/
labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/jbossesb-properties.xml
labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/jbossesb.xml
labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/jndi.properties
labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/juddi.properties
labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/lib/
labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/log4j.xml
labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/
labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/gpd.xml
labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/hibernate.cfg.xml
labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/jbpm.cfg.xml
labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/processdefinition.xml
labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/processimage.jpg
labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/quickstart/
labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/quickstart/jbpm_simple1/
labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/quickstart/jbpm_simple1/JbpmActionHandler.java
labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/quickstart/jbpm_simple1/test/
labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/quickstart/jbpm_simple1/test/JunitTest.java
labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/quickstart/jbpm_simple1/test/TestCommandMessages.java
Removed:
labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/util/Invoker.java
Modified:
labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/jbpm/CommandInterpreter.java
Log:
Jbpm simple quickstart
Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/jbpm/CommandInterpreter.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/jbpm/CommandInterpreter.java 2007-02-26 13:38:19 UTC (rev 9761)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/jbpm/CommandInterpreter.java 2007-02-26 13:40:14 UTC (rev 9762)
@@ -28,7 +28,9 @@
import org.apache.log4j.Logger;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
import org.jboss.soa.esb.couriers.Courier;
+import org.jboss.soa.esb.couriers.CourierException;
import org.jboss.soa.esb.couriers.CourierFactory;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
@@ -69,19 +71,22 @@
* @param message - Containing payload and replyToEpr where to send the reply.
* @throws Exception
*/
- public void defaultReply(Message message) throws Exception
+ protected Message defaultReply(Message message)
+ throws MalformedEPRException,CourierException
{
EPR reply = message.getHeader().getCall().getReplyTo();
if (null==reply)
+ _logger.error("Null replyToEPR in message - response will not be sent to invoker");
+ else
{
- _logger.error("Null replyToEPR in message");
- return;
+ Courier courier = CourierFactory.getCourier(reply);
+ courier.deliver(message);
}
- Courier courier = CourierFactory.getCourier(reply);
- courier.deliver(message);
+ return message;
} // ________________________________
public Message process(Message message)
+ throws MalformedEPRException, CourierException
{
_command = new CommandVehicle(message);
Enum operator = _command.getOperator();
@@ -91,6 +96,8 @@
signalToken();
else if (operator.equals(CommandVehicle.Operation.signalProcess))
signalProcess();
+ else if (operator.equals(CommandVehicle.Operation.hasInstanceEnded))
+ checkInstanceEnded();
else if (operator.equals(CommandVehicle.Operation.getProcessInstanceVariables))
getProcessInstanceVariabes();
else if (operator.equals(CommandVehicle.Operation.setProcessInstanceVariables))
@@ -110,8 +117,11 @@
}
Message retMsg = _command.toCommandMessage();
-
- return retMsg;
+ retMsg.getHeader().getCall().setTo (message.getHeader().getCall().getTo());
+ EPR replyTo = message.getHeader().getCall().getReplyTo();
+ retMsg.getHeader().getCall().setReplyTo (replyTo);
+ retMsg.getHeader().getCall().setFaultTo (message.getHeader().getCall().getFaultTo());
+ return (null==replyTo)? retMsg : defaultReply(retMsg);
} // ________________________________
public void deployProcessDefinition()
@@ -119,7 +129,7 @@
try
{
prepareJbpm();
- _jbpmCtx.getSession().beginTransaction();
+// _jbpmCtx.getSession().beginTransaction();
ProcessDefinition def = _command.getProcessDefinition();
_jbpmCtx.deployProcessDefinition(def);
_command.setProcessDefinitionName (def.getName());
@@ -139,12 +149,13 @@
{
prepareJbpm();
_processInstance = _jbpmCtx.newProcessInstance(_command.getProcessDefinitionName());
- _jbpmCtx.getSession().beginTransaction();
+// _jbpmCtx.getSession().beginTransaction();
_jbpmCtx.save(_processInstance);
_command.setProcessVersion(_processInstance.getProcessDefinition().getVersion());
_command.setInstanceId (_processInstance.getId());
_command.setTokenId (_processInstance.getRootToken().getId());
+ _command.setCurrentNodeName(_processInstance.getRootToken().getNode().getName());
_command.setReturnCode(CommandVehicle.RETCODE_OK);
}
catch (Exception e)
@@ -161,12 +172,17 @@
{
long id = _command.getInstanceId();
prepareJbpm();
- _jbpmCtx.getSession().beginTransaction();
+// _jbpmCtx.getSession().beginTransaction();
_processInstance = _jbpmCtx.loadProcessInstanceForUpdate(id);
_processInstance.signal();
_jbpmCtx.save(_processInstance);
- _command.setReturnCode(CommandVehicle.RETCODE_OK);
+ _command.setProcessDefinitionName (_processInstance.getProcessDefinition().getName());
+ _command.setProcessVersion (_processInstance.getProcessDefinition().getVersion());
+ _command.setTokenId (_processInstance.getRootToken().getId());
+ _command.setCurrentNodeName (_processInstance.getRootToken().getNode().getName());
+ _command.setUserObject (_processInstance.hasEnded());
+ _command.setReturnCode (CommandVehicle.RETCODE_OK);
}
catch (Exception e)
{
@@ -182,12 +198,18 @@
{
long id = _command.getTokenId();
prepareJbpm();
- _jbpmCtx.getSession().beginTransaction();
- Token token = _jbpmCtx.loadTokenForUpdate(id);
- token.signal();
- _jbpmCtx.save(token);
+// _jbpmCtx.getSession().beginTransaction();
+ _token = _jbpmCtx.loadTokenForUpdate(id);
+ _token.signal();
+ _jbpmCtx.save(_token);
- _command.setReturnCode(CommandVehicle.RETCODE_OK);
+ _processInstance = _token.getProcessInstance();
+ _command.setProcessDefinitionName (_processInstance.getProcessDefinition().getName());
+ _command.setProcessVersion (_processInstance.getProcessDefinition().getVersion());
+ _command.setInstanceId (_processInstance.getId());
+ _command.setCurrentNodeName (_token.getNode().getName());
+ _command.setUserObject (_processInstance.hasEnded());
+ _command.setReturnCode (CommandVehicle.RETCODE_OK);
}
catch (Exception e)
{
@@ -205,9 +227,13 @@
prepareJbpm();
_processInstance = _jbpmCtx.loadProcessInstance(id);
Map allVars = _processInstance.getContextInstance().getVariables();
- _command.setVariableValues(pickVarsFromMap(allVars));
+ _command.setVariableValues (pickVarsFromMap(allVars));
- _command.setReturnCode(CommandVehicle.RETCODE_OK);
+ _command.setProcessDefinitionName (_processInstance.getProcessDefinition().getName());
+ _command.setProcessVersion (_processInstance.getProcessDefinition().getVersion());
+ _command.setTokenId (_processInstance.getRootToken().getId());
+ _command.setCurrentNodeName (_processInstance.getRootToken().getNode().getName());
+ _command.setReturnCode (CommandVehicle.RETCODE_OK);
}
catch (Exception e)
{
@@ -217,6 +243,29 @@
finally { cleanupJbpm(); }
} //________________________________
+ public void checkInstanceEnded()
+ {
+ try
+ {
+ long id = _command.getInstanceId();
+ prepareJbpm();
+ _processInstance = _jbpmCtx.loadProcessInstance(id);
+ _command.setUserObject(_processInstance.hasEnded());
+
+ _command.setProcessDefinitionName (_processInstance.getProcessDefinition().getName());
+ _command.setProcessVersion (_processInstance.getProcessDefinition().getVersion());
+ _command.setTokenId (_processInstance.getRootToken().getId());
+ _command.setCurrentNodeName (_processInstance.getRootToken().getNode().getName());
+ _command.setReturnCode (CommandVehicle.RETCODE_OK);
+ }
+ catch (Exception e)
+ {
+ _command.setReturnCode(CommandVehicle.RETCODE_EXCEPTION);
+ _command.setException(e);
+ }
+ finally { cleanupJbpm(); }
+ } //________________________________
+
public void setProcessInstanceVariables()
{
try
@@ -230,12 +279,17 @@
}
long id = _command.getInstanceId();
prepareJbpm();
- _jbpmCtx.getSession().beginTransaction();
+// _jbpmCtx.getSession().beginTransaction();
_processInstance = _jbpmCtx.loadProcessInstanceForUpdate(id);
_processInstance.getContextInstance().addVariables(newVals);
_jbpmCtx.save(_processInstance);
- _command.setReturnCode(CommandVehicle.RETCODE_OK);
+ _command.setProcessDefinitionName (_processInstance.getProcessDefinition().getName());
+ _command.setProcessVersion (_processInstance.getProcessDefinition().getVersion());
+ _command.setInstanceId (_processInstance.getId());
+ _command.setTokenId (_processInstance.getRootToken().getId());
+ _command.setCurrentNodeName (_processInstance.getRootToken().getNode().getName());
+ _command.setReturnCode (CommandVehicle.RETCODE_OK);
}
catch (Exception e)
{
@@ -255,7 +309,12 @@
Map allVars = _token.getProcessInstance().getContextInstance().getVariables(_token);
_command.setVariableValues(pickVarsFromMap(allVars));
- _command.setReturnCode(CommandVehicle.RETCODE_OK);
+ _processInstance = _token.getProcessInstance();
+ _command.setProcessDefinitionName (_processInstance.getProcessDefinition().getName());
+ _command.setProcessVersion (_processInstance.getProcessDefinition().getVersion());
+ _command.setInstanceId (_processInstance.getId());
+ _command.setCurrentNodeName (_token.getNode().getName());
+ _command.setReturnCode (CommandVehicle.RETCODE_OK);
}
catch (Exception e)
{
@@ -278,12 +337,17 @@
}
long id = _command.getTokenId();
prepareJbpm();
- _jbpmCtx.getSession().beginTransaction();
+// _jbpmCtx.getSession().beginTransaction();
_token = _jbpmCtx.loadToken(id);
_token.getProcessInstance().getContextInstance().addVariables(newVals,_token);
_jbpmCtx.save(_token);
- _command.setReturnCode(CommandVehicle.RETCODE_OK);
+ _command.setProcessDefinitionName (_processInstance.getProcessDefinition().getName());
+ _command.setProcessVersion (_processInstance.getProcessDefinition().getVersion());
+ _command.setInstanceId (_processInstance.getId());
+ _command.setTokenId (_processInstance.getRootToken().getId());
+ _command.setCurrentNodeName (_processInstance.getRootToken().getNode().getName());
+ _command.setReturnCode (CommandVehicle.RETCODE_OK);
}
catch (Exception e)
{
@@ -342,7 +406,7 @@
} //________________________________
protected ConfigTree _config;
- protected CommandVehicle _command;
+ protected CommandVehicle _command;
protected JbpmConfiguration _jbpmConfig;
protected JbpmContext _jbpmCtx;
protected ProcessInstance _processInstance;
Copied: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/Invoker.java (from rev 9760, labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/util/Invoker.java)
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/Invoker.java (rev 0)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/Invoker.java 2007-02-26 13:40:14 UTC (rev 9762)
@@ -0,0 +1,128 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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.soa.esb.listeners.message;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Collection;
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.couriers.PickUpOnlyCourier;
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.couriers.Courier;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.couriers.CourierTimeoutException;
+import org.jboss.soa.esb.couriers.CourierUtil;
+import org.jboss.soa.esb.listeners.RegistryUtil;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.util.AbstractCommandVehicle;
+
+
+/**
+ *
+ * Utility class to hide implementation details for sending Command messages and optionally awaiting for a response.
+ *
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ *
+ */
+
+public class Invoker {
+
+ /**
+ * Encapsulate command in an ESB Message, and deliver.
+ *
+ * @param command AbstractCommandMessage - Transform into an ESB Message, and send
+ * @param category String - Service category name for Registry inquiry
+ * @param name String - Service name for Registry inquiry
+ * @throws RegistryException
+ * @throws MalformedEPRException
+ * @throws CourierException
+ */
+ public static void invoke(AbstractCommandVehicle command, String category, String name)
+ throws RegistryException, MalformedEPRException, CourierException
+ {
+ try { invokeAndAwaitResponse(command,category,name,-1); }
+ catch (CourierTimeoutException e)
+ {
+ _logger.fatal("This should NEVER happen");
+ }
+ } //________________________________
+
+ /**
+ * Encapsulate command in an ESB Message, deliver it, and wait for a response Message.
+ *
+ * @param command AbstractCommandMessage - Transform into an ESB Message, and send
+ * @param category String - Service category name for Registry inquiry
+ * @param name String - Service name for Registry inquiry
+ * @param maxWaitMillis int - Maximum time to wait for a response
+ * @return
+ * @throws RegistryException
+ * @throws MalformedEPRException
+ * @throws CourierException
+ * @throws CourierTimeoutException - If response was not received in specified time
+ */
+
+ public static Message invokeAndAwaitResponse(AbstractCommandVehicle command, String category, String name
+ ,int maxWaitMillis)
+ throws RegistryException, MalformedEPRException, CourierException, CourierTimeoutException
+ {
+ Message outgoing = command.toCommandMessage();
+ Call call = outgoing.getHeader().getCall();
+ URI uri = null;
+ try { uri = new URI(UUID.randomUUID().toString()); }
+ catch (URISyntaxException e)
+ {
+ _logger.fatal("This should NOT happen");
+ return null;
+ }
+
+ call.setMessageID(uri);
+ Collection<EPR> eprs = RegistryUtil.getEprs(category, name);
+ EPR toEpr = (eprs.size()<1) ? null : eprs.iterator().next();
+ call.setTo(toEpr);
+
+ Courier sender = CourierFactory.getCourier(toEpr);
+ PickUpOnlyCourier receiver = null;
+ EPR replyToEpr = null;
+ boolean waitForResponse = (maxWaitMillis > 0);
+ if (waitForResponse)
+ {
+ replyToEpr = CourierUtil.getTemporaryReplyToEpr(toEpr);
+ call.setReplyTo(replyToEpr);
+ call.setFaultTo(replyToEpr);
+ receiver = CourierFactory.getPickupCourier(replyToEpr);
+ }
+
+ sender.deliver(outgoing);
+ return (waitForResponse)
+ ? receiver.pickup(maxWaitMillis)
+ : null
+ ;
+ }
+
+ private static Logger _logger = Logger.getLogger(Invoker.class);
+}
Property changes on: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/Invoker.java
___________________________________________________________________
Name: svn:eol-style
+ native
Deleted: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/util/Invoker.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/util/Invoker.java 2007-02-26 13:38:19 UTC (rev 9761)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/util/Invoker.java 2007-02-26 13:40:14 UTC (rev 9762)
@@ -1,127 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, 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.soa.esb.util;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Collection;
-import java.util.UUID;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.couriers.PickUpOnlyCourier;
-import org.jboss.soa.esb.addressing.Call;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.couriers.Courier;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierTimeoutException;
-import org.jboss.soa.esb.couriers.CourierUtil;
-import org.jboss.soa.esb.listeners.RegistryUtil;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.registry.RegistryException;
-
-
-/**
- *
- * Utility class to hide implementation details for sending Command messages and optionally awaiting for a response.
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- *
- */
-
-public class Invoker {
-
- /**
- * Encapsulate command in an ESB Message, and deliver.
- *
- * @param command AbstractCommandMessage - Transform into an ESB Message, and send
- * @param category String - Service category name for Registry inquiry
- * @param name String - Service name for Registry inquiry
- * @throws RegistryException
- * @throws MalformedEPRException
- * @throws CourierException
- */
- public static void invoke(AbstractCommandVehicle command, String category, String name)
- throws RegistryException, MalformedEPRException, CourierException
- {
- try { invokeAndAwaitResponse(command,category,name,-1); }
- catch (CourierTimeoutException e)
- {
- _logger.fatal("This should NEVER happen");
- }
- } //________________________________
-
- /**
- * Encapsulate command in an ESB Message, deliver it, and wait for a response Message.
- *
- * @param command AbstractCommandMessage - Transform into an ESB Message, and send
- * @param category String - Service category name for Registry inquiry
- * @param name String - Service name for Registry inquiry
- * @param maxWaitMillis int - Maximum time to wait for a response
- * @return
- * @throws RegistryException
- * @throws MalformedEPRException
- * @throws CourierException
- * @throws CourierTimeoutException - If response was not received in specified time
- */
-
- public static Message invokeAndAwaitResponse(AbstractCommandVehicle command, String category, String name
- ,int maxWaitMillis)
- throws RegistryException, MalformedEPRException, CourierException, CourierTimeoutException
- {
- Message outgoing = command.toCommandMessage();
- Call call = outgoing.getHeader().getCall();
- URI uri = null;
- try { uri = new URI(UUID.randomUUID().toString()); }
- catch (URISyntaxException e)
- {
- _logger.fatal("This should NOT happen");
- return null;
- }
-
- call.setMessageID(uri);
- Collection<EPR> eprs = RegistryUtil.getEprs(category, name);
- EPR toEpr = (eprs.size()<1) ? null : eprs.iterator().next();
- call.setTo(toEpr);
-
- Courier sender = CourierFactory.getCourier(toEpr);
- PickUpOnlyCourier receiver = null;
- EPR replyToEpr = null;
- boolean waitForResponse = (maxWaitMillis > 0);
- if (waitForResponse)
- {
- replyToEpr = CourierUtil.getTemporaryReplyToEpr(toEpr);
- call.setReplyTo(replyToEpr);
- call.setFaultTo(replyToEpr);
- receiver = CourierFactory.getPickupCourier(replyToEpr);
- }
-
- sender.deliver(outgoing);
- return (waitForResponse)
- ? receiver.pickup(maxWaitMillis)
- : null
- ;
- }
-
- private static Logger _logger = Logger.getLogger(Invoker.class);
-}
Added: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/jbossesb-properties.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/jbossesb-properties.xml 2007-02-26 13:40:14 UTC (rev 9762)
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2006, JBoss Inc., and others contributors as indicated
+ by the @authors tag. All rights reserved.
+ See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+ This copyrighted material is made available to anyone wishing to use,
+ modify, copy, or redistribute it subject to the terms and conditions
+ of the GNU Lesser General Public License, v. 2.1.
+ This program is distributed in the hope that it will be useful, but WITHOUT A
+ 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,
+ v.2.1 along with this distribution; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA.
+
+ (C) 2005-2006,
+ @author JBoss Inc.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+ These options are described in the JBossESB manual.
+ Defaults are provided here for convenience only.
+
+ Please read through this file prior to using the system, and consider
+ updating the specified entries.
+-->
+<esb
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+ <properties name="core">
+ <property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
+ <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+ <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+ </properties>
+ <properties name="registry">
+ <property name="org.jboss.soa.esb.registry.queryManagerURI"
+ value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
+ <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
+ value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
+ <property name="org.jboss.soa.esb.registry.implementationClass"
+ value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+ <property name="org.jboss.soa.esb.registry.factoryClass"
+ value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+ <property name="org.jboss.soa.esb.registry.user"
+ value="jbossesb"/>
+ <property name="org.jboss.soa.esb.registry.password"
+ value="password"/>
+ <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+ <property name="org.jboss.soa.esb.scout.proxy.transportClass"
+ value="org.apache.ws.scout.transport.RMITransport"/>
+ </properties>
+ <properties name="transports" depends="core">
+ <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+ <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+ <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+ <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+ </properties>
+ <properties name="connection">
+ <property name="min-pool-size" value="5"/>
+ <property name="max-pool=size" value="10"/>
+ <property name="blocking-timeout-millis" value="5000"/>
+ <property name="abandoned-connection-timeout" value="10000"/>
+ <property name="abandoned-connection-time-interval" value="30000"/>
+ </properties>
+ <properties name="dbstore">
+ <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/jbossesb"/>
+ <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
+ <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
+ <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
+ <!--table managed by pool to test for valid connections - created by pool automatically -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
+ <!-- # of milliseconds to timeout waiting for a connection from pool -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
+ </properties>
+ <properties name="messagerouting">
+ <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+ </properties>
+</esb>
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/jbossesb-properties.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Added: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/jbossesb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/jbossesb.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/jbossesb.xml 2007-02-26 13:40:14 UTC (rev 9762)
@@ -0,0 +1,38 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.xsd" parameterReloadSecs="5">
+
+ <providers>
+ <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"
+ jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
+ jndi-URL="localhost" >
+
+ <jms-bus busid="toJbpmJmsChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/B"
+ selector="type='toJbpm'"
+ />
+ </jms-bus>
+ </jms-provider>
+ </providers>
+
+ <services>
+ <service
+ category="eprManager"
+ name="nameJbpmSimple1"
+ description="Simple jBPM-ESB example">
+ <listeners>
+ <jms-listener name="jmsToJbpmInterface"
+ busidref="toJbpmJmsChannel"
+ maxThreads="1"
+ />
+ </listeners>
+ <actions>
+ <action name="jbpmCommand"
+ class="org.jboss.soa.esb.actions.jbpm.CommandInterpreter"
+ />
+ </actions>
+ </service>
+ </services>
+
+</jbossesb>
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/jbossesb.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Added: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/jndi.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/jndi.properties (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/jndi.properties 2007-02-26 13:40:14 UTC (rev 9762)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/jndi.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/juddi.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/juddi.properties (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/juddi.properties 2007-02-26 13:40:14 UTC (rev 9762)
@@ -0,0 +1,69 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=com.mysql.jdbc.Driver
+juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
+juddi.jdbcUsername=root
+juddi.jdbcPassword=admin
+# jUDDI DataSource to use
+# juddi.dataSource=java:comp/env/jdbc/MySqlDS
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/juddi.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/log4j.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/log4j.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/log4j.xml 2007-02-26 13:40:14 UTC (rev 9762)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Target" value="System.out"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A size based file rolling appender -->
+ <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="./listener.log"/>
+ <param name="Append" value="false"/>
+ <param name="MaxFileSize" value="500KB"/>
+ <param name="MaxBackupIndex" value="1"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <category name="org.jboss">
+ <priority value="WARN"/>
+ </category>
+ <category name="org.jboss.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.jboss.internal.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.apache">
+ <priority value="ERROR"/>
+ </category>
+ <category name="quickstart">
+ <priority value="INFO"/>
+ </category>
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/log4j.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Added: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/gpd.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/gpd.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/gpd.xml 2007-02-26 13:40:14 UTC (rev 9762)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-diagram name="simple" width="666" height="507">
+ <node name="start" x="125" y="18" width="140" height="40">
+ <transition name="to_state">
+ <label x="5" y="-10"/>
+ </transition>
+ </node>
+ <node name="first" x="126" y="107" width="140" height="40">
+ <transition name="to_end">
+ <label x="5" y="-10"/>
+ </transition>
+ </node>
+ <node name="end" x="128" y="204" width="140" height="40"/>
+</process-diagram>
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/gpd.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Added: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/hibernate.cfg.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/hibernate.cfg.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/hibernate.cfg.xml 2007-02-26 13:40:14 UTC (rev 9762)
@@ -0,0 +1,174 @@
+<?xml version='1.0' encoding='utf-8'?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+ <session-factory>
+ <!-- jdbc connection properties -->
+ <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
+ <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
+ <property name="hibernate.connection.url">jdbc:hsqldb:mem:.;sql.enforce_strict_size=true</property>
+ <property name="hibernate.connection.username">sa</property>
+ <property name="hibernate.connection.password"></property>
+<!--
+ <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
+ <property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
+ <property name="hibernate.connection.url">jdbc:postgresql://localhost:5432/JbpmDB</property>
+ <property name="hibernate.connection.username">postgres</property>
+ <property name="hibernate.connection.password"></property>
+-->
+
+ <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
+
+ <!-- other hibernate properties
+ <property name="hibernate.show_sql">true</property>
+ <property name="hibernate.format_sql">true</property>
+ <property name="hibernate.use_sql_comments">true</property>
+ -->
+
+ <!-- ############################################ -->
+ <!-- # mapping files with external dependencies # -->
+ <!-- ############################################ -->
+
+ <!-- following mapping file has a dependendy on -->
+ <!-- 'bsh-{version}.jar'. -->
+ <!-- uncomment this if you don't have bsh on your -->
+ <!-- classpath. you won't be able to use the -->
+ <!-- script element in process definition files -->
+ <mapping resource="org/jbpm/graph/action/Script.hbm.xml"/>
+
+ <!-- following mapping files have a dependendy on -->
+ <!-- 'jbpm-identity-{version}.jar', mapping files -->
+ <!-- of the pluggable jbpm identity component. -->
+ <!-- comment out the following 3 lines if you don't-->
+ <!-- want to use the default jBPM identity mgmgt -->
+ <!-- component -->
+ <mapping resource="org/jbpm/identity/User.hbm.xml"/>
+ <mapping resource="org/jbpm/identity/Group.hbm.xml"/>
+ <mapping resource="org/jbpm/identity/Membership.hbm.xml"/>
+
+ <!-- ###################### -->
+ <!-- # jbpm mapping files # -->
+ <!-- ###################### -->
+
+ <!-- hql queries and type defs -->
+ <mapping resource="org/jbpm/db/hibernate.queries.hbm.xml" />
+
+ <!-- graph.def mapping files -->
+ <mapping resource="org/jbpm/graph/def/ProcessDefinition.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Node.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Transition.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Event.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Action.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/SuperState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/ExceptionHandler.hbm.xml"/>
+ <mapping resource="org/jbpm/instantiation/Delegation.hbm.xml"/>
+
+ <!-- graph.node mapping files -->
+ <mapping resource="org/jbpm/graph/node/StartState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/EndState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/ProcessState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/Decision.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/Fork.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/Join.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/State.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/TaskNode.hbm.xml"/>
+
+ <!-- context.def mapping files -->
+ <mapping resource="org/jbpm/context/def/ContextDefinition.hbm.xml"/>
+ <mapping resource="org/jbpm/context/def/VariableAccess.hbm.xml"/>
+
+ <!-- taskmgmt.def mapping files -->
+ <mapping resource="org/jbpm/taskmgmt/def/TaskMgmtDefinition.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/def/Swimlane.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/def/Task.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/def/TaskController.hbm.xml"/>
+
+ <!-- module.def mapping files -->
+ <mapping resource="org/jbpm/module/def/ModuleDefinition.hbm.xml"/>
+
+ <!-- bytes mapping files -->
+ <mapping resource="org/jbpm/bytes/ByteArray.hbm.xml"/>
+
+ <!-- file.def mapping files -->
+ <mapping resource="org/jbpm/file/def/FileDefinition.hbm.xml"/>
+
+ <!-- scheduler.def mapping files -->
+ <mapping resource="org/jbpm/scheduler/def/CreateTimerAction.hbm.xml"/>
+ <mapping resource="org/jbpm/scheduler/def/CancelTimerAction.hbm.xml"/>
+
+ <!-- graph.exe mapping files -->
+ <mapping resource="org/jbpm/graph/exe/Comment.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/exe/ProcessInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/exe/Token.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/exe/RuntimeAction.hbm.xml"/>
+
+ <!-- module.exe mapping files -->
+ <mapping resource="org/jbpm/module/exe/ModuleInstance.hbm.xml"/>
+
+ <!-- context.exe mapping files -->
+ <mapping resource="org/jbpm/context/exe/ContextInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/TokenVariableMap.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/VariableInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/ByteArrayInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/DateInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/DoubleInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/HibernateLongInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/HibernateStringInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/LongInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/NullInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/StringInstance.hbm.xml"/>
+
+ <!-- msg.db mapping files -->
+ <mapping resource="org/jbpm/msg/Message.hbm.xml"/>
+ <mapping resource="org/jbpm/msg/db/TextMessage.hbm.xml"/>
+ <mapping resource="org/jbpm/command/ExecuteActionCommand.hbm.xml"/>
+ <mapping resource="org/jbpm/command/ExecuteNodeCommand.hbm.xml"/>
+ <mapping resource="org/jbpm/command/SignalCommand.hbm.xml"/>
+ <mapping resource="org/jbpm/command/TaskInstanceEndCommand.hbm.xml"/>
+
+ <!-- taskmgmt.exe mapping files -->
+ <mapping resource="org/jbpm/taskmgmt/exe/TaskMgmtInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/exe/PooledActor.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/exe/SwimlaneInstance.hbm.xml"/>
+
+ <!-- scheduler.exe mapping files -->
+ <mapping resource="org/jbpm/scheduler/exe/Timer.hbm.xml"/>
+
+ <!-- logging mapping files -->
+ <mapping resource="org/jbpm/logging/log/ProcessLog.hbm.xml"/>
+ <mapping resource="org/jbpm/logging/log/MessageLog.hbm.xml"/>
+ <mapping resource="org/jbpm/logging/log/CompositeLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ActionLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/NodeLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ProcessInstanceCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ProcessInstanceEndLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ProcessStateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/SignalLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/TokenCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/TokenEndLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/TransitionLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableDeleteLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/ByteArrayUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/DateUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/DoubleUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/HibernateLongUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/HibernateStringUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/LongUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/StringUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskAssignLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskEndLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/SwimlaneLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/SwimlaneCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/SwimlaneAssignLog.hbm.xml"/>
+
+ </session-factory>
+</hibernate-configuration>
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/hibernate.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Added: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/jbpm.cfg.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/jbpm.cfg.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/jbpm.cfg.xml 2007-02-26 13:40:14 UTC (rev 9762)
@@ -0,0 +1,9 @@
+<jbpm-configuration>
+
+ <!--
+ The default configurations can be found in org/jbpm/default.jbpm.cfg.xml
+ Those configurations can be overwritten by putting this file called
+ jbpm.cfg.xml on the root of the classpath and put in the customized values.
+ -->
+
+</jbpm-configuration>
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/jbpm.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Added: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/processdefinition.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/processdefinition.xml (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/processdefinition.xml 2007-02-26 13:40:14 UTC (rev 9762)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process-definition
+ xmlns="urn:jbpm.org:jpdl-3.1"
+ name="simple">
+ <start-state name="start">
+ <transition name="to_state" to="first">
+ <action name="action" class="quickstart.jbpm_simple1.JbpmActionHandler">
+ <message>Going to the first state!</message>
+ </action>
+ </transition>
+ </start-state>
+ <state name="first">
+ <transition name="to_end" to="end">
+ <action name="action" class="quickstart.jbpm_simple1.JbpmActionHandler">
+ <message>About to finish!</message>
+ </action>
+ </transition>
+ </state>
+ <end-state name="end"></end-state>
+</process-definition>
\ No newline at end of file
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/processdefinition.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Added: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/processimage.jpg
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/processimage.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/quickstart/jbpm_simple1/JbpmActionHandler.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/quickstart/jbpm_simple1/JbpmActionHandler.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/quickstart/jbpm_simple1/JbpmActionHandler.java 2007-02-26 13:40:14 UTC (rev 9762)
@@ -0,0 +1,17 @@
+package quickstart.jbpm_simple1;
+
+import org.jbpm.graph.def.ActionHandler;
+import org.jbpm.graph.exe.ExecutionContext;
+
+public class JbpmActionHandler implements ActionHandler {
+
+ private static final long serialVersionUID = 1L;
+
+ public String message;
+
+ public void execute(ExecutionContext ctx) throws Exception {
+ System.out.println(" Message:"+message);
+ ctx.getContextInstance().setVariable("message",message);
+ }
+
+}
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/quickstart/jbpm_simple1/JbpmActionHandler.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/quickstart/jbpm_simple1/test/JunitTest.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/quickstart/jbpm_simple1/test/JunitTest.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/quickstart/jbpm_simple1/test/JunitTest.java 2007-02-26 13:40:14 UTC (rev 9762)
@@ -0,0 +1,82 @@
+package quickstart.jbpm_simple1.test;
+
+import junit.framework.TestCase;
+
+import org.hibernate.Session;
+import org.jbpm.JbpmConfiguration;
+import org.jbpm.JbpmContext;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ProcessInstance;
+
+public class JunitTest extends TestCase {
+
+ JbpmConfiguration _config;
+ JbpmContext _ctx;
+ Session _session;
+
+ public void setUp() {
+ _config = JbpmConfiguration.getInstance();
+ _config.createSchema();
+ _ctx = _config.createJbpmContext();
+ _session = _ctx.getSession();
+ }
+
+ public void tearDown() {
+ if (null!=_ctx) _ctx.close();
+ if (null!=_config)
+ {
+ _config.dropSchema();
+ _config.close();
+ }
+ }
+
+ public void testSimpleProcess() throws Exception {
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("processdefinition.xml");
+ assertNotNull("Definition should not be null", processDefinition);
+
+ _session.saveOrUpdate(processDefinition);
+ String processName = processDefinition.getName();
+ processDefinition = null;
+
+
+ ProcessInstance instance = _ctx.newProcessInstance(processName);
+ assertEquals(
+ "Instance is in start state",
+ instance.getRootToken().getNode().getName(),
+ "start");
+ assertNull(
+ "Message variable should not exist yet",
+ instance.getContextInstance().getVariable("message"));
+
+ instance.signal();
+ _ctx.save(instance);
+ long instanceId = instance.getId();
+
+ instance = _ctx.loadProcessInstanceForUpdate(instanceId);
+ assertEquals(
+ "Instance is in first state",
+ instance.getRootToken().getNode().getName(),
+ "first");
+ assertEquals(
+ "Message variable contains message",
+ instance.getContextInstance().getVariable("message"),
+ "Going to the first state!");
+
+
+ instance.signal();
+ _ctx.save(instance);
+ instance = _ctx.loadProcessInstanceForUpdate(instanceId);
+
+ assertEquals(
+ "Instance is in end state",
+ instance.getRootToken().getNode().getName(),
+ "end");
+
+ assertTrue("Instance has ended", instance.hasEnded());
+ assertEquals(
+ "Message variable is changed",
+ instance.getContextInstance().getVariable("message"),
+ "About to finish!");
+
+ }
+}
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/quickstart/jbpm_simple1/test/JunitTest.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/quickstart/jbpm_simple1/test/TestCommandMessages.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/quickstart/jbpm_simple1/test/TestCommandMessages.java (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/quickstart/jbpm_simple1/test/TestCommandMessages.java 2007-02-26 13:40:14 UTC (rev 9762)
@@ -0,0 +1,187 @@
+package quickstart.jbpm_simple1.test;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.common.Environment;
+import org.jboss.soa.esb.common.ModulePropertyManager;
+import org.jboss.soa.esb.listeners.message.Invoker;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.util.jbpm.CommandVehicle;
+
+import com.arjuna.common.util.propertyservice.PropertyManager;
+
+public class TestCommandMessages {
+
+ static Logger _logger = Logger.getLogger(TestCommandMessages.class);
+
+ public static void main(String[] args) throws Exception
+ {
+ new TestCommandMessages().run();
+ }
+
+
+
+ public void run() throws Exception {
+
+// String category = "categoryJbpmSimple1";
+ String category = "eprManager";
+ String name = "nameJbpmSimple1";
+
+ setupRegistry();
+ Enum operation = null;
+ CommandVehicle command = null;
+
+ operation = CommandVehicle.Operation.deployProcessDefinition;
+ command = new CommandVehicle(operation);
+ command.setProcessDefinition(getProcessDefinitionXml("processdefinition.xml"));
+ Message respMsg = Invoker.invokeAndAwaitResponse(command,category,name,15000);
+ CommandVehicle response = (null==respMsg) ? null : new CommandVehicle(respMsg);
+ if (null!=response)
+ {
+ _logger.info("Invoked : "+operation.toString());
+ _logger.info("Return code = "+response.getReturnCode());
+ _logger.info("Error messg = "+response.getErrorMessage());
+ Exception e = response.getException();
+ if (null==e)
+ {
+ _logger.info("PrcDef name = "+response.getProcessDefinitionName());
+ _logger.info("PrcDef vers = "+response.getProcessVersion());
+ }
+ else
+ _logger.error("Problems in jbpm.CommandInterpreter",e);
+ }
+ else
+ _logger.info("Response was not received");
+ _logger.info("_______________________________________________________________________");
+
+ operation = CommandVehicle.Operation.newProcessInstance;
+ command = new CommandVehicle(operation);
+ command.setProcessDefinitionName(response.getProcessDefinitionName());
+ respMsg = Invoker.invokeAndAwaitResponse(command,category,name,15000);
+ response = (null==respMsg) ? null : new CommandVehicle(respMsg);
+ if (null!=response)
+ {
+ _logger.info("Invoked : "+operation.toString());
+ _logger.info("Return code = "+response.getReturnCode());
+ _logger.info("Error messg = "+response.getErrorMessage());
+ Exception e = response.getException();
+ if (null==e)
+ {
+ _logger.info("PrcDef name = "+response.getProcessDefinitionName());
+ _logger.info("PrcDef vers = "+response.getProcessVersion());
+ _logger.info("Instance id = "+response.getInstanceId());
+ _logger.info("Token id = "+response.getTokenId());
+ _logger.info("Current node= "+response.getCurrentNodeName());
+ }
+ else
+ _logger.error("Problems in jbpm.CommandInterpreter",e);
+ }
+ else
+ _logger.info("Response was not received");
+ _logger.info("_______________________________________________________________________");
+
+ for (boolean continueLooping = true; continueLooping;)
+ {
+ operation = CommandVehicle.Operation.signalToken;
+ command = new CommandVehicle(operation);
+ command.setTokenId(response.getTokenId());
+ respMsg = Invoker.invokeAndAwaitResponse(command,category,name,15000);
+ response = (null==respMsg) ? null : new CommandVehicle(respMsg);
+ if (null!=response)
+ {
+ _logger.info("Invoked : "+operation.toString());
+ _logger.info("Return code = "+response.getReturnCode());
+ _logger.info("Error messg = "+response.getErrorMessage());
+ Exception e = response.getException();
+ if (null==e)
+ {
+ _logger.info("PrcDef name = "+response.getProcessDefinitionName());
+ _logger.info("PrcDef vers = "+response.getProcessVersion());
+ _logger.info("Instance id = "+response.getInstanceId());
+ _logger.info("Token id = "+response.getTokenId());
+ _logger.info("Current node= "+response.getCurrentNodeName());
+ Object obj = response.getUserObject();
+ String ended = (null==obj)?"<null>":obj.toString();
+ _logger.info("Has ended = "+ ended);
+ continueLooping = "false".equals(ended);
+ }
+ else
+ _logger.error("Problems in jbpm.CommandInterpreter",e);
+ }
+ else
+ _logger.info("Response was not received");
+ _logger.info("_______________________________________________________________________");
+
+ if (! CommandVehicle.RETCODE_OK.equals(response.getReturnCode()))
+ break;
+ }
+
+ // Invoke 'hasInstanceEnded' once just to exemplify use of this operation
+ operation = CommandVehicle.Operation.hasInstanceEnded;
+ command = new CommandVehicle(operation);
+ command.setInstanceId(response.getInstanceId());
+ respMsg = Invoker.invokeAndAwaitResponse(command,category,name,15000);
+ response = (null==respMsg) ? null : new CommandVehicle(respMsg);
+ if (null!=response)
+ {
+ _logger.info("Invoked : "+operation.toString());
+ _logger.info("Return code = "+response.getReturnCode());
+ _logger.info("Error messg = "+response.getErrorMessage());
+ Exception e = response.getException();
+ if (null==e)
+ {
+ _logger.info("PrcDef name = "+response.getProcessDefinitionName());
+ _logger.info("PrcDef vers = "+response.getProcessVersion());
+ _logger.info("Instance id = "+response.getInstanceId());
+ _logger.info("Token id = "+response.getTokenId());
+ _logger.info("Current node= "+response.getCurrentNodeName());
+ Object obj = response.getUserObject();
+ String ended = (null==obj)?"<null>":obj.toString();
+ _logger.info("Has ended = "+ ended);
+ }
+ else
+ _logger.error("Problems in jbpm.CommandInterpreter",e);
+ }
+ else
+ _logger.info("Response was not received");
+ _logger.info("_______________________________________________________________________");
+ }
+
+ /**
+ * Invocation of this method should be unnecessary.
+ * Had to invoke it because I had trouble to have the properties loaded from jbossesb-properties.xml
+ * Once that is solved, you can get rid of the invocation to this method (up in the run() )
+ */
+ protected void setupRegistry() {
+ PropertyManager mgr = null;
+
+// mgr = ModulePropertyManager.getPropertyManager("registry");
+// mgr.setProperty(Environment.REGISTRY_IMPEMENTATION_CLASS,"org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl");
+// mgr.setProperty(Environment.REGISTRY_QUERY_MANAGER_URI,"jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire");
+// mgr.setProperty(Environment.REGISTRY_LIFECYCLE_MANAGER_URI,"jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish");
+// mgr.setProperty(Environment.REGISTRY_FACTORY_CLASS,"org.apache.ws.scout.registry.ConnectionFactoryImpl");
+// mgr.setProperty(Environment.REGISTRY_SCOUT_TRANSPORT_CLASS,"org.apache.ws.scout.transport.RMITransport");
+// mgr.setProperty(Environment.REGISTRY_USER,"jbossesb");
+// mgr.setProperty(Environment.REGISTRY_PASSWORD,"password");
+// System.setProperty("javax.xml.registry.ConnectionFactoryClass", "org.apache.ws.scout.registry.ConnectionFactoryImpl");
+
+ mgr = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE) ;
+ mgr.setProperty(Environment.REGISTRY_FILE_HELPER_DIR, System.getProperty("java.io.tmpdir","/tmp")) ;
+
+ }
+
+
+ protected String getProcessDefinitionXml(String pFileName) throws Exception
+ {
+ InputStream in = this.getClass().getClassLoader().getResourceAsStream(pFileName);
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ byte[]ba = new byte[1000];
+ int iQ = -1;
+ while (-1<(iQ=in.read(ba)))
+ if (iQ>0) out.write(ba,0,iQ);
+ return out.toString();
+ }
+
+}
Property changes on: labs/jbossesb/trunk/product/samples/quickstarts/jbpm_simple1/src/quickstart/jbpm_simple1/test/TestCommandMessages.java
___________________________________________________________________
Name: svn:eol-style
+ native
More information about the jboss-svn-commits
mailing list