JBoss JBPM SVN: r4925 - jbpm3/branches/jbpm-3.2.5-soa/hudson.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-05-28 03:48:32 -0400 (Thu, 28 May 2009)
New Revision: 4925
Modified:
jbpm3/branches/jbpm-3.2.5-soa/hudson/profiles.xml.redhat.qa
Log:
JBPM-2292: Move jBPM3-SOA continuous integration to QA lab (CODING IN PROGRESS)
Update database connection parameters in profiles.redhat.xml
Modified: jbpm3/branches/jbpm-3.2.5-soa/hudson/profiles.xml.redhat.qa
===================================================================
--- jbpm3/branches/jbpm-3.2.5-soa/hudson/profiles.xml.redhat.qa 2009-05-28 07:17:22 UTC (rev 4924)
+++ jbpm3/branches/jbpm-3.2.5-soa/hudson/profiles.xml.redhat.qa 2009-05-28 07:48:32 UTC (rev 4925)
@@ -13,27 +13,35 @@
</activation>
<properties>
-
- <jdbc.mysql.url>jdbc:mysql://dev02.qa.atl2.redhat.com/jbpm3</jdbc.mysql.url>
- <jdbc.mysql.server>dev02.qa.atl2.redhat.com</jdbc.mysql.server>
+ <jdbc.mysql.server>dev02.qa.atl.jboss.com</jdbc.mysql.server>
<jdbc.mysql.port>3306</jdbc.mysql.port>
- <jdbc.mysql.database>jbpmtest</jdbc.mysql.database>
+ <jdbc.mysql.database>jbpm3</jdbc.mysql.database>
+ <jdbc.mysql.url>jdbc:mysql://${jdbc.mysql.server}:${jdbc.mysql.port}/${jdbc.mysql.database}</jdbc.mysql.url>
<jdbc.mysql.username>jbpm3</jdbc.mysql.username>
- <jdbc.mysql.password>jbpm3</jdbc.mysql.password>
+ <jdbc.mysql.password></jdbc.mysql.password>
- <jdbc.sybase.url>jdbc:jtds:sybase://dev77.qa.atl2.redhat.com:4100/jbpm3</jdbc.sybase.url>
- <jdbc.sybase.server>dev77.qa.atl2.redhat.com</jdbc.sybase.server>
+ <jdbc.sybase.server>jdbc:sybase:Tds:dev77.qa.atl2.redhat.com</jdbc.sybase.server>
<jdbc.sybase.port>4100</jdbc.sybase.port>
- <jdbc.sybase.database>jbpm3</jdbc.sybase.database>
- <jdbc.sybase.username>jbpm3</jdbc.sybase.username>
- <jdbc.sybase.password>jbpm3</jdbc.sybase.password>
+ <jdbc.sybase.database>jbpm3xa</jdbc.sybase.database>
+ <jdbc.sybase.url>jdbc:sybase:Tds:${jdbc.sybase.server}:${jdbc.sybase.port}/${jdbc.sybase.database}</jdbc.sybase.url>
+ <jdbc.sybase.username>jbpm3xa</jdbc.sybase.username>
+ <jdbc.sybase.password></jdbc.sybase.password>
+ <jdbc.sybase.driver>com.sybase.jdbc3.jdbc.SybDriver</jdbc.sybase.driver>
+ <jdbc.sybase.datasource>com.sybase.jdbc3.jdbc.SybXADataSource</jdbc.sybase.datasource>
- <jdbc.postgresql.url>jdbc:postgresql://localhost:5432/jbpmtest</jdbc.postgresql.url>
- <jdbc.postgresql.server>localhost</jdbc.postgresql.server>
+ <jdbc.postgresql.server>dev01.qa.atl.jboss.com</jdbc.postgresql.server>
<jdbc.postgresql.port>5432</jdbc.postgresql.port>
- <jdbc.postgresql.database>jbpmtest</jdbc.postgresql.database>
- <jdbc.postgresql.username>jbpmtest</jdbc.postgresql.username>
+ <jdbc.postgresql.database>jbpm3</jdbc.postgresql.database>
+ <jdbc.postgresql.url>jdbc:postgresql://${jdbc.postgresql.server}:${jdbc.postgresql.port}/${jdbc.postgresql.database}</jdbc.postgresql.url>
+ <jdbc.postgresql.username>jbpm3</jdbc.postgresql.username>
<jdbc.postgresql.password></jdbc.postgresql.password>
+
+ <jdbc.oracle.server>dev68.qa.atl2.redhat.com</jdbc.oracle.server>
+ <jdbc.oracle.port>1521</jdbc.oracle.port>
+ <jdbc.oracle.database>qadb01</jdbc.oracle.database>
+ <jdbc.oracle.url>jdbc:oracle:thin:@${jdbc.oracle.server}:${jdbc.oracle.port}:${jdbc.oracle.database}</jdbc.oracle.url>
+ <jdbc.oracle.username>jbpm3</jdbc.oracle.username>
+ <jdbc.oracle.password></jdbc.oracle.password>
</properties>
</profile>
15 years
JBoss JBPM SVN: r4924 - in jbpm4/trunk/modules: pvm/src/main/java/org/jbpm/pvm/internal/model and 3 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-05-28 03:17:22 -0400 (Thu, 28 May 2009)
New Revision: 4924
Added:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionEndActivity.java
Removed:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionEndActivity.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionEndActivityMessage.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionTakeMessage.java
Modified:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/CommandMessage.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/JobImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/EventImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java
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/ObservableElementImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/AtomicOperation.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteActivity.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteActivityMessage.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListener.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListenerMessage.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToChildActivity.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToParentActivity.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/SignalMessage.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionStartActivity.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionStartActivityMessage.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionTake.java
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml
jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/EventTest.java
jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionEventsTest.java
Log:
JBPM-2277 refactor execution state, atomic operations and job information
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/CommandMessage.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/CommandMessage.java 2009-05-27 21:43:23 UTC (rev 4923)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/CommandMessage.java 2009-05-28 07:17:22 UTC (rev 4924)
@@ -52,6 +52,7 @@
JobDbSession jobDbSession = environment.get(JobDbSession.class);
jobDbSession.delete(this);
+
return null;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/JobImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/JobImpl.java 2009-05-27 21:43:23 UTC (rev 4923)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/JobImpl.java 2009-05-28 07:17:22 UTC (rev 4924)
@@ -52,9 +52,6 @@
/** the time the lock on this jobImpl expires. */
protected Date lockExpirationTime;
- /** any information that subclasses might use in a specific way. */
- protected String info;
-
/** stack trace of the exception that occurred during command execution. */
protected String exception;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java 2009-05-27 21:43:23 UTC (rev 4923)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java 2009-05-28 07:17:22 UTC (rev 4924)
@@ -400,6 +400,16 @@
return ! (continuation==Continuation.SYNCHRONOUS);
}
+ public boolean contains(ActivityImpl activity) {
+ while (activity!=null) {
+ if (activity.getParent()==this) {
+ return true;
+ }
+ activity = activity.getParentActivity();
+ }
+ return false;
+ }
+
// getters and setters //////////////////////////////////////////////////////
public ObservableElementImpl getParent() {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/EventImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/EventImpl.java 2009-05-27 21:43:23 UTC (rev 4923)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/EventImpl.java 2009-05-28 07:17:22 UTC (rev 4924)
@@ -37,6 +37,7 @@
private static final long serialVersionUID = 1L;
protected String name;
+ protected ObservableElementImpl observableElement;
protected List<EventListenerReference> listenerReferences;
protected Continuation continuation = Continuation.SYNCHRONOUS;
@@ -100,4 +101,10 @@
public void setContinuation(Continuation continuation) {
this.continuation = continuation;
}
+ public ObservableElementImpl getObservableElement() {
+ return observableElement;
+ }
+ public void setObservableElement(ObservableElementImpl observableElement) {
+ this.observableElement = observableElement;
+ }
}
\ No newline at end of file
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java 2009-05-27 21:43:23 UTC (rev 4923)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java 2009-05-28 07:17:22 UTC (rev 4924)
@@ -33,6 +33,7 @@
import org.jbpm.api.listener.EventListener;
import org.jbpm.api.model.OpenProcessDefinition;
import org.jbpm.internal.log.Log;
+import org.jbpm.pvm.internal.model.op.AtomicOperation;
import org.jbpm.pvm.internal.model.op.MoveToChildActivity;
import org.jbpm.pvm.internal.wire.Descriptor;
@@ -196,7 +197,7 @@
if (transition!=null) {
log.trace(toString()+" takes transition "+transitionName);
execution.setTransition(transition);
- execution.performAtomicOperationSync(ExecutionImpl.TRANSITION_END_ACTIVITY);
+ execution.performAtomicOperationSync(AtomicOperation.TRANSITION_END_ACTIVITY);
} else {
log.info("WARNING: "+toString()+" couldn't find transition "+transitionName+" on "+activity);
}
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 2009-05-27 21:43:23 UTC (rev 4923)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-05-28 07:17:22 UTC (rev 4924)
@@ -40,9 +40,7 @@
import org.jbpm.api.activity.ActivityExecution;
import org.jbpm.api.client.ClientProcessDefinition;
import org.jbpm.api.client.ClientProcessInstance;
-import org.jbpm.api.cmd.CommandService;
import org.jbpm.api.env.Environment;
-import org.jbpm.api.env.Transaction;
import org.jbpm.api.job.Timer;
import org.jbpm.api.listener.EventListenerExecution;
import org.jbpm.api.model.Activity;
@@ -56,7 +54,6 @@
import org.jbpm.api.session.RepositorySession;
import org.jbpm.api.session.TimerSession;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.PvmEnvironment;
import org.jbpm.pvm.internal.hibernate.HibernatePvmDbSession;
import org.jbpm.pvm.internal.history.HistoryEvent;
import org.jbpm.pvm.internal.history.HistorySession;
@@ -68,14 +65,8 @@
import org.jbpm.pvm.internal.history.events.ProcessInstanceStart;
import org.jbpm.pvm.internal.job.MessageImpl;
import org.jbpm.pvm.internal.model.op.AtomicOperation;
-import org.jbpm.pvm.internal.model.op.ExecuteActivity;
-import org.jbpm.pvm.internal.model.op.ExecuteEventListener;
import org.jbpm.pvm.internal.model.op.MoveToChildActivity;
-import org.jbpm.pvm.internal.model.op.MoveToParentActivity;
import org.jbpm.pvm.internal.model.op.Signal;
-import org.jbpm.pvm.internal.model.op.TransitionEndActivity;
-import org.jbpm.pvm.internal.model.op.TransitionStartActivity;
-import org.jbpm.pvm.internal.model.op.TransitionTake;
import org.jbpm.pvm.internal.util.EqualsUtil;
import org.jbpm.pvm.internal.util.Priority;
@@ -92,15 +83,6 @@
private static final Log log = Log.getLog(Execution.class.getName());
- // atomic operations
- public static final AtomicOperation EXECUTE_ACTIVITY = new ExecuteActivity();
- public static final AtomicOperation TRANSITION_END_ACTIVITY = new TransitionEndActivity();
- public static final AtomicOperation TRANSITION_TAKE = new TransitionTake();
- public static final AtomicOperation TRANSITION_START_ACTIVITY = new TransitionStartActivity();
- public static final AtomicOperation PROPAGATE_TO_PARENT = new MoveToParentActivity();
-
- // persistent member fields /////////////////////////////////////////////////
-
/** an optional name for this execution. can be used to
* differentiate concurrent paths of execution like e.g.
* the 'shipping' and 'billing' paths. */
@@ -146,9 +128,6 @@
/** persistent activity reference */
protected String activityName;
- protected Integer transitionSourceIndex;
- protected String transitionSourceName;
-
// transient cached indicators of the current position //////////////////////
/** transient cached process definition. persistence is managed in {@link #processDefinitionId} */
@@ -160,12 +139,12 @@
/** transition is not to be made persistable by default */
protected TransitionImpl transition;
- /** the activity from which the transition was taken. This can be different from
- * the transition source in case a transition of an eclosing activity was taken. */
- protected ActivityImpl transitionSource;
-
protected EventImpl event;
+ protected AtomicOperation eventCompletedOperation;
+
+ protected int eventListenerIndex;
+
protected ObservableElementImpl eventSource;
// cached named executions //////////////////////////////////////////////////
@@ -212,7 +191,7 @@
fireHistoryEvent(new ProcessInstanceStart());
fire(Event.START, getProcessDefinition());
if (getActivity()!=null) {
- scopedExecution.performAtomicOperation(EXECUTE_ACTIVITY);
+ scopedExecution.performAtomicOperation(AtomicOperation.EXECUTE_ACTIVITY);
}
}
@@ -400,9 +379,9 @@
checkActive();
propagation = Propagation.EXPLICIT;
if (getActivity()!=null) {
- performAtomicOperation(new Signal(signal, parameters, getActivity()));
+ performAtomicOperation(new Signal(signal, parameters));
} else if (transition!=null) {
- performAtomicOperation(ExecutionImpl.TRANSITION_START_ACTIVITY);
+ performAtomicOperation(AtomicOperation.TRANSITION_START_ACTIVITY);
} else {
throw new JbpmException("execution is not in a activity or in a transition");
}
@@ -452,11 +431,12 @@
checkActive();
setPropagation(Propagation.EXPLICIT);
- setTransition((TransitionImpl) transition);
- performAtomicOperation(TRANSITION_END_ACTIVITY);
+ setTransition((TransitionImpl) transition);
+
+ fire(Event.END, getActivity(), AtomicOperation.TRANSITION_END_ACTIVITY);
}
-
+
public void take(Transition transition, Execution execution) {
((ExecutionImpl)execution).take(transition);
}
@@ -512,7 +492,7 @@
// if there is a parent activity
if (parentActivity!=null) {
// propagate to the parent
- performAtomicOperation(PROPAGATE_TO_PARENT);
+ performAtomicOperation(AtomicOperation.PROPAGATE_TO_PARENT);
} else {
// When we don't know how to proceed, i don't know if it's best to
@@ -532,13 +512,46 @@
setActivity((ActivityImpl) activity);
}
+ // events ///////////////////////////////////////////////////////////////////
+
+ public void fire(String eventName, ObservableElement eventSource) {
+ fire(eventName, (ObservableElementImpl) eventSource, null);
+ }
+
+ public void fire(String eventName, ObservableElementImpl observableElement, AtomicOperation eventCompletedOperation) {
+ EventImpl event = findEvent(observableElement, eventName);
+ if (event!=null) {
+ setEvent(event);
+ setEventSource(observableElement);
+ setEventListenerIndex(0);
+ setEventCompletedOperation(eventCompletedOperation);
+ performAtomicOperation(AtomicOperation.EXECUTE_EVENT_LISTENER);
+ } else {
+ if (eventCompletedOperation!=null) {
+ performAtomicOperationSync(eventCompletedOperation);
+ }
+ }
+ }
+
+ public static EventImpl findEvent(ObservableElementImpl observableElement, String eventName) {
+ if (observableElement==null) {
+ return null;
+ }
+
+ EventImpl event = observableElement.getEvent(eventName);
+ if (event!=null) {
+ return event;
+ }
+
+ return findEvent(observableElement.getParent(), eventName);
+ }
+
// execution : internal methods /////////////////////////////////////////////
public void moveTo(ActivityImpl destination) {
// move the execution to the destination
setActivity(destination);
transition = null;
- transitionSource = null;
}
public ExecutionImpl startActivity(ActivityImpl activity) {
@@ -559,6 +572,8 @@
return propagatingExecution;
}
+ // asynchronous continuations ////////////////////////////////////////////////
+
public synchronized void performAtomicOperation(AtomicOperation operation) {
if (operation.isAsync(this)) {
sendContinuationMessage(operation);
@@ -567,8 +582,6 @@
}
}
- // asynchronous continuations ////////////////////////////////////////////////
-
public void sendContinuationMessage(AtomicOperation operation) {
Environment environment = Environment.getCurrent();
MessageSession messageSession = environment.get(MessageSession.class);
@@ -603,52 +616,6 @@
}
}
- // events ///////////////////////////////////////////////////////////////////
-
- /** @see Execution#fire(String, ObservableElement) */
- public void fire(String eventName, ObservableElement eventSource) {
- fire(eventName, eventSource, (ObservableElementImpl) eventSource);
- }
-
- /** fires the event on the given *processElement* and then propagates the event
- * up to the *processElement* parent chain. */
- void fire(String eventName, ObservableElement eventSource, ObservableElementImpl observableElement) {
- if (observableElement!=null) {
- EventImpl event = (EventImpl) observableElement.getEvent(eventName);
- if (event!=null) {
- if (log.isTraceEnabled()) {
- if (observableElement==eventSource) {
- log.trace("firing "+event+" on "+eventSource);
- } else {
- log.trace("firing "+event+" on "+observableElement+", propagated from source "+eventSource);
- }
- }
- fire(event, eventSource, observableElement);
- }
- propagateEvent(eventName, eventSource, observableElement);
- }
- }
-
- /** this method enables specific process languages to overwrite the event propagation behaviour */
- protected void propagateEvent(String eventName, ObservableElement eventSource, ObservableElementImpl observableElement) {
- fire(eventName, eventSource, observableElement.getParent());
- }
-
- /** fires the given event without propagation */
- public void fire(EventImpl event, ObservableElement eventSource, ObservableElement observableElement) {
- List<EventListenerReference> eventListenerReferences = event.getListenerReferences();
- if (eventListenerReferences!=null) {
- for (EventListenerReference eventListenerReference: eventListenerReferences) {
- ExecuteEventListener executeEventListenerOperation = new ExecuteEventListener(eventListenerReference, event, (ObservableElementImpl) eventSource, observableElement);
- if (eventListenerReference.isAsync()) {
- sendContinuationMessage(executeEventListenerOperation);
- } else {
- executeEventListenerOperation.perform(this);
- }
- }
- }
- }
-
public void handleException(ObservableElementImpl observableElement,
EventImpl event,
EventListenerReference eventListenerReference,
@@ -690,23 +657,6 @@
ExceptionHandlerImpl.rethrow(exception, rethrowMessage+": "+exception.getMessage());
}
-
- /** searches for an event up the process element parent hierarchy starting
- * from the given process element and returns an event or null if no such
- * event exists. */
- EventImpl findEvent(String eventName, ObservableElementImpl observableElement) {
- EventImpl event = null;
- while ( (event==null)
- && (observableElement!=null)
- ) {
- event = (EventImpl) observableElement.getEvent(eventName);
- if (event==null) {
- observableElement = observableElement.getParent();
- }
- }
- return event;
- }
-
// comments /////////////////////////////////////////////////////////////////
public Comment createComment(String message) {
@@ -1070,62 +1020,43 @@
return activityName;
}
- // transition getter and setter /////////////////////////////////////////////
- // this getter and setter is special because persistence is based on the //
- // transition index of the current activity. //
- /////////////////////////////////////////////////////////////////////////////
+ // special getters and setters /////////////////////////////////////////////////
- public void setTransition(TransitionImpl transition) {
- this.transition = transition;
- if (transition==null) {
- this.transitionSource = null;
- this.transitionSourceName = null;
- this.transitionSourceIndex = null;
- } else {
- this.transitionSource = transition.getSource();
- this.transitionSourceName = transitionSource.getName();
- this.transitionSourceIndex = transition.getSourceIndex();
+ public boolean hasAsyncEndEvent(List<ActivityImpl> leftActivities) {
+ for (ActivityImpl leftActivity : leftActivities) {
+ EventImpl endEvent = leftActivity.getEvent(Event.END);
+ if ( (endEvent!=null)
+ && (endEvent.isAsync())
+ ) {
+ return true;
+ }
}
+ return false;
}
- public TransitionImpl getTransition() {
- if ( (transition==null)
- && (transitionSourceIndex!=null)
- ) {
- transition = (TransitionImpl) getTransitionSource().getOutgoingTransitions().get(transitionSourceIndex);
+ public List<Comment> getComments() {
+ if (comments==null) {
+ return Collections.emptyList();
}
- return transition;
+ return new ArrayList<Comment>(comments);
}
-
- public ActivityImpl getTransitionSource() {
- if ( (transitionSource==null)
- && (transitionSourceName!=null)
- ) {
- transitionSource = getProcessDefinition().findActivity(transitionSourceName);
- }
- return transitionSource;
- }
-
-
- // getters and setters /////////////////////////////////////////////////////////
-
-
public boolean isProcessInstance() {
return parent==null;
}
- public List<Comment> getComments() {
- if (comments==null) {
- return Collections.emptyList();
- }
- return new ArrayList<Comment>(comments);
+ // getters and setters /////////////////////////////////////////////////////////
+
+ public TransitionImpl getTransition() {
+ return transition;
}
-
- public Event getEvent() {
+ public void setTransition(TransitionImpl transition) {
+ this.transition = transition;
+ }
+ public EventImpl getEvent() {
return event;
}
- public ObservableElement getEventSource() {
+ public ObservableElementImpl getEventSource() {
return eventSource;
}
public Collection<Execution> getExecutions() {
@@ -1212,16 +1143,16 @@
public String getProcessDefinitionId() {
return processDefinitionId;
}
-
- public boolean hasAsyncEndEvent(List<ActivityImpl> leftActivities) {
- for (ActivityImpl leftActivity : leftActivities) {
- EventImpl endEvent = leftActivity.getEvent(Event.END);
- if ( (endEvent!=null)
- && (endEvent.isAsync())
- ) {
- return true;
- }
- }
- return false;
+ public int getEventListenerIndex() {
+ return eventListenerIndex;
}
+ public void setEventListenerIndex(int eventListenerIndex) {
+ this.eventListenerIndex = eventListenerIndex;
+ }
+ public AtomicOperation getEventCompletedOperation() {
+ return eventCompletedOperation;
+ }
+ public void setEventCompletedOperation(AtomicOperation eventCompletedOperation) {
+ this.eventCompletedOperation = eventCompletedOperation;
+ }
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ObservableElementImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ObservableElementImpl.java 2009-05-27 21:43:23 UTC (rev 4923)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ObservableElementImpl.java 2009-05-28 07:17:22 UTC (rev 4924)
@@ -59,6 +59,7 @@
/** event factory method that also establishes the bidirectional relation. */
public EventImpl createEvent(String eventName) {
EventImpl event = new EventImpl();
+ event.setObservableElement(this);
event.setName(eventName);
return addEvent(event);
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/AtomicOperation.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/AtomicOperation.java 2009-05-27 21:43:23 UTC (rev 4923)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/AtomicOperation.java 2009-05-28 07:17:22 UTC (rev 4924)
@@ -21,16 +21,38 @@
*/
package org.jbpm.pvm.internal.model.op;
+import org.jbpm.api.JbpmException;
import org.jbpm.pvm.internal.job.MessageImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
/**
* @author Tom Baeyens
*/
-public interface AtomicOperation {
+public abstract class AtomicOperation {
+
+ public static final AtomicOperation EXECUTE_ACTIVITY = new ExecuteActivity();
+ public static final AtomicOperation PROPAGATE_TO_PARENT = new MoveToParentActivity();
+ public static final AtomicOperation TRANSITION_TAKE = new TransitionTake();
+ public static final AtomicOperation TRANSITION_START_ACTIVITY = new TransitionStartActivity();
+ public static final AtomicOperation EXECUTE_EVENT_LISTENER = new ExecuteEventListener();
+ public static final AtomicOperation TRANSITION_END_ACTIVITY = new TransitionEndActivity();
+
+ public abstract boolean isAsync(ExecutionImpl execution);
+ public abstract MessageImpl<?> createAsyncMessage(ExecutionImpl execution);
+ public abstract void perform(ExecutionImpl execution);
- boolean isAsync(ExecutionImpl execution);
- MessageImpl<?> createAsyncMessage(ExecutionImpl execution);
+ public static AtomicOperation parseAtomicOperation(String text) {
+ if (text==null) {
+ return null;
+ }
- void perform(ExecutionImpl execution);
+ if (TRANSITION_END_ACTIVITY.toString().equals(text)) return TRANSITION_END_ACTIVITY;
+ if (EXECUTE_EVENT_LISTENER.toString().equals(text)) return EXECUTE_EVENT_LISTENER;
+ if (EXECUTE_ACTIVITY.toString().equals(text)) return EXECUTE_ACTIVITY;
+ if (TRANSITION_TAKE.toString().equals(text)) return TRANSITION_TAKE;
+ if (TRANSITION_START_ACTIVITY.toString().equals(text)) return TRANSITION_START_ACTIVITY;
+ if (PROPAGATE_TO_PARENT.toString().equals(text)) return PROPAGATE_TO_PARENT;
+
+ throw new JbpmException("invalid atomic operation text: "+text);
+ }
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteActivity.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteActivity.java 2009-05-27 21:43:23 UTC (rev 4923)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteActivity.java 2009-05-28 07:17:22 UTC (rev 4924)
@@ -30,7 +30,7 @@
import org.jbpm.pvm.internal.model.ExecutionImpl.Propagation;
import org.jbpm.pvm.internal.util.Clock;
-public class ExecuteActivity implements AtomicOperation {
+public class ExecuteActivity extends AtomicOperation {
private static Log log = Log.getLog(ExecuteActivity.class.getName());
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteActivityMessage.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteActivityMessage.java 2009-05-27 21:43:23 UTC (rev 4923)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteActivityMessage.java 2009-05-28 07:17:22 UTC (rev 4924)
@@ -43,7 +43,7 @@
public Object execute(Environment environment) throws Exception {
AsyncContinuations.restoreState(execution);
- execution.performAtomicOperationSync(ExecutionImpl.EXECUTE_ACTIVITY);
+ execution.performAtomicOperationSync(AtomicOperation.EXECUTE_ACTIVITY);
JobDbSession jobDbSession = environment.get(JobDbSession.class);
jobDbSession.delete(this);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListener.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListener.java 2009-05-27 21:43:23 UTC (rev 4923)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListener.java 2009-05-28 07:17:22 UTC (rev 4924)
@@ -21,6 +21,8 @@
*/
package org.jbpm.pvm.internal.model.op;
+import java.util.List;
+
import org.jbpm.api.listener.EventListener;
import org.jbpm.api.model.ObservableElement;
import org.jbpm.internal.log.Log;
@@ -34,54 +36,96 @@
/**
* @author Tom Baeyens
*/
-public class ExecuteEventListener implements AtomicOperation {
+public class ExecuteEventListener extends AtomicOperation {
private static Log log = Log.getLog(ExecuteEventListener.class.getName());
- protected EventListenerReference eventListenerReference;
- protected EventImpl event;
- protected ObservableElementImpl eventSource;
- protected ObservableElement observableElement;
+ public boolean isAsync(ExecutionImpl execution) {
+ int eventListenerIndex = execution.getEventListenerIndex();
+ EventImpl event = execution.getEvent();
+
+ if ( (eventListenerIndex==0)
+ && (event.isAsync())
+ ) {
+ return true;
+ }
+
+ List<EventListenerReference> eventListenerReferences = event.getListenerReferences();
+ if ( (eventListenerReferences==null)
+ || (eventListenerReferences.isEmpty())
+ ) {
+ return false;
+ }
- public ExecuteEventListener(EventListenerReference eventListenerReference, EventImpl event, ObservableElementImpl eventSource, ObservableElement observableElement) {
- this.eventListenerReference = eventListenerReference;
- this.event = event;
- this.eventSource = eventSource;
- this.observableElement = observableElement;
- }
-
- public boolean isAsync(ExecutionImpl execution) {
+ EventListenerReference eventListenerReference = eventListenerReferences.get(eventListenerIndex);
return eventListenerReference.isAsync();
}
public void perform(ExecutionImpl execution) {
- try {
- execution.setEvent(event);
- execution.setEventSource(eventSource);
-
- if ( (observableElement.equals(eventSource)) // this event is not propagated
- || (eventListenerReference.isPropagationEnabled()) // propagation is allowed
- ) {
+ EventImpl event = execution.getEvent();
+ ObservableElementImpl observableElement = event.getObservableElement();
+ int eventListenerIndex = execution.getEventListenerIndex();
+ List<EventListenerReference> eventListenerReferences = event.getListenerReferences();
+ if ( (eventListenerReferences!=null)
+ && (!eventListenerReferences.isEmpty())
+ ) {
+ EventListenerReference eventListenerReference = eventListenerReferences.get(eventListenerIndex);
+ ObservableElement eventSource = execution.getEventSource();
+ if ((eventSource == observableElement) || (eventListenerReference.isPropagationEnabled())) {
EventListener eventListener = eventListenerReference.get();
-
- log.trace("executing "+eventListener+" for "+event);
+ log.trace("executing " + eventListener + " for " + event);
try {
// TODO can/should this invocation be unified with the exception handler invocation of the event notification method?
eventListener.notify(execution);
} catch (Exception e) {
- log.trace("exception during action: "+e);
- execution.handleException((ObservableElementImpl) observableElement, event, eventListenerReference, e, "couldn't run action "+eventListener);
+ log.trace("exception during action: " + e);
+ execution.handleException((ObservableElementImpl) observableElement, event, eventListenerReference, e, "couldn't run action " + eventListener);
}
}
-
- } finally {
- execution.setEvent(null);
- execution.setEventSource(null);
+ // increment the event listener index
+ eventListenerIndex++;
+ execution.setEventListenerIndex(eventListenerIndex);
}
+
+ // if there are more listeners in this event
+ if ( (eventListenerReferences!=null)
+ && (eventListenerIndex < eventListenerReferences.size())
+ ) {
+ // execute the next listener
+ execution.performAtomicOperation(AtomicOperation.EXECUTE_EVENT_LISTENER);
+
+ } else {
+ // there are no more listeners in this event
+
+ ObservableElementImpl parent = observableElement.getParent();
+ // find the next event with listeners
+ EventImpl propagatedEvent = ExecutionImpl.findEvent(parent, event.getName());
+
+ // if there is an propagated event with listeners
+ if (propagatedEvent != null) {
+ // propagate to the that event
+ execution.setEvent(propagatedEvent);
+ execution.setEventListenerIndex(0);
+ execution.performAtomicOperation(AtomicOperation.EXECUTE_EVENT_LISTENER);
+
+ } else {
+ // event is completed, perform the eventCompletedOperation
+ AtomicOperation eventCompletedOperation = execution.getEventCompletedOperation();
+
+ execution.setEvent(null);
+ execution.setEventSource(null);
+ execution.setEventListenerIndex(0);
+ execution.setEventCompletedOperation(null);
+
+ if (eventCompletedOperation != null) {
+ execution.performAtomicOperation(eventCompletedOperation);
+ }
+ }
+ }
}
public MessageImpl< ? > createAsyncMessage(ExecutionImpl execution) {
- return new ExecuteEventListenerMessage(execution, observableElement, event, eventListenerReference);
+ return new ExecuteEventListenerMessage(execution);
}
public String toString() {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListenerMessage.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListenerMessage.java 2009-05-27 21:43:23 UTC (rev 4923)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListenerMessage.java 2009-05-28 07:17:22 UTC (rev 4924)
@@ -21,79 +21,141 @@
*/
package org.jbpm.pvm.internal.model.op;
+import java.util.HashMap;
+import java.util.Map;
+
import org.jbpm.api.env.Environment;
-import org.jbpm.api.listener.EventListener;
-import org.jbpm.api.model.ObservableElement;
-import org.jbpm.api.session.RepositorySession;
import org.jbpm.pvm.internal.job.MessageImpl;
+import org.jbpm.pvm.internal.jobexecutor.JobDbSession;
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.ExecutionImpl;
import org.jbpm.pvm.internal.model.ObservableElementImpl;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
import org.jbpm.pvm.internal.model.TransitionImpl;
-
/**
* @author Tom Baeyens
*/
public class ExecuteEventListenerMessage extends MessageImpl<Object> {
+ private static final String KEY_EVENT_COMPLETED_OPERATION = "ECO";
+ private static final String KEY_EVENT_LISTENER_INDEX = "ELI";
+ private static final String KEY_EVENT_NAME = "EN";
+ private static final String KEY_EVENT_OBSERVABLE_PARENT_LEVEL = "EOPL";
+ private static final String KEY_TRANSITION_SOURCE_INDEX = "TSI";
+ private static final String KEY_TRANSITION_SOURCE = "TS";
+ private static final String KEY_EVENT_SOURCE_TRANSITION = "EST";
+ private static final String KEY_EVENT_SOURCE_ACTIVITY = "ESA";
+ private static final String KEY_EVENT_SOURCE_PROCESS_DEFINITION = "ESPD";
+ private static final String KEY_STATE = "S";
+
private static final long serialVersionUID = 1L;
- protected String processDefinitionId;
- protected String activityName;
- protected Integer transitionIndex;
- protected String eventName;
- protected Integer eventListenerIndex;
-
public ExecuteEventListenerMessage() {
}
- public ExecuteEventListenerMessage(ExecutionImpl execution, ObservableElement observableElement, EventImpl event, EventListenerReference eventListenerReference) {
+ public ExecuteEventListenerMessage(ExecutionImpl execution) {
super(execution);
- if (observableElement instanceof ProcessDefinitionImpl) {
- ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) observableElement;
- processDefinitionId = processDefinition.getId();
- } else if (observableElement instanceof ActivityImpl) {
- ActivityImpl activity = (ActivityImpl) observableElement;
- processDefinitionId = activity.getProcessDefinition().getId();
- activityName = activity.getName();
- } else if (observableElement instanceof TransitionImpl) {
- TransitionImpl transition = (TransitionImpl) observableElement;
- processDefinitionId = transition.getProcessDefinition().getId();
- activityName = transition.getSource().getName();
- transitionIndex = transition.getSource().getOutgoingTransitions().indexOf(transition);
+
+ Map<String, Object> asyncExecutionInfo = new HashMap<String, Object>();
+
+ TransitionImpl transition = execution.getTransition();
+ if (transition!=null) {
+ ActivityImpl source = transition.getSource();
+ asyncExecutionInfo.put(KEY_TRANSITION_SOURCE, source.getName());
+ asyncExecutionInfo.put(KEY_TRANSITION_SOURCE_INDEX, source.getOutgoingTransitions().indexOf(transition));
}
+
+ asyncExecutionInfo.put(KEY_STATE, execution.getState());
+
+ ObservableElementImpl eventSource = (ObservableElementImpl) execution.getEventSource();
+ if (eventSource instanceof ProcessDefinitionImpl) {
+ asyncExecutionInfo.put(KEY_EVENT_SOURCE_PROCESS_DEFINITION, null);
+
+ } else if (eventSource instanceof ActivityImpl) {
+ asyncExecutionInfo.put(KEY_EVENT_SOURCE_ACTIVITY, eventSource.getName());
+
+ } else if (eventSource instanceof TransitionImpl) {
+ asyncExecutionInfo.put(KEY_EVENT_SOURCE_TRANSITION, null);
+ }
+
+ EventImpl event = execution.getEvent();
+ asyncExecutionInfo.put(KEY_EVENT_OBSERVABLE_PARENT_LEVEL, getEventObservableParentLevel(eventSource, event.getObservableElement()));
+ asyncExecutionInfo.put(KEY_EVENT_NAME, event.getName());
- eventName = event.getName();
- eventListenerIndex = event.getListenerReferences().indexOf(eventListenerReference);
+ asyncExecutionInfo.put(KEY_EVENT_LISTENER_INDEX, execution.getEventListenerIndex());
+
+ AtomicOperation eventCompletedOperation = execution.getEventCompletedOperation();
+ String eventCompletedOperationText = null;
+ if (eventCompletedOperation!=null) {
+ eventCompletedOperationText = eventCompletedOperation.toString();
+ }
+ asyncExecutionInfo.put(KEY_EVENT_COMPLETED_OPERATION, eventCompletedOperationText);
+
+ setConfiguration(asyncExecutionInfo);
}
+ public Integer getEventObservableParentLevel(ObservableElementImpl eventSource, ObservableElementImpl observableElement) {
+ int parentLevel = 0;
+ while (eventSource!=observableElement) {
+ parentLevel++;
+ eventSource = eventSource.getParent();
+ }
+ return parentLevel;
+ }
+
public Object execute(Environment environment) throws Exception {
- ObservableElementImpl observableElement = null;
+ Map<String, Object> asyncExecutionInfo = (Map) getConfiguration();
+
+ String transitionSourceName = (String) asyncExecutionInfo.get(KEY_TRANSITION_SOURCE);
+ TransitionImpl transition = null;
+ if (transitionSourceName!=null) {
+ ProcessDefinitionImpl processDefinition = execution.getProcessDefinition();
+ ActivityImpl transitionSource = processDefinition.findActivity(transitionSourceName);
+ Integer transitionIndex = (Integer) asyncExecutionInfo.get(KEY_TRANSITION_SOURCE_INDEX);
+ transition = (TransitionImpl) transitionSource.getOutgoingTransitions().get(transitionIndex);
+ execution.setTransition(transition);
+ }
+
+ if (asyncExecutionInfo.containsKey(KEY_EVENT_SOURCE_PROCESS_DEFINITION)){
+ ProcessDefinitionImpl processDefinition = execution.getProcessDefinition();
+ execution.setEventSource(processDefinition);
+
+ } else if (asyncExecutionInfo.containsKey(KEY_EVENT_SOURCE_ACTIVITY)){
+ ProcessDefinitionImpl processDefinition = execution.getProcessDefinition();
+ String activityName = (String) asyncExecutionInfo.get(KEY_EVENT_SOURCE_ACTIVITY);
+ ActivityImpl activity = processDefinition.findActivity(activityName);
+ execution.setEventSource(activity);
- RepositorySession repositorySession = environment.get(RepositorySession.class);
- ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) repositorySession.findProcessDefinitionById(processDefinitionId);
- if (activityName!=null) {
- ActivityImpl activity = processDefinition.findActivity(activityName);
- if (transitionIndex!=null) {
- TransitionImpl transition = (TransitionImpl) activity.getOutgoingTransitions().get(transitionIndex);
- observableElement = transition;
- } else {
- observableElement = activity;
- }
- } else {
- observableElement = processDefinition;
+ } else if (asyncExecutionInfo.containsKey(KEY_EVENT_SOURCE_TRANSITION)){
+ execution.setEventSource(transition);
}
+ ObservableElementImpl observableElement = (ObservableElementImpl) execution.getEventSource();
+ int parentLevel = (Integer) asyncExecutionInfo.get(KEY_EVENT_OBSERVABLE_PARENT_LEVEL);
+ for (int i=0; i<parentLevel; parentLevel++) {
+ observableElement = observableElement.getParent();
+ }
+
+ String eventName = (String) asyncExecutionInfo.get(KEY_EVENT_NAME);
EventImpl event = observableElement.getEvent(eventName);
- EventListenerReference eventListenerReference = event.getListenerReferences().get(eventListenerIndex);
- EventListener eventListener = eventListenerReference.get();
+ execution.setEvent(event);
- eventListener.notify(execution);
+ Integer eventListenerIndex = (Integer) asyncExecutionInfo.get(KEY_EVENT_LISTENER_INDEX);
+ execution.setEventListenerIndex(eventListenerIndex);
+
+ String eventCompletedOperationText = (String) asyncExecutionInfo.get(KEY_EVENT_COMPLETED_OPERATION);
+ AtomicOperation eventCompletedOperation = AtomicOperation.parseAtomicOperation(eventCompletedOperationText);
+ execution.setEventCompletedOperation(eventCompletedOperation);
+ execution.setState((String) asyncExecutionInfo.get(KEY_STATE));
+
+ execution.performAtomicOperationSync(AtomicOperation.EXECUTE_EVENT_LISTENER);
+
+ JobDbSession jobDbSession = environment.get(JobDbSession.class);
+ jobDbSession.delete(this);
+
return null;
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToChildActivity.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToChildActivity.java 2009-05-27 21:43:23 UTC (rev 4923)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToChildActivity.java 2009-05-28 07:17:22 UTC (rev 4924)
@@ -29,7 +29,7 @@
/**
* @author Tom Baeyens
*/
-public class MoveToChildActivity implements AtomicOperation {
+public class MoveToChildActivity extends AtomicOperation {
ActivityImpl activity;
@@ -40,7 +40,7 @@
public void perform(ExecutionImpl execution) {
execution.setActivity(activity);
ExecutionImpl propagatingExecution = execution.startActivity(activity);
- propagatingExecution.performAtomicOperation(ExecutionImpl.EXECUTE_ACTIVITY);
+ propagatingExecution.performAtomicOperation(AtomicOperation.EXECUTE_ACTIVITY);
}
public boolean isAsync(ExecutionImpl execution) {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToParentActivity.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToParentActivity.java 2009-05-27 21:43:23 UTC (rev 4923)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToParentActivity.java 2009-05-28 07:17:22 UTC (rev 4924)
@@ -28,7 +28,7 @@
/**
* @author Tom Baeyens
*/
-public class MoveToParentActivity implements AtomicOperation {
+public class MoveToParentActivity extends AtomicOperation {
public void perform(ExecutionImpl execution) {
ActivityImpl activity = execution.getActivity();
@@ -36,7 +36,7 @@
ExecutionImpl propagatingExecution = execution.endActivity(activity);
propagatingExecution.setActivity(parentActivity);
- propagatingExecution.performAtomicOperation(new Signal(null, null, parentActivity));
+ propagatingExecution.performAtomicOperation(new Signal(null, null));
}
public MessageImpl<?> createAsyncMessage(ExecutionImpl execution) {
@@ -46,4 +46,8 @@
public boolean isAsync(ExecutionImpl execution) {
return false;
}
+
+ public String toString() {
+ return "MoveToParentActivity";
+ }
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java 2009-05-27 21:43:23 UTC (rev 4923)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java 2009-05-28 07:17:22 UTC (rev 4924)
@@ -34,18 +34,16 @@
/**
* @author Tom Baeyens
*/
-public class Signal implements AtomicOperation {
+public class Signal extends AtomicOperation {
private static final Log log = Log.getLog(Signal.class.getName());
String signalName;
Map<String, ?> parameters;
- ActivityImpl activity;
- public Signal(String signalName, Map<String, ?> parameters, ActivityImpl activity) {
+ public Signal(String signalName, Map<String, ?> parameters) {
this.signalName = signalName;
this.parameters = parameters;
- this.activity = activity;
}
public boolean isAsync(ExecutionImpl execution) {
@@ -53,6 +51,8 @@
}
public void perform(ExecutionImpl execution) {
+ ActivityImpl activity = execution.getActivity();
+
if (execution.getName()!=null) {
log.debug(execution.toString()+" signals "+activity);
} else {
@@ -82,6 +82,6 @@
}
public MessageImpl<?> createAsyncMessage(ExecutionImpl execution) {
- return new SignalMessage(execution, signalName, activity);
+ return null;
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/SignalMessage.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/SignalMessage.java 2009-05-27 21:43:23 UTC (rev 4923)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/SignalMessage.java 2009-05-28 07:17:22 UTC (rev 4924)
@@ -21,12 +21,14 @@
*/
package org.jbpm.pvm.internal.model.op;
+import java.util.Map;
+
import org.jbpm.api.Execution;
import org.jbpm.api.env.Environment;
import org.jbpm.pvm.internal.job.MessageImpl;
import org.jbpm.pvm.internal.jobexecutor.JobDbSession;
+import org.jbpm.pvm.internal.model.ActivityImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.ActivityImpl;
/**
* @author Tom Baeyens
@@ -36,21 +38,21 @@
private static final long serialVersionUID = 1L;
String signalName;
- ActivityImpl activity;
+ Map<String, ?> parameters;
public SignalMessage() {
}
- public SignalMessage(ExecutionImpl execution, String signalName, ActivityImpl activity) {
+ public SignalMessage(ExecutionImpl execution, String signalName, Map<String, ?> parameters) {
super(execution);
this.signalName = signalName;
- this.activity = activity;
+ this.parameters = parameters;
}
public Object execute(Environment environment) throws Exception {
execution.setState(Execution.STATE_ACTIVE_ROOT);
- Signal signal = new Signal(signalName, null, activity);
+ Signal signal = new Signal(signalName, parameters);
execution.performAtomicOperationSync(signal);
JobDbSession jobDbSession = environment.get(JobDbSession.class);
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionEndActivity.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionEndActivity.java 2009-05-27 21:43:23 UTC (rev 4923)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionEndActivity.java 2009-05-28 07:17:22 UTC (rev 4924)
@@ -1,97 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.model.op;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.job.MessageImpl;
-import org.jbpm.pvm.internal.model.ActivityImpl;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.ObservableElementImpl;
-import org.jbpm.pvm.internal.model.TransitionImpl;
-
-public class TransitionEndActivity implements AtomicOperation {
-
- private static final TransitionTake TRANSITION_TAKE = new TransitionTake();
-
- private static Log log = Log.getLog(TransitionEndActivity.class.getName());
-
- public boolean isAsync(ExecutionImpl execution) {
- TransitionImpl transition = execution.getTransition();
- List<ActivityImpl> leftActivities = getActivitiesLeft(execution.getActivity(), transition.getDestination());
- return execution.hasAsyncEndEvent(leftActivities);
- }
-
- public void perform(ExecutionImpl execution) {
- TransitionImpl transition = execution.getTransition();
-
- if (execution.getName() != null) {
- log.debug(execution.toString() + " takes " + transition);
- } else {
- log.debug("taking " + transition);
- }
-
- List<ActivityImpl> leftActivities = getActivitiesLeft(execution.getActivity(), transition.getDestination());
- ExecutionImpl propagatingExecution = endActivity(execution, leftActivities);
-
- propagatingExecution.performAtomicOperation(TRANSITION_TAKE);
- }
-
- public static ExecutionImpl endActivity(ExecutionImpl execution, List<ActivityImpl> leftActivities) {
- ExecutionImpl propagatingExecution = execution;
- for (ActivityImpl leftActivity : leftActivities) {
- propagatingExecution = propagatingExecution.endActivity(leftActivity);
- }
- propagatingExecution.setActivity(null);
- return propagatingExecution;
- }
-
- List<ActivityImpl> getActivitiesLeft(ActivityImpl source, ActivityImpl destination) {
- List<ActivityImpl> activitiesLeft = new ArrayList<ActivityImpl>();
-
- if (source.equals(destination)) {
- activitiesLeft.add(source);
- } else {
- List<ObservableElementImpl> destinationChain = destination.getParentChain();
-
- if (!destinationChain.contains(source)) {
- ActivityImpl sourceActivity = source;
- while ((sourceActivity != null) && (!destinationChain.contains(sourceActivity))) {
- activitiesLeft.add(sourceActivity);
- sourceActivity = sourceActivity.getParentActivity();
- }
- }
- }
-
- return activitiesLeft;
- }
-
- public String toString() {
- return "TakeTransition";
- }
-
- public MessageImpl< ? > createAsyncMessage(ExecutionImpl execution) {
- return new TransitionEndActivityMessage(execution);
- }
-}
\ No newline at end of file
Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionEndActivity.java (from rev 4923, jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionEndActivity.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionEndActivity.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionEndActivity.java 2009-05-28 07:17:22 UTC (rev 4924)
@@ -0,0 +1,67 @@
+/*
+ * 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.pvm.internal.model.op;
+
+import org.jbpm.api.model.Event;
+import org.jbpm.pvm.internal.job.MessageImpl;
+import org.jbpm.pvm.internal.model.ActivityImpl;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.ObservableElementImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TransitionEndActivity extends AtomicOperation {
+
+ public boolean isAsync(ExecutionImpl execution) {
+ return false;
+ }
+
+ public void perform(ExecutionImpl execution) {
+ ActivityImpl activity = execution.getActivity();
+
+ ExecutionImpl propagatingExecution = execution;
+ if (activity.isLocalScope()) {
+ propagatingExecution = execution.destroyScope(activity);
+ }
+
+ ActivityImpl parentActivity = activity.getParentActivity();
+ ActivityImpl destination = execution.getTransition().getDestination();
+ if ( (parentActivity!=null)
+ && (!parentActivity.contains(destination))
+ ) {
+ propagatingExecution.setActivity(parentActivity);
+ propagatingExecution.fire(Event.END, parentActivity, AtomicOperation.TRANSITION_END_ACTIVITY);
+ } else {
+ propagatingExecution.performAtomicOperation(AtomicOperation.TRANSITION_TAKE);
+ }
+ }
+
+ public MessageImpl< ? > createAsyncMessage(ExecutionImpl execution) {
+ throw new UnsupportedOperationException("please implement me");
+ }
+
+ public String toString() {
+ return "TransitionEndActivity";
+ }
+}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionEndActivityMessage.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionEndActivityMessage.java 2009-05-27 21:43:23 UTC (rev 4923)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionEndActivityMessage.java 2009-05-28 07:17:22 UTC (rev 4924)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.model.op;
-
-import org.jbpm.api.Execution;
-import org.jbpm.api.env.Environment;
-import org.jbpm.pvm.internal.job.MessageImpl;
-import org.jbpm.pvm.internal.jobexecutor.JobDbSession;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
-
-/**
- * @author Tom Baeyens
- */
-public class TransitionEndActivityMessage extends MessageImpl<Object> {
-
- private static final long serialVersionUID = 1L;
-
- public TransitionEndActivityMessage() {
- }
-
- public TransitionEndActivityMessage(ExecutionImpl execution) {
- super(execution);
- }
-
- public Object execute(Environment environment) throws Exception {
- AsyncContinuations.restoreState(execution);
-
- execution.performAtomicOperationSync(ExecutionImpl.TRANSITION_END_ACTIVITY);
-
- JobDbSession jobDbSession = environment.get(JobDbSession.class);
- jobDbSession.delete(this);
-
- return null;
- }
-
- public String toString() {
- return "TakeTransitionMessage["+dbid+"]";
- }
-}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionStartActivity.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionStartActivity.java 2009-05-27 21:43:23 UTC (rev 4923)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionStartActivity.java 2009-05-28 07:17:22 UTC (rev 4924)
@@ -21,68 +21,74 @@
*/
package org.jbpm.pvm.internal.model.op;
-import java.util.LinkedList;
-import java.util.List;
-
+import org.jbpm.api.JbpmException;
+import org.jbpm.api.model.Event;
import org.jbpm.pvm.internal.job.MessageImpl;
+import org.jbpm.pvm.internal.model.ActivityImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.ActivityImpl;
-import org.jbpm.pvm.internal.model.ObservableElementImpl;
+import org.jbpm.pvm.internal.model.TransitionImpl;
/**
* @author Tom Baeyens
*/
-public class TransitionStartActivity implements AtomicOperation {
+public class TransitionStartActivity extends AtomicOperation {
public boolean isAsync(ExecutionImpl execution) {
return false;
}
public void perform(ExecutionImpl execution) {
- ActivityImpl destination = execution.getTransition().getDestination();
- execution.setActivity(destination);
- List<ActivityImpl> enteredActivities = getActivitiesEntered(execution.getTransitionSource(), destination);
+ TransitionImpl transition = execution.getTransition();
+ ActivityImpl source = transition.getSource();
+ ActivityImpl destination = transition.getDestination();
- ExecutionImpl propagatingExecution = execution;
- for (ActivityImpl enteredActivity : enteredActivities) {
- propagatingExecution = propagatingExecution.startActivity(enteredActivity);
- }
-
- propagatingExecution.setActivity(destination);
- propagatingExecution.setTransition(null);
-
- propagatingExecution.performAtomicOperation(ExecutionImpl.EXECUTE_ACTIVITY);
- }
-
- public List<ActivityImpl> getActivitiesEntered(ActivityImpl origin, ActivityImpl destination) {
- LinkedList<ActivityImpl> activitiesEntered = new LinkedList<ActivityImpl>();
-
- if (origin.equals(destination)) {
- activitiesEntered.add(destination);
+ ActivityImpl activity = execution.getActivity();
+ if (activity==null) {
+ // find outer most activity to start
+ activity = destination;
+ while ( (activity.getParentActivity()!=null)
+ && (!activity.getParentActivity().contains(source))
+ ) {
+ activity = activity.getParentActivity();
+ }
+ } else if (activity==destination){
+ activity = null;
+
} else {
- List<ObservableElementImpl> sourceChain = origin.getParentChain();
-
- if (!sourceChain.contains(destination)) {
- ActivityImpl destinationActivity = destination;
- while ( (destinationActivity!=null)
- && (!sourceChain.contains(destinationActivity))
- ) {
- activitiesEntered.addFirst(destinationActivity);
- destinationActivity = destinationActivity.getParentActivity();
- }
+ ActivityImpl parent = activity;
+ activity = destination;
+ while ( (activity!=null)
+ && (activity.getParent()!=parent)
+ ) {
+ activity = activity.getParentActivity();
}
+ if (activity==null) {
+ throw new JbpmException("implementation bug: couldn't find parent "+parent+" around destination "+destination);
+ }
}
- return activitiesEntered;
+ if (activity==null) {
+ execution.setTransition(null);
+ execution.performAtomicOperation(AtomicOperation.EXECUTE_ACTIVITY);
+
+ } else {
+ execution.setActivity(activity);
+
+ ExecutionImpl propagatingExecution = execution;
+ if (activity.isLocalScope()) {
+ propagatingExecution = execution.createScope(activity);
+ }
+
+ propagatingExecution.fire(Event.START, activity, AtomicOperation.TRANSITION_START_ACTIVITY);
+ }
}
-
- public String toString() {
- return "ProceedToDestination";
+ public MessageImpl<?> createAsyncMessage(ExecutionImpl execution) {
+ throw new UnsupportedOperationException("please implement me");
}
- public MessageImpl<?> createAsyncMessage(ExecutionImpl execution) {
- return new TransitionStartActivityMessage(execution);
+ public String toString() {
+ return "TransitionStartActivity";
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionStartActivityMessage.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionStartActivityMessage.java 2009-05-27 21:43:23 UTC (rev 4923)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionStartActivityMessage.java 2009-05-28 07:17:22 UTC (rev 4924)
@@ -21,7 +21,6 @@
*/
package org.jbpm.pvm.internal.model.op;
-import org.jbpm.api.Execution;
import org.jbpm.api.env.Environment;
import org.jbpm.pvm.internal.job.MessageImpl;
import org.jbpm.pvm.internal.jobexecutor.JobDbSession;
@@ -44,7 +43,7 @@
public Object execute(Environment environment) throws Exception {
AsyncContinuations.restoreState(execution);
- execution.performAtomicOperationSync(ExecutionImpl.TRANSITION_START_ACTIVITY);
+ execution.performAtomicOperationSync(AtomicOperation.TRANSITION_START_ACTIVITY);
JobDbSession jobDbSession = environment.get(JobDbSession.class);
jobDbSession.delete(this);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionTake.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionTake.java 2009-05-27 21:43:23 UTC (rev 4923)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionTake.java 2009-05-28 07:17:22 UTC (rev 4924)
@@ -23,7 +23,6 @@
import org.jbpm.api.model.Event;
import org.jbpm.pvm.internal.job.MessageImpl;
-import org.jbpm.pvm.internal.model.EventImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.model.TransitionImpl;
@@ -31,21 +30,23 @@
/**
* @author Tom Baeyens
*/
-public class TransitionTake implements AtomicOperation {
+public class TransitionTake extends AtomicOperation {
public boolean isAsync(ExecutionImpl execution) {
- TransitionImpl transition = execution.getTransition();
- EventImpl event = transition.getEvent(Event.TAKE);
- return ((event!=null) && (event.isAsync()));
+ return false;
}
public void perform(ExecutionImpl execution) {
TransitionImpl transition = execution.getTransition();
- execution.fire(Event.TAKE, transition);
- execution.performAtomicOperation(ExecutionImpl.TRANSITION_START_ACTIVITY);
+ execution.setActivity(null);
+ execution.fire(Event.TAKE, transition, AtomicOperation.TRANSITION_START_ACTIVITY);
}
public MessageImpl< ? > createAsyncMessage(ExecutionImpl execution) {
- return new TransitionTakeMessage(execution);
+ return null;
}
+
+ public String toString() {
+ return "TransitionTake";
+ }
}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionTakeMessage.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionTakeMessage.java 2009-05-27 21:43:23 UTC (rev 4923)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionTakeMessage.java 2009-05-28 07:17:22 UTC (rev 4924)
@@ -1,59 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.model.op;
-
-import org.jbpm.api.Execution;
-import org.jbpm.api.env.Environment;
-import org.jbpm.pvm.internal.job.MessageImpl;
-import org.jbpm.pvm.internal.jobexecutor.JobDbSession;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
-
-
-/**
- * @author Tom Baeyens
- */
-public class TransitionTakeMessage extends MessageImpl<Object> {
-
- private static final long serialVersionUID = 1L;
-
- public TransitionTakeMessage() {
- }
-
- public TransitionTakeMessage(ExecutionImpl execution) {
- super(execution);
- }
-
- public Object execute(Environment environment) throws Exception {
- AsyncContinuations.restoreState(execution);
-
- execution.performAtomicOperationSync(ExecutionImpl.TRANSITION_TAKE);
-
- JobDbSession jobDbSession = environment.get(JobDbSession.class);
- jobDbSession.delete(this);
-
- return null;
- }
-
- public String toString() {
- return "TransitionTakeMessage["+dbid+"]";
- }
-}
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml 2009-05-27 21:43:23 UTC (rev 4923)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml 2009-05-28 07:17:22 UTC (rev 4924)
@@ -30,8 +30,6 @@
<property name="activityName" column="ACTIVITYNAME_" />
<property name="processDefinitionId" column="PROCDEFID_" />
- <property name="transitionSourceName" column="TRANSRC_" />
- <property name="transitionSourceIndex" column="TRANSRCIDX_" />
<property name="hasVariables" column="HASVARS_" />
<map name="variables"
@@ -206,7 +204,6 @@
<property name="isExclusive" column="ISEXCLUSIVE_" />
<property name="lockOwner" column="LOCKOWNER_" />
<property name="lockExpirationTime" column="LOCKEXPTIME_" index="IDX_JOBLOCKEXP" />
- <property name="info" column="INFO_" />
<property name="exception" column="EXCEPTION_" type="text" />
<property name="retries" column="RETRIES_" index="IDX_JOBRETRIES" />
@@ -233,19 +230,7 @@
<subclass name="org.jbpm.pvm.internal.job.MessageImpl" discriminator-value="Msg">
<subclass name="org.jbpm.pvm.internal.model.op.ExecuteActivityMessage" discriminator-value="ExeAct" />
- <subclass name="org.jbpm.pvm.internal.model.op.SignalMessage" discriminator-value="Signal">
- <property name="signalName" column="SIGNAL_" />
- </subclass>
- <subclass name="org.jbpm.pvm.internal.model.op.TransitionEndActivityMessage" discriminator-value="TrEndAct" />
- <subclass name="org.jbpm.pvm.internal.model.op.TransitionTakeMessage" discriminator-value="TrTake" />
- <subclass name="org.jbpm.pvm.internal.model.op.TransitionStartActivityMessage" discriminator-value="TrStartAct" />
- <subclass name="org.jbpm.pvm.internal.model.op.ExecuteEventListenerMessage" discriminator-value="ExeEvtLst">
- <property name="processDefinitionId" column="PROCDEF_" />
- <property name="activityName" column="ACT_" />
- <property name="transitionIndex" column="TRIDX_" />
- <property name="eventName" column="EVENT_" />
- <property name="eventListenerIndex" column="EVTLSTIDX_" />
- </subclass>
+ <subclass name="org.jbpm.pvm.internal.model.op.ExecuteEventListenerMessage" discriminator-value="ExeEvtLsnr" />
<subclass name="org.jbpm.pvm.internal.job.CommandMessage" discriminator-value="Cmd" />
</subclass>
Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/EventTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/EventTest.java 2009-05-27 21:43:23 UTC (rev 4923)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/EventTest.java 2009-05-28 07:17:22 UTC (rev 4924)
@@ -231,44 +231,4 @@
execution.end();
}
}
-
- public static class RecordingProcessDefinition extends ProcessDefinitionImpl {
- private static final long serialVersionUID = 1L;
- protected ExecutionImpl newProcessInstance() {
- return new RecordingExecution();
- }
- }
-
- public static class RecordingExecution extends ExecutionImpl {
- private static final long serialVersionUID = 1L;
- List<String> events = new ArrayList<String>();
- public void fire(String eventName, ObservableElement eventSource) {
- events.add(eventName+" on "+eventSource);
- }
- }
-
- public void testBasicEventSequence() {
- ClientProcessDefinition processDefinition = ProcessDefinitionBuilder
- .startProcess("basic", new RecordingProcessDefinition())
- .startActivity("initial", new AutomaticActivity())
- .initial()
- .transition("end")
- .endActivity()
- .startActivity("end", new EndState())
- .endActivity()
- .endProcess();
-
- RecordingExecution execution = (RecordingExecution) processDefinition.startProcessInstance();
-
- int index = 0;
- assertEquals("start on process(basic)", execution.events.get(index));
- index++;
- assertEquals("end on activity(initial)", execution.events.get(index));
- index++;
- assertEquals("take on (initial)-->(end)", execution.events.get(index));
- index++;
- assertEquals("start on activity(end)", execution.events.get(index));
- index++;
- assertEquals("end on process(basic)", execution.events.get(index));
- }
}
Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionEventsTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionEventsTest.java 2009-05-27 21:43:23 UTC (rev 4923)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionEventsTest.java 2009-05-28 07:17:22 UTC (rev 4924)
@@ -45,7 +45,48 @@
}
}
+ public void testBasicEvents(){
+ Recorder fromListener = new Recorder();
+ Recorder toListener = new Recorder();
+ Recorder transitionListener = new Recorder();
+ /*
+ +------+ +----+
+ | from |------->| to |
+ +------+ +----+
+ */
+
+ ClientProcessDefinition processDefinition = ProcessDefinitionBuilder
+ .startProcess("p")
+ .startActivity("from", new WaitState())
+ .initial()
+ .startEvent(Event.END)
+ .listener(fromListener)
+ .endEvent()
+ .startFlow("to")
+ .listener(transitionListener)
+ .endFlow()
+ .endActivity()
+ .startActivity("to", new WaitState())
+ .startEvent(Event.START)
+ .listener(toListener)
+ .endEvent()
+ .endActivity()
+ .endProcess();
+
+ ClientExecution execution = processDefinition.startProcessInstance();
+ execution.signal();
+
+ assertEquals("[event(end) on activity(from)]",
+ fromListener.events.toString());
+
+ assertEquals("[event(take) on (from)-->(to)]",
+ transitionListener.events.toString());
+
+ assertEquals("[event(start) on activity(to)]",
+ toListener.events.toString());
+ }
+
public void testCompositeLeave(){
Recorder processListener = new Recorder();
Recorder outsideListener = new Recorder();
15 years
JBoss JBPM SVN: r4923 - jbpm4/trunk/modules/integration/report/src/main/resources.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-05-27 17:43:23 -0400 (Wed, 27 May 2009)
New Revision: 4923
Modified:
jbpm4/trunk/modules/integration/report/src/main/resources/definition_report.rptdesign
jbpm4/trunk/modules/integration/report/src/main/resources/process_activity.rptdesign
Log:
more work on reports
Modified: jbpm4/trunk/modules/integration/report/src/main/resources/definition_report.rptdesign
===================================================================
--- jbpm4/trunk/modules/integration/report/src/main/resources/definition_report.rptdesign 2009-05-27 21:26:30 UTC (rev 4922)
+++ jbpm4/trunk/modules/integration/report/src/main/resources/definition_report.rptdesign 2009-05-27 21:43:23 UTC (rev 4923)
@@ -775,12 +775,13 @@
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">1px</property>
<property name="marginTop">0pt</property>
+ <property name="marginLeft">10pt</property>
<property name="marginBottom">10pt</property>
<property name="paddingTop">5pt</property>
<property name="paddingLeft">5pt</property>
<property name="paddingBottom">5pt</property>
<property name="paddingRight">5pt</property>
- <text-property name="text">Process Definition Report</text-property>
+ <text-property name="text">Process Definition Workload</text-property>
</label>
<table id="28">
<property name="marginLeft">10pt</property>
@@ -902,7 +903,7 @@
<label id="103">
<property name="color">#CCCCCC</property>
<property name="marginTop">0pt</property>
- <property name="marginRight">10pt</property>
+ <property name="marginRight">20pt</property>
<property name="textAlign">right</property>
<text-property name="text">Date Created:</text-property>
</label>
@@ -982,7 +983,7 @@
<text-data id="105">
<property name="color">#CCCCCC</property>
<property name="marginTop">0pt</property>
- <property name="marginRight">10pt</property>
+ <property name="marginRight">20pt</property>
<property name="textAlign">right</property>
<expression name="valueExpr">new Date()</expression>
<property name="contentType">html</property>
@@ -1070,7 +1071,7 @@
<Visible>true</Visible>
<Label>
<Caption>
- <Value>Long Running</Value>
+ <Value>Long running instances</Value>
<Font>
<Name>SansSerif</Name>
<Size>12.0</Size>
Modified: jbpm4/trunk/modules/integration/report/src/main/resources/process_activity.rptdesign
===================================================================
--- jbpm4/trunk/modules/integration/report/src/main/resources/process_activity.rptdesign 2009-05-27 21:26:30 UTC (rev 4922)
+++ jbpm4/trunk/modules/integration/report/src/main/resources/process_activity.rptdesign 2009-05-27 21:43:23 UTC (rev 4923)
@@ -662,10 +662,10 @@
<property name="marginTop">0pt</property>
<property name="marginBottom">10pt</property>
<property name="paddingTop">5pt</property>
- <property name="paddingLeft">5pt</property>
+ <property name="paddingLeft">10pt</property>
<property name="paddingBottom">5pt</property>
<property name="paddingRight">5pt</property>
- <text-property name="text">Process Activity Report</text-property>
+ <text-property name="text">Overall System Activity</text-property>
</label>
<grid id="94">
<property name="marginLeft">10pt</property>
@@ -755,7 +755,7 @@
<label id="103">
<property name="color">#CCCCCC</property>
<property name="marginTop">0pt</property>
- <property name="marginRight">10pt</property>
+ <property name="marginRight">20pt</property>
<property name="textAlign">right</property>
<text-property name="text">Date Created:</text-property>
</label>
@@ -799,7 +799,7 @@
<text-data id="105">
<property name="color">#CCCCCC</property>
<property name="marginTop">0pt</property>
- <property name="marginRight">10pt</property>
+ <property name="marginRight">20pt</property>
<property name="textAlign">right</property>
<expression name="valueExpr">new Date()</expression>
<property name="contentType">html</property>
@@ -884,7 +884,7 @@
<Visible>true</Visible>
<Label>
<Caption>
- <Value>Most active</Value>
+ <Value>Most active process</Value>
<Font>
<Name>SansSerif</Name>
<Size>12.0</Size>
@@ -1470,7 +1470,7 @@
<Separator>, </Separator>
</DataPoint>
<LabelPosition>Inside</LabelPosition>
- <Stacked>true</Stacked>
+ <Stacked>false</Stacked>
<Triggers>
<Condition>onclick</Condition>
<Action>
@@ -2599,7 +2599,7 @@
<Visible>true</Visible>
<Label>
<Caption>
- <Value>Long running</Value>
+ <Value>Long running process</Value>
<Font>
<Name>SansSerif</Name>
<Size>12.0</Size>
15 years
JBoss JBPM SVN: r4922 - jbpm4/trunk/modules/integration/report/src/main/resources.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-05-27 17:26:30 -0400 (Wed, 27 May 2009)
New Revision: 4922
Modified:
jbpm4/trunk/modules/integration/report/src/main/resources/definition_report.rptconfig
jbpm4/trunk/modules/integration/report/src/main/resources/definition_report.rptdesign
Log:
more work on reports
Modified: jbpm4/trunk/modules/integration/report/src/main/resources/definition_report.rptconfig
===================================================================
--- jbpm4/trunk/modules/integration/report/src/main/resources/definition_report.rptconfig 2009-05-27 21:08:01 UTC (rev 4921)
+++ jbpm4/trunk/modules/integration/report/src/main/resources/definition_report.rptconfig 2009-05-27 21:26:30 UTC (rev 4922)
@@ -3,11 +3,11 @@
<list-property name="configVars">
<structure>
<property name="name">__isdisplay__id_42_0</property>
- <property name="value">simple-1</property>
+ <property name="value">simple-2</property>
</structure>
<structure>
<property name="name">id_42_1</property>
- <property name="value">simple-1</property>
+ <property name="value">simple-2</property>
</structure>
<structure>
<property name="name">id_42_type_</property>
Modified: jbpm4/trunk/modules/integration/report/src/main/resources/definition_report.rptdesign
===================================================================
--- jbpm4/trunk/modules/integration/report/src/main/resources/definition_report.rptdesign 2009-05-27 21:08:01 UTC (rev 4921)
+++ jbpm4/trunk/modules/integration/report/src/main/resources/definition_report.rptdesign 2009-05-27 21:26:30 UTC (rev 4922)
@@ -577,8 +577,7 @@
</design:resultSetColumns>
</design:resultSetDefinitions>
</design:ResultSets>
-</model:DesignValues>
-]]></xml-property>
+</model:DesignValues>]]></xml-property>
</oda-data-set>
<oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" name="execution_time" id="154">
<list-property name="computedColumns">
@@ -597,6 +596,16 @@
</structure>
</list-property>
</structure>
+ <structure>
+ <property name="name">index</property>
+ <property name="dataType">integer</property>
+ <property name="aggregateFunction">RUNNINGCOUNT</property>
+ <list-property name="arguments">
+ <structure>
+ <property name="name">Expression</property>
+ </structure>
+ </list-property>
+ </structure>
</list-property>
<list-property name="columnHints">
<structure>
@@ -625,6 +634,11 @@
<property name="name">q3</property>
<property name="dataType">integer</property>
</structure>
+ <structure>
+ <property name="position">4</property>
+ <property name="name">index</property>
+ <property name="dataType">integer</property>
+ </structure>
</list-property>
</structure>
<property name="dataSource">MySQL</property>
@@ -793,7 +807,7 @@
</detail>
</table>
<table id="128">
- <property name="marginTop">10pt</property>
+ <property name="marginTop">0pt</property>
<property name="marginLeft">10pt</property>
<property name="width">100%</property>
<list-property name="boundDataColumns">
@@ -812,6 +826,7 @@
<property name="width">2.361111111111111in</property>
</column>
<column id="142"/>
+ <column id="189"/>
<detail>
<row id="132">
<cell id="133">
@@ -883,6 +898,15 @@
<property name="resultSetColumn">Column Binding</property>
</data>
</cell>
+ <cell id="187">
+ <label id="103">
+ <property name="color">#CCCCCC</property>
+ <property name="marginTop">0pt</property>
+ <property name="marginRight">10pt</property>
+ <property name="textAlign">right</property>
+ <text-property name="text">Date Created:</text-property>
+ </label>
+ </cell>
</row>
<row id="135">
<cell id="136">
@@ -954,17 +978,29 @@
<property name="resultSetColumn">total_active</property>
</data>
</cell>
+ <cell id="188">
+ <text-data id="105">
+ <property name="color">#CCCCCC</property>
+ <property name="marginTop">0pt</property>
+ <property name="marginRight">10pt</property>
+ <property name="textAlign">right</property>
+ <expression name="valueExpr">new Date()</expression>
+ <property name="contentType">html</property>
+ </text-data>
+ </cell>
</row>
</detail>
</table>
<grid id="148">
- <property name="marginTop">10pt</property>
- <property name="marginLeft">10pt</property>
+ <property name="marginTop">0pt</property>
+ <property name="marginLeft">0pt</property>
<property name="width">100%</property>
<column id="149">
- <property name="width">50%</property>
+ <property name="width">40%</property>
</column>
- <column id="150"/>
+ <column id="150">
+ <property name="width">60%</property>
+ </column>
<row id="151">
<cell id="152">
<table id="156">
@@ -987,6 +1023,11 @@
<expression name="expression">dataSetRow["q3"]</expression>
<property name="dataType">integer</property>
</structure>
+ <structure>
+ <property name="name">index</property>
+ <expression name="expression">dataSetRow["index"]</expression>
+ <property name="dataType">string</property>
+ </structure>
</list-property>
<method name="onCreate"><![CDATA[reportContext.setPersistentGlobalVariable("3_quartile",this.getRowData().getColumnValue("q3"));]]></method>
<column id="163"/>
@@ -1029,7 +1070,7 @@
<Visible>true</Visible>
<Label>
<Caption>
- <Value>Execution Time</Value>
+ <Value>Long Running</Value>
<Font>
<Name>SansSerif</Name>
<Size>12.0</Size>
@@ -1222,7 +1263,7 @@
<Bounds>
<Left>0.0</Left>
<Top>0.0</Top>
- <Width>212.0</Width>
+ <Width>250.0</Width>
<Height>130.0</Height>
</Bounds>
<Insets>
@@ -1625,7 +1666,7 @@
<Green>192</Green>
<Blue>192</Blue>
</Color>
- <Visible>true</Visible>
+ <Visible>false</Visible>
</LineAttributes>
<Label>
<Caption>
@@ -1681,7 +1722,7 @@
<Green>196</Green>
<Blue>196</Blue>
</Color>
- <Visible>true</Visible>
+ <Visible>false</Visible>
</TickAttributes>
</MajorGrid>
<MinorGrid>
@@ -1954,7 +1995,7 @@
<Visible>false</Visible>
</Label>
<DataDefinition>
- <Definition>row["instanceId"]</Definition>
+ <Definition>row["index"]</Definition>
</DataDefinition>
<SeriesIdentifier></SeriesIdentifier>
<DataPoint>
@@ -2029,7 +2070,7 @@
</Color>
<Visible>false</Visible>
</LineAttributes>
- <TickStyle>Across</TickStyle>
+ <TickStyle>Above</TickStyle>
<TickAttributes>
<Style>Solid</Style>
<Thickness>1</Thickness>
@@ -2086,8 +2127,19 @@
</model:ChartWithAxes>
]]></xml-property>
<property name="outputFormat">SVG</property>
- <property name="height">130pt</property>
- <property name="width">212pt</property>
+ <list-property name="filter">
+ <structure>
+ <property name="operator">ge</property>
+ <expression name="expr">row["DURATION_"]</expression>
+ <simple-property-list name="value1">
+ <value>row["q3"]</value>
+ </simple-property-list>
+ </structure>
+ </list-property>
+ <property name="marginTop">10pt</property>
+ <property name="marginLeft">10pt</property>
+ <property name="height">130px</property>
+ <property name="width">250px</property>
</extended-item>
</cell>
</row>
@@ -2099,7 +2151,115 @@
</detail>
</table>
</cell>
- <cell id="153"/>
+ <cell id="153">
+ <table id="165">
+ <property name="marginTop">15pt</property>
+ <property name="marginLeft">10pt</property>
+ <property name="width">80%</property>
+ <property name="dataSet">execution_time</property>
+ <list-property name="boundDataColumns">
+ <structure>
+ <property name="name">instanceId</property>
+ <expression name="expression">dataSetRow["instanceId"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="name">DURATION_</property>
+ <expression name="expression">dataSetRow["DURATION_"]</expression>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="name">q3</property>
+ <expression name="expression">dataSetRow["q3"]</expression>
+ <property name="dataType">integer</property>
+ </structure>
+ <structure>
+ <property name="name">index</property>
+ <expression name="expression">dataSetRow["index"]</expression>
+ <property name="dataType">integer</property>
+ </structure>
+ <structure>
+ <property name="name">Column Binding</property>
+ <property name="displayName">ref</property>
+ <expression name="expression">dataSetRow["index"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="name">Column Binding_1</property>
+ <property name="displayName">id</property>
+ <expression name="expression">dataSetRow["instanceId"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="name">Column Binding_2</property>
+ <expression name="expression">dataSetRow["DURATION_"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ </list-property>
+ <list-property name="filter">
+ <structure>
+ <property name="operator">le</property>
+ <expression name="expr">row["index"]</expression>
+ <simple-property-list name="value1">
+ <value>15</value>
+ </simple-property-list>
+ </structure>
+ <structure>
+ <property name="operator">ge</property>
+ <expression name="expr">row["DURATION_"]</expression>
+ <simple-property-list name="value1">
+ <value>row["q3"]</value>
+ </simple-property-list>
+ </structure>
+ </list-property>
+ <column id="178"/>
+ <column id="179"/>
+ <column id="180"/>
+ <header>
+ <row id="166">
+ <cell id="167">
+ <label id="181">
+ <property name="textAlign">left</property>
+ <text-property name="text">Ref</text-property>
+ </label>
+ </cell>
+ <cell id="168">
+ <label id="182">
+ <property name="textAlign">left</property>
+ <text-property name="text">ID</text-property>
+ </label>
+ </cell>
+ <cell id="169">
+ <label id="183">
+ <property name="textAlign">left</property>
+ <text-property name="text">Completion Time</text-property>
+ </label>
+ </cell>
+ </row>
+ </header>
+ <detail>
+ <row id="170">
+ <property name="fontSize">10pt</property>
+ <cell id="171">
+ <data id="184">
+ <property name="fontSize">10pt</property>
+ <property name="resultSetColumn">Column Binding</property>
+ </data>
+ </cell>
+ <cell id="172">
+ <data id="185">
+ <property name="resultSetColumn">Column Binding_1</property>
+ </data>
+ </cell>
+ <cell id="173">
+ <data id="186">
+ <property name="resultSetColumn">Column Binding_2</property>
+ </data>
+ </cell>
+ </row>
+ </detail>
+ </table>
+ </cell>
</row>
</grid>
</body>
15 years
JBoss JBPM SVN: r4921 - jbpm4/trunk/modules/integration/report/src/main/resources.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-05-27 17:08:01 -0400 (Wed, 27 May 2009)
New Revision: 4921
Modified:
jbpm4/trunk/modules/integration/report/src/main/resources/process_activity.rptdesign
Log:
limit table size to 15
Modified: jbpm4/trunk/modules/integration/report/src/main/resources/process_activity.rptdesign
===================================================================
--- jbpm4/trunk/modules/integration/report/src/main/resources/process_activity.rptdesign 2009-05-27 21:01:39 UTC (rev 4920)
+++ jbpm4/trunk/modules/integration/report/src/main/resources/process_activity.rptdesign 2009-05-27 21:08:01 UTC (rev 4921)
@@ -76,7 +76,8 @@
<property name="queryText">SELECT d.DBID_ as dpl, p.STRINGVAL_ as processId FROM JBPM4_DEPLOYMENT d, JBPM4_DEPLOYPROP p
WHERE p.KEY_='pdid'
AND d.DBID_=p.DEPLOYMENT_
- GROUP BY dpl</property>
+ GROUP BY dpl
+ LIMIT 10</property>
<xml-property name="designerValues"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<model:DesignValues xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design" xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
<Version>1.0</Version>
@@ -2435,6 +2436,15 @@
<property name="dataType">string</property>
</structure>
</list-property>
+ <list-property name="filter">
+ <structure>
+ <property name="operator">le</property>
+ <expression name="expr">row["Column Binding"]</expression>
+ <simple-property-list name="value1">
+ <value>15</value>
+ </simple-property-list>
+ </structure>
+ </list-property>
<column id="195">
<property name="width">0.8194444444444444in</property>
</column>
@@ -3757,16 +3767,19 @@
</structure>
<structure>
<property name="name">Column Binding</property>
+ <property name="displayName">id</property>
<expression name="expression">dataSetRow["PROCDEFID_"]</expression>
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">Column Binding_1</property>
+ <property name="displayName">completion_time</property>
<expression name="expression">dataSetRow["DURATION_"]</expression>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="name">Column Binding_2</property>
+ <property name="displayName">ref</property>
<expression name="expression">dataSetRow["index"]</expression>
<property name="dataType">string</property>
</structure>
@@ -3779,6 +3792,13 @@
<value>row["q3"]</value>
</simple-property-list>
</structure>
+ <structure>
+ <property name="operator">le</property>
+ <expression name="expr">row["Column Binding_2"]</expression>
+ <simple-property-list name="value1">
+ <value>15</value>
+ </simple-property-list>
+ </structure>
</list-property>
<column id="218"/>
<column id="219"/>
15 years
JBoss JBPM SVN: r4920 - jbpm4/trunk/modules/integration/report/src/main/resources.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-05-27 17:01:39 -0400 (Wed, 27 May 2009)
New Revision: 4920
Modified:
jbpm4/trunk/modules/integration/report/src/main/resources/process_activity.rptdesign
Log:
clean report layout
Modified: jbpm4/trunk/modules/integration/report/src/main/resources/process_activity.rptdesign
===================================================================
--- jbpm4/trunk/modules/integration/report/src/main/resources/process_activity.rptdesign 2009-05-27 20:25:31 UTC (rev 4919)
+++ jbpm4/trunk/modules/integration/report/src/main/resources/process_activity.rptdesign 2009-05-27 21:01:39 UTC (rev 4920)
@@ -426,6 +426,16 @@
</structure>
</list-property>
</structure>
+ <structure>
+ <property name="name">index</property>
+ <property name="dataType">integer</property>
+ <property name="aggregateFunction">RUNNINGCOUNT</property>
+ <list-property name="arguments">
+ <structure>
+ <property name="name">Expression</property>
+ </structure>
+ </list-property>
+ </structure>
</list-property>
<list-property name="columnHints">
<structure>
@@ -517,6 +527,11 @@
<property name="name">q3</property>
<property name="dataType">float</property>
</structure>
+ <structure>
+ <property name="position">11</property>
+ <property name="name">index</property>
+ <property name="dataType">integer</property>
+ </structure>
</list-property>
</structure>
<property name="dataSource">MySQL</property>
@@ -659,21 +674,6 @@
<property name="width">2.4444444444444446in</property>
</column>
<column id="96"/>
- <row id="97">
- <cell id="98">
- <label id="103">
- <property name="color">#CCCCCC</property>
- <text-property name="text">Date Created:</text-property>
- </label>
- </cell>
- <cell id="99">
- <text-data id="105">
- <property name="color">#CCCCCC</property>
- <expression name="valueExpr">new Date()</expression>
- <property name="contentType">html</property>
- </text-data>
- </cell>
- </row>
<row id="100">
<cell id="101">
<label id="104">
@@ -706,7 +706,7 @@
</row>
</grid>
<grid id="109">
- <property name="marginTop">15pt</property>
+ <property name="marginTop">0pt</property>
<property name="marginLeft">10pt</property>
<property name="marginBottom">10pt</property>
<property name="marginRight">10pt</property>
@@ -715,6 +715,7 @@
<property name="width">2.4444444444444446in</property>
</column>
<column id="111"/>
+ <column id="229"/>
<row id="112">
<cell id="113">
<label id="114">
@@ -749,6 +750,15 @@
<property name="resultSetColumn">total instances</property>
</data>
</cell>
+ <cell id="227">
+ <label id="103">
+ <property name="color">#CCCCCC</property>
+ <property name="marginTop">0pt</property>
+ <property name="marginRight">10pt</property>
+ <property name="textAlign">right</property>
+ <text-property name="text">Date Created:</text-property>
+ </label>
+ </cell>
</row>
<row id="117">
<cell id="118">
@@ -784,6 +794,16 @@
<property name="resultSetColumn">running instances</property>
</data>
</cell>
+ <cell id="228">
+ <text-data id="105">
+ <property name="color">#CCCCCC</property>
+ <property name="marginTop">0pt</property>
+ <property name="marginRight">10pt</property>
+ <property name="textAlign">right</property>
+ <expression name="valueExpr">new Date()</expression>
+ <property name="contentType">html</property>
+ </text-data>
+ </cell>
</row>
</grid>
<grid id="127">
@@ -1083,7 +1103,7 @@
<Green>192</Green>
<Blue>192</Blue>
</Color>
- <Visible>true</Visible>
+ <Visible>false</Visible>
</Outline>
<Background xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
@@ -1207,7 +1227,7 @@
<Transparency>255</Transparency>
<Red>102</Red>
<Green>153</Green>
- <Blue>255</Blue>
+ <Blue>204</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
@@ -1408,15 +1428,15 @@
<Caption>
<Value></Value>
<Font>
- <Name>SansSerif</Name>
+ <Size>8.0</Size>
<Alignment/>
</Font>
</Caption>
<Background xsi:type="attribute:ColorDefinition">
- <Transparency>255</Transparency>
- <Red>254</Red>
- <Green>254</Green>
- <Blue>254</Blue>
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
</Background>
<Outline>
<Style>Solid</Style>
@@ -1480,7 +1500,7 @@
<Green>192</Green>
<Blue>192</Blue>
</Color>
- <Visible>true</Visible>
+ <Visible>false</Visible>
</LineAttributes>
<Label>
<Caption>
@@ -1537,7 +1557,7 @@
<Green>196</Green>
<Blue>196</Blue>
</Color>
- <Visible>true</Visible>
+ <Visible>false</Visible>
</TickAttributes>
</MajorGrid>
<MinorGrid>
@@ -1980,7 +2000,7 @@
<Transparency>255</Transparency>
<Red>102</Red>
<Green>153</Green>
- <Blue>255</Blue>
+ <Blue>204</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
@@ -2280,7 +2300,7 @@
</Color>
<Visible>false</Visible>
</LineAttributes>
- <TickStyle>Across</TickStyle>
+ <TickStyle>Above</TickStyle>
<TickAttributes>
<Style>Solid</Style>
<Thickness>1</Thickness>
@@ -2522,6 +2542,11 @@
<expression name="expression">dataSetRow["q3"]</expression>
<property name="dataType">float</property>
</structure>
+ <structure>
+ <property name="name">index</property>
+ <expression name="expression">dataSetRow["index"]</expression>
+ <property name="dataType">string</property>
+ </structure>
</list-property>
<method name="onCreate"><![CDATA[reportContext.setPersistentGlobalVariable("3_quartile",this.getRowData().getColumnValue("q3"));]]></method>
<column id="172"/>
@@ -2680,7 +2705,7 @@
</Color>
<Visible>false</Visible>
</Outline>
- <Visible>true</Visible>
+ <Visible>false</Visible>
<ClientArea>
<Outline>
<Style>Solid</Style>
@@ -2760,7 +2785,7 @@
<Bounds>
<Left>0.0</Left>
<Top>0.0</Top>
- <Width>200.0</Width>
+ <Width>250.0</Width>
<Height>150.0</Height>
</Bounds>
<Insets>
@@ -2782,7 +2807,7 @@
<Green>192</Green>
<Blue>192</Blue>
</Color>
- <Visible>true</Visible>
+ <Visible>false</Visible>
</Outline>
<Background xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
@@ -2806,7 +2831,7 @@
q3_ml = MarkerLineImpl.create(yAxis, NumberDataElementImpl.create(q3));
q3_ml.getLabel().getCaption().setValue("Q3: " + q3);
-q3_ml.getLineAttributes().getColor().set(255,0,0);
+q3_ml.getLineAttributes().getColor().set(152,152,152);
}</Script>
<Units>Points</Units>
@@ -2904,7 +2929,7 @@
<TitlePosition>Left</TitlePosition>
<SeriesDefinitions>
<Query>
- <Definition>row["PROCDEFID_"]</Definition>
+ <Definition></Definition>
<Grouping>
<Enabled>false</Enabled>
<GroupingInterval>1.0</GroupingInterval>
@@ -2915,9 +2940,9 @@
<SeriesPalette>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
- <Red>80</Red>
- <Green>166</Green>
- <Blue>218</Blue>
+ <Red>102</Red>
+ <Green>153</Green>
+ <Blue>204</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
@@ -3175,7 +3200,7 @@
<Green>192</Green>
<Blue>192</Blue>
</Color>
- <Visible>true</Visible>
+ <Visible>false</Visible>
</LineAttributes>
<Label>
<Caption>
@@ -3231,7 +3256,7 @@
<Green>196</Green>
<Blue>196</Blue>
</Color>
- <Visible>true</Visible>
+ <Visible>false</Visible>
</TickAttributes>
</MajorGrid>
<MinorGrid>
@@ -3278,9 +3303,9 @@
<SeriesPalette>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
- <Red>80</Red>
- <Green>166</Green>
- <Blue>218</Blue>
+ <Red>102</Red>
+ <Green>153</Green>
+ <Blue>204</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
@@ -3504,7 +3529,7 @@
<Visible>false</Visible>
</Label>
<DataDefinition>
- <Definition>row.__rownum</Definition>
+ <Definition>row["index"]</Definition>
</DataDefinition>
<SeriesIdentifier></SeriesIdentifier>
<DataPoint>
@@ -3564,7 +3589,7 @@
<Bottom>0.0</Bottom>
<Right>3.0</Right>
</Insets>
- <Visible>false</Visible>
+ <Visible>true</Visible>
<Ellipsis>45</Ellipsis>
</Label>
<LabelPosition>Below</LabelPosition>
@@ -3590,7 +3615,7 @@
</Color>
<Visible>false</Visible>
</LineAttributes>
- <TickStyle>Across</TickStyle>
+ <TickStyle>Above</TickStyle>
<TickAttributes>
<Style>Solid</Style>
<Thickness>1</Thickness>
@@ -3630,6 +3655,7 @@
</MinorGrid>
<Scale>
<MinorGridsPerUnit>5</MinorGridsPerUnit>
+ <TickBetweenCategories>true</TickBetweenCategories>
</Scale>
<Origin>
<Type>Min</Type>
@@ -3660,7 +3686,7 @@
<property name="marginTop">10pt</property>
<property name="marginLeft">10pt</property>
<property name="height">150pt</property>
- <property name="width">200pt</property>
+ <property name="width">250pt</property>
</extended-item>
</cell>
</row>
@@ -3672,7 +3698,135 @@
</detail>
</table>
</cell>
- <cell id="135"/>
+ <cell id="135">
+ <table id="205">
+ <property name="marginTop">15pt</property>
+ <property name="marginLeft">10pt</property>
+ <property name="width">100%</property>
+ <property name="dataSet">process_quartiles</property>
+ <list-property name="boundDataColumns">
+ <structure>
+ <property name="name">ID_</property>
+ <expression name="expression">dataSetRow["ID_"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="name">DBVERSION_</property>
+ <expression name="expression">dataSetRow["DBVERSION_"]</expression>
+ <property name="dataType">integer</property>
+ </structure>
+ <structure>
+ <property name="name">PROCDEFID_</property>
+ <expression name="expression">dataSetRow["PROCDEFID_"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="name">KEY_</property>
+ <expression name="expression">dataSetRow["KEY_"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="name">START_</property>
+ <expression name="expression">dataSetRow["START_"]</expression>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="name">END_</property>
+ <expression name="expression">dataSetRow["END_"]</expression>
+ <property name="dataType">date-time</property>
+ </structure>
+ <structure>
+ <property name="name">DURATION_</property>
+ <expression name="expression">dataSetRow["DURATION_"]</expression>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="name">STATE_</property>
+ <expression name="expression">dataSetRow["STATE_"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="name">ENDACTIVITY_</property>
+ <expression name="expression">dataSetRow["ENDACTIVITY_"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="name">q3</property>
+ <expression name="expression">dataSetRow["q3"]</expression>
+ <property name="dataType">float</property>
+ </structure>
+ <structure>
+ <property name="name">Column Binding</property>
+ <expression name="expression">dataSetRow["PROCDEFID_"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="name">Column Binding_1</property>
+ <expression name="expression">dataSetRow["DURATION_"]</expression>
+ <property name="dataType">integer</property>
+ </structure>
+ <structure>
+ <property name="name">Column Binding_2</property>
+ <expression name="expression">dataSetRow["index"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ </list-property>
+ <list-property name="filter">
+ <structure>
+ <property name="operator">ge</property>
+ <expression name="expr">row["DURATION_"]</expression>
+ <simple-property-list name="value1">
+ <value>row["q3"]</value>
+ </simple-property-list>
+ </structure>
+ </list-property>
+ <column id="218"/>
+ <column id="219"/>
+ <column id="220"/>
+ <header>
+ <row id="206">
+ <cell id="207">
+ <label id="223">
+ <property name="marginTop">0pt</property>
+ <property name="textAlign">left</property>
+ <text-property name="text">Ref</text-property>
+ </label>
+ </cell>
+ <cell id="208">
+ <label id="221">
+ <property name="textAlign">left</property>
+ <text-property name="text">ID</text-property>
+ </label>
+ </cell>
+ <cell id="209">
+ <label id="222">
+ <property name="textAlign">left</property>
+ <text-property name="text">Completion Time (ms)</text-property>
+ </label>
+ </cell>
+ </row>
+ </header>
+ <detail>
+ <row id="210">
+ <cell id="211">
+ <data id="226">
+ <property name="resultSetColumn">Column Binding_2</property>
+ </data>
+ </cell>
+ <cell id="212">
+ <data id="224">
+ <property name="resultSetColumn">Column Binding</property>
+ </data>
+ </cell>
+ <cell id="213">
+ <data id="225">
+ <property name="resultSetColumn">Column Binding_1</property>
+ </data>
+ </cell>
+ </row>
+ </detail>
+ </table>
+ </cell>
</row>
</grid>
</body>
15 years
JBoss JBPM SVN: r4919 - jbpm4/trunk/modules/integration/report/src/main/resources.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-05-27 16:25:31 -0400 (Wed, 27 May 2009)
New Revision: 4919
Modified:
jbpm4/trunk/modules/integration/report/src/main/resources/definition_report.rptconfig
jbpm4/trunk/modules/integration/report/src/main/resources/definition_report.rptdesign
jbpm4/trunk/modules/integration/report/src/main/resources/process_activity.rptdesign
Log:
more work on reports
Modified: jbpm4/trunk/modules/integration/report/src/main/resources/definition_report.rptconfig
===================================================================
--- jbpm4/trunk/modules/integration/report/src/main/resources/definition_report.rptconfig 2009-05-27 18:46:01 UTC (rev 4918)
+++ jbpm4/trunk/modules/integration/report/src/main/resources/definition_report.rptconfig 2009-05-27 20:25:31 UTC (rev 4919)
@@ -3,11 +3,11 @@
<list-property name="configVars">
<structure>
<property name="name">__isdisplay__id_42_0</property>
- <property name="value">vacation2-1</property>
+ <property name="value">simple-1</property>
</structure>
<structure>
<property name="name">id_42_1</property>
- <property name="value">vacation2-1</property>
+ <property name="value">simple-1</property>
</structure>
<structure>
<property name="name">id_42_type_</property>
Modified: jbpm4/trunk/modules/integration/report/src/main/resources/definition_report.rptdesign
===================================================================
--- jbpm4/trunk/modules/integration/report/src/main/resources/definition_report.rptdesign 2009-05-27 18:46:01 UTC (rev 4918)
+++ jbpm4/trunk/modules/integration/report/src/main/resources/definition_report.rptdesign 2009-05-27 20:25:31 UTC (rev 4919)
@@ -580,6 +580,134 @@
</model:DesignValues>
]]></xml-property>
</oda-data-set>
+ <oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" name="execution_time" id="154">
+ <list-property name="computedColumns">
+ <structure>
+ <property name="name">q3</property>
+ <property name="dataType">integer</property>
+ <property name="aggregateFunction">QUARTILE</property>
+ <list-property name="arguments">
+ <structure>
+ <property name="name">Expression</property>
+ <expression name="value">row["DURATION_"]</expression>
+ </structure>
+ <structure>
+ <property name="name">quart</property>
+ <expression name="value">3</expression>
+ </structure>
+ </list-property>
+ </structure>
+ </list-property>
+ <list-property name="columnHints">
+ <structure>
+ <property name="columnName">instanceId</property>
+ <property name="displayName">instanceId</property>
+ </structure>
+ <structure>
+ <property name="columnName">DURATION_</property>
+ <property name="displayName">DURATION_</property>
+ </structure>
+ </list-property>
+ <structure name="cachedMetaData">
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">instanceId</property>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="position">2</property>
+ <property name="name">DURATION_</property>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="position">3</property>
+ <property name="name">q3</property>
+ <property name="dataType">integer</property>
+ </structure>
+ </list-property>
+ </structure>
+ <property name="dataSource">MySQL</property>
+ <list-property name="parameters">
+ <structure>
+ <property name="name">id</property>
+ <property name="paramName">id</property>
+ <property name="dataType">string</property>
+ <property name="position">1</property>
+ <property name="isInput">true</property>
+ <property name="isOutput">false</property>
+ </structure>
+ </list-property>
+ <list-property name="resultSet">
+ <structure>
+ <property name="position">1</property>
+ <property name="name">instanceId</property>
+ <property name="nativeName">instanceId</property>
+ <property name="dataType">string</property>
+ <property name="nativeDataType">12</property>
+ </structure>
+ <structure>
+ <property name="position">2</property>
+ <property name="name">DURATION_</property>
+ <property name="nativeName">DURATION_</property>
+ <property name="dataType">decimal</property>
+ <property name="nativeDataType">-5</property>
+ </structure>
+ </list-property>
+ <property name="queryText">SELECT ID_ as instanceId, DURATION_
+ FROM JBPM4_HIST_PROCINST J
+ WHERE PROCDEFID_= ?
+ and STATE_ != "active"
+ ORDER BY DURATION_ DESC</property>
+ <xml-property name="designerValues"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<model:DesignValues xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design" xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
+ <Version>1.0</Version>
+ <design:ResultSets derivedMetaData="true">
+ <design:resultSetDefinitions>
+ <design:resultSetColumns>
+ <design:resultColumnDefinitions>
+ <design:attributes>
+ <design:name>instanceId</design:name>
+ <design:position>1</design:position>
+ <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
+ <design:precision>255</design:precision>
+ <design:scale>0</design:scale>
+ <design:nullability>NotNullable</design:nullability>
+ <design:uiHints>
+ <design:displayName>instanceId</design:displayName>
+ </design:uiHints>
+ </design:attributes>
+ <design:usageHints>
+ <design:label>instanceId</design:label>
+ <design:formattingHints>
+ <design:displaySize>255</design:displaySize>
+ </design:formattingHints>
+ </design:usageHints>
+ </design:resultColumnDefinitions>
+ <design:resultColumnDefinitions>
+ <design:attributes>
+ <design:name>DURATION_</design:name>
+ <design:position>2</design:position>
+ <design:nativeDataTypeCode>-5</design:nativeDataTypeCode>
+ <design:precision>20</design:precision>
+ <design:scale>0</design:scale>
+ <design:nullability>Nullable</design:nullability>
+ <design:uiHints>
+ <design:displayName>DURATION_</design:displayName>
+ </design:uiHints>
+ </design:attributes>
+ <design:usageHints>
+ <design:label>DURATION_</design:label>
+ <design:formattingHints>
+ <design:displaySize>20</design:displaySize>
+ </design:formattingHints>
+ </design:usageHints>
+ </design:resultColumnDefinitions>
+ </design:resultSetColumns>
+ </design:resultSetDefinitions>
+ </design:ResultSets>
+</model:DesignValues>]]></xml-property>
+ </oda-data-set>
</data-sets>
<styles>
<style name="report" id="4">
@@ -829,5 +957,1150 @@
</row>
</detail>
</table>
+ <grid id="148">
+ <property name="marginTop">10pt</property>
+ <property name="marginLeft">10pt</property>
+ <property name="width">100%</property>
+ <column id="149">
+ <property name="width">50%</property>
+ </column>
+ <column id="150"/>
+ <row id="151">
+ <cell id="152">
+ <table id="156">
+ <property name="marginTop">0pt</property>
+ <property name="width">100%</property>
+ <property name="dataSet">execution_time</property>
+ <list-property name="boundDataColumns">
+ <structure>
+ <property name="name">instanceId</property>
+ <expression name="expression">dataSetRow["instanceId"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="name">DURATION_</property>
+ <expression name="expression">dataSetRow["DURATION_"]</expression>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="name">q3</property>
+ <expression name="expression">dataSetRow["q3"]</expression>
+ <property name="dataType">integer</property>
+ </structure>
+ </list-property>
+ <method name="onCreate"><![CDATA[reportContext.setPersistentGlobalVariable("3_quartile",this.getRowData().getColumnValue("q3"));]]></method>
+ <column id="163"/>
+ <header>
+ <row id="157">
+ <cell id="158">
+ <extended-item extensionName="Chart" name="NewChart" id="164">
+ <xml-property name="xmlRepresentation"><![CDATA[<model:ChartWithAxes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:attribute="http://www.birt.eclipse.org/ChartModelAttribute" xmlns:data="http://www.birt.eclipse.org/ChartModelData" xmlns:layout="http://www.birt.eclipse.org/ChartModelLayout" xmlns:model="http://www.birt.eclipse.org/ChartModel" xmlns:type="http://www.birt.eclipse.org/ChartModelType">
+ <Type>Bar Chart</Type>
+ <SubType>Side-by-side</SubType>
+ <Block>
+ <Children xsi:type="layout:TitleBlock">
+ <Bounds>
+ <Left>0.0</Left>
+ <Top>0.0</Top>
+ <Width>0.0</Width>
+ <Height>0.0</Height>
+ </Bounds>
+ <Insets>
+ <Top>3.0</Top>
+ <Left>3.0</Left>
+ <Bottom>3.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Row>-1</Row>
+ <Column>-1</Column>
+ <Rowspan>-1</Rowspan>
+ <Columnspan>-1</Columnspan>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Visible>true</Visible>
+ <Label>
+ <Caption>
+ <Value>Execution Time</Value>
+ <Font>
+ <Name>SansSerif</Name>
+ <Size>12.0</Size>
+ <Bold>true</Bold>
+ <Alignment>
+ <horizontalAlignment>Center</horizontalAlignment>
+ <verticalAlignment>Center</verticalAlignment>
+ </Alignment>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>true</Visible>
+ </Label>
+ </Children>
+ <Children xsi:type="layout:Plot">
+ <Bounds>
+ <Left>0.0</Left>
+ <Top>0.0</Top>
+ <Width>0.0</Width>
+ <Height>0.0</Height>
+ </Bounds>
+ <Insets>
+ <Top>3.0</Top>
+ <Left>3.0</Left>
+ <Bottom>3.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Row>-1</Row>
+ <Column>-1</Column>
+ <Rowspan>-1</Rowspan>
+ <Columnspan>-1</Columnspan>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Visible>true</Visible>
+ <HorizontalSpacing>5</HorizontalSpacing>
+ <VerticalSpacing>5</VerticalSpacing>
+ <ClientArea>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>0</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>0.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>0.0</Right>
+ </Insets>
+ </ClientArea>
+ </Children>
+ <Children xsi:type="layout:Legend">
+ <Bounds>
+ <Left>0.0</Left>
+ <Top>0.0</Top>
+ <Width>0.0</Width>
+ <Height>0.0</Height>
+ </Bounds>
+ <Insets>
+ <Top>3.0</Top>
+ <Left>3.0</Left>
+ <Bottom>3.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Row>-1</Row>
+ <Column>-1</Column>
+ <Rowspan>-1</Rowspan>
+ <Columnspan>-1</Columnspan>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Visible>false</Visible>
+ <ClientArea>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>0</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>2.0</Top>
+ <Left>2.0</Left>
+ <Bottom>2.0</Bottom>
+ <Right>2.0</Right>
+ </Insets>
+ </ClientArea>
+ <Text>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Text>
+ <Orientation>Vertical</Orientation>
+ <Direction>Top_Bottom</Direction>
+ <Separator>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>true</Visible>
+ </Separator>
+ <Position>Right</Position>
+ <ItemType>Series</ItemType>
+ <Title>
+ <Caption>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Title>
+ <TitlePosition>Above</TitlePosition>
+ </Children>
+ <Bounds>
+ <Left>0.0</Left>
+ <Top>0.0</Top>
+ <Width>212.0</Width>
+ <Height>130.0</Height>
+ </Bounds>
+ <Insets>
+ <Top>3.0</Top>
+ <Left>3.0</Left>
+ <Bottom>3.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Row>-1</Row>
+ <Column>-1</Column>
+ <Rowspan>-1</Rowspan>
+ <Columnspan>-1</Columnspan>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Visible>true</Visible>
+ </Block>
+ <Dimension>Two_Dimensional</Dimension>
+ <Script>function beforeGeneration(chart, icsc)
+{
+importPackage(Packages.org.eclipse.birt.chart.model.component.impl);
+importPackage(Packages.org.eclipse.birt.chart.model.data.impl);
+importPackage(Packages.org.eclipse.birt.chart.model.attribute);
+importPackage(Packages.org.eclipse.birt.chart.model.attribute.impl);
+
+var chart = icsc.getChartInstance();
+var yAxis = chart.getAxes().get(0).getAssociatedAxes().get(0);
+var q3 = icsc.getExternalContext().getScriptable().getPersistentGlobalVariable("3_quartile");
+
+q3_ml = MarkerLineImpl.create(yAxis, NumberDataElementImpl.create(q3));
+q3_ml.getLabel().getCaption().setValue("Q3: " + q3);
+q3_ml.getLineAttributes().getColor().set(255,0,0);
+
+}</Script>
+ <Units>Points</Units>
+ <SeriesThickness>10.0</SeriesThickness>
+ <SampleData>
+ <BaseSampleData>
+ <DataSetRepresentation>A, B, C</DataSetRepresentation>
+ </BaseSampleData>
+ <OrthogonalSampleData>
+ <DataSetRepresentation>6,4,12,8,10</DataSetRepresentation>
+ <SeriesDefinitionIndex>0</SeriesDefinitionIndex>
+ </OrthogonalSampleData>
+ </SampleData>
+ <Interactivity/>
+ <Axes>
+ <Type>Text</Type>
+ <Title>
+ <Caption>
+ <Value>X-Axis Title</Value>
+ <Font>
+ <Size>14.0</Size>
+ <Bold>true</Bold>
+ <Alignment>
+ <horizontalAlignment>Center</horizontalAlignment>
+ <verticalAlignment>Center</verticalAlignment>
+ </Alignment>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Title>
+ <TitlePosition>Below</TitlePosition>
+ <AssociatedAxes>
+ <Type>Logarithmic</Type>
+ <Title>
+ <Caption>
+ <Value>Y-Axis Title</Value>
+ <Font>
+ <Size>14.0</Size>
+ <Bold>true</Bold>
+ <Alignment>
+ <horizontalAlignment>Center</horizontalAlignment>
+ <verticalAlignment>Center</verticalAlignment>
+ </Alignment>
+ <Rotation>90.0</Rotation>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Title>
+ <TitlePosition>Left</TitlePosition>
+ <SeriesDefinitions>
+ <Query>
+ <Definition></Definition>
+ </Query>
+ <SeriesPalette>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>80</Red>
+ <Green>166</Green>
+ <Blue>218</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>242</Red>
+ <Green>88</Green>
+ <Blue>106</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>232</Red>
+ <Green>172</Green>
+ <Blue>57</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>255</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>64</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>170</Red>
+ <Green>85</Green>
+ <Blue>85</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>192</Red>
+ <Green>192</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>192</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>7</Red>
+ <Green>146</Green>
+ <Blue>94</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>128</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>0</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>64</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>80</Red>
+ <Green>240</Green>
+ <Blue>120</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>64</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>0</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>0</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>64</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>0</Blue>
+ </Entries>
+ </SeriesPalette>
+ <Series xsi:type="type:BarSeries">
+ <Visible>true</Visible>
+ <Label>
+ <Caption>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Label>
+ <DataDefinition>
+ <Definition>row["DURATION_"]</Definition>
+ </DataDefinition>
+ <SeriesIdentifier>Series 1</SeriesIdentifier>
+ <DataPoint>
+ <Components>
+ <Type>Orthogonal_Value</Type>
+ </Components>
+ <Separator>, </Separator>
+ </DataPoint>
+ <LabelPosition>Outside</LabelPosition>
+ <Stacked>false</Stacked>
+ <Riser>Rectangle</Riser>
+ </Series>
+ <Grouping>
+ <Enabled>false</Enabled>
+ <GroupingInterval>1.0</GroupingInterval>
+ <GroupType>Text</GroupType>
+ <AggregateExpression>Sum</AggregateExpression>
+ </Grouping>
+ </SeriesDefinitions>
+ <Orientation>Vertical</Orientation>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>192</Red>
+ <Green>192</Green>
+ <Blue>192</Blue>
+ </Color>
+ <Visible>true</Visible>
+ </LineAttributes>
+ <Label>
+ <Caption>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Label>
+ <LabelPosition>Left</LabelPosition>
+ <MajorGrid>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>196</Red>
+ <Green>196</Green>
+ <Blue>196</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </LineAttributes>
+ <TickStyle>Across</TickStyle>
+ <TickAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>196</Red>
+ <Green>196</Green>
+ <Blue>196</Blue>
+ </Color>
+ <Visible>true</Visible>
+ </TickAttributes>
+ </MajorGrid>
+ <MinorGrid>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>225</Red>
+ <Green>225</Green>
+ <Blue>225</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </LineAttributes>
+ <TickStyle>Across</TickStyle>
+ <TickAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>225</Red>
+ <Green>225</Green>
+ <Blue>225</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </TickAttributes>
+ </MinorGrid>
+ <Scale>
+ <MinorGridsPerUnit>5</MinorGridsPerUnit>
+ </Scale>
+ <Origin>
+ <Type>Min</Type>
+ <Value xsi:type="data:NumberDataElement">
+ <Value>0.0</Value>
+ </Value>
+ </Origin>
+ <PrimaryAxis>true</PrimaryAxis>
+ <Percent>false</Percent>
+ </AssociatedAxes>
+ <SeriesDefinitions>
+ <Query>
+ <Definition></Definition>
+ </Query>
+ <SeriesPalette>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>80</Red>
+ <Green>166</Green>
+ <Blue>218</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>242</Red>
+ <Green>88</Green>
+ <Blue>106</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>232</Red>
+ <Green>172</Green>
+ <Blue>57</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>255</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>64</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>170</Red>
+ <Green>85</Green>
+ <Blue>85</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>192</Red>
+ <Green>192</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>192</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>7</Red>
+ <Green>146</Green>
+ <Blue>94</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>128</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>192</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>0</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>64</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>80</Red>
+ <Green>240</Green>
+ <Blue>120</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>64</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>0</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>0</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>64</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>128</Red>
+ <Green>128</Green>
+ <Blue>128</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>64</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>128</Green>
+ <Blue>0</Blue>
+ </Entries>
+ </SeriesPalette>
+ <Series>
+ <Visible>true</Visible>
+ <Label>
+ <Caption>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>false</Visible>
+ </Label>
+ <DataDefinition>
+ <Definition>row["instanceId"]</Definition>
+ </DataDefinition>
+ <SeriesIdentifier></SeriesIdentifier>
+ <DataPoint>
+ <Components>
+ <Type>Orthogonal_Value</Type>
+ </Components>
+ <Separator>, </Separator>
+ </DataPoint>
+ <LabelPosition>Outside</LabelPosition>
+ <Stacked>false</Stacked>
+ </Series>
+ <Grouping>
+ <Enabled>false</Enabled>
+ <GroupingInterval>1.0</GroupingInterval>
+ <GroupType>Text</GroupType>
+ <AggregateExpression>Sum</AggregateExpression>
+ </Grouping>
+ </SeriesDefinitions>
+ <Orientation>Horizontal</Orientation>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>192</Red>
+ <Green>192</Green>
+ <Blue>192</Blue>
+ </Color>
+ <Visible>true</Visible>
+ </LineAttributes>
+ <Label>
+ <Caption>
+ <Value></Value>
+ <Font>
+ <Alignment/>
+ </Font>
+ </Caption>
+ <Background xsi:type="attribute:ColorDefinition">
+ <Transparency>0</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Background>
+ <Outline>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
+ </Outline>
+ <Insets>
+ <Top>0.0</Top>
+ <Left>2.0</Left>
+ <Bottom>0.0</Bottom>
+ <Right>3.0</Right>
+ </Insets>
+ <Visible>true</Visible>
+ </Label>
+ <LabelPosition>Below</LabelPosition>
+ <MajorGrid>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>196</Red>
+ <Green>196</Green>
+ <Blue>196</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </LineAttributes>
+ <TickStyle>Across</TickStyle>
+ <TickAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>196</Red>
+ <Green>196</Green>
+ <Blue>196</Blue>
+ </Color>
+ <Visible>true</Visible>
+ </TickAttributes>
+ </MajorGrid>
+ <MinorGrid>
+ <LineAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>225</Red>
+ <Green>225</Green>
+ <Blue>225</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </LineAttributes>
+ <TickStyle>Across</TickStyle>
+ <TickAttributes>
+ <Style>Solid</Style>
+ <Thickness>1</Thickness>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>225</Red>
+ <Green>225</Green>
+ <Blue>225</Blue>
+ </Color>
+ <Visible>false</Visible>
+ </TickAttributes>
+ </MinorGrid>
+ <Scale>
+ <MinorGridsPerUnit>5</MinorGridsPerUnit>
+ </Scale>
+ <Origin>
+ <Type>Min</Type>
+ <Value xsi:type="data:NumberDataElement">
+ <Value>0.0</Value>
+ </Value>
+ </Origin>
+ <PrimaryAxis>true</PrimaryAxis>
+ <CategoryAxis>true</CategoryAxis>
+ <Percent>false</Percent>
+ </Axes>
+ <Orientation>Vertical</Orientation>
+ <UnitSpacing>50.0</UnitSpacing>
+ <Rotation/>
+</model:ChartWithAxes>
+]]></xml-property>
+ <property name="outputFormat">SVG</property>
+ <property name="height">130pt</property>
+ <property name="width">212pt</property>
+ </extended-item>
+ </cell>
+ </row>
+ </header>
+ <detail>
+ <row id="159">
+ <cell id="160"/>
+ </row>
+ </detail>
+ </table>
+ </cell>
+ <cell id="153"/>
+ </row>
+ </grid>
</body>
</report>
Modified: jbpm4/trunk/modules/integration/report/src/main/resources/process_activity.rptdesign
===================================================================
--- jbpm4/trunk/modules/integration/report/src/main/resources/process_activity.rptdesign 2009-05-27 18:46:01 UTC (rev 4918)
+++ jbpm4/trunk/modules/integration/report/src/main/resources/process_activity.rptdesign 2009-05-27 20:25:31 UTC (rev 4919)
@@ -297,6 +297,18 @@
<property name="queryText">SELECT distinct(ID_) as instanceId, PROCDEFID_ FROM JBPM4_HIST_PROCINST J </property>
</oda-data-set>
<oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" name="number_executions" id="126">
+ <list-property name="computedColumns">
+ <structure>
+ <property name="name">index</property>
+ <property name="dataType">integer</property>
+ <property name="aggregateFunction">RUNNINGCOUNT</property>
+ <list-property name="arguments">
+ <structure>
+ <property name="name">Expression</property>
+ </structure>
+ </list-property>
+ </structure>
+ </list-property>
<list-property name="columnHints">
<structure>
<property name="columnName">numExecutions</property>
@@ -319,6 +331,11 @@
<property name="name">PROCDEFID_</property>
<property name="dataType">string</property>
</structure>
+ <structure>
+ <property name="position">3</property>
+ <property name="name">index</property>
+ <property name="dataType">integer</property>
+ </structure>
</list-property>
</structure>
<property name="dataSource">MySQL</property>
@@ -338,7 +355,7 @@
<property name="nativeDataType">12</property>
</structure>
</list-property>
- <property name="queryText">SELECT count(PROCDEFID_) as numExecutions, PROCDEFID_
+ <property name="queryText">SELECT count(PROCDEFID_) as numExecutions, PROCDEFID_
FROM JBPM4_HIST_PROCINST J
GROUP BY PROCDEFID_
ORDER BY numExecutions DESC
@@ -645,11 +662,13 @@
<row id="97">
<cell id="98">
<label id="103">
+ <property name="color">#CCCCCC</property>
<text-property name="text">Date Created:</text-property>
</label>
</cell>
<cell id="99">
<text-data id="105">
+ <property name="color">#CCCCCC</property>
<expression name="valueExpr">new Date()</expression>
<property name="contentType">html</property>
</text-data>
@@ -769,8 +788,12 @@
</grid>
<grid id="127">
<property name="width">100%</property>
- <column id="128"/>
- <column id="129"/>
+ <column id="128">
+ <property name="width">40%</property>
+ </column>
+ <column id="129">
+ <property name="width">60%</property>
+ </column>
<row id="130">
<cell id="131">
<table id="174">
@@ -997,7 +1020,7 @@
<Visible>false</Visible>
</Separator>
<Position>Below</Position>
- <ItemType>Categories</ItemType>
+ <ItemType>Series</ItemType>
<Title>
<Caption>
<Value>ID</Value>
@@ -1039,7 +1062,7 @@
<Left>0.0</Left>
<Top>0.0</Top>
<Width>250.0</Width>
- <Height>200.0</Height>
+ <Height>150.0</Height>
</Bounds>
<Insets>
<Top>3.0</Top>
@@ -1092,16 +1115,22 @@
<Type>Text</Type>
<Title>
<Caption>
- <Value>X-Axis Title</Value>
+ <Value>Ref</Value>
<Font>
- <Size>14.0</Size>
+ <Size>10.0</Size>
<Bold>true</Bold>
<Alignment>
<horizontalAlignment>Center</horizontalAlignment>
<verticalAlignment>Center</verticalAlignment>
</Alignment>
- <Rotation>0.0</Rotation>
+ <Rotation>90.0</Rotation>
</Font>
+ <Color>
+ <Transparency>255</Transparency>
+ <Red>0</Red>
+ <Green>0</Green>
+ <Blue>0</Blue>
+ </Color>
</Caption>
<Background xsi:type="attribute:ColorDefinition">
<Transparency>0</Transparency>
@@ -1118,6 +1147,7 @@
<Green>0</Green>
<Blue>0</Blue>
</Color>
+ <Visible>false</Visible>
</Outline>
<Insets>
<Top>0.0</Top>
@@ -1170,14 +1200,14 @@
<TitlePosition>Left</TitlePosition>
<SeriesDefinitions>
<Query>
- <Definition>row["PROCDEFID_"]</Definition>
+ <Definition></Definition>
</Query>
<SeriesPalette>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
- <Red>80</Red>
- <Green>166</Green>
- <Blue>218</Blue>
+ <Red>102</Red>
+ <Green>153</Green>
+ <Blue>255</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
@@ -1365,6 +1395,12 @@
<Green>128</Green>
<Blue>0</Blue>
</Entries>
+ <Entries xsi:type="attribute:ColorDefinition">
+ <Transparency>255</Transparency>
+ <Red>255</Red>
+ <Green>255</Green>
+ <Blue>255</Blue>
+ </Entries>
</SeriesPalette>
<Series xsi:type="type:BarSeries">
<Visible>true</Visible>
@@ -1372,23 +1408,24 @@
<Caption>
<Value></Value>
<Font>
+ <Name>SansSerif</Name>
<Alignment/>
</Font>
</Caption>
<Background xsi:type="attribute:ColorDefinition">
- <Transparency>0</Transparency>
- <Red>255</Red>
- <Green>255</Green>
- <Blue>255</Blue>
+ <Transparency>255</Transparency>
+ <Red>254</Red>
+ <Green>254</Green>
+ <Blue>254</Blue>
</Background>
<Outline>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
- <Red>0</Red>
- <Green>0</Green>
- <Blue>0</Blue>
+ <Red>254</Red>
+ <Green>254</Green>
+ <Blue>254</Blue>
</Color>
<Visible>false</Visible>
</Outline>
@@ -1406,12 +1443,23 @@
<SeriesIdentifier>Series 1</SeriesIdentifier>
<DataPoint>
<Components>
- <Type>Series_Value</Type>
+ <Type>Base_Value</Type>
</Components>
+ <Prefix></Prefix>
<Separator>, </Separator>
</DataPoint>
- <LabelPosition>Outside</LabelPosition>
+ <LabelPosition>Inside</LabelPosition>
<Stacked>true</Stacked>
+ <Triggers>
+ <Condition>onclick</Condition>
+ <Action>
+ <Type>Show_Tooltip</Type>
+ <Value xsi:type="attribute:TooltipValue">
+ <Text>row["PROCDEFID_"]</Text>
+ <Delay>200</Delay>
+ </Value>
+ </Action>
+ </Triggers>
<Translucent>false</Translucent>
<Riser>Rectangle</Riser>
</Series>
@@ -1464,7 +1512,7 @@
<Bottom>0.0</Bottom>
<Right>3.0</Right>
</Insets>
- <Visible>true</Visible>
+ <Visible>false</Visible>
</Label>
<LabelPosition>Left</LabelPosition>
<MajorGrid>
@@ -1930,9 +1978,9 @@
<SeriesPalette>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
- <Red>80</Red>
- <Green>166</Green>
- <Blue>218</Blue>
+ <Red>102</Red>
+ <Green>153</Green>
+ <Blue>255</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
@@ -2174,6 +2222,7 @@
<GroupType>Text</GroupType>
<AggregateExpression>Sum</AggregateExpression>
</Grouping>
+ <SortKey/>
</SeriesDefinitions>
<Orientation>Horizontal</Orientation>
<LineAttributes>
@@ -2270,6 +2319,9 @@
</TickAttributes>
</MinorGrid>
<Scale>
+ <Min xsi:type="data:NumberDataElement">
+ <Value>1.0</Value>
+ </Min>
<MinorGridsPerUnit>5</MinorGridsPerUnit>
<ShowOutside>false</ShowOutside>
</Scale>
@@ -2280,7 +2332,7 @@
</Value>
</Origin>
<PrimaryAxis>true</PrimaryAxis>
- <CategoryAxis>false</CategoryAxis>
+ <CategoryAxis>true</CategoryAxis>
<Percent>false</Percent>
</Axes>
<Orientation>Horizontal</Orientation>
@@ -2300,8 +2352,8 @@
<property name="marginTop">10pt</property>
<property name="marginLeft">10pt</property>
<property name="dataSet">number_executions</property>
- <property name="height">200pt</property>
- <property name="width">250pt</property>
+ <property name="height">150pt</property>
+ <property name="width">250px</property>
<list-property name="boundDataColumns">
<structure>
<property name="name">numExecutions</property>
@@ -2313,6 +2365,11 @@
<expression name="expression">dataSetRow["PROCDEFID_"]</expression>
<property name="dataType">string</property>
</structure>
+ <structure>
+ <property name="name">index</property>
+ <expression name="expression">dataSetRow["index"]</expression>
+ <property name="dataType">integer</property>
+ </structure>
</list-property>
</extended-item>
</cell>
@@ -2326,6 +2383,91 @@
</table>
</cell>
<cell id="132">
+ <table id="182">
+ <property name="marginTop">15pt</property>
+ <property name="marginLeft">10pt</property>
+ <property name="width">80%</property>
+ <property name="dataSet">number_executions</property>
+ <list-property name="boundDataColumns">
+ <structure>
+ <property name="name">numExecutions</property>
+ <expression name="expression">dataSetRow["numExecutions"]</expression>
+ <property name="dataType">decimal</property>
+ </structure>
+ <structure>
+ <property name="name">PROCDEFID_</property>
+ <expression name="expression">dataSetRow["PROCDEFID_"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="name">Column Binding</property>
+ <expression name="expression">dataSetRow["index"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="name">Column Binding_1</property>
+ <expression name="expression">row["PROCDEFID_"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ <structure>
+ <property name="name">Column Binding_2</property>
+ <expression name="expression">dataSetRow["numExecutions"]</expression>
+ <property name="dataType">string</property>
+ </structure>
+ </list-property>
+ <column id="195">
+ <property name="width">0.8194444444444444in</property>
+ </column>
+ <column id="196"/>
+ <column id="197"/>
+ <header>
+ <row id="183">
+ <cell id="184">
+ <label id="198">
+ <property name="color">#000000</property>
+ <property name="textAlign">left</property>
+ <text-property name="text">Ref</text-property>
+ </label>
+ </cell>
+ <cell id="185">
+ <label id="199">
+ <property name="textAlign">left</property>
+ <text-property name="text">ID</text-property>
+ </label>
+ </cell>
+ <cell id="186">
+ <label id="200">
+ <property name="marginTop">0pt</property>
+ <property name="textAlign">left</property>
+ <text-property name="text">Num Executions</text-property>
+ </label>
+ </cell>
+ </row>
+ </header>
+ <detail>
+ <row id="187">
+ <cell id="188">
+ <data id="202">
+ <property name="resultSetColumn">Column Binding</property>
+ </data>
+ </cell>
+ <cell id="189">
+ <data id="203">
+ <property name="resultSetColumn">Column Binding_1</property>
+ </data>
+ </cell>
+ <cell id="190">
+ <data id="204">
+ <property name="resultSetColumn">Column Binding_2</property>
+ </data>
+ </cell>
+ </row>
+ </detail>
+ </table>
+ </cell>
+ </row>
+ <row id="133">
+ <cell id="134">
<table id="165">
<property name="width">100%</property>
<property name="dataSet">process_quartiles</property>
@@ -2618,8 +2760,8 @@
<Bounds>
<Left>0.0</Left>
<Top>0.0</Top>
- <Width>250.0</Width>
- <Height>200.0</Height>
+ <Width>200.0</Width>
+ <Height>150.0</Height>
</Bounds>
<Insets>
<Top>3.0</Top>
@@ -3517,8 +3659,8 @@
</list-property>
<property name="marginTop">10pt</property>
<property name="marginLeft">10pt</property>
- <property name="height">200pt</property>
- <property name="width">250pt</property>
+ <property name="height">150pt</property>
+ <property name="width">200pt</property>
</extended-item>
</cell>
</row>
@@ -3530,9 +3672,6 @@
</detail>
</table>
</cell>
- </row>
- <row id="133">
- <cell id="134"/>
<cell id="135"/>
</row>
</grid>
15 years
JBoss JBPM SVN: r4918 - in jbpm4/branches/tbaeyens/modules/pvm/src/main: java/org/jbpm/pvm/internal/model and 2 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-05-27 14:46:01 -0400 (Wed, 27 May 2009)
New Revision: 4918
Modified:
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/CommandMessage.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToParentActivity.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/SignalMessage.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/resources/jbpm.execution.hbm.xml
Log:
refactored signal job
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/CommandMessage.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/CommandMessage.java 2009-05-27 16:43:05 UTC (rev 4917)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/CommandMessage.java 2009-05-27 18:46:01 UTC (rev 4918)
@@ -52,6 +52,7 @@
JobDbSession jobDbSession = environment.get(JobDbSession.class);
jobDbSession.delete(this);
+
return null;
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-05-27 16:43:05 UTC (rev 4917)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-05-27 18:46:01 UTC (rev 4918)
@@ -379,7 +379,7 @@
checkActive();
propagation = Propagation.EXPLICIT;
if (getActivity()!=null) {
- performAtomicOperation(new Signal(signal, parameters, getActivity()));
+ performAtomicOperation(new Signal(signal, parameters));
} else if (transition!=null) {
performAtomicOperation(AtomicOperation.TRANSITION_START_ACTIVITY);
} else {
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToParentActivity.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToParentActivity.java 2009-05-27 16:43:05 UTC (rev 4917)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToParentActivity.java 2009-05-27 18:46:01 UTC (rev 4918)
@@ -36,7 +36,7 @@
ExecutionImpl propagatingExecution = execution.endActivity(activity);
propagatingExecution.setActivity(parentActivity);
- propagatingExecution.performAtomicOperation(new Signal(null, null, parentActivity));
+ propagatingExecution.performAtomicOperation(new Signal(null, null));
}
public MessageImpl<?> createAsyncMessage(ExecutionImpl execution) {
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java 2009-05-27 16:43:05 UTC (rev 4917)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java 2009-05-27 18:46:01 UTC (rev 4918)
@@ -40,12 +40,10 @@
String signalName;
Map<String, ?> parameters;
- ActivityImpl activity;
- public Signal(String signalName, Map<String, ?> parameters, ActivityImpl activity) {
+ public Signal(String signalName, Map<String, ?> parameters) {
this.signalName = signalName;
this.parameters = parameters;
- this.activity = activity;
}
public boolean isAsync(ExecutionImpl execution) {
@@ -53,6 +51,8 @@
}
public void perform(ExecutionImpl execution) {
+ ActivityImpl activity = execution.getActivity();
+
if (execution.getName()!=null) {
log.debug(execution.toString()+" signals "+activity);
} else {
@@ -82,6 +82,6 @@
}
public MessageImpl<?> createAsyncMessage(ExecutionImpl execution) {
- return new SignalMessage(execution, signalName, activity);
+ return null;
}
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/SignalMessage.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/SignalMessage.java 2009-05-27 16:43:05 UTC (rev 4917)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/SignalMessage.java 2009-05-27 18:46:01 UTC (rev 4918)
@@ -21,12 +21,14 @@
*/
package org.jbpm.pvm.internal.model.op;
+import java.util.Map;
+
import org.jbpm.api.Execution;
import org.jbpm.api.env.Environment;
import org.jbpm.pvm.internal.job.MessageImpl;
import org.jbpm.pvm.internal.jobexecutor.JobDbSession;
+import org.jbpm.pvm.internal.model.ActivityImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.ActivityImpl;
/**
* @author Tom Baeyens
@@ -36,21 +38,21 @@
private static final long serialVersionUID = 1L;
String signalName;
- ActivityImpl activity;
+ Map<String, ?> parameters;
public SignalMessage() {
}
- public SignalMessage(ExecutionImpl execution, String signalName, ActivityImpl activity) {
+ public SignalMessage(ExecutionImpl execution, String signalName, Map<String, ?> parameters) {
super(execution);
this.signalName = signalName;
- this.activity = activity;
+ this.parameters = parameters;
}
public Object execute(Environment environment) throws Exception {
execution.setState(Execution.STATE_ACTIVE_ROOT);
- Signal signal = new Signal(signalName, null, activity);
+ Signal signal = new Signal(signalName, parameters);
execution.performAtomicOperationSync(signal);
JobDbSession jobDbSession = environment.get(JobDbSession.class);
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/resources/jbpm.execution.hbm.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/resources/jbpm.execution.hbm.xml 2009-05-27 16:43:05 UTC (rev 4917)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/resources/jbpm.execution.hbm.xml 2009-05-27 18:46:01 UTC (rev 4918)
@@ -232,11 +232,7 @@
<subclass name="org.jbpm.pvm.internal.job.MessageImpl" discriminator-value="Msg">
<subclass name="org.jbpm.pvm.internal.model.op.ExecuteActivityMessage" discriminator-value="ExeAct" />
<subclass name="org.jbpm.pvm.internal.model.op.ExecuteEventListenerMessage" discriminator-value="ExeEvtLsnr" />
- <subclass name="org.jbpm.pvm.internal.model.op.SignalMessage" discriminator-value="Signal">
- <property name="signalName" column="SIGNAL_" />
- </subclass>
<subclass name="org.jbpm.pvm.internal.job.CommandMessage" discriminator-value="Cmd" />
-
</subclass>
<subclass name="org.jbpm.pvm.internal.job.TimerImpl" discriminator-value="Timer">
15 years
JBoss JBPM SVN: r4917 - in jbpm4/branches/tbaeyens/modules: pvm/src/main/java/org/jbpm/pvm/internal/model/op and 2 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-05-27 12:43:05 -0400 (Wed, 27 May 2009)
New Revision: 4917
Modified:
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/AtomicOperation.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteActivity.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteActivityMessage.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListener.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListenerMessage.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToChildActivity.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToParentActivity.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionEndActivity.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionStartActivity.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionStartActivityMessage.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionTake.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/resources/jbpm.execution.hbm.xml
jbpm4/branches/tbaeyens/modules/test-pojo/src/main/java/org/jbpm/test/activities/EventTest.java
Log:
execution refactoring
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java 2009-05-27 14:04:11 UTC (rev 4916)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java 2009-05-27 16:43:05 UTC (rev 4917)
@@ -33,6 +33,7 @@
import org.jbpm.api.listener.EventListener;
import org.jbpm.api.model.OpenProcessDefinition;
import org.jbpm.internal.log.Log;
+import org.jbpm.pvm.internal.model.op.AtomicOperation;
import org.jbpm.pvm.internal.model.op.MoveToChildActivity;
import org.jbpm.pvm.internal.wire.Descriptor;
@@ -196,7 +197,7 @@
if (transition!=null) {
log.trace(toString()+" takes transition "+transitionName);
execution.setTransition(transition);
- execution.performAtomicOperationSync(ExecutionImpl.TRANSITION_END_ACTIVITY);
+ execution.performAtomicOperationSync(AtomicOperation.TRANSITION_END_ACTIVITY);
} else {
log.info("WARNING: "+toString()+" couldn't find transition "+transitionName+" on "+activity);
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-05-27 14:04:11 UTC (rev 4916)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-05-27 16:43:05 UTC (rev 4917)
@@ -65,14 +65,8 @@
import org.jbpm.pvm.internal.history.events.ProcessInstanceStart;
import org.jbpm.pvm.internal.job.MessageImpl;
import org.jbpm.pvm.internal.model.op.AtomicOperation;
-import org.jbpm.pvm.internal.model.op.ExecuteActivity;
-import org.jbpm.pvm.internal.model.op.ExecuteEventListener;
import org.jbpm.pvm.internal.model.op.MoveToChildActivity;
-import org.jbpm.pvm.internal.model.op.MoveToParentActivity;
import org.jbpm.pvm.internal.model.op.Signal;
-import org.jbpm.pvm.internal.model.op.TransitionEndActivity;
-import org.jbpm.pvm.internal.model.op.TransitionStartActivity;
-import org.jbpm.pvm.internal.model.op.TransitionTake;
import org.jbpm.pvm.internal.util.EqualsUtil;
import org.jbpm.pvm.internal.util.Priority;
@@ -89,18 +83,6 @@
private static final Log log = Log.getLog(Execution.class.getName());
- // atomic operations
- public static final AtomicOperation EXECUTE_ACTIVITY = new ExecuteActivity();
- public static final AtomicOperation PROPAGATE_TO_PARENT = new MoveToParentActivity();
-
- public static final AtomicOperation TRANSITION_TAKE = new TransitionTake();
- public static final AtomicOperation TRANSITION_START_ACTIVITY = new TransitionStartActivity();
-
- public static final AtomicOperation EXECUTE_EVENT_LISTENER = new ExecuteEventListener();
- public static final AtomicOperation TRANSITION_END_ACTIVITY = new TransitionEndActivity();
-
- // persistent member fields /////////////////////////////////////////////////
-
/** an optional name for this execution. can be used to
* differentiate concurrent paths of execution like e.g.
* the 'shipping' and 'billing' paths. */
@@ -209,7 +191,7 @@
fireHistoryEvent(new ProcessInstanceStart());
fire(Event.START, getProcessDefinition());
if (getActivity()!=null) {
- scopedExecution.performAtomicOperation(EXECUTE_ACTIVITY);
+ scopedExecution.performAtomicOperation(AtomicOperation.EXECUTE_ACTIVITY);
}
}
@@ -399,7 +381,7 @@
if (getActivity()!=null) {
performAtomicOperation(new Signal(signal, parameters, getActivity()));
} else if (transition!=null) {
- performAtomicOperation(ExecutionImpl.TRANSITION_START_ACTIVITY);
+ performAtomicOperation(AtomicOperation.TRANSITION_START_ACTIVITY);
} else {
throw new JbpmException("execution is not in a activity or in a transition");
}
@@ -452,9 +434,7 @@
setTransition((TransitionImpl) transition);
- ObservableElementImpl observableElement = getActivity();
-
- fire(Event.END, observableElement, TRANSITION_END_ACTIVITY);
+ fire(Event.END, getActivity(), AtomicOperation.TRANSITION_END_ACTIVITY);
}
public void take(Transition transition, Execution execution) {
@@ -512,7 +492,7 @@
// if there is a parent activity
if (parentActivity!=null) {
// propagate to the parent
- performAtomicOperation(PROPAGATE_TO_PARENT);
+ performAtomicOperation(AtomicOperation.PROPAGATE_TO_PARENT);
} else {
// When we don't know how to proceed, i don't know if it's best to
@@ -545,7 +525,7 @@
setEventSource(observableElement);
setEventListenerIndex(0);
setEventCompletedOperation(eventCompletedOperation);
- performAtomicOperation(EXECUTE_EVENT_LISTENER);
+ performAtomicOperation(AtomicOperation.EXECUTE_EVENT_LISTENER);
} else {
if (eventCompletedOperation!=null) {
performAtomicOperationSync(eventCompletedOperation);
@@ -559,10 +539,7 @@
}
EventImpl event = observableElement.getEvent(eventName);
- if ( (event!=null)
- && (event.getListenerReferences()!=null)
- && (!event.getListenerReferences().isEmpty())
- ) {
+ if (event!=null) {
return event;
}
@@ -595,6 +572,8 @@
return propagatingExecution;
}
+ // asynchronous continuations ////////////////////////////////////////////////
+
public synchronized void performAtomicOperation(AtomicOperation operation) {
if (operation.isAsync(this)) {
sendContinuationMessage(operation);
@@ -603,8 +582,6 @@
}
}
- // asynchronous continuations ////////////////////////////////////////////////
-
public void sendContinuationMessage(AtomicOperation operation) {
Environment environment = Environment.getCurrent();
MessageSession messageSession = environment.get(MessageSession.class);
@@ -1079,7 +1056,7 @@
public EventImpl getEvent() {
return event;
}
- public ObservableElement getEventSource() {
+ public ObservableElementImpl getEventSource() {
return eventSource;
}
public Collection<Execution> getExecutions() {
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/AtomicOperation.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/AtomicOperation.java 2009-05-27 14:04:11 UTC (rev 4916)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/AtomicOperation.java 2009-05-27 16:43:05 UTC (rev 4917)
@@ -21,16 +21,38 @@
*/
package org.jbpm.pvm.internal.model.op;
+import org.jbpm.api.JbpmException;
import org.jbpm.pvm.internal.job.MessageImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
/**
* @author Tom Baeyens
*/
-public interface AtomicOperation {
+public abstract class AtomicOperation {
+
+ public static final AtomicOperation EXECUTE_ACTIVITY = new ExecuteActivity();
+ public static final AtomicOperation PROPAGATE_TO_PARENT = new MoveToParentActivity();
+ public static final AtomicOperation TRANSITION_TAKE = new TransitionTake();
+ public static final AtomicOperation TRANSITION_START_ACTIVITY = new TransitionStartActivity();
+ public static final AtomicOperation EXECUTE_EVENT_LISTENER = new ExecuteEventListener();
+ public static final AtomicOperation TRANSITION_END_ACTIVITY = new TransitionEndActivity();
+
+ public abstract boolean isAsync(ExecutionImpl execution);
+ public abstract MessageImpl<?> createAsyncMessage(ExecutionImpl execution);
+ public abstract void perform(ExecutionImpl execution);
- boolean isAsync(ExecutionImpl execution);
- MessageImpl<?> createAsyncMessage(ExecutionImpl execution);
+ public static AtomicOperation parseAtomicOperation(String text) {
+ if (text==null) {
+ return null;
+ }
- void perform(ExecutionImpl execution);
+ if (TRANSITION_END_ACTIVITY.toString().equals(text)) return TRANSITION_END_ACTIVITY;
+ if (EXECUTE_EVENT_LISTENER.toString().equals(text)) return EXECUTE_EVENT_LISTENER;
+ if (EXECUTE_ACTIVITY.toString().equals(text)) return EXECUTE_ACTIVITY;
+ if (TRANSITION_TAKE.toString().equals(text)) return TRANSITION_TAKE;
+ if (TRANSITION_START_ACTIVITY.toString().equals(text)) return TRANSITION_START_ACTIVITY;
+ if (PROPAGATE_TO_PARENT.toString().equals(text)) return PROPAGATE_TO_PARENT;
+
+ throw new JbpmException("invalid atomic operation text: "+text);
+ }
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteActivity.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteActivity.java 2009-05-27 14:04:11 UTC (rev 4916)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteActivity.java 2009-05-27 16:43:05 UTC (rev 4917)
@@ -30,7 +30,7 @@
import org.jbpm.pvm.internal.model.ExecutionImpl.Propagation;
import org.jbpm.pvm.internal.util.Clock;
-public class ExecuteActivity implements AtomicOperation {
+public class ExecuteActivity extends AtomicOperation {
private static Log log = Log.getLog(ExecuteActivity.class.getName());
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteActivityMessage.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteActivityMessage.java 2009-05-27 14:04:11 UTC (rev 4916)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteActivityMessage.java 2009-05-27 16:43:05 UTC (rev 4917)
@@ -43,7 +43,7 @@
public Object execute(Environment environment) throws Exception {
AsyncContinuations.restoreState(execution);
- execution.performAtomicOperationSync(ExecutionImpl.EXECUTE_ACTIVITY);
+ execution.performAtomicOperationSync(AtomicOperation.EXECUTE_ACTIVITY);
JobDbSession jobDbSession = environment.get(JobDbSession.class);
jobDbSession.delete(this);
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListener.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListener.java 2009-05-27 14:04:11 UTC (rev 4916)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListener.java 2009-05-27 16:43:05 UTC (rev 4917)
@@ -36,62 +36,77 @@
/**
* @author Tom Baeyens
*/
-public class ExecuteEventListener implements AtomicOperation {
+public class ExecuteEventListener extends AtomicOperation {
private static Log log = Log.getLog(ExecuteEventListener.class.getName());
public boolean isAsync(ExecutionImpl execution) {
int eventListenerIndex = execution.getEventListenerIndex();
EventImpl event = execution.getEvent();
+
+ if ( (eventListenerIndex==0)
+ && (event.isAsync())
+ ) {
+ return true;
+ }
+
List<EventListenerReference> eventListenerReferences = event.getListenerReferences();
+ if ( (eventListenerReferences==null)
+ || (eventListenerReferences.isEmpty())
+ ) {
+ return false;
+ }
+
EventListenerReference eventListenerReference = eventListenerReferences.get(eventListenerIndex);
return eventListenerReference.isAsync();
}
public void perform(ExecutionImpl execution) {
EventImpl event = execution.getEvent();
+ ObservableElementImpl observableElement = event.getObservableElement();
int eventListenerIndex = execution.getEventListenerIndex();
List<EventListenerReference> eventListenerReferences = event.getListenerReferences();
- EventListenerReference eventListenerReference = eventListenerReferences.get(eventListenerIndex);
- ObservableElement eventSource = execution.getEventSource();
- ObservableElementImpl observableElement = event.getObservableElement();
-
- if ( (eventSource==observableElement)
- || (eventListenerReference.isPropagationEnabled())
+ if ( (eventListenerReferences!=null)
+ && (!eventListenerReferences.isEmpty())
) {
- EventListener eventListener = eventListenerReference.get();
- log.trace("executing "+eventListener+" for "+event);
- try {
- // TODO can/should this invocation be unified with the exception handler invocation of the event notification method?
- eventListener.notify(execution);
- } catch (Exception e) {
- log.trace("exception during action: "+e);
- execution.handleException((ObservableElementImpl) observableElement, event, eventListenerReference, e, "couldn't run action "+eventListener);
+ EventListenerReference eventListenerReference = eventListenerReferences.get(eventListenerIndex);
+ ObservableElement eventSource = execution.getEventSource();
+ if ((eventSource == observableElement) || (eventListenerReference.isPropagationEnabled())) {
+ EventListener eventListener = eventListenerReference.get();
+ log.trace("executing " + eventListener + " for " + event);
+ try {
+ // TODO can/should this invocation be unified with the exception handler invocation of the event notification method?
+ eventListener.notify(execution);
+ } catch (Exception e) {
+ log.trace("exception during action: " + e);
+ execution.handleException((ObservableElementImpl) observableElement, event, eventListenerReference, e, "couldn't run action " + eventListener);
+ }
}
+ // increment the event listener index
+ eventListenerIndex++;
+ execution.setEventListenerIndex(eventListenerIndex);
}
- // increment the event listener index
- eventListenerIndex++;
- execution.setEventListenerIndex(eventListenerIndex);
-
// if there are more listeners in this event
- if (eventListenerIndex<eventListenerReferences.size()) {
+ if ( (eventListenerReferences!=null)
+ && (eventListenerIndex < eventListenerReferences.size())
+ ) {
// execute the next listener
- execution.performAtomicOperation(ExecutionImpl.EXECUTE_EVENT_LISTENER);
-
+ execution.performAtomicOperation(AtomicOperation.EXECUTE_EVENT_LISTENER);
+
} else {
- // there are no more listeners in this even
-
+ // there are no more listeners in this event
+
ObservableElementImpl parent = observableElement.getParent();
// find the next event with listeners
EventImpl propagatedEvent = ExecutionImpl.findEvent(parent, event.getName());
-
+
// if there is an propagated event with listeners
- if (propagatedEvent!=null) {
+ if (propagatedEvent != null) {
// propagate to the that event
execution.setEvent(propagatedEvent);
execution.setEventListenerIndex(0);
- execution.performAtomicOperation(ExecutionImpl.EXECUTE_EVENT_LISTENER);
+ execution.performAtomicOperation(AtomicOperation.EXECUTE_EVENT_LISTENER);
} else {
// event is completed, perform the eventCompletedOperation
@@ -101,8 +116,8 @@
execution.setEventSource(null);
execution.setEventListenerIndex(0);
execution.setEventCompletedOperation(null);
-
- if (eventCompletedOperation!=null) {
+
+ if (eventCompletedOperation != null) {
execution.performAtomicOperation(eventCompletedOperation);
}
}
@@ -110,7 +125,7 @@
}
public MessageImpl< ? > createAsyncMessage(ExecutionImpl execution) {
- throw new UnsupportedOperationException("please implement me");
+ return new ExecuteEventListenerMessage(execution);
}
public String toString() {
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListenerMessage.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListenerMessage.java 2009-05-27 14:04:11 UTC (rev 4916)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListenerMessage.java 2009-05-27 16:43:05 UTC (rev 4917)
@@ -21,79 +21,141 @@
*/
package org.jbpm.pvm.internal.model.op;
+import java.util.HashMap;
+import java.util.Map;
+
import org.jbpm.api.env.Environment;
-import org.jbpm.api.listener.EventListener;
-import org.jbpm.api.model.ObservableElement;
-import org.jbpm.api.session.RepositorySession;
import org.jbpm.pvm.internal.job.MessageImpl;
+import org.jbpm.pvm.internal.jobexecutor.JobDbSession;
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.ExecutionImpl;
import org.jbpm.pvm.internal.model.ObservableElementImpl;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
import org.jbpm.pvm.internal.model.TransitionImpl;
-
/**
* @author Tom Baeyens
*/
public class ExecuteEventListenerMessage extends MessageImpl<Object> {
+ private static final String KEY_EVENT_COMPLETED_OPERATION = "ECO";
+ private static final String KEY_EVENT_LISTENER_INDEX = "ELI";
+ private static final String KEY_EVENT_NAME = "EN";
+ private static final String KEY_EVENT_OBSERVABLE_PARENT_LEVEL = "EOPL";
+ private static final String KEY_TRANSITION_SOURCE_INDEX = "TSI";
+ private static final String KEY_TRANSITION_SOURCE = "TS";
+ private static final String KEY_EVENT_SOURCE_TRANSITION = "EST";
+ private static final String KEY_EVENT_SOURCE_ACTIVITY = "ESA";
+ private static final String KEY_EVENT_SOURCE_PROCESS_DEFINITION = "ESPD";
+ private static final String KEY_STATE = "S";
+
private static final long serialVersionUID = 1L;
- protected String processDefinitionId;
- protected String activityName;
- protected Integer transitionIndex;
- protected String eventName;
- protected Integer eventListenerIndex;
-
public ExecuteEventListenerMessage() {
}
- public ExecuteEventListenerMessage(ExecutionImpl execution, ObservableElement observableElement, EventImpl event, EventListenerReference eventListenerReference) {
+ public ExecuteEventListenerMessage(ExecutionImpl execution) {
super(execution);
- if (observableElement instanceof ProcessDefinitionImpl) {
- ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) observableElement;
- processDefinitionId = processDefinition.getId();
- } else if (observableElement instanceof ActivityImpl) {
- ActivityImpl activity = (ActivityImpl) observableElement;
- processDefinitionId = activity.getProcessDefinition().getId();
- activityName = activity.getName();
- } else if (observableElement instanceof TransitionImpl) {
- TransitionImpl transition = (TransitionImpl) observableElement;
- processDefinitionId = transition.getProcessDefinition().getId();
- activityName = transition.getSource().getName();
- transitionIndex = transition.getSource().getOutgoingTransitions().indexOf(transition);
+
+ Map<String, Object> asyncExecutionInfo = new HashMap<String, Object>();
+
+ TransitionImpl transition = execution.getTransition();
+ if (transition!=null) {
+ ActivityImpl source = transition.getSource();
+ asyncExecutionInfo.put(KEY_TRANSITION_SOURCE, source.getName());
+ asyncExecutionInfo.put(KEY_TRANSITION_SOURCE_INDEX, source.getOutgoingTransitions().indexOf(transition));
}
+
+ asyncExecutionInfo.put(KEY_STATE, execution.getState());
+
+ ObservableElementImpl eventSource = (ObservableElementImpl) execution.getEventSource();
+ if (eventSource instanceof ProcessDefinitionImpl) {
+ asyncExecutionInfo.put(KEY_EVENT_SOURCE_PROCESS_DEFINITION, null);
+
+ } else if (eventSource instanceof ActivityImpl) {
+ asyncExecutionInfo.put(KEY_EVENT_SOURCE_ACTIVITY, eventSource.getName());
+
+ } else if (eventSource instanceof TransitionImpl) {
+ asyncExecutionInfo.put(KEY_EVENT_SOURCE_TRANSITION, null);
+ }
+
+ EventImpl event = execution.getEvent();
+ asyncExecutionInfo.put(KEY_EVENT_OBSERVABLE_PARENT_LEVEL, getEventObservableParentLevel(eventSource, event.getObservableElement()));
+ asyncExecutionInfo.put(KEY_EVENT_NAME, event.getName());
- eventName = event.getName();
- eventListenerIndex = event.getListenerReferences().indexOf(eventListenerReference);
+ asyncExecutionInfo.put(KEY_EVENT_LISTENER_INDEX, execution.getEventListenerIndex());
+
+ AtomicOperation eventCompletedOperation = execution.getEventCompletedOperation();
+ String eventCompletedOperationText = null;
+ if (eventCompletedOperation!=null) {
+ eventCompletedOperationText = eventCompletedOperation.toString();
+ }
+ asyncExecutionInfo.put(KEY_EVENT_COMPLETED_OPERATION, eventCompletedOperationText);
+
+ setConfiguration(asyncExecutionInfo);
}
+ public Integer getEventObservableParentLevel(ObservableElementImpl eventSource, ObservableElementImpl observableElement) {
+ int parentLevel = 0;
+ while (eventSource!=observableElement) {
+ parentLevel++;
+ eventSource = eventSource.getParent();
+ }
+ return parentLevel;
+ }
+
public Object execute(Environment environment) throws Exception {
- ObservableElementImpl observableElement = null;
+ Map<String, Object> asyncExecutionInfo = (Map) getConfiguration();
+
+ String transitionSourceName = (String) asyncExecutionInfo.get(KEY_TRANSITION_SOURCE);
+ TransitionImpl transition = null;
+ if (transitionSourceName!=null) {
+ ProcessDefinitionImpl processDefinition = execution.getProcessDefinition();
+ ActivityImpl transitionSource = processDefinition.findActivity(transitionSourceName);
+ Integer transitionIndex = (Integer) asyncExecutionInfo.get(KEY_TRANSITION_SOURCE_INDEX);
+ transition = (TransitionImpl) transitionSource.getOutgoingTransitions().get(transitionIndex);
+ execution.setTransition(transition);
+ }
+
+ if (asyncExecutionInfo.containsKey(KEY_EVENT_SOURCE_PROCESS_DEFINITION)){
+ ProcessDefinitionImpl processDefinition = execution.getProcessDefinition();
+ execution.setEventSource(processDefinition);
+
+ } else if (asyncExecutionInfo.containsKey(KEY_EVENT_SOURCE_ACTIVITY)){
+ ProcessDefinitionImpl processDefinition = execution.getProcessDefinition();
+ String activityName = (String) asyncExecutionInfo.get(KEY_EVENT_SOURCE_ACTIVITY);
+ ActivityImpl activity = processDefinition.findActivity(activityName);
+ execution.setEventSource(activity);
- RepositorySession repositorySession = environment.get(RepositorySession.class);
- ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) repositorySession.findProcessDefinitionById(processDefinitionId);
- if (activityName!=null) {
- ActivityImpl activity = processDefinition.findActivity(activityName);
- if (transitionIndex!=null) {
- TransitionImpl transition = (TransitionImpl) activity.getOutgoingTransitions().get(transitionIndex);
- observableElement = transition;
- } else {
- observableElement = activity;
- }
- } else {
- observableElement = processDefinition;
+ } else if (asyncExecutionInfo.containsKey(KEY_EVENT_SOURCE_TRANSITION)){
+ execution.setEventSource(transition);
}
+ ObservableElementImpl observableElement = (ObservableElementImpl) execution.getEventSource();
+ int parentLevel = (Integer) asyncExecutionInfo.get(KEY_EVENT_OBSERVABLE_PARENT_LEVEL);
+ for (int i=0; i<parentLevel; parentLevel++) {
+ observableElement = observableElement.getParent();
+ }
+
+ String eventName = (String) asyncExecutionInfo.get(KEY_EVENT_NAME);
EventImpl event = observableElement.getEvent(eventName);
- EventListenerReference eventListenerReference = event.getListenerReferences().get(eventListenerIndex);
- EventListener eventListener = eventListenerReference.get();
+ execution.setEvent(event);
- eventListener.notify(execution);
+ Integer eventListenerIndex = (Integer) asyncExecutionInfo.get(KEY_EVENT_LISTENER_INDEX);
+ execution.setEventListenerIndex(eventListenerIndex);
+
+ String eventCompletedOperationText = (String) asyncExecutionInfo.get(KEY_EVENT_COMPLETED_OPERATION);
+ AtomicOperation eventCompletedOperation = AtomicOperation.parseAtomicOperation(eventCompletedOperationText);
+ execution.setEventCompletedOperation(eventCompletedOperation);
+ execution.setState((String) asyncExecutionInfo.get(KEY_STATE));
+
+ execution.performAtomicOperationSync(AtomicOperation.EXECUTE_EVENT_LISTENER);
+
+ JobDbSession jobDbSession = environment.get(JobDbSession.class);
+ jobDbSession.delete(this);
+
return null;
}
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToChildActivity.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToChildActivity.java 2009-05-27 14:04:11 UTC (rev 4916)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToChildActivity.java 2009-05-27 16:43:05 UTC (rev 4917)
@@ -29,7 +29,7 @@
/**
* @author Tom Baeyens
*/
-public class MoveToChildActivity implements AtomicOperation {
+public class MoveToChildActivity extends AtomicOperation {
ActivityImpl activity;
@@ -40,7 +40,7 @@
public void perform(ExecutionImpl execution) {
execution.setActivity(activity);
ExecutionImpl propagatingExecution = execution.startActivity(activity);
- propagatingExecution.performAtomicOperation(ExecutionImpl.EXECUTE_ACTIVITY);
+ propagatingExecution.performAtomicOperation(AtomicOperation.EXECUTE_ACTIVITY);
}
public boolean isAsync(ExecutionImpl execution) {
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToParentActivity.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToParentActivity.java 2009-05-27 14:04:11 UTC (rev 4916)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToParentActivity.java 2009-05-27 16:43:05 UTC (rev 4917)
@@ -28,7 +28,7 @@
/**
* @author Tom Baeyens
*/
-public class MoveToParentActivity implements AtomicOperation {
+public class MoveToParentActivity extends AtomicOperation {
public void perform(ExecutionImpl execution) {
ActivityImpl activity = execution.getActivity();
@@ -46,4 +46,8 @@
public boolean isAsync(ExecutionImpl execution) {
return false;
}
+
+ public String toString() {
+ return "MoveToParentActivity";
+ }
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java 2009-05-27 14:04:11 UTC (rev 4916)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java 2009-05-27 16:43:05 UTC (rev 4917)
@@ -34,7 +34,7 @@
/**
* @author Tom Baeyens
*/
-public class Signal implements AtomicOperation {
+public class Signal extends AtomicOperation {
private static final Log log = Log.getLog(Signal.class.getName());
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionEndActivity.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionEndActivity.java 2009-05-27 14:04:11 UTC (rev 4916)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionEndActivity.java 2009-05-27 16:43:05 UTC (rev 4917)
@@ -25,12 +25,13 @@
import org.jbpm.pvm.internal.job.MessageImpl;
import org.jbpm.pvm.internal.model.ActivityImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.ObservableElementImpl;
/**
* @author Tom Baeyens
*/
-public class TransitionEndActivity implements AtomicOperation {
+public class TransitionEndActivity extends AtomicOperation {
public boolean isAsync(ExecutionImpl execution) {
return false;
@@ -38,7 +39,7 @@
public void perform(ExecutionImpl execution) {
ActivityImpl activity = execution.getActivity();
-
+
ExecutionImpl propagatingExecution = execution;
if (activity.isLocalScope()) {
propagatingExecution = execution.destroyScope(activity);
@@ -46,18 +47,16 @@
ActivityImpl parentActivity = activity.getParentActivity();
ActivityImpl destination = execution.getTransition().getDestination();
- if (isLeft(parentActivity, activity, destination)) {
+ if ( (parentActivity!=null)
+ && (!parentActivity.contains(destination))
+ ) {
propagatingExecution.setActivity(parentActivity);
- propagatingExecution.fire(Event.END, parentActivity, ExecutionImpl.TRANSITION_END_ACTIVITY);
+ propagatingExecution.fire(Event.END, parentActivity, AtomicOperation.TRANSITION_END_ACTIVITY);
} else {
- propagatingExecution.performAtomicOperation(ExecutionImpl.TRANSITION_TAKE);
+ propagatingExecution.performAtomicOperation(AtomicOperation.TRANSITION_TAKE);
}
}
- protected boolean isLeft(ActivityImpl activity, ActivityImpl from, ActivityImpl to) {
- return false;
- }
-
public MessageImpl< ? > createAsyncMessage(ExecutionImpl execution) {
throw new UnsupportedOperationException("please implement me");
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionStartActivity.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionStartActivity.java 2009-05-27 14:04:11 UTC (rev 4916)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionStartActivity.java 2009-05-27 16:43:05 UTC (rev 4917)
@@ -31,7 +31,7 @@
/**
* @author Tom Baeyens
*/
-public class TransitionStartActivity implements AtomicOperation {
+public class TransitionStartActivity extends AtomicOperation {
public boolean isAsync(ExecutionImpl execution) {
return false;
@@ -70,7 +70,7 @@
if (activity==null) {
execution.setTransition(null);
- execution.performAtomicOperation(ExecutionImpl.EXECUTE_ACTIVITY);
+ execution.performAtomicOperation(AtomicOperation.EXECUTE_ACTIVITY);
} else {
execution.setActivity(activity);
@@ -80,7 +80,7 @@
propagatingExecution = execution.createScope(activity);
}
- propagatingExecution.fire(Event.START, activity, ExecutionImpl.TRANSITION_START_ACTIVITY);
+ propagatingExecution.fire(Event.START, activity, AtomicOperation.TRANSITION_START_ACTIVITY);
}
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionStartActivityMessage.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionStartActivityMessage.java 2009-05-27 14:04:11 UTC (rev 4916)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionStartActivityMessage.java 2009-05-27 16:43:05 UTC (rev 4917)
@@ -43,7 +43,7 @@
public Object execute(Environment environment) throws Exception {
AsyncContinuations.restoreState(execution);
- execution.performAtomicOperationSync(ExecutionImpl.TRANSITION_START_ACTIVITY);
+ execution.performAtomicOperationSync(AtomicOperation.TRANSITION_START_ACTIVITY);
JobDbSession jobDbSession = environment.get(JobDbSession.class);
jobDbSession.delete(this);
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionTake.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionTake.java 2009-05-27 14:04:11 UTC (rev 4916)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionTake.java 2009-05-27 16:43:05 UTC (rev 4917)
@@ -23,7 +23,6 @@
import org.jbpm.api.model.Event;
import org.jbpm.pvm.internal.job.MessageImpl;
-import org.jbpm.pvm.internal.model.EventImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.model.TransitionImpl;
@@ -31,22 +30,20 @@
/**
* @author Tom Baeyens
*/
-public class TransitionTake implements AtomicOperation {
+public class TransitionTake extends AtomicOperation {
public boolean isAsync(ExecutionImpl execution) {
- TransitionImpl transition = execution.getTransition();
- EventImpl event = transition.getEvent(Event.TAKE);
- return ((event!=null) && (event.isAsync()));
+ return false;
}
public void perform(ExecutionImpl execution) {
TransitionImpl transition = execution.getTransition();
execution.setActivity(null);
- execution.fire(Event.TAKE, transition, ExecutionImpl.TRANSITION_START_ACTIVITY);
+ execution.fire(Event.TAKE, transition, AtomicOperation.TRANSITION_START_ACTIVITY);
}
public MessageImpl< ? > createAsyncMessage(ExecutionImpl execution) {
- throw new UnsupportedOperationException("please implement me");
+ return null;
}
public String toString() {
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/resources/jbpm.execution.hbm.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/resources/jbpm.execution.hbm.xml 2009-05-27 14:04:11 UTC (rev 4916)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/resources/jbpm.execution.hbm.xml 2009-05-27 16:43:05 UTC (rev 4917)
@@ -231,20 +231,12 @@
<subclass name="org.jbpm.pvm.internal.job.MessageImpl" discriminator-value="Msg">
<subclass name="org.jbpm.pvm.internal.model.op.ExecuteActivityMessage" discriminator-value="ExeAct" />
+ <subclass name="org.jbpm.pvm.internal.model.op.ExecuteEventListenerMessage" discriminator-value="ExeEvtLsnr" />
<subclass name="org.jbpm.pvm.internal.model.op.SignalMessage" discriminator-value="Signal">
<property name="signalName" column="SIGNAL_" />
</subclass>
- <subclass name="org.jbpm.pvm.internal.model.op.TransitionEndActivityMessage" discriminator-value="TrEndAct" />
- <subclass name="org.jbpm.pvm.internal.model.op.TransitionTakeMessage" discriminator-value="TrTake" />
- <subclass name="org.jbpm.pvm.internal.model.op.TransitionStartActivityMessage" discriminator-value="TrStartAct" />
- <subclass name="org.jbpm.pvm.internal.model.op.ExecuteEventListenerMessage" discriminator-value="ExeEvtLst">
- <property name="processDefinitionId" column="PROCDEF_" />
- <property name="activityName" column="ACT_" />
- <property name="transitionIndex" column="TRIDX_" />
- <property name="eventName" column="EVENT_" />
- <property name="eventListenerIndex" column="EVTLSTIDX_" />
- </subclass>
<subclass name="org.jbpm.pvm.internal.job.CommandMessage" discriminator-value="Cmd" />
+
</subclass>
<subclass name="org.jbpm.pvm.internal.job.TimerImpl" discriminator-value="Timer">
Modified: jbpm4/branches/tbaeyens/modules/test-pojo/src/main/java/org/jbpm/test/activities/EventTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-pojo/src/main/java/org/jbpm/test/activities/EventTest.java 2009-05-27 14:04:11 UTC (rev 4916)
+++ jbpm4/branches/tbaeyens/modules/test-pojo/src/main/java/org/jbpm/test/activities/EventTest.java 2009-05-27 16:43:05 UTC (rev 4917)
@@ -231,44 +231,4 @@
execution.end();
}
}
-
- public static class RecordingProcessDefinition extends ProcessDefinitionImpl {
- private static final long serialVersionUID = 1L;
- protected ExecutionImpl newProcessInstance() {
- return new RecordingExecution();
- }
- }
-
- public static class RecordingExecution extends ExecutionImpl {
- private static final long serialVersionUID = 1L;
- List<String> events = new ArrayList<String>();
- public void fire(String eventName, ObservableElement eventSource) {
- events.add(eventName+" on "+eventSource);
- }
- }
-
- public void testBasicEventSequence() {
- ClientProcessDefinition processDefinition = ProcessDefinitionBuilder
- .startProcess("basic", new RecordingProcessDefinition())
- .startActivity("initial", new AutomaticActivity())
- .initial()
- .transition("end")
- .endActivity()
- .startActivity("end", new EndState())
- .endActivity()
- .endProcess();
-
- RecordingExecution execution = (RecordingExecution) processDefinition.startProcessInstance();
-
- int index = 0;
- assertEquals("start on process(basic)", execution.events.get(index));
- index++;
- assertEquals("end on activity(initial)", execution.events.get(index));
- index++;
- assertEquals("take on (initial)-->(end)", execution.events.get(index));
- index++;
- assertEquals("start on activity(end)", execution.events.get(index));
- index++;
- assertEquals("end on process(basic)", execution.events.get(index));
- }
}
15 years
JBoss JBPM SVN: r4916 - in jbpm4/branches/tbaeyens/modules: pvm/src/main/java/org/jbpm/pvm/internal/model/op and 1 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-05-27 10:04:11 -0400 (Wed, 27 May 2009)
New Revision: 4916
Modified:
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionStartActivity.java
jbpm4/branches/tbaeyens/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionEventsTest.java
Log:
execution refactoring
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-05-27 14:03:06 UTC (rev 4915)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-05-27 14:04:11 UTC (rev 4916)
@@ -559,9 +559,9 @@
}
EventImpl event = observableElement.getEvent(eventName);
- if ( (event==null)
- || (event.getListenerReferences()==null)
- || (event.getListenerReferences().isEmpty())
+ if ( (event!=null)
+ && (event.getListenerReferences()!=null)
+ && (!event.getListenerReferences().isEmpty())
) {
return event;
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionStartActivity.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionStartActivity.java 2009-05-27 14:03:06 UTC (rev 4915)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionStartActivity.java 2009-05-27 14:04:11 UTC (rev 4916)
@@ -22,6 +22,7 @@
package org.jbpm.pvm.internal.model.op;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.model.Event;
import org.jbpm.pvm.internal.job.MessageImpl;
import org.jbpm.pvm.internal.model.ActivityImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
@@ -79,7 +80,7 @@
propagatingExecution = execution.createScope(activity);
}
- propagatingExecution.performAtomicOperation(ExecutionImpl.TRANSITION_START_ACTIVITY);
+ propagatingExecution.fire(Event.START, activity, ExecutionImpl.TRANSITION_START_ACTIVITY);
}
}
Modified: jbpm4/branches/tbaeyens/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionEventsTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionEventsTest.java 2009-05-27 14:03:06 UTC (rev 4915)
+++ jbpm4/branches/tbaeyens/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionEventsTest.java 2009-05-27 14:04:11 UTC (rev 4916)
@@ -45,7 +45,48 @@
}
}
+ public void testBasicEvents(){
+ Recorder fromListener = new Recorder();
+ Recorder toListener = new Recorder();
+ Recorder transitionListener = new Recorder();
+ /*
+ +------+ +----+
+ | from |------->| to |
+ +------+ +----+
+ */
+
+ ClientProcessDefinition processDefinition = ProcessDefinitionBuilder
+ .startProcess("p")
+ .startActivity("from", new WaitState())
+ .initial()
+ .startEvent(Event.END)
+ .listener(fromListener)
+ .endEvent()
+ .startFlow("to")
+ .listener(transitionListener)
+ .endFlow()
+ .endActivity()
+ .startActivity("to", new WaitState())
+ .startEvent(Event.START)
+ .listener(toListener)
+ .endEvent()
+ .endActivity()
+ .endProcess();
+
+ ClientExecution execution = processDefinition.startProcessInstance();
+ execution.signal();
+
+ assertEquals("[event(end) on activity(from)]",
+ fromListener.events.toString());
+
+ assertEquals("[event(take) on (from)-->(to)]",
+ transitionListener.events.toString());
+
+ assertEquals("[event(start) on activity(to)]",
+ toListener.events.toString());
+ }
+
public void testCompositeLeave(){
Recorder processListener = new Recorder();
Recorder outsideListener = new Recorder();
15 years