Can any one give me a simple exemple of how to use activiti workflow engin with CMIS (even a very small user task with activiti and how to use it in CMIS standard)
P.S :I'm working with alfresco
I'm not exactly sure what you are trying to do. The easiest way to use Activiti and CMIS together is to write a Java Delegate class that leverages Apache Chemistry OpenCMIS to work with Alfresco. You might do this if you want to have an Activiti business process that has one or more tasks that involve creating, accessing, or updating content in Alfresco (or any other CMIS repository).
Writing a Java Delegate class is really easy and using OpenCMIS is pretty easy too, so you should have no trouble putting them together.
Here is a video from Alfresco Summit that talks about Java Delegates:
https://www.youtube.com/watch?v=phju1Lru7kI
Here is a link to the Java Delegate documentation:
https://www.activiti.org/javadocs/index.html
And here is a site that documents a variety of CMIS examples:
https://chemistry.apache.org/docs/cmis-samples/
Related
Is there any guidelines to connect to Documentum via Java code. My whole scenario is to copy files from Documentum to Alfresco 5.2 using Java code (need to copy all metadata too)
As you guessed, CMIS is the best way to do this.
Documentum implements CMIS relatively well, you will be able to extract data and metadata from all documents.
Alfresco implements CMIS greatly, you will be able to create the documents using the data and metadata from Documentum.
Obviously, your Java code will need to have a mapping telling it how to match metadata between the two servers.
I want to build a JavaEE GED application using alfresco and activiti Workflow engine which manages and monitors the mail of an organization (Letter, Fax, mail etc.). Since I am new with alfresco I want to know the best way to communicate with alfresco in my case : the use of CMIS or web scripts (I'm building a third-party application ) .
I can suggest two solutions using Using the REST API or CMIS with a library like Apache Chemistry
Apache Chemistry is very well documented and you can find good pointers on the official website for pretty much any thing you would want to do !
If you want to get a session from your Alfresco Repository for example follow this post : How to retrieve 'repository root' id/children from CMIS repository?
Alternatively, you can find a lot of resources around for interacting with alfresco using REST (either the new REST API, or old restful endpoints). Check the platform integrations portal from the official docs, it would be a very good starting point.
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
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)
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.
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.
I would definitely stick to the APIs as was mentioned
Alch3mi5t answered this, but again I would steer clear
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
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
Could you please let me know, is it possible to integrate CMIS with BPM system? I know Pega BPM system can be integrated with CMIS. But I want to integrate CMIS with Workflows in Documentum or with Alfresco repository. I do not find out any object type related to BMP that CMIS provides.
Kindly advice. Thanks for your help!
There's no API provided by CMIS that directly maps to the realm of workflows: all of the domain model and APIs are meant for document management.
That said, it's not impossible to establish some contracts between the BPM engine and your client application, so that workflow related informations (states, properties, workflow definitions, etc) will be mapped to the CMIS domain level entities, i.e. documents, properties, relationships and policies.
It's definitely not ideal, but as there's no direct workflow API in CMIS that's the only option you get.
I see this question is rather old but an actual answer may still be interesting. I have successfully tested the concept of making a Service Broker for K2 (http://www.k2.com/) that supports CMIS.
K2 allows you building Service Brokers in .Net so this is rather simple. You can later on generate K2 SmartObjects connecting to your broker and use them in both your process and your web forms.
I actually tested this with Alfresco to test CMIS. The Alfresco support was great.
So to answer your question, yes, this is definitely possible with K2 Blackpearl and K2 SmartForms.
We are going to build custom workflow solution to our clients and most of the time we need to integrate it to their existing system predominately using Microsoft technologies e.g. Exchange Server and SharePoint.
Clients are expecting use workflow to computerize tasks from HR processes, product inventory management. They may or may not have their own CRM but some of them may already using Sharepoint for some processes and they are willing to move away if we can offer a more robust, flexible and economical solution.
I found Alfresco and Activiti very promising but not sure which should I adopt. From my research Alfresco is a full blown CRM with Cloud and workflow (using Activiti as engine) whereas Activiti is the engine on its own.
How should I judge when to go for Alfresco and likewise for Activiti?
TIA
Alfresco is, first and foremost, a repository. If you need a place to store files (either end-users storing files or applications storing files) you should consider using Alfresco as your repository for those files.
As you point out, Alfresco has embedded the Activiti workflow engine. This includes an abstracted service layer that wraps the engine so that, for many operations, when working with Java or server-side JavaScript, you don't need to know much about Activiti. (Obviously you do need to know how to define BPMN 2.0 process definitions to create the workflow).
So if you need to store files and you need to route those files in a business process, Alfresco's embedded workflow engine makes it very easy to do that.
If your primary use case is more general than that (ie, you don't always need to route files in a business process) then you may want to consider a standalone workflow engine. Alfresco can still participate in those workflows, of course, but if your primary use case isn't about files, why go to the trouble of setting up and maintaining a document repository?
In the end, there is no hard and fast rule here. The beauty is that both Alfresco and Activiti are open source. You can try them out, dig into the details, and decide for yourself what is the best fit.