cancel
Showing results for 
Search instead for 
Did you mean: 

Rules on a space

durdy48
Champ in-the-making
Champ in-the-making
When i add a rule on a space for associate an aspect to a determinate document, for example, extract metadatas for OpenOffice documents an add its aspect, where is it found in source code this filter??

I am meanning that a would like to know how i can doing a filter for an space
accept a rule, for example:


if( space has the rule) {
//TO DO

}

Thanks.
2 REPLIES 2

jpfi
Champ in-the-making
Champ in-the-making
Hi,

it is more complex than a simple if.
You'll find the sourde code of the rules engine in the respository project in he packages org.alfresco.repo.rule and org.alfresco.repo.rule.trigger.

Example: Update Rule triggered by a  setProperty()-call:
nodeService.setProperty(nodeRef, ContentModel.PROP_NAME, "nameChanged");

The concrete NodeServiceImplementation will perhaps be org.alfresco.repo.node.db.DbNodeServiceImpl.
This setProperty()-Implementation (there are a few indirections…) calls onUpdateProperties(…) method on a
NodeServicePolicies.OnUpdatePropertiesPolicy implementation, e.g.
org.alfresco.repo.rule.ruletrigger.OnPropertyUpdateRuleTrigger. This triggers the rules (triggerRuleType() in org.alfresco.service.cmr.rule.RuleType).

Cheers,
Jan

kevinr
Star Contributor
Star Contributor
You can execute JavaScript (script rule) which can do all you want - you can have as much logic as you want then:
http://wiki.alfresco.com/wiki/JavaScript_API

Thanks,

Kevin