[jbpm-commits] JBoss JBPM SVN: r6831 - jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes.
do-not-reply at jboss.org
do-not-reply at jboss.org
Wed Nov 17 12:12:48 EST 2010
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;
+ }
+
+}
More information about the jbpm-commits
mailing list