Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Custom Workflow Step Not Showing up in Process List Dropdown

Avatar

Level 2

Hi,

I have written an OSGI service that implements com.adobe.granite.workflow.exec.WorkflowProcess.  The bundle deploys and is in "active" state with no errors.  When trying to create a "process step" within OSGI workflow editor, my service does not show up in the process list (see attached screenshot).  The annotations I am using in my service class are pasted below, along with relevant errors from the error log.  What am I doing wrong?

@Component
@Service
@Properties({
@Property(name = Constants.SERVICE_DESCRIPTION, value = "Alfresco CMIS Connector"),
    @Property(name = Constants.SERVICE_VENDOR, value = "Adobe"),
    @Property(name = "process.label", value = "Store PDF into Alfresco repository") 
})

ERROR LOG SNIPPET

18.01.2017 14:05:39.685 *INFO* [0:0:0:0:0:0:0:1 [1484769939594] POST /etc/workflow/models/drilling-permit-submit/jcr:content.generate.json HTTP/1.1] com.adobe.granite.workflow.core.WorkflowSessionImpl Workflow model deployed: /etc/workflow/models/drilling-permit-submit/jcr:content/model(Version: 1.1)
18.01.2017 14:05:46.302 *INFO* [0:0:0:0:0:0:0:1 [1484769946299] GET /libs/wcm/core/content/components.1484763158416.json HTTP/1.1] com.day.cq.wcm.core.impl.components.ComponentServlet provided components.
18.01.2017 14:06:53.632 *ERROR* [0:0:0:0:0:0:0:1 [1484770013626] GET /libs/cq/workflow/content/console/process.list.json HTTP/1.1] com.adobe.granite.workflow.console.servlet.ProcessListServlet trouble resolving jcr:title property form script's jcr:content node. Fallback to script path
18.01.2017 14:06:53.632 *ERROR* [0:0:0:0:0:0:0:1 [1484770013626] GET /libs/cq/workflow/content/console/process.list.json HTTP/1.1] com.adobe.granite.workflow.console.servlet.ProcessListServlet trouble resolving jcr:title property form script's jcr:content node. Fallback to script path
18.01.2017 14:06:53.633 *ERROR* [0:0:0:0:0:0:0:1 [1484770013626] GET /libs/cq/workflow/content/console/process.list.json HTTP/1.1] com.adobe.granite.workflow.console.servlet.ProcessListServlet trouble resolving jcr:title property form script's jcr:content node. Fallback to script path
18.01.2017 14:06:53.633 *ERROR* [0:0:0:0:0:0:0:1 [1484770013626] GET /libs/cq/workflow/content/console/process.list.json HTTP/1.1] com.adobe.granite.workflow.console.servlet.ProcessListServlet trouble resolving jcr:title property form script's jcr:content node. Fallback to script path
18.01.2017 14:06:53.633 *ERROR* [0:0:0:0:0:0:0:1 [1484770013626] GET /libs/cq/workflow/content/console/process.list.json HTTP/1.1] com.adobe.granite.workflow.console.servlet.ProcessListServlet trouble resolving jcr:title property form script's jcr:content node. Fallback to script path
18.01.2017 14:06:53.633 *ERROR* [0:0:0:0:0:0:0:1 [1484770013626] GET /libs/cq/workflow/content/console/process.list.json HTTP/1.1] com.adobe.granite.workflow.console.servlet.ProcessListServlet trouble resolving jcr:title property form script's jcr:content node. Fallback to script path
18.01.2017 14:06:53.672 *ERROR* [0:0:0:0:0:0:0:1 [1484770013666] GET /libs/cq/workflow/content/console/process.list.json HTTP/1.1] com.adobe.granite.workflow.console.servlet.ProcessListServlet trouble resolving jcr:title property form script's jcr:content node. Fallback to script path
18.01.2017 14:06:53.672 *ERROR* [0:0:0:0:0:0:0:1 [1484770013666] GET /libs/cq/workflow/content/console/process.list.json HTTP/1.1] com.adobe.granite.workflow.console.servlet.ProcessListServlet trouble resolving jcr:title property form script's jcr:content node. Fallback to script path
18.01.2017 14:06:53.673 *ERROR* [0:0:0:0:0:0:0:1 [1484770013666] GET /libs/cq/workflow/content/console/process.list.json HTTP/1.1] com.adobe.granite.workflow.console.servlet.ProcessListServlet trouble resolving jcr:title property form script's jcr:content node. Fallback to script path
18.01.2017 14:06:53.673 *ERROR* [0:0:0:0:0:0:0:1 [1484770013666] GET /libs/cq/workflow/content/console/process.list.json HTTP/1.1] com.adobe.granite.workflow.console.servlet.ProcessListServlet trouble resolving jcr:title property form script's jcr:content node. Fallback to script path
18.01.2017 14:06:53.673 *ERROR* [0:0:0:0:0:0:0:1 [1484770013666] GET /libs/cq/workflow/content/console/process.list.json HTTP/1.1] com.adobe.granite.workflow.console.servlet.ProcessListServlet trouble resolving jcr:title property form script's jcr:content node. Fallback to script path
18.01.2017 14:06:53.673 *ERROR* [0:0:0:0:0:0:0:1 [1484770013666] GET /libs/cq/workflow/content/console/process.list.json HTTP/1.1] com.adobe.granite.workflow.console.servlet.ProcessListServlet trouble resolving jcr:title property form script's jcr:content node. Fallback to script path
18.01.2017 14:07:23.005 *INFO* [sling-default-37-com.adobe.granite.oauth.server.impl.AccessTokenCleanupTask.1069] com.adobe.granite.oauth.server.impl.AccessTokenCleanupTask AccessTokenCleanupTask: Removed 0 token(s) in 1ms (0 token(s) still active)

