cancel
Showing results for 
Search instead for 
Did you mean: 

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

doblek
Champ in-the-making
Champ in-the-making
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…  Smiley Sad

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  Smiley Surprisedops:
4 REPLIES 4

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

I've been studying this issue a little bit more and, from my point of view, it's not possible to create a 'compositeaction' node through web services since there is no CompositeAction class in the web-service-client.jar distribution…

I mean… a CompositeActionImpl can be found at org.alfresco.repo.action package, but the equivalent class does not exists as webservice in the org.alfresco.repo.webservice.action package…

So, as far as I know (and if I'm not wrong), it's not possible to create rules using web services that can be edited later through the web client using Alfresco 2.0.

Am I wrong??  Smiley Surprisedops:

Thanks in advance and regards,
Enrique

goathers
Champ in-the-making
Champ in-the-making
Hi,

I'm do it inverse. Make a Rule assigned to folder on web interface an then read it from webservices.

An composite-action is an action that has "composite-action" on actionName attribute.

Tomás.

kumbach
Champ in-the-making
Champ in-the-making
So, as far as I know (and if I'm not wrong), it's not possible to create rules using web services that can be edited later through the web client using Alfresco 2.0.

Am I wrong??  Smiley Surprisedops:

I just ran into this today. Since nobody answered your question, I created a JIRA issue to find help flush out an answer.

http://issues.alfresco.com/browse/AWC-1633

Kevin

andresaimar
Champ in-the-making
Champ in-the-making
Sorry for bothering you but I am experiencing some problems trying to create a rule.
I am currently trying to create a rule but I always got a NULL EXCEPTION when trying to save the rule.
Did anyone knows something about it?
By the way, I am doing it by using web services.