cancel
Showing results for 
Search instead for 
Did you mean: 

Deployment workflow package into Alfresco 3.4.e

uhel
Champ in-the-making
Champ in-the-making
Hello,

I am new in Alfresco and I need help with Activiti workflow deployment. I have read a lot of documentation about this in wiki and I try some examples.

I want to build (or create some zip or other archive) package from Eclipse alfresco workflow activiti project and deploy it to Alfresco server, which run on other machine as Development Environment. Can you help me with this? - I try this example:
http://ecmarchitect.com/archives/2011/04/27/1357
which works OK for me, but I deploy it from Eclipse, which was installed on the same machine as Alfresco

Can you write me a detailed procedure (steps) to do this?
1. How to create Activiti workflow package in Eclipse for deployment to machine where Alfresco server runs
2. Where the package copy/extract in server (or best practise)
3. How to tell alfresco about the new workflow package exist? (only restart or do I need to use workflow console or what other and how?)

Thank you very much for help!
2 REPLIES 2

uhel
Champ in-the-making
Champ in-the-making
Has somebody any idea for help, please?

uhel
Champ in-the-making
Champ in-the-making
Hello,

I still can not successfully deploy "custom" workflow - at the last time I tried deploy predefined alfresco sample workflow with name: lifecycle (It's files are placed in tomcat\shared\classes\alfresco\extension and all what I did it was rename the workflow files = remove "sample" from names - for example: lifecycle-workflow-context.xml.sample -> lifecycle-workflow-context.xml). It works for me fine, byt when I customized this workflow (I only coped it files and rename + rename workflow id to prevent conflict) it can not start (I found it in list of workflow in Alfresco Share, but any form display) and gives this error in log:

Error from stdout_20110908.log:
14:53:17,259 User:admin WARN  [repo.dictionary.DictionaryDAO] Type not found: {}startevent2
14:53:17,259 User:admin WARN  [repo.dictionary.DictionaryDAO] Type not found: {}startevent3
14:53:42,290 User:admin DEBUG [repo.jscript.ScriptLogger] Generating form for item:
14:53:42,290 User:admin DEBUG [repo.jscript.ScriptLogger]    kind = workflow
14:53:42,290 User:admin DEBUG [repo.jscript.ScriptLogger]    id = activiti$m_activitiLifecycleApproval
14:53:42,306 User:admin DEBUG [repo.jscript.ScriptLogger] org.alfresco.repo.forms.FormNotFoundException:

08080007 A form could not be found for item: [workflow]activiti$m_activitiLifecycleApproval
14:53:42,306 User:admin DEBUG [repo.jscript.ScriptLogger] Returning 404 status code
14:53:42,353 http-8080-32 ERROR [scripts.forms.FormUIGet] org.alfresco.repo.forms.FormNotFoundException:

08080007 A form could not be found for item: [workflow]activiti$m_activitiLifecycleApproval


The list of files, which I rename/modified:
    m_lifecycle-workflow-context.xml
    m_lifecycleModel.xml
    m_process-messages.properties
    m_lifecycle-process.bpmn20.xml
<?xml version="1.0" encoding="UTF-8" ?>

<definitions id="m_lifecycle-definitions"
             typeLanguage="http://www.w3.org/2001/XMLSchema"
             expressionLanguage="http://www.w3.org/1999/XPath"
             targetNamespace="http://activiti.org/bpmn20"
             xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:activiti="http://activiti.org/bpmn">

    <process id="m_activitiLifecycleApproval" name="M Activiti Lifecycle Process">
       <extensionElements>
           <!– When process is deleted/cancelled, status should be set to draft –>
             <activiti:executionListener event="end" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
              <activiti:field name="script">
                     <activiti:string>
                        if(cancelled || deleted) {
                           for (var i = 0; i &lt; bpm_package.children.length; i++)
                          {
                             if (!bpm_package.children[i].hasAspect("wfl:status"))
                             {
                                  bpm_package.children[i].properties["wfl:status"] = "Draft";
                                   bpm_package.children[i].save();
                             }
                          }
                        }
                     </activiti:string>
                  </activiti:field>
            </activiti:executionListener>
         </extensionElements>
        <startEvent id="start"
            activiti:formKey="wf:submitReviewTask" />

        <sequenceFlow id='flow1'
            sourceRef='start'
            targetRef='reviewTask'>
             <extensionElements>
                <activiti:executionListener event="take" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
                 <activiti:field name="script">
                        <activiti:string>
                           for (var i = 0; i &lt; bpm_package.children.length; i++)
                          {
                             if (!bpm_package.children[i].hasAspect("wfl:status"))
                             {
                                bpm_package.children[i].addAspect("wfl:status");
                             }
                          }
                        </activiti:string>
                     </activiti:field>
               </activiti:executionListener>
            </extensionElements>
        </sequenceFlow>

        <userTask id="reviewTask" name="Review Task"
            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.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
                        if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
                       
                         for (var i = 0; i &lt; bpm_package.children.length; i++)
                        {
                           if (bpm_package.children[0].hasAspect("wfl:status")) {
                              bpm_package.children[i].properties["wfl:status"] = "In Review";
                              bpm_package.children[i].save();
                           }
                        }
                     </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'));
                     </activiti:string>
                  </activiti:field>
               </activiti:taskListener>
           </extensionElements>
            <humanPerformer>
                <resourceAssignmentExpression>
                    <formalExpression>${bpm_assignee.properties.userName}</formalExpression>
                </resourceAssignmentExpression>
            </humanPerformer>
        </userTask>

        <sequenceFlow id='flow2'
        sourceRef='reviewTask'
            targetRef='reviewDecision' />

        <exclusiveGateway  id="reviewDecision" name="Review Decision" />

        <sequenceFlow id='flow3' sourceRef='reviewDecision' targetRef='approved' >
            <conditionExpression xsi:type="tFormalExpression">${wf_reviewOutcome == 'Approve'}</conditionExpression>
        </sequenceFlow>

        <sequenceFlow id='flow4'
        sourceRef='reviewDecision'
            targetRef='rejected' />

       <userTask id="approved" name="Document Approved"
            activiti:formKey="wf:approvedTask" >
            <documentation>
                The document was reviewed and approved.
            </documentation>
            <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.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
                        if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
                       
                        for (var i = 0; i &lt; bpm_package.children.length; i++)
                       {
                          if (bpm_package.children[0].hasAspect("wfl:status")) {
                             bpm_package.children[i].properties["wfl:status"] = "Approved";
                             bpm_package.children[i].save();
                          }
                       }
                     </activiti:string>
                  </activiti:field>
               </activiti:taskListener>
            </extensionElements>
            <humanPerformer>
                <resourceAssignmentExpression>
                    <formalExpression>${initiator.properties.userName}</formalExpression>
                </resourceAssignmentExpression>
            </humanPerformer>
        </userTask>
       
        <userTask id="rejected" name="Document Rejected"
            activiti:formKey="wf:rejectedTask" >
            <documentation>
                The document was reviewed and rejected.
            </documentation>
            <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.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
                        if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
                       
                        for (var i = 0; i &lt; bpm_package.children.length; i++)
                       {
                          if (bpm_package.children[0].hasAspect("wfl:status"))
                          {
                             bpm_package.children[i].properties["wfl:status"] = "Draft";
                             bpm_package.children[i].save();
                          }
                       }
                     </activiti:string>
                  </activiti:field>
               </activiti:taskListener>
            </extensionElements>
            <humanPerformer>
                <resourceAssignmentExpression>
                    <formalExpression>${initiator.properties.userName}</formalExpression>
                </resourceAssignmentExpression>
            </humanPerformer>
        </userTask>

        <sequenceFlow id='flow5' sourceRef='approved'
            targetRef='end' />

        <sequenceFlow id='flow6' sourceRef='rejected'
            targetRef='end' />

        <endEvent id="end" />

    </process>

</definitions>

I think that I somethig missed to do. Can you help me what?