cancel
Showing results for 
Search instead for 
Did you mean: 

can a custom action call another action?

lapo
Champ in-the-making
Champ in-the-making
(is this the correct forum? I'd say "no", because actions are not necessarily related to the webclient, but I didn't find any forum that seemed better suited to me)

Can a custom action, in its executeImpl, call a different [custom] action?

I'd say "no", as i tried and the second executeImpl deadlocks on getParameterValue… in that case: what's the suggested way to do it?

Of course, both custom actions being written by me, I can always refactor one to expose a method that does most of the job of the "inner" action, so that the outer one can call that instead of invoking the action itself, but I wonder if a different approach could work/be-better.
1 REPLY 1

rivetlogic
Champ on-the-rise
Champ on-the-rise
You should be able to call another action from executeImpl method  of an action.



//AnotherActionExecuter.java is the another custom action
Action action = this.actionService.createAction(AnotherActionExecuter.NAME);
action.setParameterValues(parameterValues);
// Execute action
this.actionService.executeAction(action, usersHomeNodeRef);

Make sure you have reference to action service in your *context.xml

<property name="actionService">
      <ref bean="ActionService"/>
</property>

Regards,
Shagul