cancel
Showing results for 
Search instead for 
Did you mean: 

Orbeon Xform integration with Activiti workflow

shailk
Champ in-the-making
Champ in-the-making
Is there anyway to call Activiti process engine from Orbeon Xforms so that process instance can be created and task flow can start?

I couldnt find any details to start the process instance using Orbeon Rest Api (which dont support JSON).
7 REPLIES 7

b_schnarr
Champ in-the-making
Champ in-the-making
You could do that with a little servlet. On orbeon side, you determine the URL where the form data should be posted to. On this endpoint, you put a little servlet. This servlet parses the Orbeon form data and extracts the process variables. Later on in this servlet, you can use the Activiti APIs to start / update process instances.

shailk
Champ in-the-making
Champ in-the-making
Thanks for your reply. How do you manage transaction since in that case Orbeon Xform engine will be call HTTP servlet and then java code within this servlet will make another HTTP REST call to start the workflow.

b_schnarr
Champ in-the-making
Champ in-the-making
Within your servlet, you could use the Java APIs from Activiti instead of using Activiti REST. Simply create a Maven Web-project and import the Activiti modules. Your servlet could use the same database as your other Activiti instances (like the REST-API or the Explorer). Then, you do not have any transactional problems while starting a process instance with the Activiti Java API.

shailk
Champ in-the-making
Champ in-the-making

Is it Orbeon form which should call Activiti engine to start the workflow or custom application makes a call to Activiti engine  which then calls calls either Orbeon form (if its form capture) or execute the task in process.

I have a requirement where I am using front end as ASP.NET web application and I am not sure how to call Activiti engine process workflow. Could you please help with examples or link?

Thanks

b_schnarr
Champ in-the-making
Champ in-the-making
Are you using the community edition or the commercial edition? Within the commercial edition, you can call REST-Services right from the orbeon form. The problem is, that Activiti cannot process the XML posted by Orbeon. So you need something which parses the XML and passes the variables to Activiti. I would not do that directly in Orbeon.

You could realize it like this:
1. Display an orbeon form which has fields for the initial process values
2. Submit those values to a custom servlet
3. The servlet parses the orbeon xml form data and extracts the typed in values
4. Use the Activiti Java API wihtin your servlet to start a process instance with the values extracted from the orboen xml
5. If the instance was started correctly, send a HTTPStatusCode 200 back to orbeon.
6. Close the orbeon form.

You should only have minimal business logic within your orbeon form. All other thinks (parsing XML, validate data, start process instances etc.) should be implemented in your own servlet. Otherwise, you have to add your custom logic per form.

In addition, you should think about security. Only users with the correct rights should be able to submit those form data to Activiti. So you also need to authenticate the user in a secure way and validate the user rights.

shailk
Champ in-the-making
Champ in-the-making
Thanks for your reply.

My point here is since I have ASP.NET web application which will make calls to process workflow which should render the orbeon form and then submit of form should initiate next tasks in the process workflow.

How to invoke activiti engine API using ASP.NET C# code?

Thanks

b_schnarr
Champ in-the-making
Champ in-the-making
ok, when you want to invoke the Activiti API from a .NET application, then you have to use the Activiti REST-API. Another approach would be to render the orbeon forms in your .NET application. The processing of the form data could still be done in a java servlet. Because on orbeon side, you have to determine a post-URL. To this URL, orbeon will send the submitted XML. Therefore, in all cases, you need custom logic which processes the orbeon XML. Maybe, it would be easier to to this in a java web servlet. Otherwise, you would need post the orbeon data back to your .NET app (something like a callback).,