4 Replies Latest reply on Feb 27, 2008 7:50 AM by (Scott_Brodersen)

    Invoke process from string value

    kc@dafolo.dk Level 1
      Hi all,

      I am trying to create a monitoring process that should monitor a mailbox. This monitoring process should look in the subject of the individual mails and by the subject determine which action to take (which underlying process) that should be invoked.

      So if subject is "Process1" then the monitoring process ahould invoke "Process1".

      EIther I see the possiblilty of dropping the form (attached to the email) into a predefined watched folder with the name "Process1" or calling the appropriate process by creating my own code for the EJB-endpoint (or SOAP?). However I don't knwo which solution is the easiest. I don't want to manually create 50 unique folders if using the EJB endpoint is simple.

      Does anyone of you have an obvious solution (which I might have overlooked) or just some comments/pointers for which/where to go from here they would be highly appreciated.

        • 1. Re: Invoke process from string value
          Jasmin Charbonneau Level 4
          Why can't you just call the Process1 as sub process from the Monitoring process?

          This way you don't have to create a bunch of watch folders. You can just pass the PDF as an input parameter for that sub process.

          • 2. Re: Invoke process from string value
            kc@dafolo.dk Level 1
            Hi again,

            Thanks for your suggestion.

            The problem with doing it this way is that everytime we need a new process we will need to change the monitoring process.

            The idea is that this process should never be changed (I know the number of processes that needs beforehand).

            I hope you understand what I am trying to do, otherwise don't hesitate to ask, and I'll elaborate.

            • 3. Re: Invoke process from string value
              Jasmin Charbonneau Level 4
              I get it now.

              I would suggest to use the EJB to invoke LiveCycle. Like you mentioned, you should be able to create a generic function that takes the name of the process as an input parameter and then you call that process using a generic call (if the input/output parameters are the same).

              This is an example:
              public InvocationResponse InvokeShortLived(String service, String operation, Map parameters){
              try {
              // Create a ServiceClient object
              ServiceClient myServiceClient = _factory.getServiceClient();

              InvocationRequest request = _factory.createInvocationRequest(
              service, // Specify the short-lived process name
              operation, // Specify the operation name
              null, // Specify input values
              false); // Create a synchronous request

              // Send the Invocation request to the short-lived process and
              // get back an InvocationResponse object

              InvocationResponse response = myServiceClient.invoke(request);
              eturn response;
              } catch (Exception ex) {
              System.out.println(" ERROR -> " + ex.getMessage());
              return null;

              • 4. Re: Invoke process from string value
                You might also be able to use events...the monitoring process throws an asynchronous event that contains the process name as event data. All other processes are listening for the event throw using event start points, and they filter on the process name.

                If the event passes the filter, the process is invoked.

                This is similar to subprocesses, but the event framework provides more flexibility.

                See the Event Implementation section of http://livedocs.adobe.com/livecycle/es/wb_help/00000565.html