Using two or more ActionService.execute() in a same class or same method

elk_sinam
elk_sinam Member
edited February 3, 2014 in Documentum #1

    Hi, everyone.

I have problem using ActionService execute method.

I have an action named customaction . This action open an container dialog container which its container component calls CustomContainer class (extends DialogContainer) ...

In CustomContainer class I want execute two actions ( myexportrenditionaction and checkout ) . I have created myexportrenditionaction and its call custom container class. myexportrenditionaction action export document rendition to the client which client user not select destination directory, because custom class select directory automatically (for example: String destDirectory = "C:\\temp\\test") . it works well. there is not any problem. and chekout action is work too.

There is no problem with actions. They work separately. but I want execute this actions in the same method or the same time. However when I place those actions in the same method together the method execution fails. How can I execute they together?

in CustomContainer class onInit method :

public void onInit(ArgumentList args) {

        super.onInit(args);

        String id = args.get("objectId");   // document id

        ArgumentList rendArgs;

        rendArgs.add("objectId", id);

        rendArgs.add("contentType", "xml");

        ArgumentList checkoutArgs;

        checkoutArgs.add("objectId", id);

       // ActionService.execute("myexportrenditionaction", rendArgs, getContext(), this,null);

       // ActionService.execute("checkout", checkoutArgs, getContext(), this,null);

}

There is no problem with actions, problem is that how can I execute them together?

Best Answer

  • elk_sinam
    elk_sinam Member
    edited June 14, 2012 #2 Answer ✓

    I have found solution

    We can execute actions together like this:

    public void onInit(ArgumentList args) {       - - - - - - - - - - - -       ActionService.execute("myexportrenditionaction", rendArgs, getContext(), this, new CallbackDoneListener(this,"completeAction") );}public void completeAction(String s, boolean flag, Map map) {        ArgumentList checkoutArgs = new ArgumentList();        checkoutArgs.add("objectId",ID);        ActionService.execute("checkout", checkoutArgs, getContext(), this,new CallbackDoneListener(this,null));}

Answers

  • elk_sinam
    elk_sinam Member
    edited June 14, 2012 #3 Answer ✓

    I have found solution

    We can execute actions together like this:

    public void onInit(ArgumentList args) {       - - - - - - - - - - - -       ActionService.execute("myexportrenditionaction", rendArgs, getContext(), this, new CallbackDoneListener(this,"completeAction") );}public void completeAction(String s, boolean flag, Map map) {        ArgumentList checkoutArgs = new ArgumentList();        checkoutArgs.add("objectId",ID);        ActionService.execute("checkout", checkoutArgs, getContext(), this,new CallbackDoneListener(this,null));}
  • prashantagg
    prashantagg Member
    edited February 3, 2014 #4

    I have pass the parameter but whenever We try to get argument in component behavior class it is null;

    help  me