cancel
Showing results for 
Search instead for 
Did you mean: 

Add Publisher in workflow wizard

rajshree11
Champ in-the-making
Champ in-the-making
I have created an advanced workflow in which a document after the reviewer stage shud go to publisher for publish.
But my code doesn't renders to publisher.I have to login as reviewer to publish task……….  Smiley Sad

My requirement is that, publisher should publish the task………..but I am not able to assign the task to publisher

I have done changes to lifecycle_processdefination.xml
help needed!!!!!!!! :x
5 REPLIES 5

kevindorr
Champ in-the-making
Champ in-the-making
Rajshree -

Could you please post the following so that I can can help you:

1) Your Alfresco version and configuration information (os, database, etc.)
2) Your workflow definition XML file
3) Your user and group configuration information

Thanks!

Kevin Dorr
Alfresco

rajshree11
Champ in-the-making
Champ in-the-making
Hi Kevin,


Thanks……


1.I am using alfresco 3.4d community version , os: windows XP , Database: mysql
2. I have done changes to lifecycle_processdefinition.xml file at C:\Alfresco\tomcat\shared\classes\alfresco\extension
3. And did changes to workflowModel.xml at C:\Alfresco\tomcat\shared\classes\alfresco\extension
4. I have written rule in web client i.e for adding aspects
5. I have added users to my space and have not done any group configuration.
6. lifecycle_processdefinition.xml : <?xml version="1.0" encoding="UTF-8"?>

<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wfl:lifecycleapproval">

    <swimlane name="initiator" />

    <start-state name="start">
        <task name="wf:submitReviewTask" swimlane="initiator" />

        <event type="node-leave">
            <!– Call script once the workflow package exists i.e. on node-leave –>
            <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                <!– Apply the Workflow Lifecycle Aspect (wfl:status) if not set already. Note: The default wfl:status property is draft –>
                <script>
                    for (var i = 0; i &lt; bpm_package.children.length; i++)
                    {
                       if (!bpm_package.children.hasAspect("wfl:status"))
                       {
                          bpm_package.children.addAspect("wfl:status");
                       }
                    }
                </script>
            </action>
        </event>

        <transition name="" to="review" />
    </start-state>

    <swimlane name="reviewer">
       <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
          <actor>#{bpm_assignee}</actor>
       </assignment>
    </swimlane>

    <task-node name="review">
        <event type="node-enter">
            <!– Update the status to In Review when we enter this task –>
            <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                <script>
                    for (var i = 0; i &lt; bpm_package.children.length; i++)
                    {
                       bpm_package.children.properties["wfl:status"] = "In Review";
                       bpm_package.children.save();
                    }
                </script>
            </action>
        </event>

        <task name="wf:reviewTask" swimlane="reviewer">
            <event type="task-create">
                <script>
                    if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
                    if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
                </script>
            </event>
        </task>
       
        <transition name="review" to="publish" />
        <transition name="reject" to="rejected" />
    </task-node>

    <task-node name="rejected">
        <event type="node-enter">
            <!– Update the status to Draft when we enter this task –>
            <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                <script>
                    for (var i = 0; i &lt; bpm_package.children.length; i++)
                    {
                       bpm_package.children.properties["wfl:status"] = "Draft";
                       bpm_package.children.save();
                    }
                </script>
            </action>
        </event>

        <task name="wf:rejectedTask" swimlane="initiator" />
        <transition name="" to="end" />
    </task-node>

    <task-node name="approved">
        <event type="node-enter">
            <!– Update the status to Approved when we enter this task –>
            <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                <script>
                    for (var i = 0; i &lt; bpm_package.children.length; i++)
                    {
                       bpm_package.children.properties["wfl:status"] = "Approved";
                       bpm_package.children.save();
                    }
                </script>
            </action>
        </event>

  <swimlane name="publisher">
       <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
          <actor>#{publisher}</actor>
       </assignment>
    </swimlane>

        <task name="wfSmiley TongueublishedTask" swimlane="publisher" />
        <transition name="approved" to="publish" />
        <transition name="publish" to="end" />
    </task-node>


