1 Reply Latest reply on May 9, 2013 11:35 PM by Sham HC

    Issue in implementing Dynamic participant chooser process Step

    nephelem

      I am facing issue in implementing Participant chooser process Step.

       

       

      I want to create dynamic Participant chooser process Step, I have implemented 'ParticipantStepChooser' class and overwrote 'getParticipant' method. But this process did not appear in Dynamic participant chooser dropdown in CQ5.6 environment.

       

      I deployed same code in CQ5.5 and process appeared in Dynamic participant chooser dropdown.

       

       

       

      This is the sample code which I have used:

       

      @Component(immediate = true, metatype = true, label = "DMP Config Service123")

      @Service

      @Properties({

              @Property(name = Constants.SERVICE_DESCRIPTION, value = "A sample implementation of a dynamic participant chooser.", propertyPrivate=true),

              @Property(name = Constants.SERVICE_VENDOR, value = "Adobe", propertyPrivate=true),

              @Property(name = ParticipantStepChooser.SERVICE_PROPERTY_LABEL, value = "******** Hello ********", propertyPrivate=true),

              @Property(name = "immediate" , value = "true", propertyPrivate=true)

               })

      public class MyDynamicParticipant implements ParticipantStepChooser {

       

          private static final String TYPE_JCR_PATH = "JCR_PATH";

         

          @Activate

      void activate(ComponentContext context) {

        LoggerUtil.infoLog(this.getClass(), " ");

      }

       

          public String getParticipant(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap args) throws WorkflowException {

        LoggerUtil.infoLog(this.getClass(), "inside getParticipant method{} ");

              WorkflowData workflowData = workItem.getWorkflowData();

              if (workflowData.getPayloadType().equals(TYPE_JCR_PATH)) {

      String path = workflowData.getPayload().toString();

      String pathFromArgument = args.get("PROCESS_ARGS", String.class);

      if (pathFromArgument != null && path.startsWith(pathFromArgument)) {

      return "admin";

      }

              }

              return "administrators";

          }

         

        

      }

        • 1. Re: Issue in implementing Dynamic participant chooser process Step
          Sham HC Level 7

          Make sure to change your imports in 5.6 to use granite api. Please change from [1] to [2].

           

           

          [1]

          import com.day.cq.workflow.WorkflowException;

          import com.day.cq.workflow.WorkflowSession;

          import com.day.cq.workflow.exec.ParticipantStepChooser;

          import com.day.cq.workflow.exec.WorkItem;

          import com.day.cq.workflow.exec.WorkflowData;

          import com.day.cq.workflow.metadata.MetaDataMap;

           

          [2]

          import com.adobe.granite.workflow.WorkflowException;

          import com.adobe.granite.workflow.WorkflowSession;

          import com.adobe.granite.workflow.exec.ParticipantStepChooser;

          import com.adobe.granite.workflow.exec.WorkItem;

          import com.adobe.granite.workflow.metadata.MetaDataMap;