cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow Issues

nh
Champ in-the-making
Champ in-the-making
Hi,

I have a space in which all the users have Consumer role. I have a content rule applied to the space with a workflow. I follwed the process as it is in the Alfresco book.

I login in as usr and upload document in a folder called Draft and assign permissions to other users on that content. After this I try to submit this document for Review [ if it wrkd the document wud move to Pending space] , the system throws an error as below.

Failed to approve the document due to system error: Access Denied. You do not have the appropriate permissions to perform this operation.

Please assist me with this

Thanks,
21 REPLIES 21

richard_tsai
Champ in-the-making
Champ in-the-making
Hi! NH,
    I also added a comment in bpm:task, too. I want to copy comment from Task to Document when user sign the task. However, I cannot get the comment by javascript in workflow. It always return nothing.


        <transition name="Approve" to="endreview">
           <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                <script>
                    <variable name="wf_approveCount" access="read,write" />
                    <expression>
                        wf_approveCount = wf_approveCount +1;
                     </expression>
bpm_package.children[0].properties["{ext.htc.km}comments"] += bpm_comment;
                   bpm_package.children[0].save();
                </script>
            </action>
        </transition>
‍‍‍‍‍‍‍‍‍‍‍‍‍‍

The task detailed information:
id: jbpm$31
name: wf:htcReviewTask
title: wf:htcReviewTask
description: wf:htcReviewTask
state: COMPLETED
path: [email protected]
transitions: 2
transition: Approve , title: Approve , desc: Approve
transition: Reject , title: Reject , desc: Reject
properties: 17
{http://www.alfresco.org/model/bpm/1.0}comment = COMMNT TEST
{http://www.alfresco.org/model/bpm/1.0}context = workspace://SpacesStore/aaee0ea2-f484-11db-9d54-0146068e95dd
{http://www.alfresco.org/model/bpm/1.0}dueDate = null
{http://www.alfresco.org/model/bpm/1.0}description = MPM Document Flow-Snippy.exe
{http://www.alfresco.org/model/bpm/1.0}pooledActors = []
{http://www.alfresco.org/model/content/1.0}created = 2007-04-27 18:47:22.0
{http://www.alfresco.org/model/bpm/1.0}outcome = Approve
{http://www.alfresco.org/model/bpm/1.0}status = Completed
{http://www.alfresco.org/model/bpm/1.0}completionDate = 2007-04-27 18:47:33.0
{http://www.alfresco.org/model/content/1.0}owner = htcmfgadmin
{http://www.alfresco.org/model/bpm/1.0}packageActionGroup =
{http://www.alfresco.org/model/bpm/1.0}priority = 3
{http://www.alfresco.org/model/bpm/1.0}startDate = null
{http://www.alfresco.org/model/bpm/1.0}percentComplete = 0
{http://www.alfresco.org/model/bpm/1.0}taskId = 31
{http://www.alfresco.org/model/bpm/1.0}package = workspace://SpacesStore/959f9fd8-f4ac-11db-af3a-c301cbde1f95
{http://www.alfresco.org/model/bpm/1.0}packageItemActionGroup = edit_package_item_actions

richard_tsai
Champ in-the-making
Champ in-the-making
Hi!
     I found why it happened. It should be caused by mixing jPDL Beanshell with Alfresco JavaScript.


<transition name="Approve" to="endreview">
           <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                <script>
                    <variable name="wf_approveCount" access="read,write" />
wf_approveCount = wf_approveCount +1;
bpm_package.children[0].properties["{ext.htc.km}comments"] += bpm_comment;
                   bpm_package.children[0].save();
                </script>
            </action>
        </transition>
‍‍‍‍‍‍‍‍‍‍‍‍