<task-node name="publish">
        <event type="node-enter">
            <!– Update the status to published when we enter this task –>
            <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                <script>
                    for (var i = 0; i &lt; bpm_package.children.length; i++)
                    {
                       bpm_package.children.properties["wfl:status"] = "published";
                       bpm_package.children.save();
                    }
                </script>
            </action>
        </event>

    <end-state name="end" />

    <event type="process-end">
        <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
                if (cancelled)
                {
                    for (var i = 0; i &lt; bpm_package.children.length; i++)
                    {
                       if (bpm_package.children[0].hasAspect("wfl:status"))
                       {
                          bpm_package.children.properties["wfl:status"] = "Draft";
                          bpm_package.children.save();
                       }
                    }
                    if (logger.isLoggingEnabled()) logger.log("Workflow cancelled, status reset to Draft");
                }
                else               
                {
                    if (logger.isLoggingEnabled()) logger.log("Workflow completed");
                }
            </script>
        </action>
    </event>

</process-definition>


7. workflowModel.xml : <?xml version="1.0" encoding="UTF-8"?>

<model name="wf:workflowmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <imports>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
      <import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm"/>
   </imports>

   <namespaces>
      <namespace uri="http://www.alfresco.org/model/workflow/1.0" prefix="wf"/>
   </namespaces>
     
   <types>

      <!–                               –>
      <!–  Basic Review & Approve Tasks –>              
      <!–                               –>
     
      <type name="wf:submitReviewTask">
         <parent>bpm:startTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>

      <type name="wf:submitConcurrentReviewTask">
         <parent>bpm:startTask</parent>
         <properties>
            <property name="wf:requiredApprovePercent">
                <type>d:int</type>
                <mandatory>true</mandatory>
                <default>50</default>
                <constraints>
                    <constraint type="MINMAX">
                        <parameter name="minValue"><value>1</value></parameter>
                        <parameter name="maxValue"><value>100</value></parameter>
                    </constraint>
                </constraints>
            </property>
         </properties>
      </type>

      <!–  Submit review to multiple people (explicit list) –>
      <type name="wf:submitParallelReviewTask">
         <parent>wf:submitConcurrentReviewTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignees</aspect>
         </mandatory-aspects>
      </type>

      <!–  Submit review to multiple people (as included in a group) –>
      <type name="wf:submitGroupReviewTask">
         <parent>wf:submitConcurrentReviewTask</parent>
         <mandatory-aspects>
            <aspect>bpm:groupAssignee</aspect>
         </mandatory-aspects>
      </type>

      <type name="wf:reviewTask">
         <parent>bpm:workflowTask</parent>
         <overrides>
            <property name="bpmSmiley TongueackageItemActionGroup">
               <default>edit_package_item_actions</default>
            </property>
         </overrides>
      </type>

      <type name="wf:approvedTask">
         <parent>bpm:workflowTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>

      <type name="wf:rejectedTask">
         <parent>bpm:workflowTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>

