AnsweredAssumed Answered

Executing actions on workflow rules

Question asked by mimi_mircea on Oct 4, 2007
I have one rule witch is a simple workflow and has only approve and reject actions. I want to execute this rule on a specific content on that space.

The rule is defined via the UI, and i wat to run it via web services…

My code is this :

Reference refe = new Reference(store,rows[4].getNode().getId(),null);
Predicate pred = new Predicate(new Reference[]{refe},store,null);
ActionExecutionResult[] resultado = actionService.executeActions(pred,rules[0].getAction().getActions());

rows[4] is the content on witch i want to execute the rule, and rules[0] is the rule.

If the rule has an action like "remove an aspect ", or anything different of a workflow, this code runs ok, but when i want to approve or reject [or a rule with only approve action] it doesn't work. It changes my modified date, but it doesn't move the content to a specific space.

This is the rule "Move item to 'User Homes' if 'Accept' action is taken. Move item to 'INTRANET' if 'deny' action is taken."

I looked verry hard on google and on this forum, but i didn't find anything.

My rule has an action witch is a composite-action… and it contains an array of actions. in this array i have an action witch has this 6 parameters:
0 : name "approve-move" value "true"
1 : name "approve-step" value "Accept"
2 : name "reject-move" value "true"
3 : name "reject-step" value "deny"
4 : name "approve-folder" value "workspace://SpacesStore/bd6a37c8-0389-11dc-93af-e1b360d3eec0"
5: : name "reject-folder" value "workspace://SpacesStore/0c175ace-0489-11dc-bc81-8dcef503d25d"

[img]http://img171.imageshack.us/img171/7579/problemeo0.png[/img]


This is a little odd because i expected one action for approve and another action for reject, so can i choose witch action should run.

But in this way, it's only one action and i don't know how to run it for approve or for reject but this is the way alfresco implements actions for rules, please add code or something to make this work because i had ran out of ideas.

So a web service client can execute the rule action for a specific need… approve or reject…?

Thank you very much

Outcomes