[
https://jira.jboss.org/jira/browse/JBPM-2537?page=com.atlassian.jira.plug...
]
Ronald van Kuijk commented on JBPM-2537:
----------------------------------------
Ok, I have a 'new fix'... What I did was:
- Create a TimeoutActivityBehaviour interface in the api module.
- Changed some methods in the ExecutionImpl (backwards compatible) and added a timeout
method.
// This processes normal signals and timeouts
private void signal(String signal, Map<String, ?> parameters, boolean timeout) {
checkActive();
if (getProcessDefinition().isSuspended()) {
throw new JbpmException("process definition
"+getProcessDefinition().getId()+" is suspended");
}
propagation = Propagation.EXPLICIT;
if (getActivity()!=null) {
performAtomicOperation(new Signal(signal, parameters, timeout));
} else if (transition!=null) {
performAtomicOperation(AtomicOperation.TRANSITION_START_ACTIVITY);
} else {
throw new JbpmException("execution is not in a activity or in a
transition");
}
}
public void signal(String signal, Map<String, ?> parameters) {
signal(signal, parameters, false);
}
public void timeout(String signalName) {
signal(signalName, (Map<String,?>)null, true);
}
- The Signal got an additional constructor with a boolean to for timeout
public Signal(String signalName, Map<String, ?> parameters, boolean timeout) {
this.signalName = signalName;
this.parameters = parameters;
this.timeout = timeout;
}
and in the 'perform' of the Signal I look if the activitybehaviour implements the
TimeoutActivityBehaviour and based on that result either call the timeout method that
needs to be implemented in the specific activity (TaskActivity in this case) or backwards
compatible just call 'signal'.
- The jpdl TaskActivity implements the interface and so the timeout method which calls the
timeout method on the TaskImpl where it puts the specific task in history, deletes it
etc... Just where it should be (PVM)
Advantages:
- Fully backwards compatible, no changes to other classes needed
- Only use api classes in the PVM, no jpdl ones
- This could (I think) be easily extended to have a 'error' behaviour thing to so
eventlisteners that do something in case of a low level error could be implemented by
means of signals as well.
- ...
Disadvantages:
- Tell me, I could not find any (yet)
Ronald
p.s. Patch will be added later, have to merge things first (2 week lag)
A triggered timer does not end the task which is left
-----------------------------------------------------
Key: JBPM-2537
URL:
https://jira.jboss.org/jira/browse/JBPM-2537
Project: jBPM
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Runtime Engine
Affects Versions: jBPM 4.1, jBPM 4.0
Reporter: Alexis Seigneurin
Assignee: Tom Baeyens
Priority: Critical
Fix For: jBPM 4.4
Attachments: jbpm-2537-patch, jbpm-2537-patch-method.patch,
jbpm-2537-patch-method.patch, kukeltje.zip, process.jpdl.xml, screenshot-1.jpg,
TaskTimeoutTest.java, workflow-test-jbpm4.1.zip
In my process definition, "task1" has a transition with a due date. When this
timer is triggered by the job executor, the transition takes the process to
"task2" but "task1" still looks active. For instance, when I run a
"task query", instead of only finding "task2", both "task1"
and "task2" are found.
Here is my process definition:
<?xml version="1.0" encoding="UTF-8"?>
<process name="test1"
xmlns="http://jbpm.org/4.0/jpdl">
<start g="-9,192,48,48" name="start1">
<transition g="-44,-18" name="to task3"
to="task3" />
</start>
<end g="490,192,48,48" name="end1" />
<task g="272,189,92,52" name="task1">
<transition g="-42,-18" name="to end1" to="end1"
/>
<transition g="-45,-18" name="to java1"
to="reminder">
<timer duedate="10 seconds" />
</transition>
</task>
<java class="fr.idm.SimpleReminder" g="272,316,92,52"
method="remind" name="reminder">
<transition to="task2" />
</java>
<end g="626,319,48,48" name="end2" />
<task g="454,316,92,52" name="task2">
<transition g="-42,-18" name="to end2" to="end2"
/>
</task>
<task g="113,189,92,52" name="task3">
<transition g="-44,-18" to="task1" name="to
end1" />
</task>
</process>
For testing purpose, I introduced "task3" before "task1". It is not
listed by the task query, which makes me think that, once "task1" is left, it
should no longer be active.
This looks like
https://jira.jboss.org/jira/browse/JBPM-967 but the suggested solution
does not seem applicable to JBPM 4.x.
I will attached the whole source code.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira