[Other JBoss Development Design] - Re: failing org.jboss.test.util.test.ThreadPoolRunnableUnitT
by scott.stark@jboss.org
The source is clearly different, with the brew version clearly missing two changes. This is a source tree older than 1.3.4 to be sure:
| [starksm@succubus oswego-concurrent]$ diff -w 1.3.4/lib/src/EDU/oswego/cs/dl/util/concurrent/PooledExecutor.java 1.3.4-brew/src/concurrent/PooledExecutor.java
| 30,31d29
| < 30aug2003 dl check for new tasks when timing out
| < 18feb2004 dl replace dead thread if no others left
| 190,193c188
| < * <dd> Wait until a thread becomes available. This
| < * policy should, in general, not be used if the minimum number of
| < * of threads is zero, in which case a thread may never become
| < * available.
| ---
| > * <dd> Wait until a thread becomes available.
| 298c293
| < * <li> Same as (2) except clients abort if both the buffer is full and
| ---
| > * <li> Same as (2) except clients block if both the buffer is full and
| 304c299
| < * pool.abortWhenBlocked();
| ---
| > * pool.waitWhenBlocked();
| 699,709d693
| <
| < // Create a replacement if needed
| < if (poolSize_ == 0 || poolSize_ < minimumPoolSize_) {
| < try {
| < Runnable r = (Runnable)(handOff_.poll(0));
| < if (r != null && !shutdown_) // just consume task if shut down
| < addThread(r);
| < } catch(InterruptedException ie) {
| < return;
| < }
| < }
| 794,797d777
| < synchronized(PooledExecutor.this) {
| < if (shutdown_)
| < return true;
| < }
| 805,806c785
| < * is available, unless the pool has been shut down, in which case
| < * the action is discarded.
| ---
| > * is available.
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031157#4031157
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4031157
17 years, 3 months
[Design of JBoss jBPM] - Re: Fork with one path for every element of a collection
by jeffdelong
You should probably post this to the user forum, as it is not a jBPM design issue per se.
However what you want to do is easy to do with an action at a node that has code as follows where you get forkCount from the size of your collection, e.g.,
| Node fork = rootToken.getNode();
|
| if (forkCount > 0) {
| // create a child token for every fork
| for (int 0 = 1; i < forkCount; i++) {
|
| List<Transition> transitions = fork.getLeavingTransitions();
| Iterator iter = transitions.iterator();
| // need to iterate through the leaving transitions
| // although we only have one
| while (iter.hasNext()) {
| Transition leavingTransition = (Transition) iter.next();
| String childTokenName = leavingTransition.getName();
| Token childToken = new Token(rootToken, childTokenName);
| ci.setVariable("x", x, childToken);
| ExecutionContext childExecutionContext = new ExecutionContext(
| childToken);
| fork.leave(childExecutionContext, childTokenName);
| }
| }
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031133#4031133
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4031133
17 years, 3 months
[Design of JBoss jBPM] - Fork with one path for every element of a collection
by camunda
Hi!
Today I faced the problem for the second time: We need a fork which starts a sub token for every item of a collection (but all have the same process flow).
This is currently not possible with jbpm. So I plan to enhance the fork for that. My plan was, to configure a "fork-collection", where I can configure the name of a process variable, which must be a array or collection. And then, the fork automatically forks at that point and create a subtoken for every item and (thats the point, where I don't know how to realize that), every token has to know the exact item, he is working on. Also the join must know, how much tokens must arrive, bevor he fires...
what do you think of this idea in general?
Or maybe, anybody has already implemented something like that? Or his own idea in his mind?
Thanks and best regards
Bernd
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031117#4031117
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4031117
17 years, 3 months