Expand my Community achievements bar.

Custom Workflow step is not visible in dropdown

Avatar

Level 2

I have created custom workflow process step but  I dont see that custom workflow step in dropdown in workflow model page.

 

my workflow class is as follows

 

@Component(
immediate = true,
service = WorkflowProcess.class,
property = {
"process.label=org: Reduce Image Resolution"
}
)
public class ReduceImageResolutionProcess implements WorkflowProcess {

 

I have similar another workflow step which is visible in dropdown. what could be the problem?

6 Replies

Avatar

Level 8

Hi @pawanpatilrocks , check your import statements whether they are from 

com.adobe.granite.workflow

or not. 

Avatar

Level 2

yes they are

 

import com.adobe.granite.workflow.WorkflowException;
import com.adobe.granite.workflow.WorkflowSession;
import com.adobe.granite.workflow.exec.WorkItem;
import com.adobe.granite.workflow.exec.WorkflowProcess;
import com.adobe.granite.workflow.metadata.MetaDataMap;

Avatar

Level 2

import com.adobe.granite.workflow.WorkflowException;
import com.adobe.granite.workflow.WorkflowSession;
import com.adobe.granite.workflow.exec.WorkItem;
import com.adobe.granite.workflow.exec.WorkflowProcess;
import com.adobe.granite.workflow.metadata.MetaDataMap;
import com.day.cq.dam.api.Asset;
import com.day.cq.dam.api.Rendition;
import com.day.image.Layer;
import com.starbucks.core.exception.AEMCustomException;
import com.starbucks.core.services.CropResizeImageService;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.io.InputStream;

@component(
immediate = true,
service = WorkflowProcess.class,
property = {
"process.label=org: Reduce Image Resolution"
}
)
public class ReduceImageResolutionProcess implements WorkflowProcess {

private static final Logger logger = LoggerFactory.getLogger(ReduceImageResolutionProcess.class);

@reference
private CropResizeImageService criService;


@Override
public void execute(WorkItem item, WorkflowSession session, MetaDataMap metaDataMap) throws WorkflowException {
try {
// My custom logic

} catch (IOException e) {
throw new RuntimeException(e);
} catch (AEMCustomException e) {
throw new RuntimeException(e);
}
}

 


}

Avatar

Level 8

Hi @pawanpatilrocks , All the things are in place, please check whether your workflow process class is part of your core bundle or not. If not try to rebuild your code and check.

Avatar

Community Advisor

@pawanpatilrocks 

 

Step-1: Please assure that your service is active.

Go to the bundle in OSGi console, and validate the status of your service.

 

Step-2: If its anything other than Active, please check if there is any missing dependency.

 

Step-3: If the service is Active, but the workflow step is still not visible, please try renaming the file and check. Sometime OSGi gives such issue. Restart instance and see if it helps as well.

 


Aanchal Sikka