cancel
Showing results for 
Search instead for 
Did you mean: 

activiti workflows

ggoutham
Champ in-the-making
Champ in-the-making
Hi all,
I want to know how to create a activiti workflow i have downloaded the activiti 5.11 plugin for eclipse but i am unable to get the idea to work with it and how to deploy the workflow created with extension .bpmnd.
i read the jeff potts workflow tutorial but that is for old versions of activiti and alfresco.

Kindly help me in this regard

Thanks in advance
24 REPLIES 24

ggoutham
Champ in-the-making
Champ in-the-making
I am trying to deploy the workflow like this in the workflow console
i just copied my workflow to the location below and i have not configured to the share or explorer UI,
deploy activiti alfresco/WEB-INF/classes/alfresco/extension/workflows/eligo_review_approve.bpmn20.xml it is showing error like this
org.alfresco.error.AlfrescoRuntimeException: 01120027 Exception in Transaction.

This is my .bpmn20.xml

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlnsSmiley Surprisedmgdc="http://www.omg.org/spec/DD/20100524/DC" xmlnsSmiley Surprisedmgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
  <process id="eligo_review_approve" name="eligo_review_approve" isExecutable="true">
    <extensionElements>
      <activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
        <activiti:field name="script">
          <activiti:string>execution.setVariable('wf_managementGroup', groups.getGroup('Management').getFullName());</activiti:string>
        </activiti:field>
      </activiti:executionListener>
    </extensionElements>
    <startEvent id="start" name="Start" activiti:formKey="wf:submitReviewTask"></startEvent>
    <userTask id="assignEstimateTask" name="Assign Estimate Task" activiti:assignee="admin" activiti:candidateGroups="${wf_managementGroup}" activiti:formKey="wf:reviewTask">
      <extensionElements>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_workflowDueDate;
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
if (typeof bpm_comment != 'undefined') task.setVariable('bpm_comment', bpm_comment);</activiti:string>
          </activiti:field>
        </activiti:taskListener>
        <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>execution.setVariable('bpm_assignee', task.getVariable('bpm_assignee'));
execution.setVariable('bpm_comment', task.getVariable('bpm_comment'));
execution.setVariable('wf_manager', person);
execution.setVariable('bpm_dueDate', task.dueDate);
execution.setVariable('bpm_priority', task.priority);</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>
    <userTask id="estimateTask" name="Estimate Task" activiti:assignee="venu" activiti:formKey="wf:estimateTask">
      <extensionElements>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_dueDate;
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_priority;
if (typeof bpm_comment != 'undefined') task.setVariable('bpm_comment', bpm_comment);</activiti:string>
          </activiti:field>
        </activiti:taskListener>
        <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>execution.setVariable('bpm_comment', task.getVariable('bpm_comment'));</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>
    <userTask id="reviewEstimate" name="Review Estimate" activiti:assignee="goutham" activiti:formKey="wf:activitiReviewTask">
      <extensionElements>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_workflowDueDate;
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
if (typeof bpm_comment != 'undefined') task.setVariable('bpm_comment', bpm_comment);</activiti:string>
          </activiti:field>
        </activiti:taskListener>
        <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>execution.setVariable('wf_reviewOutcome', task.getVariable('wf_reviewOutcome'));
