Rule not triggered after specializing type

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2012 09:09 AM
At the moment I want to configure a rule which send out a notification to a person when content gets a a custom content type assigned.
For example a user upload one particular document A.pdf. At this moment the content type is still cm:content.
However after the content type is specialized to: my:customcontent it looks lik Alfresco does receive this trigger.
Does anyone know how this can be solved?
The notifications itself work so that is not the issue.
Kind regards,
Marcel
Alfresco Community v4.0.0
(3979) schema 5025
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2012 03:04 PM
Hi there,
At the moment I want to configure a rule which send out a notification to a person when content gets a a custom content type assigned.
For example a user upload one particular document A.pdf. At this moment the content type is still cm:content.
However after the content type is specialized to: my:customcontent it looks lik Alfresco does receive this trigger.
Does anyone know how this can be solved?
The notifications itself work so that is not the issue.
Kind regards,
Marcel
Alfresco Community v4.0.0
(3979) schema 5025
You can have more than one folder rule configured to the same folder.
The first one is that you described. When a new document is created, its type is configured.
Just create a second rule, registered to run at "items are updated", and the criteria as "content of type or sub-types" type my:customcontent".

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2012 02:56 AM
Thank you for your reply.
I'm not sure if I did something wrong however what I already wrote, and perhaps I did not make it very clear.
It looks like if Alfresco did not receive the update trigger after the type is specialized.
Any idea what the problem could be?
Kind regards,
Marcel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2012 11:21 AM
Hi douglas,
Thank you for your reply.
I'm not sure if I did something wrong however what I already wrote, and perhaps I did not make it very clear.
It looks like if Alfresco did not receive the update trigger after the type is specialized.
Any idea what the problem could be?
Kind regards,
Marcel
You are right… I just made a test, and the rules engine seems to ignore the update.
What about creating an second action inside the same rule, executed just after the first one?
You can try to select a javascript to run.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2012 03:19 AM
Sorry for my delayed response.
I wasn't be able to respond earlier.
Within the rule which checks if a content type is added or updated with content type "type1" I added another rule which executes the following action.
The problem is the same as mentioned earlier. Alfresco does not see the change of content type as an update trigger.
if(document.typeShort == "type1" || document.typeShort == "type2" || document.typeShort == "type3"){ // create mail action var mail = actions.create("mail"); // set the required parameters mail.parameters.to = "mail@mail.com"; mail.parameters.subject = "subject"; mail.parameters.from = "alfresco@alfresco.com"; mail.parameters.text = "Text Message"; // execute action against a document mail.execute(document);}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2012 07:42 AM
I have one case where I have something just like what you want to do.
Take a look at this.
[img]http://i49.tinypic.com/117a6af.jpg[/img]
In this rule, I've specialized the type, and then, I executed a script.
Can you try this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2012 07:57 AM
Thanks for your reply.
I believe that your example will work however you define in your rule which content type it will be.
The problem is, in our situation, the content types can be different and will not be set by a rule, just by hand changing the content type.
I think that is not what you displayed in your screenshot is it?
Kind regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2012 08:33 AM
I didn't know that the type would be set manually…
All the tests I did were made with automatic actions driven by rules.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2012 09:17 AM
Perhaps I need to find it elsewhere in Alfresco's functionality.
With policies, or scheduled actions…

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2012 10:23 PM
An update event should be fired whenever the content is modified either by end user or a rule action.
