cancel
Showing results for 
Search instead for 
Did you mean: 

execute rule after parallel review

nibot
Champ in-the-making
Champ in-the-making
Hi,

I am currently writing my bachelor thesis on alfresco (working with alfresco 4.0.d) and I have to get some things working.
Now I ran into a problem regarding rules and advanced workflows.

My professor demands an internal publishing function (moving a document from one site to another after a successful parallel review and approval). Everything should be manageable for the user from the share page.
I tried to design a simple rule on the directory checking the values of bpmSmiley Surprisedutcome, bpmSmiley TongueercentComplete, bpm:status, wf:actualPercent and even wf:reviewOutcome, that should get activated when the document gets approved.

How could I implement this function?

Needles to say I do not know my way around in alfresco that well.
My second problem is defining a scheduled revision of published documents after one year. Currently I do not have any questions on this topic, but I know this function would be included in the RM-Module of alfresco which is not jet released for 4.0.d.

Thanks in advance,
nibot
1 REPLY 1

jpotts
World-Class Innovator
World-Class Innovator
It was good to think of rules–those are frequently used to automate operations on documents. The problem is that rules don't have access to BPM variables like bpm_outcome and so on.

So you have two options:

1. If you want to use a rule, you need a value to trigger the rule on. That value needs to be set at the end of the successful workflow. You can add some JavaScript to your workflow that will set a property. Maybe it is a custom property or maybe it is an out-of-the-box property, it doesn't really matter. Let's say you use cm:author (bad choice, but just an example). Assuming you will only ever have one document in your workflow package, your workflow can set cm:author like this:

bpm_package.children[0].properties['cm:author'] = "MOVE ME";

Then, your folder rule can look for documents where the cm:author property equals "MOVE ME" and carry out the move.

2. Option 2 would be to skip rules altogether and just do the move from within the JavaScript inside the workflow. So instead of just setting a property like you did in Option 1, you invoke the Move action.

There are trade-offs for each of these options. But it's your thesis so I'll let you think about those. Smiley Happy

If you need examples showing how to use JavaScript within a workflow, check out this tutorial: The first edition covers pre-4 using jBPM and the second edition covers Alfresco 4 with Activiti.

Jeff