Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Process step is not coming in dropdown list

Avatar

Level 7

@Component(

   label = "CQ Workflow Process amit",
   description = "Sample Workflow Process implementation amit",
   metatype = true,
   immediate = true
)

@Properties({

   @Property(

   name = "service.description",
   value = "CQ Workflow Process implementation.amit",
   propertyPrivate = true
   ),
   @Property(

   name = "service.pid",
   value = "amitsample.core.filters.WorkflowSamplefilter",
   description = "CQ Workflow Process description"
   ),
   @Property(

   name = "process.label",
   value = "my first workflow process step ",
   description = "CQ Workflow Process description"
   )

})

1833692_pastedImage_0.png

1833693_pastedImage_1.png

1833694_pastedImage_2.png

1833695_pastedImage_3.png

I am not getting  my customised process in the list . Please suggest what i m doing wromh here ...aem version 6.0 i m using ....and using all scr annotations

and

<dependency>
  <groupId>com.day.cq.workflow</groupId>
  <artifactId>cq-workflow-api</artifactId>
  <version>5.4.2</version>
  <scope>provided</scope>
</dependency>

full code if want to check:

package amitsample.core.filters;

import com.day.cq.workflow.WorkflowException;
import com.day.cq.workflow.WorkflowSession;
import com.day.cq.workflow.exec.WorkItem;
import com.day.cq.workflow.exec.WorkflowProcess;
import com.day.cq.workflow.metadata.MetaDataMap;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Properties;
import org.apache.felix.scr.annotations.Property;

@Component(

   label = "CQ Workflow Process amit",
   description = "Sample Workflow Process implementation amit",
   metatype = true,
   immediate = true
)

@Properties({

   @Property(

   name = "service.description",
   value = "CQ Workflow Process implementation.amit",
   propertyPrivate = true
   ),
   @Property(

   name = "service.pid",
   value = "amitsample.core.filters.WorkflowSamplefilter",
   description = "CQ Workflow Process description"
   ),
   @Property(

   name = "process.label",
   value = "my first workflow process step ",
   description = "CQ Workflow Process description"
   )

})

public class WorkflowSamplefilter implements WorkflowProcess {

   @Override
   public void execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap) throws WorkflowException {

  }

}

8 Replies

Avatar

Community Advisor

Hi,

@service annotation seems to be missing in your code.could you please add and check again?

Please follow this: Adobe Experience Manager Help | Creating custom AEM workflow steps that send email messages

Regards,

Arpit

Avatar

Level 7

yeah i missed that but after adding that aslo it didnt resolve the issue

@Service(WorkflowSamplefilter.class)

any other work around?

Avatar

Community Advisor

Can you replace your annotation with below and try again:

@Component

@Service

@Properties({

    @Property(name = Constants.SERVICE_DESCRIPTION, value = "Sample Workflow Process implementation amit")

    @Property(name = "process.label", value = "my first workflow process step") })

public class WorkflowSamplefilter implements WorkflowProcess {

   @Override
   public void execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap) throws WorkflowException {

  }

}

Avatar

Level 7

Thanks Arpit.   its worked ..........but still wondering wat was wrong ?

Avatar

Community Advisor

You were using @Service(WorkflowSamplefilter.class) which was wrong.

Instead, you should either use @Service(WorkflowProcess.class) or just @Service annotation

Avatar

Level 7

I have gone through all the links available for workflows and did Rnd already ..didnt get wats the actual issue ...that is why posted here ...Thanks

Avatar

Employee

Try to use something like:

@Component(service=WorkflowProcess.class, property = {"process.label=My Workflow"})

Avatar

Level 7

still I am using SCR annotations .....and working in AEM 6.0