02-10-2017 06:32 AM
Hi
I am new on Alfresco. I am using community version 5.2
In my workflow I have service task with java class. There I get Alfresco service registry
// Get services
Map<Object, Object> registeredBeans = Context.getProcessEngineConfiguration().getBeans();
ServiceRegistry registry = (ServiceRegistry)registeredBeans.get(ActivitiConstants.SERVICE_REGISTRY_BEAN_KEY);
ContentService contentService = registry.getContentService();
I want to use content service to read content of document associated with workflow
// Get Document
ActivitiScriptNode scriptNode = (ActivitiScriptNode) execution.getVariable("docnode");
docref = new NodeRef("workspace://SpacesStore/18fb353f-d525-4dbc-98ec-d91a3faccbe0"); //test with fixed existing file in repo
ContentReader reader = contentService.getReader(docref, ContentModel.PROP_CONTENT);
originalInputStream = reader.getContentInputStream();
filename = scriptNode.getName();
Unfortunately contentService.getReader ends up with excetion
Caused by: net.sf.acegisecurity.providers.ProviderNotFoundException: No authentication provider for net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken
Help me plesase how to get rid of it.
Thank you in advance.
02-10-2017 08:42 AM
You may need to provide additional information about your workflow. Specifically I would be interested to know how the service task is integrated into the execution flow, e.g. if it is an asynchronous service task, triggered by a timer or some other condition that can lead to it being executed without an active user authentication.
02-13-2017 12:12 AM
Hi, thank you for response.
As I wrote service task is java class type
<serviceTask id="servicetask1" name="Send Mail" activiti:class="com.comp.sendMailProcess.task.sendMail"/>
Implementation I described in question above. There is not any other condition.
02-13-2017 08:00 AM
That doesn't help at all - it'd probably be best/easiest for you to just attach the BPMN file...
02-14-2017 12:03 AM
Explore our Alfresco products with the links below. Use labels to filter content by product module.