execution.setVariable('bpm_comment', task.getVariable('bpm_comment'));</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>
    <exclusiveGateway id="reviewDecision" name="Review Decision"></exclusiveGateway>
    <userTask id="estimateApproved" name="Estimate Approved" activiti:assignee="${initiator.exists() ? initiator.properties.userName : 'admin'}" activiti:formKey="wf:estimateApproved">
      <extensionElements>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_workflowDueDate;
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
if (typeof bpm_comment != 'undefined') task.setVariable('bpm_comment', bpm_comment);</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>
    <endEvent id="end" name="End"></endEvent>
    <sequenceFlow id="flow1" sourceRef="start" targetRef="assignEstimateTask"></sequenceFlow>
    <sequenceFlow id="flow3" sourceRef="assignEstimateTask" targetRef="estimateTask"></sequenceFlow>
    <sequenceFlow id="flow4" sourceRef="estimateTask" targetRef="reviewEstimate"></sequenceFlow>
    <sequenceFlow id="flow5" sourceRef="reviewEstimate" targetRef="reviewDecision"></sequenceFlow>
    <sequenceFlow id="flow6" sourceRef="reviewDecision" targetRef="estimateApproved">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${wf_reviewOutcome
            == 'Approve'}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow7" sourceRef="estimateApproved" targetRef="end"></sequenceFlow>
    <sequenceFlow id="flow8" sourceRef="reviewDecision" targetRef="estimateTask"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_eligo_review_approve">
    <bpmndi:BPMNPlane bpmnElement="eligo_review_approve" id="BPMNPlane_eligo_review_approve">
      <bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_start">
        <omgdc:Bounds height="35.0" width="35.0" x="30.0" y="200.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="assignEstimateTask" id="BPMNShape_assignEstimateTask">
        <omgdc:Bounds height="55.0" width="105.0" x="105.0" y="190.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="estimateTask" id="BPMNShape_estimateTask">
        <omgdc:Bounds height="55.0" width="105.0" x="250.0" y="190.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="reviewEstimate" id="BPMNShape_reviewEstimate">
        <omgdc:Bounds height="55.0" width="105.0" x="395.0" y="190.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="reviewDecision" id="BPMNShape_reviewDecision">
        <omgdc:Bounds height="40.0" width="40.0" x="540.0" y="197.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="estimateApproved" id="BPMNShape_estimateApproved">
        <omgdc:Bounds height="55.0" width="105.0" x="620.0" y="137.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_end">
        <omgdc:Bounds height="35.0" width="35.0" x="765.0" y="147.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="65.0" y="217.0"></omgdi:waypoint>
        <omgdi:waypoint x="105.0" y="217.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
        <omgdi:waypoint x="210.0" y="217.0"></omgdi:waypoint>
        <omgdi:waypoint x="250.0" y="217.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
        <omgdi:waypoint x="355.0" y="217.0"></omgdi:waypoint>
        <omgdi:waypoint x="395.0" y="217.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
        <omgdi:waypoint x="500.0" y="217.0"></omgdi:waypoint>
        <omgdi:waypoint x="540.0" y="217.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
        <omgdi:waypoint x="560.0" y="197.0"></omgdi:waypoint>
        <omgdi:waypoint x="560.0" y="164.0"></omgdi:waypoint>
        <omgdi:waypoint x="620.0" y="164.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
        <omgdi:waypoint x="725.0" y="164.0"></omgdi:waypoint>
        <omgdi:waypoint x="765.0" y="164.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
        <omgdi:waypoint x="560.0" y="237.0"></omgdi:waypoint>
        <omgdi:waypoint x="447.0" y="327.0"></omgdi:waypoint>
        <omgdi:waypoint x="302.0" y="245.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

ggoutham
Champ in-the-making
Champ in-the-making
Can anybody provide an example for deploying the activiti workflow, so that i can understand easily.
My examples are not working correct.

Please help me in this regard

Thanks in advance
Goutham

mtw999
Champ in-the-making
Champ in-the-making
Is this your complete bpmn20.xml file? What if you create a simple process with a startEvent, userTask, and endEvent, can you deploy it?

Mike

ggoutham
Champ in-the-making
Champ in-the-making
Hi Mike,
Thanks for your reply. I have not tried with the simple one but this workflow is working fine with enterprise edition.
I will try with a simple one and deploy it on the community editiion

Regards,
Goutham

bikshapathi
Champ in-the-making
Champ in-the-making
HI goutham,

I am facing same issues while implementing the custom work flows so can you please help me regarding this.

can you please share me if you have any documents related.

I would be thank full to you!

Hi Bikshapathi,
Please let me know, what are the issues that you're facing with workflow?

Thanks,
Murali.

Thanks for reply muralidharan,

I am using alfresco Enterprise 30days trail pack(i.e alfresco-4.14).
Now i have designed the custom workflow using activiti designer plugin in My eclipse Indigo & juno.

Actually my problem is when i am deploying my custom workflow it is working fine but i am not getting customised form in my workflow.

whether i don't know my requirement is possible or not.

If Possible can you please share related documents or videos or urls.

Thanks in Advance of sharing.

Sorry for late Reply.

Hi,
Are you able to upload your bpmn file using activiti-admin console ? For learning purpose, activiti-admin console is handy.
http://localhost:8080/alfresco/activiti-admin
Login with Admin account. Click Deployment menu–>Upload new–>Select your YOURWORKFLOW.bpmn20.xml file to upload.

If you're getting any error, please share bpmn20.xml file and error log files.

Refer the below URLs also:

http://forums.alfresco.com/comment/75058#comment-75058
http://wiki.alfresco.com/wiki/Workflow_with_Activiti
http://ecmarchitect.com/archives/2012/02/20/1552
Sample : http://ecmarchitect.com/images/articles/alfresco-workflow/alfresco-workflow-tutorial.zip
http://techblog.zabuchy.net/2012/creation-of-workflow-in-alfresco-using-activiti-step-by-step/

Hi Murali,
Thanks for your reply when i am trying to access the activiti-admin using this http://localhost:8080/alfresco/activiti-admin it is giving a 404 error. I am using community 4.2.c i have tried this bpmn20.xml file in enterprise edition it is working fine
Is activiti-admin works in community editions??
And why my workflow is not working in 4.2.c

Regards,
Goutham

Hi Goutham,
Activiti-admin is one of the Enterprise Edition feature 😞