[jboss-dev-forums] [Design of PVM (Process Virtual Machine)] - Re: Composite execution problem

beeke do-not-reply at jboss.com
Thu Apr 16 05:47:18 EDT 2009


Thank you, Tom

The Sequence class is :test-pojo/EventPropagationTest#Sequence.


  | public static class Sequence implements ExternalActivityBehaviour {
  |     private static final long serialVersionUID = 1L;
  |     public void execute(ActivityExecution execution) {
  |       List<Activity> activities = execution.getActivity().getActivities();
  |       if ( (activities!=null)
  |            && (!activities.isEmpty())
  |          ) {
  |         execution.execute(activities.get(0));
  |       }
  |     }
  |     public void signal(ActivityExecution execution, String signal, Map<String, Object> parameters) {
  |       Activity previous = execution.getPreviousActivity();
  |       List<Activity> activities = execution.getActivity().getActivities();
  |       int index = activities.indexOf(previous);
  |       index++;
  |       if (index < activities.size()) {
  |         Activity next = activities.get(index);
  |         execution.execute(next);
  |       }
  |     }
  | 

When I set the transition:.initial().needsPrevious().transition("end"),
the sequence activity in ExecutionImpl.proceed() will never executed as a block stucted code.

If I modify the structure like this:

  | .startActivity("three", new WaitState()).transition("end")
  | .endActivity()
  | 
It works fine.

But  the structure is
http://docs.jboss.org/jbpm/pvm/manual/html_single/images/ch02.transition.out.of.composite.png

Can you tell me how to write a currect ActivityBehaviour?
Thank you!



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

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4225851



More information about the jboss-dev-forums mailing list