Add new workflow into Alfresco share

AnzeR picture AnzeR · May 11, 2011 · Viewed 12.2k times · Source

I'm new to Alfresco/Activiti.

Our company is using Skelta BPM.NET (in integration with our self developed RMS) and now we would like to take a look into other BPM software.

I last days I found our how to create new workflow using Eclipse and Import them into standalone installation of Activiti.

Now I would like to publish this workflow into Alfresco share. Is there any easy way to do that? I was searching whole day on Google but didn't find anything useful.

And another question about installation: Is it possible to install Activiti with all it's webapps on the same tomcat, that alfresco is running on? That Apache Ant can build only standalone installation. So can this two application be merged?

Thanks for your info, Anze

Answer

Jeff Potts picture Jeff Potts · Jun 28, 2011

If you place your BPMN 2.0 process definition XML somewhere in the Alfresco classpath, you can use Alfresco's workflow console to deploy the definition.

For example, I always place my workflows under WEB-INF/classes/alfresco/extension/workflows/someFolder where someFolder is a unique folder for each process definition I am using.

The workflow console is in http://localhost:8080/alfresco/faces/jsp/admin/workflow-console.jsp. Assuming you are using 3.4.e, which is a preview release showing Activiti integration, you can deploy a process through the workflow console with this command:

    deploy activiti /alfresco/extension/workflows/activiti/activitiHelloWorld.activiti

You can see other helpful workflow console commands by typing help.

Alternatively, as Gagravarr suggests, you can use Spring to deploy your workflow when Alfresco starts up. The Spring config file must have a name ending with "-context.xml". I usually place mine in WEB-INF/classes/alfresco/extension.

    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

    <beans>

  <bean id="someco.workflowBootstrap" parent="workflowDeployer">
    <property name="workflowDefinitions">
      <list>
        <props>
          <prop key="engineId">activiti</prop>
          <prop key="location">alfresco/extension/workflows/activiti/activitiHelloWorld.bpmn20.xml</prop>
          <prop key="mimetype">text/xml</prop>
          <prop key="redeploy">false</prop>         
        </props>
      </list>
    </property>
    <property name="models">
      <list>
        <value>alfresco/extension/model/scWorkflowModel.xml</value>
      </list>
    </property>
    <property name="labels">
      <list>
        <value>alfresco.extension.messages.scWorkflow</value>
      </list>
    </property>
  </bean>
    </beans>

If you'd like working examples of some simple workflows, with the same workflows implemented for both jBPM and Activiti for easy comparison, take a look at this blog post: http://ecmarchitect.com/archives/2011/04/27/1357

Jeff