AnsweredAssumed Answered

Creating rules — how can I create a composite-action node?

Question asked by doblek on Jun 8, 2007
Latest reply on Jun 10, 2008 by andresaimar
Hi all,

When I had installed version 1.3 of Alfresco, I could create a rule using web services, and I could edit this rule later using the web client.
Now, I had installed version 2.0, so I've translated the code from version 1.3 to version 2.0. This new code creates the rule, but it has some weird node structure (since node structure for rules in 2.0 is slightly different from 1.3)… The rule works, but it can be edited from web client (just rules with "composite-action" nodes can be edited in this new version)…

As far as I know, when a rule is created in 2.0, it has the following node structure:


node_where_the_rule_applies

             |

         ruleFolder
             |
           rule
             |
      composite-action
        /         \
   action       condition
     |               |
parameter       parameter

In order to achieve this new node structure, I've written a new code that tries to create an action (whose 'definitionName' is 'composite-action') that contains the real action and the condition as children… But I'm always getting an exception, because I think that repository does not recognize that action name…  :(

My code follows these steps:
- create the condition for the rule (to trigger the action or not)
- create the action that the rule is going to perform
- create the 'composite-action', where the previous action and condition are added
- create the rule, where the composite-action is added
- save the rule against the repository

I read (in the Web Services Documentation ['Action' service]) that, in order to create the rules in that way
…this action is defined as a composite action (by setting the type of action appropriatly)…

However, I don't see how to create an action of type 'composite-action', since that action definition is not available for web services… =/

Can anybody tell me how can I create a composite-action?

Thanks in advance and regards,
Enrique


PS: sorry for my English  :oops:

Outcomes