cancel
Showing results for 
Search instead for 
Did you mean: 

how to call executeImpl method through a workflow

jetty
Champ in-the-making
Champ in-the-making
hi ,
    now i am working with workflows ,I( need to call an  class called  ActionExecuterAbstractBase wich is having methods like execute impl and addParameterDefinitions. please help in how to call this class .


please help me out
2 REPLIES 2

mrogers
Star Contributor
Star Contributor
You need to call the action service createAction to create an action with the correct parameters  and then call executeAction to execute the action.

jetty
Champ in-the-making
Champ in-the-making
Thanks mrogers,

Say if i have an action called "CustomCategoryCreationExecutor", from my workflow I need to call this action. Am confused that how could I call this action from workflow. So what i did was, i have created a class which extends ActionHandler and called it from workflow. This is what I did.

<node name="Approved">
<transition name="" to="end1">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<variable name="bpm_package" access="read" />
<expression>
var createCategoryAction= actions.create("create-category");
createCategoryAction.parameters["active"] = true;
createCategoryAction.execute(bpm_package.children[0]);
</expression>
</script>
</action>
</transition>
</node>

And here is my Class.

public class SampleClass implements ActionHandler{
   public void execute(ExecutionContext arg0) throws Exception {
               // Call the CustomCategoryCreationExecutor from here.
        }
}

My CustomCategoryCreationExecutor will looks like.

public class CustomCategoryCreationExecutor extends ActionExecuterAbstractBase {
      protected void executeImpl(Action arg0, NodeRef actionedUponNodeRef) {
      }
}

In the above said way, I dont have any idea on how to call the action CustomCategoryCreationExecutor.

I didn't find the way to execute the CustomCategoryCreationExecutor  action from workflow itself. That's why I tried it in the above mentioned way. Is this the right way am proceeding. If there is any other way please let me know.

Thanks,
Jetty.