how to invoke Rest API from a worflow
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2014 11:16 AM
Hi everyone,
I'm new in Alfresco and I have to develop a custom workflow with Activiti.
One of the requirement of it is a tag-search in Alfresco repository (server side).
Could i use the restful api GET /alfresco/service/api/tags/{store_type}/{store_id}/{tag}/nodes?
How to invoke this API in my activiti service task? I need an example for learning.
I'm new in Alfresco and I have to develop a custom workflow with Activiti.
One of the requirement of it is a tag-search in Alfresco repository (server side).
Could i use the restful api GET /alfresco/service/api/tags/{store_type}/{store_id}/{tag}/nodes?
How to invoke this API in my activiti service task? I need an example for learning.
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2014 11:35 AM
No, you don't need to (although you can) use restful api in Activiti.
Javascript api or java api is just ok.
Javascript api or java api is just ok.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2014 05:29 PM
How can i use java API?
An example please..
An example please..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2014 02:44 AM
1.Write a java servcie class that implement org.activiti.engine.delegate.JavaDelegate
2.In your method ,get alfresco ServcieRegistry bean
3. config your java servcie class in bmpn xml file
public class YourJavaDelegate implements JavaDelegate { public void execute(DelegateExecution execution) throws Exception { // todo }}
2.In your method ,get alfresco ServcieRegistry bean
public void execute(DelegateExecution execution) throws Exception { // todo ProcessEngineConfigurationImpl config = Context.getProcessEngineConfiguration(); ServiceRegistry registry = (ServiceRegistry) config.getBeans().get(ActivitiConstants.SERVICE_REGISTRY_BEAN_KEY); // get node servcie/tagging service from registy // do what you want to do. }
3. config your java servcie class in bmpn xml file
<serviceTask id="javaService" name="Your Java Service Task" activiti:class="com.your.company.YourJavaDelegate" />
