cancel
Showing results for 
Search instead for 
Did you mean: 

Get action id for action evaluated in ActionEvaluator impl

bpeters
Champ in-the-making
Champ in-the-making
Does any one know if it is possible to retrieve the action id for the action that is currently evaluated when an ActionEvaluator is executed?

I have for example the following action definition in my web-client-config:
<action id="test_id">
  <permissions>
    <permission allow="true">Write</permission>
  </permissions>
  <evaluator>nl.bua.alfresco.action.evaluator.ScriptableActionEvaluator</evaluator>
  <label>Test</label>
  <image>/images/icons/copy.gif</image>
  <action-listener>
    #{ActionHandlerBean.execute}
  </action-listener>
  <params>
    <param name="id">#{actionContext.id}</param>
  </params>
</action>
In my ScriptableActionEvaluator I'd like to retrieve the value 'test_id' when the evaluator evaluates this action.

Thanks in advance,

Bas
3 REPLIES 3

patil
Champ on-the-rise
Champ on-the-rise
Hi,
action id will be unique across the system.
So if you write the unique actionlistener  for each action then in your actionlistener you can findout what is the actionid
<action-listener>
    #{ActionHandlerBean.execute}
  </action-listener>

But what you are trying to do with the actionid?

Thanks,
Patil
Cignex Technologies
Bangalore

bpeters
Champ in-the-making
Champ in-the-making
Hi Patil,

I want to use the action definition for the action that is being evaluated in my ActionEvaluator implmentation to read a parameter.

Like this:
ActionService service = Repository.getServiceRegistry(context).getActionService();
ActionDefinition actionDefinition = service.getActionDefinition("test_id");
But in order to be able to read the definition I need the action id ('test_id').

It is just for the evaluator and not part of the action execution that is done in the actionhandler.execute() method.

Kind regards,

Bas

patil
Champ on-the-rise
Champ on-the-rise
HI,
Check the config service, u might get some method.

Thanks,
Patil
Cignex Technologies
Bangalore