1 Accepted Solution

Avatar

Correct answer by
Level 2

I figured out the issue.  Problem was that the workflow dependency defined in my maven project file did declare a scope, i.e. it used the default maven 'compile' scope.  By adding 'provided' scope, as shown below, my service now shows up in process list of "process step".

        <dependency>
            <groupId>com.adobe.granite</groupId>
            <artifactId>com.adobe.granite.workflow.api</artifactId>
            <version>1.0.10</version>
            <scope>provided</scope>
        </dependency>

View solution in original post

6 Replies

Avatar

Level 2

Try this

 

@Component
@Service
public class AlfrescoConnector implements WorkflowProcess {
    @Property(value = "Alfresco CMIS Connector.")
    static final String DESCRIPTION = Constants.SERVICE_DESCRIPTION;
    @Property(value = "Adobe")
    static final String VENDOR = Constants.SERVICE_VENDOR;
    @Property(value = "Store PDF into Alfresco repository")
    static final String LABEL="process.label";
    
    @Override
    public void execute(WorkItem workItem, WorkflowSession workflowSession, MetaDataMap metaDataMap) throws WorkflowException {
    
        ......YOUR LOGIC HERE......
        }
    }

Avatar

Level 2

Thanks.  I actually followed that tutorial.

Avatar

Level 2

Tried the suggested alternative form of property annotations and still not showing up in process list.  Has anyone seen that specific error?  I am logged in as admin, so can't be a permissions problem.

Avatar

Level 10

When you followed the article - did you see the action in the drop-down? 

Avatar

Correct answer by
Level 2

I figured out the issue.  Problem was that the workflow dependency defined in my maven project file did declare a scope, i.e. it used the default maven 'compile' scope.  By adding 'provided' scope, as shown below, my service now shows up in process list of "process step".

        <dependency>
            <groupId>com.adobe.granite</groupId>
            <artifactId>com.adobe.granite.workflow.api</artifactId>
            <version>1.0.10</version>
            <scope>provided</scope>
        </dependency>