cancel
Showing results for 
Search instead for 
Did you mean: 

ActivityExecution.takeAll: what is the 2nd parameter?

f_lombardo
Champ in-the-making
Champ in-the-making
Sorry for the silly question, but could you explain the meaning of the 2nd parameter of method of ActivityExecution.takeAll?

Thank you very much.

Bye

Franco
6 REPLIES 6

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Well, the javadoc sais:

  /**
   * Takes the given outgoing transitions, and potentially reusing
   * the given list of executions that were previously joined.
   */
  void takeAll(List<PvmTransition> outgoingTransitions, List<ActivityExecution> joinedExecutions);

How it is used can best be seen if youanalyze t code a littl and find references of its usage. It as to do with gateways.

f_lombardo
Champ in-the-making
Champ in-the-making
First of all, thank you for your answer.

I already tried to understand the engine source code, but, since I'm not so smart, I was asking you some hints 🙂

Anyway, I'll try again, thanks.

Bye

Franco

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
My I ask why you need to know this? I use activiti all the time and never needed this INTERNAL method in normal usage (it is not in the public api). The only moment I needed to know parts of the internal api whas when fixing some bug in a gateway.

f_lombardo
Champ in-the-making
Champ in-the-making
I need this method because I'm  writing a special kind of gateway implemening some particular business rules of my process.

Thanks

Bye

Franco

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
… but, since I'm not so smart
I'm writing a special kind of gateway implemening…

Ok… I'd still go for analyzing how it is used then… I doubt an answer by one of the core devs would help you in actually using it… And they most likely will not write the 'special gateway' for you.

Can't the businessrule not be implemented using the existing gateways?

f_lombardo
Champ in-the-making
Champ in-the-making
Can't the businessrule not be implemented using the existing gateways?

It could definitively be implemented using existing gateways, but I think it would be a bit "convoluted".

Anyway, I did it this way, and it seems it works:


public class MyGateway implements ActivityBehavior {

  public void execute(ActivityExecution execution) throws Exception {
    List<PvmTransition> transitions = findTransitionsWithMyFunnyRules();
   
    execution.inactivate();
   
    execution.takeAll(transitions, new ArrayList<ActivityExecution>());
  }

}

Thanks.

Bye

Franco