How to assign a workflow to usergroup in AEM 6.3 using osgi R6 annotations? | Community
Skip to main content
Suraj_Kamdi
New Participant
Feb 26, 2018 10:33 AM UTC
Solved

How to assign a workflow to usergroup in AEM 6.3 using osgi R6 annotations?

how to assign a workflow to usergroup in AEM 6.3 using osgi R6 annotations?

I want to create workflow for "dynamic participant step". can anyone please explain how to use "chooser.label" and "service.description" in OSGI R6 annotation.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
rmahendra
rmahendraAccepted solution
Employee
Feb 26, 2018 12:47 PM UTC

Try the below code. Make sure you have the R6 annotations dependencies in the pom.

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.metadata.MetaDataMap;

import org.osgi.service.component.annotations.Component;

@Component(service = ParticipantStepChooser.class, property = {"chooser.label = A Test Particpant Chooser step"})

public class DynamicParticipantStepChooser implements ParticipantStepChooser {

   @Override
   public String getParticipant(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap) throws WorkflowException {

   // code
   return "administrators";

  }

}

2 replies

rmahendra
rmahendraAccepted solution
Employee
Feb 26, 2018 12:47 PM UTC

Try the below code. Make sure you have the R6 annotations dependencies in the pom.

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.metadata.MetaDataMap;

import org.osgi.service.component.annotations.Component;

@Component(service = ParticipantStepChooser.class, property = {"chooser.label = A Test Particpant Chooser step"})

public class DynamicParticipantStepChooser implements ParticipantStepChooser {

   @Override
   public String getParticipant(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap) throws WorkflowException {

   // code
   return "administrators";

  }

}

Translate
Hemant_arora
Level 8
Feb 26, 2018 10:39 AM UTC

Try like this

@Component(service=Servlet.class,     

     property={ Constants.SERVICE_DESCRIPTION + "=Simple Demo Servlet", 

                 "sling.servlet.methods=" + HttpConstants.METHOD_GET,

                  "sling.servlet.resourceTypes="+ "com.poc.osgiannotation/components/structure/page", 

                 "sling.servlet.paths="+ "/bin/servlet",

                   "sling.servlet.extensions=" + "txt"

          })

Translate