Highlighted

Process step is not coming in dropdown list

AdobeID24

16-09-2019

@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 {

  }

}

Replies

Highlighted

berliant

Employee

16-09-2019

Try to use something like:

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

Highlighted

AdobeID24

16-09-2019

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

@Service(WorkflowSamplefilter.class)

any other work around?

Highlighted

AdobeID24

16-09-2019

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

Highlighted

ArpitVarshney

MVP

16-09-2019

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 {

  }

}

Highlighted

ArpitVarshney

MVP

16-09-2019

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

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