AdobeID24
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"
)
})
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 {
}
}
ArpitVarshney
MVP
ArpitVarshney
MVP
16-09-2019
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
berliant
Employee
berliant
Employee
16-09-2019
Try to use something like:
@Component(service=WorkflowProcess.class, property = {"process.label=My Workflow"})
AdobeID24
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?
AdobeID24
AdobeID24
16-09-2019
still I am using SCR annotations .....and working in AEM 6.0
AdobeID24
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
ArpitVarshney
MVP
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 {
}
}
AdobeID24
AdobeID24
16-09-2019
Thanks Arpit. its worked ..........but still wondering wat was wrong ?
ArpitVarshney
MVP
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