Hi,
We have an ActionHandler where we want to Transition to take the first possible 
transition that is not an Exception Path, this is, is not one of the possible 
transitions taken by an ExceptionHandler`s actions.
We have this code now:


  |     private String getOutputTransition(ExecutionContext context)
  |                     throws ActionHandlerConfigurationException {
  |             List<ExceptionHandler> exceptionsH = 
context.getToken().getNode()
  |                             .getExceptionHandlers();
  |             
  |             Node node = context.getToken().getNode();
  |             exceptionNodes = new ArrayList<String>();
  |             outputTransitions = node.getLeavingTransitions();
  |             if (exceptionsH != null) {
  |                     for (ExceptionHandler eh : exceptionsH) {
  |                             Action action = (Action) 
eh.getActions().iterator().next();
  |                             if (action != null) {
  |                                     if 
(action.getActionDelegation().getClassName().equals("x.ba.MiExceptionHandler")) 
{
  |                                             String tr = 
StringUtils.substringBetween(action
  |                                                             
.getActionDelegation().getConfiguration(),
  |                                                             
"<exceptionPathTransition>",
  |                                                             
"</exceptionPathTransition>");
  |                                             
exceptionNodes.add(node.getLeavingTransition(tr)
  |                                                             
.getTo().getName());
  |                                     }
  |                             }
  |                     }
  |             }
  |             if (exceptionNodes.size() == 0) {
  |                     return null;
  |             } else {
  |                     for (Transition t : outputTransitions) {
  |                             if 
(!exceptionNodes.contains(t.getTo().getName())) {
  |                                     return t.getName();
  |                             }
  |                     }
  |             }
  |             throw new ActionHandlerConfigurationException(
  |                             "All next transitions exceptions. Set a normal 
path");
  |     }
  | 

This code is working, but it takes long time to execute, compared with the rest 
of our ActionHandlers things.

Is there a way to achieve same result, and not having to use Configuration 
class?

Thanks.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4108433#4108433

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4108433
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to