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

gavinc
Champ in-the-making
Champ in-the-making
Yes, that is one way of removing the workflow i.e. don't load it in the first place. I presumed you were in a position where you couldn't reset your database, in which case undeploying it is the only way to remove it from the UI.

According to http://wiki.alfresco.com/wiki/JavaScript_API#Permission_and_Security_API the code you have should work. Have you tried the other alternative of

document.setPermission("Delete")‍

which should apply the permission to all users?

Yes, you should be able to copy/move nodes in JavaScript: http://wiki.alfresco.com/wiki/JavaScript_API#Modifying_and_Creating_API

nh
Champ in-the-making
Champ in-the-making
Gavin,Thanks for the reply.

I apologise, but i could not understand your suggestion.

are u refering about redeploying the workflow everytime i make such changes? if yes, then i have enabled the "redeploy" option to true.

Can u pls explain this a bit more?

Thanks in Advance,

gavinc
Champ in-the-making
Champ in-the-making
No, i was referring to the AdHoc workflow that you wanted removed from the system.

I was just saying that if you had already bootstrapped your system and you were not in a position to re-create your database then you could undeploy the adhoc workflow via the workflow console.

But as you have commented out the code in bootstrap.xml I'm guessing you that deleted your database and started again?

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

We have implemented the Review & Approve workflow, and we have some isssues regarding the workflow.

Eg: a workflow is initiated on a content and 2 other resources are added to this same sent to the reviewer for review. after the review when the revr approves/rejects a mail needs to be triggered to the workflow initiator, and the content owners separately i,e 3 contents and three different mails to the owners.

We have tried to send mails to the different owners separately and it works, but we do not have the content details separetely.
var i;
for (i in bpm_package.children)
{
var ownerGuy = bpm_package.children[x].properties.creator;
var ownerMail = people.getPerson(ownerGuy).properties["cm:email"];
var mail = actions.create("mail");
mail.parameters.to = ownerMail;
mail.parameters.subject = "Document Approved: " + bpm_workflowDescription;
mail.parameters.from = bpm_assignee.properties["cm:email"];
mail.parameters.text = "Hiiiiiiiiiiii,"+ people.getPerson(ownerGuy).properties["cm:firstName"] +" Your content has been approved by the reviewer"+bpm_assignee.properties["cm:firstName"]+""+bpm_assignee.properties["cm:lastName"]+"  with the following review comments:                 mail.execute(bpm_package);
}

In the above code we are able to get the creator's info. How can we fetch the content info respectively?
the content name, node link

Please Help

Thanks,
Hari

gavinc
Champ in-the-making
Champ in-the-making
Does "var contentName = bpm_package.children[x].properties.name; " not work?

nh
Champ in-the-making
Champ in-the-making
Gavin,

it wrks. i was able to implement it after some trial and error.

thanks a lot for the reply

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

I have two issues regarding the workflow  and content addition.

Workflow:
During the review of the content, we need to make a few fields mandatory and validate. Can someone please sugges how to go about it?

Content upload or creation:
While uploading a content, the default type of the content wud be the extension of the content[eg MS Excel for .xls content and so on]. After the upload one could easliy modfigy the content type, which has some impact during the content search.

Is there a way this content type drop down list could be disabled as and when required?

Please help
NH

gavinc
Champ in-the-making
Champ in-the-making
The fields used in a workflow are defined using a model behind the scenes (called bpmModel.xml and workflowModel.xml off the top of my head), so to make properties mandatory and have validation add the <mandatory> element and constraints to the property definition.

Of course if you wanting to change the out of the box definition to upgrade proof you'll need to define your own model and extend the default Alfresco one.

The mimetype field is shown as the result of the following in the config file web-client-config.xml:

<show-property name="mimetype" display-label-id="content_type" component-generator="MimeTypeSelectorGenerator" />‍

To remove the drop down you could override the relevant config to hide the property. But this would be global so i'm not sure if it would satisfy your "as and when" requirement.

Hope this helps.

nh
Champ in-the-making
Champ in-the-making
Gavin,
Thanks a lot for the hint.The mime type definition[drop down box] works.

However, the other issue of making a field mandatory has some hiccups.
I was able to make the required field/s as mandatory, but it had a negetive impact.

We have added a new field "Comments" in the workflow screen by modifying the bpmmodel and the other files. This works fine in most of the cases, but as this field is added in the bpm under the all tasks list, the mandatory feature stops the submission of the content when actually not required.

Is there a way we could configure this field so as , its mandatory only when reqired?

  <!–                                 –>
        <!–  Base definition for all Tasks  –>
        <!–                                 –>

        <type name="bpm:task">
            <parent>cm:content</parent>

            <properties>

                <!–             –>
                <!–  Assignment –>
                <!–             –>
                <!–  Note: Implemented via cmSmiley Surprisedwnable aspect –>

                <!–                  –>
                <!–  Task Identifier –>
                <!–                  –>
                <property name="bpm:taskId">
                    <type>d:long</type>
                    <protected>true</protected>
                    <mandatory>true</mandatory>
                </property>

                <!–  Task Description –>
                <property name="bpm:description">
                    <type>d:text</type>
                </property>

            <!– Task Comments –>
              <property name="bpm:comments">
                    <type>d:text</type>
               <mandatory>false</mandatory>
                </property>



Please help.
NH

gavinc
Champ in-the-making
Champ in-the-making
Unfortunately not, if a property is defined as mandatory it's always treated as such.

What you could do is create a custom JSP for the manage task dialog for the task type in which you need the comments field to be filled in i.e. mandatory. In the custom dialog add some JavaScript to check for comments being present.