JBoss JBPM SVN: r6838 - in jbpm3/branches/jbpm-3.2-soa: enterprise/src/main/java/org/jbpm/scheduler/ejbtimer and 2 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-11-23 08:45:16 -0500 (Tue, 23 Nov 2010)
New Revision: 6838
Modified:
jbpm3/branches/jbpm-3.2-soa/enterprise-jee5/src/main/etc/jbpm.cfg.xml
jbpm3/branches/jbpm-3.2-soa/enterprise-jee5/src/main/java/org/jbpm/jms/ExecuteJobCommand.java
jbpm3/branches/jbpm-3.2-soa/enterprise-jee5/src/main/java/org/jbpm/jms/JmsConnectorService.java
jbpm3/branches/jbpm-3.2-soa/enterprise/src/main/java/org/jbpm/msg/jms/JmsMessageService.java
jbpm3/branches/jbpm-3.2-soa/enterprise/src/main/java/org/jbpm/msg/jms/JmsMessageServiceFactory.java
jbpm3/branches/jbpm-3.2-soa/enterprise/src/main/java/org/jbpm/msg/jms/JmsMessageServiceFactoryImpl.java
jbpm3/branches/jbpm-3.2-soa/enterprise/src/main/java/org/jbpm/scheduler/ejbtimer/EjbSchedulerService.java
jbpm3/branches/jbpm-3.2-soa/enterprise/src/main/java/org/jbpm/scheduler/ejbtimer/EntitySchedulerService.java
Log:
reference as few objects as possible in jms message/connector and ejb/entity scheduler services
Modified: jbpm3/branches/jbpm-3.2-soa/enterprise/src/main/java/org/jbpm/msg/jms/JmsMessageService.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/enterprise/src/main/java/org/jbpm/msg/jms/JmsMessageService.java 2010-11-21 13:43:03 UTC (rev 6837)
+++ jbpm3/branches/jbpm-3.2-soa/enterprise/src/main/java/org/jbpm/msg/jms/JmsMessageService.java 2010-11-23 13:45:16 UTC (rev 6838)
@@ -28,84 +28,82 @@
import javax.jms.MessageProducer;
import javax.jms.Session;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.jbpm.JbpmContext;
import org.jbpm.JbpmException;
import org.jbpm.db.JobSession;
-import org.jbpm.graph.exe.Token;
import org.jbpm.job.Job;
import org.jbpm.msg.MessageService;
import org.jbpm.svc.Services;
-import org.jbpm.taskmgmt.exe.TaskInstance;
-import org.jbpm.tx.TxService;
public class JmsMessageService implements MessageService {
- private static final long serialVersionUID = 1L;
+ private final JmsMessageServiceFactory serviceFactory;
- private static final Log log = LogFactory.getLog(JmsMessageService.class);
+ private final Connection connection;
+ private final Session session;
- final JobSession jobSession;
+ private static final long serialVersionUID = 2L;
+ private static final String GROUP_ID_PROP = "JMSXGroupID";
+ private static final String GROUP_PREFIX = "jBPMPID";
- final Connection connection;
- final Session session;
- final MessageProducer messageProducer;
+ /** @deprecated use {@link #JmsMessageService(JmsMessageServiceFactory)} instead */
+ public JmsMessageService(Connection connection, Destination destination, boolean commitEnabled)
+ throws JMSException {
+ this.connection = connection;
+ session = createSession(connection);
+ serviceFactory = (JmsMessageServiceFactory) Services.getCurrentService(Services.SERVICENAME_MESSAGE);
+ }
- final boolean isCommitEnabled;
+ public JmsMessageService(JmsMessageServiceFactory serviceFactory) throws JMSException {
+ connection = serviceFactory.getConnectionFactory().createConnection();
+ session = createSession(connection);
+ this.serviceFactory = serviceFactory;
+ }
/**
- * @deprecated use {@link #JmsMessageService(JmsMessageServiceFactory)} instead
+ * EJB 2.1 section 17.3.5 Because the container manages the transactional enlistment of JMS
+ * sessions on behalf of a bean, the parameters of the
+ * {@link Connection#createSession(boolean, int) createSession} method are ignored. It is
+ * recommended that the Bean Provider specify that a session is transacted, but provide
+ * <code>0</code> for the value of the acknowledgment mode.
+ * <p>
+ * Nonetheless, in <a href="http://publib.boulder.ibm.com/infocenter/adiehelp/v5r1m1/topic/com.ibm.wa..."
+ * >WebSphere</a>, if the transacted flag is set to true outside of a transaction, the
+ * application should use {@link Session#commit() commit} or {@link Session#rollback()
+ * rollback} to control the completion of the work.
+ * </p>
+ * <p>
+ * Therefore, the safest course of action is to create a session with the parameters
+ * <code>false</code> and {@link Session#AUTO_ACKNOWLEDGE}.
*/
- public JmsMessageService(Connection connection, Destination destination, boolean isCommitEnabled)
- throws JMSException {
- JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
- if (jbpmContext == null) throw new JbpmException("no active jbpm context");
- jobSession = jbpmContext.getJobSession();
+ private static Session createSession(Connection connection) throws JMSException {
+ return connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ }
- this.connection = connection;
+ public void send(Job job) {
+ getJobSession().saveJob(job);
- if (isCommitEnabled) {
- session = connection.createSession(true, Session.SESSION_TRANSACTED);
- this.isCommitEnabled = true;
+ try {
+ sendMessage(job);
}
- else {
- session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- this.isCommitEnabled = false;
+ catch (JMSException e) {
+ throw new JbpmException("could not send jms message", e);
}
-
- messageProducer = session.createProducer(destination);
}
- public JmsMessageService(JmsMessageServiceFactory factory) throws JMSException {
- this(factory.getConnectionFactory().createConnection(), factory.getDestination(),
- factory.isCommitEnabled());
+ private JobSession getJobSession() {
+ return serviceFactory.getJbpmConfiguration().getCurrentJbpmContext().getJobSession();
}
- public void send(Job job) {
- jobSession.saveJob(job);
+ private void sendMessage(Job job) throws JMSException {
+ Message message = getSession().createMessage();
+ modifyMessage(message, job);
+ MessageProducer messageProducer = getMessageProducer();
try {
- Message message = session.createMessage();
- message.setLongProperty("jobId", job.getId());
-
- Token token = job.getToken();
- if (token != null) {
- message.setLongProperty("tokenId", token.getId());
- message.setLongProperty("processInstanceId", job.getProcessInstance().getId());
- }
-
- TaskInstance taskInstance = job.getTaskInstance();
- if (taskInstance != null) {
- message.setLongProperty("taskInstanceId", taskInstance.getId());
- }
-
- modifyMessage(message, job);
messageProducer.send(message);
}
- catch (JMSException e) {
- throw new JbpmException("could not send jms message", e);
+ finally {
+ messageProducer.close();
}
}
@@ -115,49 +113,21 @@
* asynchronous continuations.
*/
protected void modifyMessage(Message message, Job job) throws JMSException {
+ message.setLongProperty("jobId", job.getId());
+
+ if (job.isExclusive()) {
+ message.setStringProperty(GROUP_ID_PROP, GROUP_PREFIX + job.getProcessInstance().getId());
+ }
}
public void close() {
+ // there is no need to close the sessions and producers of a closed connection
try {
- messageProducer.close();
- }
- catch (JMSException e) {
- log.warn("could not close message producer", e);
- }
-
- JMSException commitException = null;
- if (isCommitEnabled) {
- TxService txService = (TxService) Services.getCurrentService(Services.SERVICENAME_TX);
- try {
- if (txService.isRollbackOnly()) {
- session.rollback();
- }
- else {
- session.commit();
- }
- }
- catch (JMSException e) {
- commitException = e;
- }
- }
-
- try {
- session.close();
- }
- catch (JMSException e) {
- log.warn("could not close jms session", e);
- }
-
- try {
connection.close();
}
catch (JMSException e) {
- log.warn("could not close jms connection", e);
+ throw new JbpmException("could not close jms connection", e);
}
-
- if (commitException != null) {
- throw new JbpmException("could not commit jms session", commitException);
- }
}
public Session getSession() {
@@ -165,6 +135,6 @@
}
protected MessageProducer getMessageProducer() throws JMSException {
- return messageProducer;
+ return getSession().createProducer(serviceFactory.getDestination());
}
}
Modified: jbpm3/branches/jbpm-3.2-soa/enterprise/src/main/java/org/jbpm/msg/jms/JmsMessageServiceFactory.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/enterprise/src/main/java/org/jbpm/msg/jms/JmsMessageServiceFactory.java 2010-11-21 13:43:03 UTC (rev 6837)
+++ jbpm3/branches/jbpm-3.2-soa/enterprise/src/main/java/org/jbpm/msg/jms/JmsMessageServiceFactory.java 2010-11-23 13:45:16 UTC (rev 6838)
@@ -25,10 +25,13 @@
import javax.jms.Destination;
import javax.jms.JMSException;
+import org.jbpm.JbpmConfiguration;
+import org.jbpm.JbpmContext;
import org.jbpm.JbpmException;
import org.jbpm.ejb.impl.JobListenerBean;
import org.jbpm.svc.Service;
import org.jbpm.svc.ServiceFactory;
+import org.jbpm.svc.Services;
import org.jbpm.util.JndiUtil;
/**
@@ -42,7 +45,6 @@
* <ul>
* <li><code>connectionFactoryJndiName</code></li>
* <li><code>destinationJndiName</code></li>
- * <li><code>isCommitEnabled</code></li>
* </ul>
*
* Refer to the jBPM manual for details.
@@ -57,11 +59,22 @@
String connectionFactoryJndiName = "java:comp/env/jms/JbpmConnectionFactory";
String destinationJndiName = "java:comp/env/jms/JobQueue";
- boolean isCommitEnabled;
-
+ private JbpmConfiguration jbpmConfiguration;
private ConnectionFactory connectionFactory;
private Destination destination;
+ public JbpmConfiguration getJbpmConfiguration() {
+ // if this field was not injected
+ if (jbpmConfiguration == null) {
+ // set to current context
+ JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
+ if (jbpmContext == null) throw new JbpmException("no active jbpm context");
+ assert this == jbpmContext.getServiceFactory(Services.SERVICENAME_MESSAGE) : jbpmContext.getServiceFactory(Services.SERVICENAME_MESSAGE);
+ jbpmConfiguration = jbpmContext.getJbpmConfiguration();
+ }
+ return jbpmConfiguration;
+ }
+
public synchronized ConnectionFactory getConnectionFactory() {
if (connectionFactory == null) {
connectionFactory = (ConnectionFactory) JndiUtil.lookup(connectionFactoryJndiName, ConnectionFactory.class);
@@ -76,8 +89,12 @@
return destination;
}
+ /**
+ * @deprecated the EJB container manages the transactional enlistment of JMS sessions
+ * @return <code>false</code>
+ */
public boolean isCommitEnabled() {
- return isCommitEnabled;
+ return false;
}
public Service openService() {
Modified: jbpm3/branches/jbpm-3.2-soa/enterprise/src/main/java/org/jbpm/msg/jms/JmsMessageServiceFactoryImpl.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/enterprise/src/main/java/org/jbpm/msg/jms/JmsMessageServiceFactoryImpl.java 2010-11-21 13:43:03 UTC (rev 6837)
+++ jbpm3/branches/jbpm-3.2-soa/enterprise/src/main/java/org/jbpm/msg/jms/JmsMessageServiceFactoryImpl.java 2010-11-23 13:45:16 UTC (rev 6838)
@@ -39,7 +39,7 @@
public Service openService() {
try {
Connection connection = getConnectionFactory().createConnection();
- return new JmsMessageServiceImpl(connection, getDestination(), isCommitEnabled);
+ return new JmsMessageServiceImpl(connection, getDestination(), isCommitEnabled());
}
catch (JMSException e) {
throw new JbpmException("couldn't open message session", e);
Modified: jbpm3/branches/jbpm-3.2-soa/enterprise/src/main/java/org/jbpm/scheduler/ejbtimer/EjbSchedulerService.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/enterprise/src/main/java/org/jbpm/scheduler/ejbtimer/EjbSchedulerService.java 2010-11-21 13:43:03 UTC (rev 6837)
+++ jbpm3/branches/jbpm-3.2-soa/enterprise/src/main/java/org/jbpm/scheduler/ejbtimer/EjbSchedulerService.java 2010-11-23 13:45:16 UTC (rev 6838)
@@ -5,10 +5,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.hibernate.Session;
+
import org.jbpm.JbpmContext;
import org.jbpm.JbpmException;
-import org.jbpm.db.JobSession;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.graph.exe.Token;
import org.jbpm.job.Timer;
@@ -20,39 +19,34 @@
*/
public class EjbSchedulerService implements SchedulerService {
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 2L;
- private JobSession jobSession;
- private Session session;
+ private JbpmContext jbpmContext;
private LocalTimerService timerService;
public EjbSchedulerService(LocalTimerServiceHome timerServiceHome) {
- JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
- if (jbpmContext == null) {
- throw new JbpmException("instantiation of the EjbSchedulerService requires a current JbpmContext");
- }
- this.jobSession = jbpmContext.getJobSession();
- this.session = jbpmContext.getSession();
+ jbpmContext = JbpmContext.getCurrentJbpmContext();
+ if (jbpmContext == null) throw new JbpmException("no active jbpm context");
try {
timerService = timerServiceHome.create();
}
catch (CreateException e) {
- throw new JbpmException("ejb local timer creation problem", e);
+ throw new JbpmException("failed to create local timer service", e);
}
}
public void createTimer(Timer timer) {
log.debug("creating " + timer);
- jobSession.saveJob(timer);
- session.flush();
+ jbpmContext.getJobSession().saveJob(timer);
+ jbpmContext.getSession().flush();
timerService.createTimer(timer);
}
public void deleteTimer(Timer timer) {
if (log.isDebugEnabled()) log.debug("deleting " + timer);
timerService.cancelTimer(timer);
- jobSession.deleteJob(timer);
+ jbpmContext.getJobSession().deleteJob(timer);
}
public void deleteTimersByName(String timerName, Token token) {
@@ -60,18 +54,17 @@
log.debug("deleting timers by name '" + timerName + "' for " + token);
}
timerService.cancelTimersByName(timerName, token);
- jobSession.deleteTimersByName(timerName, token);
+ jbpmContext.getJobSession().deleteTimersByName(timerName, token);
}
public void deleteTimersByProcessInstance(ProcessInstance processInstance) {
if (log.isDebugEnabled()) log.debug("deleting timers for " + processInstance);
timerService.cancelTimersForProcessInstance(processInstance);
- jobSession.deleteJobsForProcessInstance(processInstance);
+ jbpmContext.getJobSession().deleteJobsForProcessInstance(processInstance);
}
public void close() {
try {
- if (log.isDebugEnabled()) log.debug("removing the timer service session bean");
timerService.remove();
}
catch (RemoveException e) {
Modified: jbpm3/branches/jbpm-3.2-soa/enterprise/src/main/java/org/jbpm/scheduler/ejbtimer/EntitySchedulerService.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/enterprise/src/main/java/org/jbpm/scheduler/ejbtimer/EntitySchedulerService.java 2010-11-21 13:43:03 UTC (rev 6837)
+++ jbpm3/branches/jbpm-3.2-soa/enterprise/src/main/java/org/jbpm/scheduler/ejbtimer/EntitySchedulerService.java 2010-11-23 13:45:16 UTC (rev 6838)
@@ -7,10 +7,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.hibernate.Session;
+
import org.jbpm.JbpmContext;
import org.jbpm.JbpmException;
-import org.jbpm.db.JobSession;
import org.jbpm.ejb.LocalTimerEntity;
import org.jbpm.ejb.LocalTimerEntityHome;
import org.jbpm.graph.exe.ProcessInstance;
@@ -20,26 +19,22 @@
public class EntitySchedulerService implements SchedulerService {
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 2L;
- JobSession jobSession;
- Session session;
- LocalTimerEntityHome timerEntityHome;
+ private JbpmContext jbpmContext;
+ private LocalTimerEntityHome timerEntityHome;
public EntitySchedulerService(LocalTimerEntityHome timerEntityHome) {
- JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
- if (jbpmContext == null) {
- throw new JbpmException("entity scheduler service must be created inside a jbpm context");
- }
- this.jobSession = jbpmContext.getJobSession();
- this.session = jbpmContext.getSession();
+ jbpmContext = JbpmContext.getCurrentJbpmContext();
+ if (jbpmContext == null) throw new JbpmException("no active jbpm context");
this.timerEntityHome = timerEntityHome;
}
public void createTimer(Timer timer) {
if (log.isDebugEnabled()) log.debug("creating " + timer);
- jobSession.saveJob(timer);
- session.flush();
+ jbpmContext.getJobSession().saveJob(timer);
+ jbpmContext.getSession().flush();
+
try {
LocalTimerEntity timerEntity = timerEntityHome.findByPrimaryKey(new Long(timer.getId()));
timerEntity.createTimer(timer);
@@ -58,7 +53,7 @@
catch (FinderException e) {
log.error("failed to retrieve entity for " + timer, e);
}
- jobSession.deleteJob(timer);
+ jbpmContext.getJobSession().deleteJob(timer);
}
public void deleteTimersByName(String timerName, Token token) {
@@ -76,7 +71,7 @@
catch (FinderException e) {
log.error("failed to retrieve timer entities by name '" + timerName + "' for " + token, e);
}
- jobSession.deleteTimersByName(timerName, token);
+ jbpmContext.getJobSession().deleteTimersByName(timerName, token);
}
public void deleteTimersByProcessInstance(ProcessInstance processInstance) {
@@ -93,11 +88,11 @@
catch (FinderException e) {
log.error("failed to retrieve timer entities for " + processInstance, e);
}
- jobSession.deleteJobsForProcessInstance(processInstance);
+ jbpmContext.getJobSession().deleteJobsForProcessInstance(processInstance);
}
public void close() {
- timerEntityHome = null;
+ // nothing to do here
}
private static final Log log = LogFactory.getLog(EntitySchedulerService.class);
Modified: jbpm3/branches/jbpm-3.2-soa/enterprise-jee5/src/main/etc/jbpm.cfg.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/enterprise-jee5/src/main/etc/jbpm.cfg.xml 2010-11-21 13:43:03 UTC (rev 6837)
+++ jbpm3/branches/jbpm-3.2-soa/enterprise-jee5/src/main/etc/jbpm.cfg.xml 2010-11-23 13:45:16 UTC (rev 6838)
@@ -2,35 +2,31 @@
<jbpm-context>
<service name="persistence" factory="org.jbpm.persistence.jta.JtaDbPersistenceServiceFactory" />
- <service name="message">
- <factory>
- <ref bean="jbpm.jms.connector.command.service" />
- </factory>
- </service>
- <service name="scheduler">
- <factory>
- <ref bean="jbpm.jms.connector.job.service" />
- </factory>
- </service>
+ <service name="message">
+ <factory>
+ <ref bean="jbpm.jms.connector.job.service" />
+ </factory>
+ </service>
+ <service name="scheduler">
+ <factory>
+ <ref bean="jbpm.jms.connector.job.service" />
+ </factory>
+ </service>
<service name="tx" factory="org.jbpm.tx.TxServiceFactory" />
<service name="logging" factory="org.jbpm.logging.db.DbLoggingServiceFactory" />
<service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
</jbpm-context>
- <bean name="jbpm.jms.connector.command.service" class="org.jbpm.jms.JmsConnectorServiceFactory">
- <field name="jbpmConfiguration">
- <ref bean="jbpm.configuration" />
- </field>
- <property name="connectionFactoryJndiName"><string value="java:JmsXA"/></property>
- <property name="destinationJndiName"><string value="queue/JbpmJobQueue"/></property>
- </bean>
-
<bean name="jbpm.jms.connector.job.service" class="org.jbpm.jms.JmsConnectorServiceFactory">
- <field name="jbpmConfiguration">
+ <field name="jbpmConfiguration">
<ref bean="jbpm.configuration" />
</field>
- <property name="connectionFactoryJndiName"><string value="java:JmsXA"/></property>
- <property name="destinationJndiName"><string value="queue/JbpmJobQueue"/></property>
+ <property name="connectionFactoryJndiName">
+ <string value="java:JmsXA" />
+ </property>
+ <property name="destinationJndiName">
+ <string value="queue/JbpmJobQueue" />
+ </property>
</bean>
<!-- employ the context class loader -->
Modified: jbpm3/branches/jbpm-3.2-soa/enterprise-jee5/src/main/java/org/jbpm/jms/ExecuteJobCommand.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/enterprise-jee5/src/main/java/org/jbpm/jms/ExecuteJobCommand.java 2010-11-21 13:43:03 UTC (rev 6837)
+++ jbpm3/branches/jbpm-3.2-soa/enterprise-jee5/src/main/java/org/jbpm/jms/ExecuteJobCommand.java 2010-11-23 13:45:16 UTC (rev 6838)
@@ -92,7 +92,7 @@
Timer timer = jbpmContext.getJobSession().loadTimer(job.getId());
JmsConnectorService schedulerService = (JmsConnectorService) jbpmContext.getServices()
.getSchedulerService();
- schedulerService.sendWithoutSaving(timer);
+ schedulerService.sendMessage(timer);
}
}
Modified: jbpm3/branches/jbpm-3.2-soa/enterprise-jee5/src/main/java/org/jbpm/jms/JmsConnectorService.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/enterprise-jee5/src/main/java/org/jbpm/jms/JmsConnectorService.java 2010-11-21 13:43:03 UTC (rev 6837)
+++ jbpm3/branches/jbpm-3.2-soa/enterprise-jee5/src/main/java/org/jbpm/jms/JmsConnectorService.java 2010-11-23 13:45:16 UTC (rev 6838)
@@ -21,9 +21,6 @@
*/
package org.jbpm.jms;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-
import javax.jms.Connection;
import javax.jms.JMSException;
import javax.jms.Message;
@@ -32,7 +29,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jbpm.JbpmContext;
+
import org.jbpm.JbpmException;
import org.jbpm.db.JobSession;
import org.jbpm.graph.exe.ProcessInstance;
@@ -43,56 +40,48 @@
import org.jbpm.scheduler.SchedulerService;
public class JmsConnectorService implements MessageService, SchedulerService {
-
- private final JobSession jobSession;
- private final JmsConnectorServiceFactory factory;
- private static final String JMS_PROP_SCHEDULED = "JMS_JBOSS_SCHEDULED_DELIVERY";
- private static final String JMS_PROP_GROUP = "JMSXGroupID";
- private static final String JBPM_GROUP_PREFIX = "jBPMPID";
-
- private static final DateFormat sdf = new SimpleDateFormat("yyyy.MM.dd G 'at' HH:mm:ss z");
- private static final long serialVersionUID = 1L;
+ private final JmsConnectorServiceFactory serviceFactory;
+ private final Connection connection;
+
+ private static final String SCHEDULED_DELIVERY_PROP = "JMS_JBOSS_SCHEDULED_DELIVERY";
+ private static final String GROUP_ID_PROP = "JMSXGroupID";
+ private static final String GROUP_PREFIX = "jBPMPID";
+ private static final long serialVersionUID = 2L;
+
private static final Log log = LogFactory.getLog(JmsConnectorService.class);
-
- public JmsConnectorService(JmsConnectorServiceFactory factory) throws JMSException {
- JbpmContext jbpmContext = factory.getJbpmConfiguration().getCurrentJbpmContext();
- if (jbpmContext == null) throw new JbpmException("no active jbpm context");
- jobSession = jbpmContext.getJobSession();
-
- this.factory = factory;
+
+ JmsConnectorService(JmsConnectorServiceFactory serviceFactory) throws JMSException {
+ connection = serviceFactory.getConnectionFactory().createConnection();
+ this.serviceFactory = serviceFactory;
}
+ private JobSession getJobSession() {
+ return serviceFactory.getJbpmConfiguration().getCurrentJbpmContext().getJobSession();
+ }
+
public void send(Job job) {
- jobSession.saveJob(job);
+ getJobSession().saveJob(job);
try {
- sendWithoutSaving(job);
+ sendMessage(job);
}
catch (JMSException e) {
throw new JbpmException("failed to send job message", e);
}
}
- void sendWithoutSaving(Job job) throws JMSException {
- Connection connection = factory.getConnectionFactory().createConnection();
+ final void sendMessage(Job job) throws JMSException {
+ Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
try {
- Session session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
-
Message message = session.createMessage();
populateMessage(message, job);
- MessageProducer messageProducer = session.createProducer(factory.getDestination());
+ MessageProducer messageProducer = session.createProducer(serviceFactory.getDestination());
messageProducer.send(message);
}
finally {
- // there is no need to close the sessions and producers of a closed connection
- // http://download.oracle.com/javaee/1.4/api/javax/jms/Connection.html#close()
- try {
- connection.close();
- }
- catch (JMSException e) {
- log.warn("failed to close jms connection", e);
- }
+ // there is no need to close the producers of a closed session
+ session.close();
}
}
@@ -101,21 +90,17 @@
if (job instanceof Timer) {
Timer timer = (Timer) job;
-
- if(log.isDebugEnabled()) {
- log.debug("Creating timer for job: "+job.getId()+" to execute at: "+(timer.getDueDate() == null ? "no set date" : sdf.format(timer.getDueDate())));
+
+ if (log.isDebugEnabled()) {
+ log.debug("scheduling " + timer + " to execute at " + timer.getDueDate());
}
- message.setLongProperty(JMS_PROP_SCHEDULED, timer.getDueDate().getTime());
- //higher priority for timers.
+ message.setLongProperty(SCHEDULED_DELIVERY_PROP, timer.getDueDate().getTime());
+ // raise timer priority
message.setJMSPriority(9);
}
-
- if(!(job instanceof Timer))
- {
- if(job.isExclusive())
- {
- message.setStringProperty(JMS_PROP_GROUP, JBPM_GROUP_PREFIX+job.getProcessInstance().getId());
- }
+
+ if (job.isExclusive()) {
+ message.setStringProperty(GROUP_ID_PROP, GROUP_PREFIX + job.getProcessInstance().getId());
}
}
@@ -124,18 +109,23 @@
}
public void deleteTimer(Timer timer) {
- jobSession.deleteJob(timer);
+ getJobSession().deleteJob(timer);
}
public void deleteTimersByName(String timerName, Token token) {
- jobSession.deleteTimersByName(timerName, token);
+ getJobSession().deleteTimersByName(timerName, token);
}
public void deleteTimersByProcessInstance(ProcessInstance processInstance) {
- jobSession.deleteJobsForProcessInstance(processInstance);
+ getJobSession().deleteJobsForProcessInstance(processInstance);
}
public void close() {
- //nothing to do...
+ try {
+ connection.close();
+ }
+ catch (JMSException e) {
+ throw new JbpmException("failed to close jms connection", e);
+ }
}
}
13 years, 6 months
JBoss JBPM SVN: r6837 - in jbpm4/trunk/modules: pvm/src/main/java/org/jbpm/pvm/internal/util and 2 other directories.
by do-not-reply@jboss.org
Author: rebody
Date: 2010-11-21 08:43:03 -0500 (Sun, 21 Nov 2010)
New Revision: 6837
Added:
jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/bpmn/test/task/UserTaskTest.java
jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/userTask.bpmn.xml
Modified:
jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/AbstractTaskBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java
Log:
JBPM-2921 provide assignment-handler in BPMN
Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/AbstractTaskBinding.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/AbstractTaskBinding.java 2010-11-21 12:55:19 UTC (rev 6836)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/AbstractTaskBinding.java 2010-11-21 13:43:03 UTC (rev 6837)
@@ -7,6 +7,8 @@
import org.jbpm.pvm.internal.el.Expression;
import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
import org.jbpm.pvm.internal.util.XmlUtil;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
+import org.jbpm.pvm.internal.wire.usercode.UserCodeReference;
import org.jbpm.pvm.internal.xml.Parse;
import org.w3c.dom.Element;
@@ -72,6 +74,12 @@
taskDefinition.setAssigneeExpression(expression);
} else if (POTENTIAL_OWNER.equals(type) && "user".equals(scope)) { // default is group
taskDefinition.setCandidateUsersExpression(expression);
+ } else if ("assignment-handler".equals(scope)) {
+ UserCodeReference assignmentHandlerReference = new UserCodeReference();
+
+ ObjectDescriptor objectDescriptor = new ObjectDescriptor(formalExpression);
+ assignmentHandlerReference.setDescriptor(objectDescriptor);
+ taskDefinition.setAssignmentHandlerReference(assignmentHandlerReference);
} else {
taskDefinition.setCandidateGroupsExpression(expression);
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java 2010-11-21 12:55:19 UTC (rev 6836)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java 2010-11-21 13:43:03 UTC (rev 6837)
@@ -199,7 +199,7 @@
}
public static Method findMethod(Class<?> clazz, String methodName, List<ArgDescriptor> argDescriptors, Object[] args) {
- if (log.isTraceEnabled()) log.trace("searching for method "+methodName+" in "+clazz.getName());
+ if (log.isTraceEnabled()) log.trace("searching for method " + methodName + " in " + clazz.getName());
Method[] candidates = clazz.getDeclaredMethods();
for (int i=0; i<candidates.length; i++) {
Method candidate = candidates[i];
@@ -208,13 +208,13 @@
) {
if (log.isTraceEnabled()) {
- if (log.isTraceEnabled()) log.trace("found matching method "+clazz.getName()+"."+methodName);
+ if (log.isTraceEnabled()) log.trace("found matching method " + clazz.getName() + "." + methodName);
}
return candidate;
}
}
- if (clazz.getSuperclass()!=null) {
+ if (clazz.getSuperclass() != null) {
return findMethod(clazz.getSuperclass(), methodName, argDescriptors, args);
}
return null;
@@ -222,7 +222,7 @@
public static Constructor<?> findConstructor(Class<?> clazz, List<ArgDescriptor> argDescriptors, Object[] args) {
Constructor<?>[] constructors = clazz.getDeclaredConstructors();
- for (int i=0; i<constructors.length; i++) {
+ for (int i = 0; i < constructors.length; i++) {
if (isArgumentMatch(constructors[i].getParameterTypes(), argDescriptors, args)) {
return constructors[i];
}
@@ -231,18 +231,18 @@
}
public static boolean isArgumentMatch(Class<?>[] parameterTypes, List<ArgDescriptor> argDescriptors, Object[] args) {
- int nbrOfArgs = args!=null ? args.length : 0;
- int nbrOfParameterTypes = parameterTypes!=null ? parameterTypes.length : 0;
+ int nbrOfArgs = args != null ? args.length : 0;
+ int nbrOfParameterTypes = parameterTypes != null ? parameterTypes.length : 0;
- if (nbrOfArgs!=nbrOfParameterTypes) {
+ if (nbrOfArgs != nbrOfParameterTypes) {
return false;
}
- if (nbrOfArgs==0) {
+ if (nbrOfArgs == 0) {
return true;
}
- for (int i=0; i<parameterTypes.length; i++) {
+ for (int i = 0; i < parameterTypes.length; i++) {
Class<?> parameterType = parameterTypes[i];
String argTypeName;
if (argDescriptors == null || (argTypeName = argDescriptors.get(i).getTypeName()) == null) {
Added: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/bpmn/test/task/UserTaskTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/bpmn/test/task/UserTaskTest.java (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/bpmn/test/task/UserTaskTest.java 2010-11-21 13:43:03 UTC (rev 6837)
@@ -0,0 +1,42 @@
+package org.jbpm.bpmn.test.task;
+
+import java.util.List;
+
+import org.jbpm.api.NewDeployment;
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.model.OpenExecution;
+import org.jbpm.api.task.Assignable;
+import org.jbpm.api.task.AssignmentHandler;
+import org.jbpm.api.task.Task;
+import org.jbpm.test.JbpmTestCase;
+
+
+public class UserTaskTest extends JbpmTestCase {
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ NewDeployment deployment = repositoryService.createDeployment();
+ deployment.addResourceFromClasspath("org/jbpm/bpmn/userTask.bpmn.xml");
+ registerDeployment(deployment.deploy());
+ }
+
+ public void testAssignmentHandler() {
+ ProcessInstance pi = executionService.startProcessInstanceByKey("userTaskProcess");
+
+ assertNotNull(pi.getId());
+
+ List<Task> allTasks = taskService.findPersonalTasks("johndoe");
+ assertEquals(1, allTasks.size());
+
+ taskService.completeTask(allTasks.get(0).getId());
+ assertProcessInstanceEnded(pi);
+ }
+
+ public static class TaskHandler implements AssignmentHandler {
+ public void assign(Assignable assignable, OpenExecution execution) {
+ assignable.setAssignee("johndoe");
+ }
+ }
+
+}
Added: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/userTask.bpmn.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/userTask.bpmn.xml (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/userTask.bpmn.xml 2010-11-21 13:43:03 UTC (rev 6837)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<definitions id="sid-e471f2be-74cc-4f20-a201-09327449efdf"
+ typeLanguage="http://www.w3.org/2001/XMLSchema"
+ expressionLanguage="http://www.w3.org/1999/XPath"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ targetNamespace="http://www.omg.org/bpmn20"
+ xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
+ xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
+ xmlns:jbpm="http://jbpm.org/bpmn2">
+ <process id="userTaskProcess" name="userTaskProcess">
+ <startEvent name="Process start" id="start"/>
+ <sequenceFlow targetRef="userTask" sourceRef="start" name="flow2Manual" id="flow1"/>
+ <userTask implementation="other" name="Sales operation" id="userTask">
+ <potentialOwner jbpm:type="assignment-handler">
+ <resourceRef>sales</resourceRef>
+ <resourceAssignmentExpression>
+ <formalExpression>org.jbpm.bpmn.test.task.UserTaskTest$TaskHandler</formalExpression>
+ </resourceAssignmentExpression>
+ </potentialOwner>
+ </userTask>
+ <sequenceFlow targetRef="end" sourceRef="userTask" name="flow2End" id="flow3"/>
+ <endEvent name="Process end" id="end"/>
+ </process>
+</definitions>
13 years, 6 months
JBoss JBPM SVN: r6836 - in jbpm4/trunk/modules: examples/src/test/java/org/jbpm/examples/bpmn and 4 other directories.
by do-not-reply@jboss.org
Author: rebody
Date: 2010-11-21 07:55:19 -0500 (Sun, 21 Nov 2010)
New Revision: 6836
Added:
jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/SignalStartEventActivity.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/subprocess/
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/subprocess/SignalStartEventTest.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/subprocess/
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/subprocess/signal_start_sub_process.bpmn.xml
Modified:
jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/StartEventBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
Log:
JBPM-2723 signal start event
Added: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/SignalStartEventActivity.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/SignalStartEventActivity.java (rev 0)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/SignalStartEventActivity.java 2010-11-21 12:55:19 UTC (rev 6836)
@@ -0,0 +1,52 @@
+/*
+ * 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.bpmn.flownodes;
+
+import org.jbpm.api.Execution;
+import org.jbpm.api.listener.EventListener;
+import org.jbpm.api.listener.EventListenerExecution;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.op.AtomicOperation;
+
+/**
+ * @author Huisheng Xu
+ */
+public class SignalStartEventActivity extends NoneStartEventActivity implements BpmnEvent, EventListener {
+
+ private static final long serialVersionUID = 1L;
+
+ private String activityName;
+
+ public void notify(EventListenerExecution execution) {
+ ExecutionImpl parentExecution = (ExecutionImpl) execution;
+ ExecutionImpl childExecution = parentExecution.createExecution(activityName);
+ childExecution.setActivity(parentExecution.getProcessDefinition().findActivity(activityName));
+ childExecution.setState(Execution.STATE_ACTIVE_ROOT);
+
+ childExecution.performAtomicOperation(AtomicOperation.EXECUTE_ACTIVITY);
+ }
+
+ public void setActivityName(String activityName) {
+ this.activityName = activityName;
+ }
+
+}
Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/StartEventBinding.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/StartEventBinding.java 2010-11-21 03:47:28 UTC (rev 6835)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/StartEventBinding.java 2010-11-21 12:55:19 UTC (rev 6836)
@@ -29,6 +29,8 @@
import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.job.StartProcessTimer;
import org.jbpm.pvm.internal.model.ActivityImpl;
+import org.jbpm.pvm.internal.model.EventImpl;
+import org.jbpm.pvm.internal.model.EventListenerReference;
import org.jbpm.pvm.internal.model.TimerDefinitionImpl;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.util.XmlUtil;
@@ -38,51 +40,56 @@
public class StartEventBinding extends BpmnBinding {
-
+
private static final Log LOG = Log.getLog(StartEventBinding.class.getName());
public StartEventBinding() {
- super("startEvent");
+ super("startEvent");
}
-
+
public Object parse(Element element, Parse parse, BpmnParser bpmnParser) {
ActivityImpl startActivity = parse.contextStackFind(ActivityImpl.class);
BpmnProcessDefinition processDefinition = parse.contextStackFind(BpmnProcessDefinition.class);
-
+
if (processDefinition.getInitial()==null) {
processDefinition.setInitial(startActivity);
-
+
} else if (startActivity.getParentActivity()==null) {
parse.addProblem("multiple start events not yet supported", element);
}
-
+
String id = XmlUtil.attribute(element, "id", parse);
Element eventDefinition = XmlUtil.element(element);
- if (eventDefinition != null && "timerEventDefinition".equals(eventDefinition.getNodeName())) {
- return createTimerStartEvent(processDefinition, eventDefinition, id, bpmnParser, parse);
- } else if (eventDefinition != null){
- parse.addProblem("Invalid eventDefinition type : " + eventDefinition.getNodeName());
+
+ if (eventDefinition != null) {
+ if ("timerEventDefinition".equals(eventDefinition.getNodeName())) {
+ return createTimerStartEvent(processDefinition, eventDefinition, id, bpmnParser, parse);
+ } else if ("signalEventDefinition".equals(eventDefinition.getNodeName())) {
+ return createSignalStartEvent(processDefinition, eventDefinition, id, bpmnParser, parse);
+ } else {
+ parse.addProblem("Invalid eventDefinition type : " + eventDefinition.getNodeName());
+ }
}
-
+
return new NoneStartEventActivity(); // default
}
-
+
/**
* Timer start event
*/
- protected TimerStartEventActivity createTimerStartEvent(BpmnProcessDefinition processDefinition,
+ protected TimerStartEventActivity createTimerStartEvent(BpmnProcessDefinition processDefinition,
Element timerEventDefinition, String eventId, BpmnParser parser, Parse parse) {
-
+
TimerStartEventActivity timerStartEvent = new TimerStartEventActivity();
TimerDefinitionImpl timerDefinition = parser.parseTimerEventDefinition(timerEventDefinition, parse, eventId);
-
+
if (timerDefinition == null) { // problem explanation will already be added to parse, no need to do it here
return null;
}
-
+
StartProcessTimer startProcessTimer = new StartProcessTimer();
startProcessTimer.setProcessDefinitionName(processDefinition.getName());
-
+
if (timerDefinition.getDueDate() != null) {
startProcessTimer.setDuedate(timerDefinition.getDueDate());
} else if (timerDefinition.getDueDateDescription() != null) {
@@ -90,20 +97,41 @@
} else if (timerDefinition.getCronExpression() != null) {
startProcessTimer.setIntervalExpression(timerDefinition.getCronExpression());
}
-
+
if (LOG.isDebugEnabled()) {
- LOG.debug("Scheduling a new start process timer for process definition "
- + processDefinition.getName());
+ LOG.debug("Scheduling a new start process timer for process definition "
+ + processDefinition.getName());
}
-
+
deleteStartProcessTimers(processDefinition.getName()); // Only the latest procDef should have a timer start
startProcessTimer.schedule();
return timerStartEvent;
}
-
+
+ protected SignalStartEventActivity createSignalStartEvent(BpmnProcessDefinition processDefinition,
+ Element signalEventDefinition, String eventId, BpmnParser parser, Parse parse) {
+ SignalStartEventActivity signalStartEvent = new SignalStartEventActivity();
+
+ signalStartEvent.setActivityName(eventId);
+
+ String eventName = XmlUtil.attribute(signalEventDefinition, "signalRef");
+ EventImpl event = processDefinition.getEvent(eventName);
+ if (event == null) {
+ event = processDefinition.createEvent(eventName);
+ }
+ EventListenerReference eventListenerReference = event.createEventListenerReference(signalStartEvent);
+ eventListenerReference.setPropagationEnabled(true);
+
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("activityId : " + eventId + ", event : " + event);
+ }
+
+ return signalStartEvent;
+ }
+
/**
* Deletes all existing timer start events for a given process definition.
- *
+ *
* This is required when a new version of a process definition with a timer start is deployed:
* only the latest may version may be started by the timer start event.
*/
@@ -117,5 +145,5 @@
dbSession.delete(spt);
}
}
-
+
}
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/subprocess/SignalStartEventTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/subprocess/SignalStartEventTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/subprocess/SignalStartEventTest.java 2010-11-21 12:55:19 UTC (rev 6836)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.examples.bpmn.subprocess;
+
+import org.jbpm.api.NewDeployment;
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.history.HistoryProcessInstance;
+import org.jbpm.test.JbpmTestCase;
+
+/**
+ *
+ * @author Huisheng Xu
+ */
+public class SignalStartEventTest extends JbpmTestCase {
+
+ public void testSignalStart() {
+ NewDeployment deployment = repositoryService.createDeployment();
+ deployment.addResourceFromClasspath("org/jbpm/examples/bpmn/subprocess/signal_start_sub_process.bpmn.xml");
+ registerDeployment(deployment.deploy());
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("signal_start_sub_process");
+
+ assertEquals(2, taskService.createTaskQuery().list().size());
+ }
+
+}
Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/subprocess/signal_start_sub_process.bpmn.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/subprocess/signal_start_sub_process.bpmn.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/subprocess/signal_start_sub_process.bpmn.xml 2010-11-21 12:55:19 UTC (rev 6836)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
+ xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
+ typeLanguage="http://www.w3.org/2001/XMLSchema"
+ expressionLanguage="http://www.w3.org/1999/XPath"
+ targetNamespace="http://jbpm.org/example/bpmn2/signal_start_sub_process"
+ xmlns:jbpm="http://jbpm.org/bpmn2">
+
+ <signal id="MySignal" name="MySignal" />
+
+ <process id="signal_start_sub_process" name="Signal Start Sub Process">
+
+ <startEvent id="startEvent" name="StartProcess"/>
+
+ <sequenceFlow id="flow1" sourceRef="startEvent" targetRef="signalEvent"/>
+
+ <intermediateThrowEvent id="signalEvent" name="Signal Event">
+ <signalEventDefinition signalRef="MySignal"/>
+ </intermediateThrowEvent>
+
+ <sequenceFlow id="flow2" sourceRef="signalEvent" targetRef="subTask1"/>
+
+ <userTask id="subTask1" name="User Task" />
+
+ <sequenceFlow id="flow3" sourceRef="subTask1" targetRef="end"/>
+
+ <endEvent id="end" name="EndEvent">
+ <terminateEventDefinition/>
+ </endEvent>
+
+ <subProcess id="subProcess" name="HelloSignal" triggeredByEvent="true">
+ <startEvent id="subStart" name="StartSubProcess">
+ <signalEventDefinition signalRef="MySignal"/>
+ </startEvent>
+
+ <sequenceFlow id="flow4" sourceRef="subStart" targetRef="subTask2"/>
+
+ <userTask id="subTask2" name="User Task2" />
+
+ <sequenceFlow id="flow5" sourceRef="subTask2" targetRef="subEnd"/>
+
+ <endEvent id="subEnd" name="EndEvent"/>
+ </subProcess>
+
+ </process>
+</definitions>
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2010-11-21 03:47:28 UTC (rev 6835)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2010-11-21 12:55:19 UTC (rev 6836)
@@ -212,13 +212,13 @@
public void start() {
if (!STATE_CREATED.equals(state)) {
- throw new JbpmException(toString()+" is already begun: "+state);
+ throw new JbpmException(toString() + " is already begun: " + state);
}
this.state = STATE_ACTIVE_ROOT;
ExecutionImpl scopedExecution = initializeScopes();
fire(Event.START, getProcessDefinition());
- if (getActivity()!=null) {
+ if (getActivity() != null) {
scopedExecution.performAtomicOperation(AtomicOperation.EXECUTE_ACTIVITY);
}
}
@@ -229,7 +229,7 @@
ActivityImpl initial = getProcessDefinition().getInitial();
ExecutionImpl scopedExecution = null;
- if (initial!=null) {
+ if (initial != null) {
enteredActivities.add(initial);
ActivityImpl parentActivity = initial.getParentActivity();
while (parentActivity!=null) {
13 years, 6 months
JBoss JBPM SVN: r6835 - jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes.
by do-not-reply@jboss.org
Author: rebody
Date: 2010-11-20 22:47:28 -0500 (Sat, 20 Nov 2010)
New Revision: 6835
Modified:
jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/BpmnActivity.java
jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateCatchSignalEvent.java
Log:
JBPM-2734 if cannot find execution for signal, don't throw a NPE
Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/BpmnActivity.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/BpmnActivity.java 2010-11-21 03:22:34 UTC (rev 6834)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/BpmnActivity.java 2010-11-21 03:47:28 UTC (rev 6835)
@@ -24,6 +24,7 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -100,7 +101,7 @@
execution.end();
}
- Map<Transition, ExecutionImpl> childExecutionsMap = new HashMap<Transition, ExecutionImpl>();
+ Map<Transition, ExecutionImpl> childExecutionsMap = new LinkedHashMap<Transition, ExecutionImpl>();
for (Transition transition : transitions) {
ExecutionImpl concurrentExecution = concurrentRoot.createExecution(transition.getName());
concurrentExecution.setActivity(activity);
@@ -161,6 +162,9 @@
throw new JbpmException("No outgoing sequence flow found for " + execution.getActivityName());
}
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("forking transitions : " + forkingTransitions);
+ }
return forkingTransitions;
}
Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateCatchSignalEvent.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateCatchSignalEvent.java 2010-11-21 03:22:34 UTC (rev 6834)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateCatchSignalEvent.java 2010-11-21 03:47:28 UTC (rev 6835)
@@ -27,6 +27,7 @@
import org.jbpm.api.activity.ActivityExecution;
import org.jbpm.api.listener.EventListener;
import org.jbpm.api.listener.EventListenerExecution;
+import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.model.ExecutionImpl;
/**
@@ -35,6 +36,8 @@
*/
public class IntermediateCatchSignalEvent extends BpmnExternalActivity implements EventListener, BpmnEvent {
+ private static final Log log = Log.getLog(IntermediateCatchSignalEvent.class.getName());
+
private static final long serialVersionUID = 1L;
private String signalCode;
@@ -56,7 +59,12 @@
public void notify(EventListenerExecution execution) throws Exception {
Execution processInstance = execution.getProcessInstance();
ExecutionImpl executionImpl = (ExecutionImpl) processInstance.findActiveExecutionIn(activityName);
- proceed(executionImpl, findOutgoingSequenceFlow(executionImpl, CONDITIONS_CHECKED));
+
+ if (executionImpl == null) {
+ log.info("cannot find execution for : " + activityName);
+ } else {
+ proceed(executionImpl, findOutgoingSequenceFlow(executionImpl, CONDITIONS_CHECKED));
+ }
}
public void signal(ActivityExecution execution, String signalName, Map<String, ?> parameters) {
13 years, 6 months
JBoss JBPM SVN: r6834 - in jbpm4/trunk/modules: examples/src/test/java/org/jbpm/examples/bpmn/event/signal and 2 other directories.
by do-not-reply@jboss.org
Author: rebody
Date: 2010-11-20 22:22:34 -0500 (Sat, 20 Nov 2010)
New Revision: 6834
Added:
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/signal/CatchSignalEventTest.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/event/signal/catch_signal_event_none_interrupting.bpmn.xml
Modified:
jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateCatchEventBinding.java
jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateCatchSignalEvent.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
Log:
JBPM-2734 catch signal event
Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateCatchEventBinding.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateCatchEventBinding.java 2010-11-18 05:05:16 UTC (rev 6833)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateCatchEventBinding.java 2010-11-21 03:22:34 UTC (rev 6834)
@@ -21,9 +21,12 @@
*/
package org.jbpm.bpmn.flownodes;
+import org.jbpm.bpmn.model.BpmnProcessDefinition;
import org.jbpm.bpmn.parser.BpmnParser;
+import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.model.ActivityImpl;
import org.jbpm.pvm.internal.model.EventImpl;
+import org.jbpm.pvm.internal.model.EventListenerReference;
import org.jbpm.pvm.internal.model.TimerDefinitionImpl;
import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.pvm.internal.xml.Parse;
@@ -34,6 +37,8 @@
*/
public class IntermediateCatchEventBinding extends BpmnBinding {
+ private static final Log log = Log.getLog(IntermediateCatchEventBinding.class.getName());
+
public IntermediateCatchEventBinding() {
super("intermediateCatchEvent");
}
@@ -75,9 +80,26 @@
protected IntermediateCatchSignalEvent createIntermediateSignalCatchEvent(String catchEventId,
Element eventDefinitionElement, BpmnParser parser, Parse parse) {
+ String eventName = XmlUtil.attribute(eventDefinitionElement, "signalRef");
+ BpmnProcessDefinition processDefinition = parse.contextStackFind(BpmnProcessDefinition.class);
+
IntermediateCatchSignalEvent intermediateCatchSignalEvent = new IntermediateCatchSignalEvent();
- intermediateCatchSignalEvent.setSignalCode(XmlUtil.attribute(eventDefinitionElement, "signalCode"));
+ intermediateCatchSignalEvent.setSignalCode(eventName);
+ intermediateCatchSignalEvent.setActivityName(catchEventId);
+ BpmnProcessDefinition bpmnProcessDefinition = parse.contextStackFind(BpmnProcessDefinition.class);
+
+ EventImpl event = processDefinition.getEvent(eventName);
+ if (event == null) {
+ event = processDefinition.createEvent(eventName);
+ }
+ EventListenerReference eventListenerReference = event.createEventListenerReference(intermediateCatchSignalEvent);
+ eventListenerReference.setPropagationEnabled(true);
+
+ if (log.isDebugEnabled()) {
+ log.debug("activityId : " + catchEventId + ", event : " + event);
+ }
+
return intermediateCatchSignalEvent;
}
Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateCatchSignalEvent.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateCatchSignalEvent.java 2010-11-18 05:05:16 UTC (rev 6833)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateCatchSignalEvent.java 2010-11-21 03:22:34 UTC (rev 6834)
@@ -21,6 +21,9 @@
*/
package org.jbpm.bpmn.flownodes;
+import java.util.Map;
+
+import org.jbpm.api.Execution;
import org.jbpm.api.activity.ActivityExecution;
import org.jbpm.api.listener.EventListener;
import org.jbpm.api.listener.EventListenerExecution;
@@ -30,12 +33,14 @@
*
* @author Huisheng Xu
*/
-public class IntermediateCatchSignalEvent extends BpmnActivity implements EventListener, BpmnEvent {
+public class IntermediateCatchSignalEvent extends BpmnExternalActivity implements EventListener, BpmnEvent {
private static final long serialVersionUID = 1L;
private String signalCode;
+ private String activityName;
+
public void execute(ActivityExecution execution) {
execute((ExecutionImpl) execution);
}
@@ -49,12 +54,20 @@
* The given execution should be continued.
*/
public void notify(EventListenerExecution execution) throws Exception {
- ExecutionImpl executionImpl = (ExecutionImpl) execution;
+ Execution processInstance = execution.getProcessInstance();
+ ExecutionImpl executionImpl = (ExecutionImpl) processInstance.findActiveExecutionIn(activityName);
proceed(executionImpl, findOutgoingSequenceFlow(executionImpl, CONDITIONS_CHECKED));
}
+ public void signal(ActivityExecution execution, String signalName, Map<String, ?> parameters) {
+ }
+
public void setSignalCode(String signalCode) {
this.signalCode = signalCode;
}
+ public void setActivityName(String activityName) {
+ this.activityName = activityName;
+ }
+
}
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/signal/CatchSignalEventTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/signal/CatchSignalEventTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/signal/CatchSignalEventTest.java 2010-11-21 03:22:34 UTC (rev 6834)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.examples.bpmn.event.signal;
+
+import org.jbpm.api.NewDeployment;
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.history.HistoryProcessInstance;
+import org.jbpm.test.JbpmTestCase;
+
+/**
+ *
+ * @author Huisheng Xu
+ */
+public class CatchSignalEventTest extends JbpmTestCase {
+
+ public void testInterruptingSignalThrowEvent() {
+ NewDeployment deployment = repositoryService.createDeployment();
+ deployment.addResourceFromClasspath("org/jbpm/examples/bpmn/event/signal/catch_signal_event_none_interrupting.bpmn.xml");
+ registerDeployment(deployment.deploy());
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("catch_signal_event");
+
+ assertEquals(2, taskService.createTaskQuery().list().size());
+ }
+
+}
Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/event/signal/catch_signal_event_none_interrupting.bpmn.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/event/signal/catch_signal_event_none_interrupting.bpmn.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/event/signal/catch_signal_event_none_interrupting.bpmn.xml 2010-11-21 03:22:34 UTC (rev 6834)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
+ xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
+ typeLanguage="http://www.w3.org/2001/XMLSchema"
+ expressionLanguage="http://www.w3.org/1999/XPath"
+ targetNamespace="http://jbpm.org/example/bpmn2/catch_signal_event"
+ xmlns:jbpm="http://jbpm.org/bpmn2">
+
+ <signal id="MySignal" name="MySignal" />
+
+ <process id="catch_signal_event" name="Signal Catch Event Process">
+ <startEvent id="startEvent" name="StartProcess"/>
+
+ <sequenceFlow id="flow1" sourceRef="startEvent" targetRef="parallelGatewaySplit"/>
+
+ <parallelGateway id="parallelGatewaySplit" name="Split"
+ gatewayDirection="Diverging"/>
+
+ <sequenceFlow id="flow2" sourceRef="parallelGatewaySplit" targetRef="catchSignal"/>
+
+ <sequenceFlow id="flow3" sourceRef="parallelGatewaySplit" targetRef="throwSignal"/>
+
+ <intermediateCatchEvent id="catchSignal" name="Catch Signal Event">
+ <signalEventDefinition signalRef="MySignal"/>
+ </intermediateCatchEvent>
+
+ <intermediateThrowEvent id="throwSignal" name="Throw Signal Event">
+ <signalEventDefinition signalRef="MySignal"/>
+ </intermediateThrowEvent>
+
+ <sequenceFlow id="flow4" sourceRef="catchSignal" targetRef="subTask1"/>
+
+ <userTask id="subTask1" name="User Task1" />
+
+ <sequenceFlow id="flow5" sourceRef="throwSignal" targetRef="subTask2"/>
+
+ <userTask id="subTask2" name="User Task2" />
+
+ <sequenceFlow id="flow6" sourceRef="subTask1" targetRef="parallelGatewayJoin"/>
+
+ <sequenceFlow id="flow7" sourceRef="subTask2" targetRef="parallelGatewayJoin"/>
+
+ <parallelGateway id="parallelGatewayJoin" name="Join"
+ gatewayDirection="Converging"/>
+
+ <sequenceFlow id="flow8" sourceRef="parallelGatewayJoin" targetRef="endEvent"/>
+
+ <endEvent id="endEvent" name="EndProcess"/>
+ </process>
+</definitions>
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2010-11-18 05:05:16 UTC (rev 6833)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2010-11-21 03:22:34 UTC (rev 6834)
@@ -573,6 +573,9 @@
public void fire(String eventName, ObservableElementImpl observableElement,
AtomicOperation eventCompletedOperation) {
+ if (log.isDebugEnabled()) {
+ log.debug("observableElement : " + observableElement + ", fire event : " + eventName);
+ }
EventImpl event = findEvent(observableElement, eventName);
if (event != null) {
setEvent(event);
@@ -587,12 +590,12 @@
}
public static EventImpl findEvent(ObservableElementImpl observableElement, String eventName) {
- if (observableElement==null) {
+ if (observableElement == null) {
return null;
}
EventImpl event = observableElement.getEvent(eventName);
- if (event!=null) {
+ if (event != null) {
return event;
}
13 years, 6 months
JBoss JBPM SVN: r6833 - in jbpm3/branches/jbpm-3.2-soa: core and 1 other directory.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-11-18 00:05:16 -0500 (Thu, 18 Nov 2010)
New Revision: 6833
Modified:
jbpm3/branches/jbpm-3.2-soa/core/pom.xml
jbpm3/branches/jbpm-3.2-soa/pom.xml
Log:
JBPM-2978 mark jaxen as test dependency
Modified: jbpm3/branches/jbpm-3.2-soa/core/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/core/pom.xml 2010-11-18 00:46:30 UTC (rev 6832)
+++ jbpm3/branches/jbpm-3.2-soa/core/pom.xml 2010-11-18 05:05:16 UTC (rev 6833)
@@ -90,13 +90,7 @@
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>jdom</groupId>
- <artifactId>jdom</artifactId>
- </exclusion>
- </exclusions>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>hsqldb</groupId>
Modified: jbpm3/branches/jbpm-3.2-soa/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/pom.xml 2010-11-18 00:46:30 UTC (rev 6832)
+++ jbpm3/branches/jbpm-3.2-soa/pom.xml 2010-11-18 05:05:16 UTC (rev 6833)
@@ -254,6 +254,10 @@
<version>1.1.1</version>
<exclusions>
<exclusion>
+ <groupId>jdom</groupId>
+ <artifactId>jdom</artifactId>
+ </exclusion>
+ <exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
13 years, 6 months
JBoss JBPM SVN: r6832 - in jbpm3/branches/jbpm-3.2-soa/tomcat: src/main/java/org/jbpm/realm and 1 other directory.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-11-17 19:46:30 -0500 (Wed, 17 Nov 2010)
New Revision: 6832
Modified:
jbpm3/branches/jbpm-3.2-soa/tomcat/.classpath
jbpm3/branches/jbpm-3.2-soa/tomcat/pom.xml
jbpm3/branches/jbpm-3.2-soa/tomcat/src/main/java/org/jbpm/realm/DataSourceRealm.java
Log:
JBPM-2978 build jbpm-tomcat module against tomcat 5.5 and jdk 1.4
Modified: jbpm3/branches/jbpm-3.2-soa/tomcat/.classpath
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/tomcat/.classpath 2010-11-17 17:12:47 UTC (rev 6831)
+++ jbpm3/branches/jbpm-3.2-soa/tomcat/.classpath 2010-11-18 00:46:30 UTC (rev 6832)
@@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Modified: jbpm3/branches/jbpm-3.2-soa/tomcat/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/tomcat/pom.xml 2010-11-17 17:12:47 UTC (rev 6831)
+++ jbpm3/branches/jbpm-3.2-soa/tomcat/pom.xml 2010-11-18 00:46:30 UTC (rev 6832)
@@ -11,32 +11,22 @@
<version>3.2.10-SNAPSHOT</version>
</parent>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
+ <properties>
+ <tomcat.version>5.5.23</tomcat.version>
+ </properties>
- <plugin>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
<dependencies>
- <!-- Provided dependencies -->
<dependency>
- <groupId>org.apache.tomcat</groupId>
+ <groupId>tomcat</groupId>
<artifactId>catalina</artifactId>
- <version>6.0.29</version>
+ <version>${tomcat.version}</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>tomcat</groupId>
+ <artifactId>naming-factory</artifactId>
+ <version>${tomcat.version}</version>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
</project>
Modified: jbpm3/branches/jbpm-3.2-soa/tomcat/src/main/java/org/jbpm/realm/DataSourceRealm.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/tomcat/src/main/java/org/jbpm/realm/DataSourceRealm.java 2010-11-17 17:12:47 UTC (rev 6831)
+++ jbpm3/branches/jbpm-3.2-soa/tomcat/src/main/java/org/jbpm/realm/DataSourceRealm.java 2010-11-18 00:46:30 UTC (rev 6832)
@@ -191,14 +191,14 @@
return new GenericPrincipal(this, username, null, null);
}
- private List<String> getRoles(Connection dbConnection, String username) {
+ private List getRoles(Connection dbConnection, String username) {
PreparedStatement statement = null;
try {
statement = dbConnection.prepareStatement(roleQuery);
statement.setString(1, username);
ResultSet rs = statement.executeQuery();
- List<String> roles = new ArrayList<String>();
+ List roles = new ArrayList();
while (rs.next()) {
roles.add(rs.getString(1));
}
13 years, 6 months
JBoss JBPM SVN: r6831 - jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes.
by do-not-reply@jboss.org
Author: rebody
Date: 2010-11-17 12:12:47 -0500 (Wed, 17 Nov 2010)
New Revision: 6831
Added:
jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateCatchSignalEvent.java
Modified:
jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateCatchEventBinding.java
Log:
JBPM-2734 signal Intermediate Catch Event
Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateCatchEventBinding.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateCatchEventBinding.java 2010-11-17 16:57:06 UTC (rev 6830)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateCatchEventBinding.java 2010-11-17 17:12:47 UTC (rev 6831)
@@ -43,6 +43,8 @@
Element eventDefinition = XmlUtil.element(element);
if ("timerEventDefinition".equals(eventDefinition.getNodeName())) {
return createIntermediateTimerCatchEvent(id, eventDefinition, bpmnParser, parse);
+ } else if ("signalEventDefinition".equals(eventDefinition.getNodeName())) {
+ return createIntermediateSignalCatchEvent(id, eventDefinition, bpmnParser, parse);
} else {
parse.addProblem("Invalid eventDefinition type : " + eventDefinition.getNodeName());
}
@@ -70,4 +72,13 @@
return intermediateCatchTimerEvent;
}
+ protected IntermediateCatchSignalEvent createIntermediateSignalCatchEvent(String catchEventId,
+ Element eventDefinitionElement, BpmnParser parser, Parse parse) {
+
+ IntermediateCatchSignalEvent intermediateCatchSignalEvent = new IntermediateCatchSignalEvent();
+ intermediateCatchSignalEvent.setSignalCode(XmlUtil.attribute(eventDefinitionElement, "signalCode"));
+
+ return intermediateCatchSignalEvent;
+ }
+
}
Added: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateCatchSignalEvent.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateCatchSignalEvent.java (rev 0)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateCatchSignalEvent.java 2010-11-17 17:12:47 UTC (rev 6831)
@@ -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.bpmn.flownodes;
+
+import org.jbpm.api.activity.ActivityExecution;
+import org.jbpm.api.listener.EventListener;
+import org.jbpm.api.listener.EventListenerExecution;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+
+/**
+ *
+ * @author Huisheng Xu
+ */
+public class IntermediateCatchSignalEvent extends BpmnActivity implements EventListener, BpmnEvent {
+
+ private static final long serialVersionUID = 1L;
+
+ private String signalCode;
+
+ public void execute(ActivityExecution execution) {
+ execute((ExecutionImpl) execution);
+ }
+
+ public void execute(ExecutionImpl execution) {
+ execution.waitForSignal();
+ }
+
+ /**
+ * Called when an intermediate timer fires.
+ * The given execution should be continued.
+ */
+ public void notify(EventListenerExecution execution) throws Exception {
+ ExecutionImpl executionImpl = (ExecutionImpl) execution;
+ proceed(executionImpl, findOutgoingSequenceFlow(executionImpl, CONDITIONS_CHECKED));
+ }
+
+ public void setSignalCode(String signalCode) {
+ this.signalCode = signalCode;
+ }
+
+}
13 years, 6 months
JBoss JBPM SVN: r6830 - in jbpm4/trunk/modules: examples/src/test/java/org/jbpm/examples/bpmn/event/escalation and 3 other directories.
by do-not-reply@jboss.org
Author: rebody
Date: 2010-11-17 11:57:06 -0500 (Wed, 17 Nov 2010)
New Revision: 6830
Added:
jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateThrowEscalationEvent.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/escalation/ThrowEscalationEventTest.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/signal/ThrowSignalEventTest.java
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/event/escalation/throw_escalation_event_interrupting.bpmn.xml
jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/event/signal/throw_signal_event_interrupting.bpmn.xml
Modified:
jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateThrowEventBinding.java
Log:
JBPM-2731 Intermediate Throw Escalation Event
Added: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateThrowEscalationEvent.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateThrowEscalationEvent.java (rev 0)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateThrowEscalationEvent.java 2010-11-17 16:57:06 UTC (rev 6830)
@@ -0,0 +1,61 @@
+/*
+ * 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.bpmn.flownodes;
+
+import org.jbpm.api.activity.ActivityExecution;
+import org.jbpm.api.listener.EventListener;
+import org.jbpm.api.listener.EventListenerExecution;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+
+/**
+ *
+ * @author Huisheng Xu
+ */
+public class IntermediateThrowEscalationEvent extends BpmnActivity implements EventListener, BpmnEvent {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String escalationCode;
+
+ public void execute(ActivityExecution execution) {
+ ExecutionImpl executionImpl = (ExecutionImpl) execution;
+ execute(executionImpl);
+ proceed(executionImpl, findOutgoingSequenceFlow(executionImpl, CONDITIONS_CHECKED));
+ }
+
+ public void execute(ExecutionImpl execution) {
+ execution.fire(escalationCode, execution.getActivity());
+ }
+
+ public void notify(EventListenerExecution execution) throws Exception {
+ this.execute((ExecutionImpl) execution);
+ }
+
+ public void setEscalationCode(String escalationCode) {
+ this.escalationCode = escalationCode;
+ }
+
+ public boolean isDefaultEnabled() {
+ return true;
+ }
+
+}
Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateThrowEventBinding.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateThrowEventBinding.java 2010-11-17 05:03:57 UTC (rev 6829)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/IntermediateThrowEventBinding.java 2010-11-17 16:57:06 UTC (rev 6830)
@@ -43,6 +43,8 @@
Element eventDefinition = XmlUtil.element(element);
if ("signalEventDefinition".equals(eventDefinition.getNodeName())) {
return createIntermediateSignalThrowEvent(id, eventDefinition, bpmnParser, parse);
+ } else if ("escalationEventDefinition".equals(eventDefinition.getNodeName())) {
+ return createIntermediateEscalationThrowEvent(id, eventDefinition, bpmnParser, parse);
} else {
parse.addProblem("Invalid eventDefinition type : " + eventDefinition.getNodeName());
}
@@ -62,4 +64,16 @@
return intermediateThrowSignalEvent;
}
+ protected IntermediateThrowEscalationEvent createIntermediateEscalationThrowEvent(String throwEventId,
+ Element eventDefinitionElement, BpmnParser parser, Parse parse) {
+
+ // String eventName = "INTERMEDIATE_SIGNAL_" + throwEventId;
+ String eventName = XmlUtil.attribute(eventDefinitionElement, "escalationRef");
+
+ IntermediateThrowEscalationEvent intermediateThrowEscalationEvent = new IntermediateThrowEscalationEvent();
+ intermediateThrowEscalationEvent.setEscalationCode(eventName);
+
+ return intermediateThrowEscalationEvent;
+ }
+
}
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/escalation/ThrowEscalationEventTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/escalation/ThrowEscalationEventTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/escalation/ThrowEscalationEventTest.java 2010-11-17 16:57:06 UTC (rev 6830)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.examples.bpmn.event.escalation;
+
+import org.jbpm.api.NewDeployment;
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.history.HistoryProcessInstance;
+import org.jbpm.test.JbpmTestCase;
+
+/**
+ *
+ * @author Huisheng Xu
+ */
+public class ThrowEscalationEventTest extends JbpmTestCase {
+
+ public void testInterruptingSignalThrowEvent() {
+ NewDeployment deployment = repositoryService.createDeployment();
+ deployment.addResourceFromClasspath("org/jbpm/examples/bpmn/event/escalation/throw_escalation_event_interrupting.bpmn.xml");
+ registerDeployment(deployment.deploy());
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("throw_escalation_event");
+ // assertProcessInstanceEnded(processInstance);
+
+ HistoryProcessInstance hip = historyService.createHistoryProcessInstanceQuery().uniqueResult();
+ assertNotNull(hip);
+ }
+/*
+ public void testNoneInterruptingSignalBoundaryEvent() {
+ NewDeployment deployment = repositoryService.createDeployment();
+ deployment.addResourceFromClasspath("org/jbpm/examples/bpmn/event/signal/boundary_signal_event_none_interrupting.bpmn.xml");
+ registerDeployment(deployment.deploy());
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("boundary_signal_event");
+ // assertProcessInstanceEnded(processInstance);
+
+ HistoryProcessInstance hip = historyService.createHistoryProcessInstanceQuery().uniqueResult();
+ assertNotNull(hip);
+ }
+*/
+}
Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/signal/ThrowSignalEventTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/signal/ThrowSignalEventTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/event/signal/ThrowSignalEventTest.java 2010-11-17 16:57:06 UTC (rev 6830)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.examples.bpmn.event.signal;
+
+import org.jbpm.api.NewDeployment;
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.history.HistoryProcessInstance;
+import org.jbpm.test.JbpmTestCase;
+
+/**
+ *
+ * @author Huisheng Xu
+ */
+public class ThrowSignalEventTest extends JbpmTestCase {
+
+ public void testInterruptingSignalThrowEvent() {
+ NewDeployment deployment = repositoryService.createDeployment();
+ deployment.addResourceFromClasspath("org/jbpm/examples/bpmn/event/signal/throw_signal_event_interrupting.bpmn.xml");
+ registerDeployment(deployment.deploy());
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("throw_signal_event");
+ // assertProcessInstanceEnded(processInstance);
+
+ HistoryProcessInstance hip = historyService.createHistoryProcessInstanceQuery().uniqueResult();
+ assertNotNull(hip);
+ }
+/*
+ public void testNoneInterruptingSignalBoundaryEvent() {
+ NewDeployment deployment = repositoryService.createDeployment();
+ deployment.addResourceFromClasspath("org/jbpm/examples/bpmn/event/signal/boundary_signal_event_none_interrupting.bpmn.xml");
+ registerDeployment(deployment.deploy());
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("boundary_signal_event");
+ // assertProcessInstanceEnded(processInstance);
+
+ HistoryProcessInstance hip = historyService.createHistoryProcessInstanceQuery().uniqueResult();
+ assertNotNull(hip);
+ }
+*/
+}
Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/event/escalation/throw_escalation_event_interrupting.bpmn.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/event/escalation/throw_escalation_event_interrupting.bpmn.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/event/escalation/throw_escalation_event_interrupting.bpmn.xml 2010-11-17 16:57:06 UTC (rev 6830)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
+ xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
+ typeLanguage="http://www.w3.org/2001/XMLSchema"
+ expressionLanguage="http://www.w3.org/1999/XPath"
+ targetNamespace="http://jbpm.org/example/bpmn2/throw_escalation_event"
+ xmlns:jbpm="http://jbpm.org/bpmn2">
+
+ <signal id="MyEscalation" name="MyEscalation" />
+
+ <process id="throw_escalation_event" name="Escalation Throw Event Process">
+ <startEvent id="startEvent" name="StartProcess"/>
+ <sequenceFlow id="flow1" sourceRef="startEvent" targetRef="subProcess"/>
+ <subProcess id="subProcess" name="Hello" >
+ <startEvent id="sub-start" name="StartSubProcess"/>
+ <sequenceFlow id="flow2" sourceRef="sub-start" targetRef="signal-event"/>
+ <intermediateThrowEvent id="signal-event" name="Signal Event">
+ <escalationEventDefinition escalationRef="MyEscalation"/>
+ </intermediateThrowEvent>
+ <sequenceFlow id="flow4" sourceRef="signal-event" targetRef="sub-task"/>
+ <userTask id="sub-task" name="User Task" />
+ <sequenceFlow id="flow5" sourceRef="sub-task" targetRef="sub-end"/>
+ <endEvent id="sub-end" name="EndEvent"/>
+ </subProcess>
+ <sequenceFlow id="flow6" sourceRef="subProcess" targetRef="terminateEnd"/>
+ <endEvent id="terminateEnd" name="EndProcess">
+ <terminateEventDefinition/>
+ </endEvent>
+ <boundaryEvent id="boundarySignalEvent" name="Boundary Signal Event" attachedToRef="subProcess" >
+ <escalationEventDefinition escalationRef="MyEscalation" />
+ </boundaryEvent>
+ <sequenceFlow id="flow7" sourceRef="boundarySignalEvent" targetRef="task"/>
+ <scriptTask id="task" name="Goodbye">
+ <script>System.out.println("Escalation handled");</script>
+ </scriptTask>
+ <sequenceFlow id="flow8" sourceRef="task" targetRef="endEvent"/>
+ <endEvent id="endEvent" name="EndProcess"/>
+ </process>
+</definitions>
Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/event/signal/throw_signal_event_interrupting.bpmn.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/event/signal/throw_signal_event_interrupting.bpmn.xml (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/event/signal/throw_signal_event_interrupting.bpmn.xml 2010-11-17 16:57:06 UTC (rev 6830)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
+ xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
+ typeLanguage="http://www.w3.org/2001/XMLSchema"
+ expressionLanguage="http://www.w3.org/1999/XPath"
+ targetNamespace="http://jbpm.org/example/bpmn2/throw_signal_event"
+ xmlns:jbpm="http://jbpm.org/bpmn2">
+
+ <signal id="MySignal" name="MySignal" />
+
+ <process id="throw_signal_event" name="Signal Throw Event Process">
+ <startEvent id="startEvent" name="StartProcess"/>
+ <sequenceFlow id="flow1" sourceRef="startEvent" targetRef="subProcess"/>
+ <subProcess id="subProcess" name="Hello" >
+ <startEvent id="sub-start" name="StartSubProcess"/>
+ <sequenceFlow id="flow2" sourceRef="sub-start" targetRef="signal-event"/>
+ <intermediateThrowEvent id="signal-event" name="Signal Event">
+ <signalEventDefinition signalRef="MySignal"/>
+ </intermediateThrowEvent>
+ <sequenceFlow id="flow4" sourceRef="signal-event" targetRef="sub-task"/>
+ <userTask id="sub-task" name="User Task" />
+ <sequenceFlow id="flow5" sourceRef="sub-task" targetRef="sub-end"/>
+ <endEvent id="sub-end" name="EndEvent"/>
+ </subProcess>
+ <sequenceFlow id="flow6" sourceRef="subProcess" targetRef="terminateEnd"/>
+ <endEvent id="terminateEnd" name="EndProcess">
+ <terminateEventDefinition/>
+ </endEvent>
+ <boundaryEvent id="boundarySignalEvent" name="Boundary Signal Event" attachedToRef="subProcess" >
+ <signalEventDefinition signalRef="MySignal" />
+ </boundaryEvent>
+ <sequenceFlow id="flow7" sourceRef="boundarySignalEvent" targetRef="task"/>
+ <scriptTask id="task" name="Goodbye">
+ <script>System.out.println("Escalation handled");</script>
+ </scriptTask>
+ <sequenceFlow id="flow8" sourceRef="task" targetRef="endEvent"/>
+ <endEvent id="endEvent" name="EndProcess"/>
+ </process>
+</definitions>
13 years, 6 months
JBoss JBPM SVN: r6829 - in jbpm3/branches/jbpm-3.2-soa: distribution and 1 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2010-11-17 00:03:57 -0500 (Wed, 17 Nov 2010)
New Revision: 6829
Modified:
jbpm3/branches/jbpm-3.2-soa/distribution/pom.xml
jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/installer/auto-install-template.xml
jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/installer/auto-install-tomcat.xml
jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/installer/install-definition.xml
jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/installer/user-input-lang_eng.xml
jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/installer/user-input-lang_spa.xml
jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/installer/user-input-spec.xml
jbpm3/branches/jbpm-3.2-soa/pom.xml
Log:
JBPM-2978 offer tomcat 5.5 option from installer, in addition to tomcat 6.0
Modified: jbpm3/branches/jbpm-3.2-soa/distribution/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/distribution/pom.xml 2010-11-17 00:53:13 UTC (rev 6828)
+++ jbpm3/branches/jbpm-3.2-soa/distribution/pom.xml 2010-11-17 05:03:57 UTC (rev 6829)
@@ -193,6 +193,14 @@
<artifactId>bsh</artifactId>
</dependency>
<dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.el</groupId>
+ <artifactId>el-ri</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.jboss.cluster</groupId>
<artifactId>hibernate-jbc-cacheprovider</artifactId>
</dependency>
Modified: jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/installer/auto-install-template.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/installer/auto-install-template.xml 2010-11-17 00:53:13 UTC (rev 6828)
+++ jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/installer/auto-install-template.xml 2010-11-17 05:03:57 UTC (rev 6829)
@@ -20,18 +20,15 @@
</com.izforge.izpack.panels.TreePacksPanel>
<com.izforge.izpack.panels.UserInputPanel>
<userInput>
- <entry key="jbossTargetServer" value="@jboss.server@" />
+ <entry key="jbossInstallPath" value="@jboss.home@" />
<entry key="jbossSelection" value="@container@" />
+ <entry key="jbossTargetServer" value="@jboss.server@" />
</userInput>
</com.izforge.izpack.panels.UserInputPanel>
<com.izforge.izpack.panels.UserInputPanel>
<userInput>
- <entry key="jbossInstallPath" value="@jboss.home@" />
- </userInput>
- </com.izforge.izpack.panels.UserInputPanel>
- <com.izforge.izpack.panels.UserInputPanel>
- <userInput>
<entry key="tomcatInstallPath" value="@tomcat.home@" />
+ <entry key="tomcatSelection" value="@container@" />
</userInput>
</com.izforge.izpack.panels.UserInputPanel>
<com.izforge.izpack.panels.UserInputPanel>
Modified: jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/installer/auto-install-tomcat.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/installer/auto-install-tomcat.xml 2010-11-17 00:53:13 UTC (rev 6828)
+++ jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/installer/auto-install-tomcat.xml 2010-11-17 05:03:57 UTC (rev 6829)
@@ -20,18 +20,15 @@
</com.izforge.izpack.panels.TreePacksPanel>
<com.izforge.izpack.panels.UserInputPanel>
<userInput>
- <entry key="jbossTargetServer" value="@jboss.server@" />
+ <entry key="jbossInstallPath" value="@jboss.home@" />
<entry key="jbossSelection" value="@container@" />
+ <entry key="jbossTargetServer" value="@jboss.server@" />
</userInput>
</com.izforge.izpack.panels.UserInputPanel>
<com.izforge.izpack.panels.UserInputPanel>
<userInput>
- <entry key="jbossInstallPath" value="@jboss.home@" />
- </userInput>
- </com.izforge.izpack.panels.UserInputPanel>
- <com.izforge.izpack.panels.UserInputPanel>
- <userInput>
<entry key="tomcatInstallPath" value="@tomcat.home@" />
+ <entry key="tomcatSelection" value="@container@" />
</userInput>
</com.izforge.izpack.panels.UserInputPanel>
<com.izforge.izpack.panels.UserInputPanel>
Modified: jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/installer/install-definition.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/installer/install-definition.xml 2010-11-17 00:53:13 UTC (rev 6828)
+++ jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/installer/install-definition.xml 2010-11-17 05:03:57 UTC (rev 6829)
@@ -40,7 +40,8 @@
<variable name="jboss423.home" value="@{jboss423.home}" />
<variable name="jboss501.home" value="@{jboss501.home}" />
<variable name="jboss510.home" value="@{jboss510.home}" />
- <variable name="tomcat.home" value="@{tomcat.home}" />
+ <variable name="tomcat55.home" value="@{tomcat55.home}" />
+ <variable name="tomcat60.home" value="@{tomcat60.home}" />
</variables>
<!-- Dynamic Variables -->
@@ -49,11 +50,13 @@
<variable name="jboss.home" value="${jboss423.home}" condition="isJBoss423" />
<variable name="jboss.home" value="${jboss501.home}" condition="isJBoss501" />
<variable name="jboss.home" value="${jboss510.home}" condition="isJBoss510" />
+ <variable name="tomcat.home" value="${tomcat60.home" condition="isTomcat60" />
+ <variable name="tomcat.home" value="${tomcat55.home" condition="isTomcat55" />
</dynamicvariables>
<!-- Conditions -->
<conditions>
- <!-- Target Server Conditions -->
+ <!-- JBoss AS Conditions -->
<condition type="variable" id="isJBoss405">
<name>jbossSelection</name>
<value>jboss405</value>
@@ -71,7 +74,17 @@
<value>jboss510</value>
</condition>
- <!-- Target Database Conditions -->
+ <!-- Tomcat Conditions -->
+ <condition type="variable" id="isTomcat55">
+ <name>tomcatSelection</name>
+ <value>tomcat55</value>
+ </condition>
+ <condition type="variable" id="isTomcat60">
+ <name>tomcatSelection</name>
+ <value>tomcat60</value>
+ </condition>
+
+ <!-- Database Conditions -->
<condition type="variable" id="isDB2">
<name>dbSelection</name>
<value>db2</value>
@@ -110,7 +123,6 @@
<panel classname="UserInputPanel" />
<panel classname="UserInputPanel" />
<panel classname="UserInputPanel" />
- <panel classname="UserInputPanel" />
<panel classname="SummaryPanel" />
<panel classname="InstallPanel" />
<panel classname="FinishPanel" />
@@ -397,18 +409,25 @@
-->
<pack name="Tomcat Integration" required="no" preselected="no">
<description>Web server integration</description>
+ <!-- server/lib -->
+ <file src="@{assemblyDirectory}/lib/jbpm-tomcat.jar" targetdir="${tomcatInstallPath}/server/lib"
+ condition="isTomcat55" />
+ <!-- common/lib -->
+ <file src="@{assemblyDirectory}/lib/hsqldb.jar" targetdir="${tomcatInstallPath}/common/lib"
+ condition="isTomcat55" />
<!-- lib -->
- <file src="@{assemblyDirectory}/lib/jbpm-tomcat.jar"
- targetdir="${tomcatInstallPath}/lib" />
- <file src="@{assemblyDirectory}/lib/hsqldb.jar" targetdir="${tomcatInstallPath}/lib" />
+ <file src="@{assemblyDirectory}/lib/jbpm-tomcat.jar" targetdir="${tomcatInstallPath}/lib"
+ condition="isTomcat60" />
+ <file src="@{assemblyDirectory}/lib/hsqldb.jar" targetdir="${tomcatInstallPath}/lib"
+ condition="isTomcat60" />
<!-- webapps/jbpm-console -->
<file src="@{assemblyDirectory}/lib/jsf-console-tomcat.war"
targetdir="${tomcatInstallPath}/webapps/jbpm-console"
unpack="true" />
<fileset dir="@{assemblyDirectory}/lib"
- targetdir="${tomcatInstallPath}/webapps/jbpm-console/WEB-INF/lib">
+ targetdir="${tomcatInstallPath}/webapps/jbpm-console/WEB-INF/lib">
<include name="antlr.jar" />
<include name="asm.jar" />
<include name="backport-util-concurrent.jar" />
@@ -427,6 +446,12 @@
<singlefile src="@{assemblyDirectory}/config/hibernate.cfg.tomcat.xml"
target="${tomcatInstallPath}/webapps/jbpm-console/WEB-INF/classes/hibernate.cfg.xml" />
+ <fileset dir="@{assemblyDirectory}/lib" condition="isTomcat55"
+ targetdir="${tomcatInstallPath}/webapps/jbpm-console/WEB-INF/lib">
+ <include name="el-api.jar" />
+ <include name="el-ri.jar" />
+ </fileset>
+
<!-- work/jbpm-console -->
<fileset dir="@{resourcesDirectory}/database/hypersonic"
targetdir="${tomcatInstallPath}/work/Catalina/localhost/jbpm-console">
Modified: jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/installer/user-input-lang_eng.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/installer/user-input-lang_eng.xml 2010-11-17 00:53:13 UTC (rev 6828)
+++ jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/installer/user-input-lang_eng.xml 2010-11-17 05:03:57 UTC (rev 6829)
@@ -4,5 +4,6 @@
<str id="jboss.configuration" txt="Server configuration" />
<str id="jboss.home" txt="JBoss AS directory" />
<str id="tomcat.home" txt="Tomcat directory" />
+ <str id="tomcat.selection" txt="Tomcat version" />
<str id="database.selection" txt="Database" />
</langpack>
\ No newline at end of file
Modified: jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/installer/user-input-lang_spa.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/installer/user-input-lang_spa.xml 2010-11-17 00:53:13 UTC (rev 6828)
+++ jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/installer/user-input-lang_spa.xml 2010-11-17 05:03:57 UTC (rev 6829)
@@ -4,5 +4,6 @@
<str id="jboss.configuration" txt="Configuración del servidor" />
<str id="jboss.home" txt="Directorio de JBoss AS" />
<str id="tomcat.home" txt="Directorio de Tomcat" />
+ <str id="tomcat.selection" txt="Versión de Tomcat" />
<str id="database.selection" txt="Base de datos" />
</langpack>
\ No newline at end of file
Modified: jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/installer/user-input-spec.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/installer/user-input-spec.xml 2010-11-17 00:53:13 UTC (rev 6828)
+++ jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/installer/user-input-spec.xml 2010-11-17 05:03:57 UTC (rev 6829)
@@ -2,6 +2,10 @@
<userInput>
<panel order="0">
<createForPack name="JBoss AS Integration" />
+ <field type="dir" align="left" variable="jbossInstallPath">
+ <spec id="jboss.home" size="20" set="${jboss.home}" />
+ </field>
+ <field type="space" />
<field type="radio" variable="jbossSelection">
<description align="left" id="jboss.selection" />
<spec>
@@ -13,22 +17,24 @@
</field>
<field type="space" />
<field type="text" variable="jbossTargetServer">
- <spec id="jboss.configuration" size="5" set="all" />
+ <spec id="jboss.configuration" size="10" set="all" />
</field>
</panel>
<panel order="1">
- <createForPack name="JBoss AS Integration" />
- <field type="dir" align="left" variable="jbossInstallPath">
- <spec id="jboss.home" size="20" set="${jboss.home}" />
- </field>
- </panel>
- <panel order="2">
<createForPack name="Tomcat Integration" />
<field type="dir" align="left" variable="tomcatInstallPath">
<spec id="tomcat.home" size="20" set="${tomcat.home}" />
</field>
+ <field type="space" />
+ <field type="radio" variable="tomcatSelection">
+ <description align="left" id="tomcat.selection" />
+ <spec>
+ <choice txt="Tomcat 6.0" value="tomcat60" set="true" />
+ <choice txt="Tomcat 5.5" value="tomcat55" />
+ </spec>
+ </field>
</panel>
- <panel order="3">
+ <panel order="2">
<createForPack name="JBoss AS Integration" />
<field type="radio" variable="dbSelection">
<description align="left" id="database.selection" />
Modified: jbpm3/branches/jbpm-3.2-soa/pom.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/pom.xml 2010-11-17 00:53:13 UTC (rev 6828)
+++ jbpm3/branches/jbpm-3.2-soa/pom.xml 2010-11-17 05:03:57 UTC (rev 6829)
@@ -189,9 +189,14 @@
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
- <version>1.2</version>
+ <version>1.0</version>
</dependency>
<dependency>
+ <groupId>com.sun.el</groupId>
+ <artifactId>el-ri</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss.gravel</groupId>
<artifactId>gravel</artifactId>
<version>1.0.0.GA</version>
13 years, 6 months