Abhishek
Abhishek

Reputation: 11

Doubts on Activiti Based Alfresco workflow

I am new to Alfresco. Am working for a project which uses Alfresco as the document repository. There is a requirement to create some approval workflow for the documents. We are still in doubt on using the Activiti in Alfresco for implementation If you guys can help me out with the following questions, it will be very much helpful in making the decision

1) The rules for approval will be changing dynamically. Could the rule engine like drools be integrated with Activiti in alfresco? And if yes , then how?

2) The task created has to be shown in an external application. How feasible it is to query the alfresco database from an external application? Could SQL be used for it, or we need to relay on API's for this.??

3) How could I check the database schema of the Activiti in Alfresco?

4) If the rules file could be used for decision making, could these rules file be changed dynamically from the external application. And if yes, how?

These questions may sound very silly but they are eating my head out. Please help

Thanks, Abhishek

Upvotes: 0

Views: 2220

Answers (4)

marsbard
marsbard

Reputation: 2178

According to the Activiti documentation you can use drools rules on a "Business Rule" task

A Business Rule task is used to synchronously execute one or more rules. Activiti uses Drools Expert, the Drools rule engine to execute business rules. Currently, the .drl files containing the business rules have to be deployed together with the process definition that defines a business rule task to execute those rules. This means that all .drl files that are used in a process have to be packaged in the process BAR file like for example the task forms

Upvotes: 0

marsbard
marsbard

Reputation: 2178

  1. Not sure about embedding drools, but you have two types of code based tasks in Activiti - a script task and a service task. Script tasks are probably easier as they are javascript by default but you can also load other script engines like groovy if you need to. Service tasks are java classes that need to be deployed into the Alfresco classpath to be used.
  2. I would definitely stick to the APIs as was mentioned
  3. Alch3mi5t answered this, but again I would steer clear
  4. I would use a service task for this as you could call out from your java code into another system.

If you use Activiti explorer to add a service task to a diagram, you'll notice a property called 'Service class' which is relevant when the selected type is 'java class'. You would put here the fully qualified class name, e.g. org.example.activiti.CustomLogic This has to implement one of a couple of interfaces, such as ActivityBehavior, ActivityExecution or DelegateExecution. This interface requires you to create an execute() method in which you can put your logic and any external callouts.

To deploy, compile it into a jar (in eclipse, 'Create deployment artefacts') and deploy the jar to Alfresco's classpath, e.g. webapps/alfresco/WEB-INF/lib then restart alfresco

Upvotes: 1

Teqnology
Teqnology

Reputation: 1298

1) Although the bpm is a fork of drools, I don't think Alfresco has native support to that. But still, I'm not quite sure about that. We always used jbpm or activiti.

2) You should use Alfresco workflow API's to achieve what you want. At least is the correct and highly recommended way in developing workflows in Alfresco.

3) You could do that by opening the activit-engine in the Alfresco package. Inside you should find a file named activiti.mysql.create.sql. That could help you somehow. If you follow this link you could also find some interesting commands to debug Alfreco and Activiti tables

4) Define rules file, please. If you're talking about modifying activiti workflow files, no, that is should't be done once deployed. If you're talking about ending tasks or taking actions in workflow, you should use API's for that.

Upvotes: 1

Michał Wróbel
Michał Wróbel

Reputation: 558

If you want to write some applications using Activiti also outside of Alfresco, I think you should go toward using Activiti standalone, and probably integrate it with Alfresco just when you need to upload documents to repository or things like that. Level of Alfresco and Activiti integration is quite deep.

AD 2,3) If you really want to access Activiti tables not using Alfresco API's, yes, it's possible. The tables in database are just the same as mentioned in Activiti documentation (http://www.activiti.org/userguide/#database.tables.explained)

Upvotes: 1

Related Questions