cancel
Showing results for 
Search instead for 
Did you mean: 

Call a url through an action

rd
Champ in-the-making
Champ in-the-making
Hi there

I am new to Alfresco and trying to understand a lot of the functionality.
As a part of my project's requirement I need to test Alfresco with an external workflow application like WSO2 Business process server.
To try a simple test, I want to trigger a Business Process defined in WSO2, exposed via an HTTP url on any Node related event in Alfresco, like file uploaded into "X" folder. Once the workflow is triggered in WSO2 some user tasks will happen there like approval/rejection, after which WSO2 will make a HTTP call to Alfresco to move the file to folder "Y".

From whatever I have understood till now about Alfresco, I think -

1) The call to WSO2 service (HTTP url) to trigger the workflow can be done through an action. Is this correct? How do I do this? How do I configure the custom action?

2) I can write a webscript to move the file from folder "X" to "Y". This webscript url can be called by the WSO2 user task. Is there any webscript readily available in Alfresco to move file from 1 folder to another? If not can you give me some pointers to how I should write this?

I am using Alfresco 4.2 CE.

Thanks in advance.
3 REPLIES 3

mrogers
Star Contributor
Star Contributor
You may also want to take a look at the inbuilt workflow capabilities of alfresco since to some extent you are reinventing what's already there.    Although its based upon BPMN rather than BPEL.

However documents entering a folder are normally handled via either scheduled jobs or rules.  

You can bundle up your code to call wso2 in an action or just deploy a library to contain your custom code that gets called.   Likewise wso2 can call any of alfresco's remote interfaces or write your own web scripts if there's something that's not already covered.

rd
Champ in-the-making
Champ in-the-making
Thank your for the reply. Actually WSO2 is mandated by the client, as they already use it in their organisation.
Calling WSO2 process through an action is exactly how I am planning to do it. But I am not sure which Action class to extend. Should I extend org.alfresco.repo.action.executer.ActionExecuterAbstractBase? Or is there some other action better suited for this?

Also can an action execute automatically if I bundle it up as a jar with a Spring bean definition? Or do I need to configure a rule to call the Action? How do I configure the rule in this case?

Thanks again.

romschn
Star Collaborator
Star Collaborator
If you are planning to invoke a http url from alfresco action then in that case you should create a custom action. Refer http://ecmarchitect.com/alfresco-developer-series-tutorials/actions/tutorial/tutorial.html, to get understanding of how to create custom actions in alfrecso.
You can setup a business rule to execute the action.