<type name="wfSmiley TongueublishedTask">
         <parent>bpm:workflowTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>

      <type name="wf:rejectedParallelTask">
         <parent>bpm:workflowTask</parent>
         <mandatory-aspects>
            <aspect>wfSmiley TonguearallelReviewStats</aspect>
         </mandatory-aspects>
      </type>

      <type name="wf:approvedParallelTask">
         <parent>bpm:workflowTask</parent>
         <mandatory-aspects>
            <aspect>wfSmiley TonguearallelReviewStats</aspect>
         </mandatory-aspects>
      </type>


      <!–                               –>
      <!–  Adhoc Tasks –>              
      <!–                               –>
     
      <type name="wf:submitAdhocTask">
         <parent>bpm:startTask</parent>
         <properties>
            <property name="wf:notifyMe">
               <type>d:boolean</type>
               <default>false</default>
            </property>
         </properties>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>

      <type name="wf:adhocTask">
         <parent>bpm:workflowTask</parent>
         <overrides>
            <property name="bpmSmiley TongueackageActionGroup">
               <default>add_package_item_actions</default>
            </property>
            <property name="bpmSmiley TongueackageItemActionGroup">
               <default>edit_package_item_actions</default>
            </property>
         </overrides>
      </type>

      <type name="wf:completedAdhocTask">
         <parent>bpm:workflowTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>
       
      <!– Deprecated workflow task from Alfresco 3.0 –>
      <!– Needs to be defined for patch.InvitationMigration which gets rid of it.  –>
     
      <type name="wf:inviteToSiteTask">
         <parent>bpm:startTask</parent>
         <properties>
            <property name="wf:serverPath">
               <type>d:text</type>
            </property>
            <property name="wf:acceptUrl">
               <type>d:text</type>
            </property>
            <property name="wf:rejectUrl">
               <type>d:text</type>
            </property>
            <property name="wf:inviteTicket">
               <type>d:text</type>
            </property>
            <property name="wf:inviterUserName">
               <type>d:text</type>
            </property>
            <property name="wf:inviteeUserName">
               <type>d:text</type>
            </property>
            <property name="wf:inviteeFirstName">
               <type>d:text</type>
            </property>
            <property name="wf:inviteeLastName">
               <type>d:text</type>
            </property>
            <property name="wf:inviteeGenPassword">
               <type>d:text</type>
            </property>
            <property name="wf:siteShortName">
               <type>d:text</type>
            </property>
            <property name="wf:inviteeSiteRole">
               <type>d:text</type>
            </property>
         </properties>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>

   </types>
  
   <aspects>
  
      <aspect name="wfSmiley TonguearallelReviewStats">
         <properties>
            <property name="wf:reviewerCount">
               <type>d:int</type>
            </property>
            <property name="wf:requiredPercent">
               <type>d:int</type>
            </property>
            <property name="wf:approveCount">
               <type>d:int</type>
            </property>
            <property name="wf:actualPercent">
               <type>d:int</type>
            </property>
         </properties>
      </aspect>
  
   </aspects>

</model>

kevindorr
Champ in-the-making
Champ in-the-making
Rajshree -

From the looks of your process definition, the problem is that you haven't told the workflow engine what "publisher" refers to, so it's defaulting to the bpm_assignee that was previously being used (the reviewer).

One way to do this is to define some groups in Alfresco and add users to the groups. If you add your publisher to an Alfresco group called "publishers", you can get all of the members of the group like this to define a swimlane:

<swimlane name="publishing">
   <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
      <pooledactors>#{people.getGroup('GROUP_publishers')}</pooledactors>
   </assignment>
</swimlane>

Note that any reference to a defined group in Alfresco MUST be preceded by the "GROUP_" prefix by convention! If you define your swimlane like this, and add your publishers to the "publishers" group using the Alfresco group administration interface, I think it will solve your problem.

An excellent jBPM reference with some example code can by found on the blog of the Chief Community Officer, Jeff Potts, here:

http://ecmarchitect.com/archives/2007/11/19/785

Kevin Dorr
Alfresco

mitpatoliya
Star Collaborator
Star Collaborator
If you just change the swimlane for this task
<task name="wfSmiley TongueublishedTask" swimlane="publisher" />
as follow
<task name="wfSmiley TongueublishedTask" swimlane="reviewer" />
you should be fine.

rajshree11
Champ in-the-making
Champ in-the-making
Hi Kevin,

I tried the way u suggested …..but my workflow is following the same previous process
I have created publisher group in alfresco and I have added users to the group ……..but the workflow task is not going to publisher

I want to assign publisher the task for publishing!!!!!!!!!!!!!!!!!!!help, Currently publishing is done by reviewer
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.