Package org.alfresco.service.cmr.rule
Interface RuleService
-
- All Known Implementing Classes:
RuleServiceImpl
public interface RuleServiceRule service interface.- Author:
- Roy Wetherall
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intcountRules(org.alfresco.service.cmr.repository.NodeRef nodeRef)Count the number of rules associated with an actionable node.voiddisableRule(Rule rule)Disables a rule, preventing it from being fired.voiddisableRules()Disable rules for the current threadvoiddisableRules(org.alfresco.service.cmr.repository.NodeRef nodeRef)Disables the rules for a given node reference.voiddisableRuleType(java.lang.String ruleType)Disables the rules of a given type.voidenableRule(Rule rule)Enables a rule previously disabled.voidenableRules()Enable rules for the current threadvoidenableRules(org.alfresco.service.cmr.repository.NodeRef nodeRef)Enables the rules for a given node reference.voidenableRuleType(java.lang.String ruleType)Enables rules of a given type.java.util.List<org.alfresco.service.cmr.repository.NodeRef>getLinkedFromRuleNodes(org.alfresco.service.cmr.repository.NodeRef nodeRef)Get a list of the all the rule nodes that link to the passed rule node.org.alfresco.service.cmr.repository.NodeRefgetLinkedToRuleNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)Get the node reference to the rule node which the rule node links to.org.alfresco.service.cmr.repository.NodeRefgetOwningNodeRef(Action action)Returns the owning node reference for an action.org.alfresco.service.cmr.repository.NodeRefgetOwningNodeRef(Rule rule)Returns the owning node reference for a rule.RulegetRule(org.alfresco.service.cmr.repository.NodeRef nodeRef)Get the rule given its node referencejava.util.List<Rule>getRules(org.alfresco.service.cmr.repository.NodeRef nodeRef)Get all the rules associated with an actionable node, including those inherited from parents.java.util.List<Rule>getRules(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean includeInhertied)Get the rules associated with an actionable node.java.util.List<Rule>getRules(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean includeInhertiedRuleType, java.lang.String ruleTypeName)Get the rules associated with an actionable node that are of a specific rule type.RuleTypegetRuleType(java.lang.String name)Gets a rule type by name.java.util.List<RuleType>getRuleTypes()Get the rule types currently defined in the repository.booleanhasRules(org.alfresco.service.cmr.repository.NodeRef nodeRef)Indicates whether the node in question has any rules associated with it.booleanisEnabled()Indicates whether rules are currently enabled for the current thread or notbooleanisLinkedToRuleNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)Indicates whether the passed rule node reference is linked to another rule node.booleanisRuleTypeEnabled(java.lang.String ruleType)Indicates whether the rule is enabled or notvoidremoveAllRules(org.alfresco.service.cmr.repository.NodeRef nodeRef)Removes all the rules associated with an actionable nodevoidremoveRule(org.alfresco.service.cmr.repository.NodeRef nodeRef, Rule rule)Removes a rule from the given rule actionable nodebooleanrulesEnabled(org.alfresco.service.cmr.repository.NodeRef nodeRef)Indicates whether the rules for a given node are enabled or not.voidsaveRule(org.alfresco.service.cmr.repository.NodeRef nodeRef, Rule rule)Saves the details of the rule to the specified node reference.voidsaveRule(org.alfresco.service.cmr.repository.NodeRef nodeRef, Rule rule, int index)voidsetRulePosition(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.cmr.repository.NodeRef ruleNodeRef, int index)voidsetRulePosition(org.alfresco.service.cmr.repository.NodeRef nodeRef, Rule rule, int index)
-
-
-
Method Detail
-
getRuleTypes
@Auditable java.util.List<RuleType> getRuleTypes()
Get the rule types currently defined in the repository.- Returns:
- a list of rule types
-
getRuleType
@Auditable(parameters="name") RuleType getRuleType(java.lang.String name)
Gets a rule type by name.- Parameters:
name- the name of the rule type- Returns:
- the rule type, null if not found
-
enableRules
@Auditable void enableRules()
Enable rules for the current thread- See Also:
isEnabled(),disableRules()
-
disableRules
@Auditable void disableRules()
Disable rules for the current thread- See Also:
enableRules(),isEnabled()
-
isEnabled
@Auditable boolean isEnabled()
Indicates whether rules are currently enabled for the current thread or not- Returns:
- true if rules are enabled for the current thread, false otherwise
- See Also:
enableRules(),disableRules()
-
rulesEnabled
@Auditable(parameters="nodeRef") boolean rulesEnabled(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Indicates whether the rules for a given node are enabled or not. If the rules are not enabled then they will not be executed.- Parameters:
nodeRef- the node reference- Returns:
- true if the rules are enabled, false otherwise
-
disableRules
@Auditable(parameters="nodeRef") void disableRules(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Disables the rules for a given node reference. When the rules are disabled they will not execute.- Parameters:
nodeRef- the node reference
-
enableRules
@Auditable(parameters="nodeRef") void enableRules(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Enables the rules for a given node reference. When the rules are enabled they will execute as usual. By default all rules are enabled.- Parameters:
nodeRef- the node reference
-
disableRule
@Auditable(parameters="rule") void disableRule(Rule rule)
Disables a rule, preventing it from being fired.- Parameters:
rule- the rule to disable- See Also:
enableRule(Rule)
-
enableRule
@Auditable(parameters="rule") void enableRule(Rule rule)
Enables a rule previously disabled.- Parameters:
rule- the rule to enable- See Also:
disableRule(Rule)
-
disableRuleType
@Auditable(parameters="ruleType") void disableRuleType(java.lang.String ruleType)
Disables the rules of a given type.- Parameters:
ruleType- rule type
-
enableRuleType
@Auditable(parameters="ruleType") void enableRuleType(java.lang.String ruleType)
Enables rules of a given type.- Parameters:
ruleType- rule type
-
isRuleTypeEnabled
@Auditable(parameters="ruleType") boolean isRuleTypeEnabled(java.lang.String ruleType)
Indicates whether the rule is enabled or not- Parameters:
ruleType- rule type- Returns:
- boolean true if enabled false otherwise
-
hasRules
@Auditable(parameters="nodeRef") boolean hasRules(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Indicates whether the node in question has any rules associated with it.- Parameters:
nodeRef- the node reference- Returns:
- true if the node has rules associated, false otherwise
-
getRules
@Auditable(parameters="nodeRef") java.util.List<Rule> getRules(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Get all the rules associated with an actionable node, including those inherited from parents.An exception is raised if the actionable aspect is not present on the passed node.
- Parameters:
nodeRef- the node reference- Returns:
- a list of the rules associated with the node
-
getRules
@Auditable(parameters={"nodeRef","includeInhertied"}) java.util.List<Rule> getRules(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean includeInhertied)Get the rules associated with an actionable node.Optionally this list includes rules inherited from its parents.
An exception is raised if the actionable aspect is not present on the passed node.
- Parameters:
nodeRef- the node referenceincludeInhertied- indicates whether the inherited rules should be included in the result list or not- Returns:
- a list of the rules associated with the node
-
getRules
@Auditable(parameters={"nodeRef","includeInhertiedRuleType","ruleTypeName"}) java.util.List<Rule> getRules(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean includeInhertiedRuleType, java.lang.String ruleTypeName)Get the rules associated with an actionable node that are of a specific rule type.- Parameters:
nodeRef- the node referenceincludeInhertiedRuleType- indicates whether the inherited rules should be included in the result list or notruleTypeName- the name of the rule type, if null is passed all rule types are returned- Returns:
- a list of the rules associated with the node
-
countRules
@Auditable(parameters="nodeRef") int countRules(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Count the number of rules associated with an actionable node.- Parameters:
nodeRef- the node reference- Returns:
- a list of the rules associated with the node
-
getRule
@Auditable(parameters="nodeRef") Rule getRule(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Get the rule given its node reference- Parameters:
nodeRef- the node reference- Returns:
- the rule corresponding to the node reference
-
saveRule
@Auditable(parameters={"nodeRef","rule"}) void saveRule(org.alfresco.service.cmr.repository.NodeRef nodeRef, Rule rule)Saves the details of the rule to the specified node reference.If the rule is already associated with the node, the details are updated with those specified.
- Parameters:
nodeRef- NodeRefrule- Rule
-
saveRule
@Auditable(parameters={"nodeRef","rule","index"}) void saveRule(org.alfresco.service.cmr.repository.NodeRef nodeRef, Rule rule, int index)- Parameters:
nodeRef- NodeRefrule- Ruleindex- int
-
setRulePosition
@Auditable(parameters={"nodeRef","ruleNodeRef","index"}) void setRulePosition(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.cmr.repository.NodeRef ruleNodeRef, int index)- Parameters:
nodeRef- NodeRefruleNodeRef- NodeRefindex- int
-
setRulePosition
@Auditable(parameters={"nodeRef","rule","index"}) void setRulePosition(org.alfresco.service.cmr.repository.NodeRef nodeRef, Rule rule, int index)- Parameters:
nodeRef- NodeRefrule- Ruleindex- int
-
removeRule
@Auditable(parameters={"nodeRef","rule"}) void removeRule(org.alfresco.service.cmr.repository.NodeRef nodeRef, Rule rule)Removes a rule from the given rule actionable node- Parameters:
nodeRef- the actionable node reference
-
removeAllRules
@Auditable(parameters="nodeRef") void removeAllRules(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Removes all the rules associated with an actionable node- Parameters:
nodeRef- the actionable node reference
-
getOwningNodeRef
@Auditable(parameters="rule") org.alfresco.service.cmr.repository.NodeRef getOwningNodeRef(Rule rule)
Returns the owning node reference for a rule.- Parameters:
rule- the rule- Returns:
- the owning node reference
-
getOwningNodeRef
@Auditable(parameters="action") org.alfresco.service.cmr.repository.NodeRef getOwningNodeRef(Action action)
Returns the owning node reference for an action. Returns null for an unsaved action or one that is not parented by a rule. NOTE: this method is temporary and will be removed in future versions. It should only be used with good reason.- Parameters:
action- the action- Returns:
- the owning node reference
-
isLinkedToRuleNode
@Auditable(parameters="nodeRef") boolean isLinkedToRuleNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Indicates whether the passed rule node reference is linked to another rule node.- Parameters:
nodeRef- rule node reference- Returns:
- boolean true if linked, false otherwise
-
getLinkedToRuleNode
@Auditable(parameters="nodeRef") org.alfresco.service.cmr.repository.NodeRef getLinkedToRuleNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Get the node reference to the rule node which the rule node links to. Returns null if rules are not linked.- Parameters:
nodeRef- node reference of a rule node- Returns:
- NodeRef reference to the
-
getLinkedFromRuleNodes
@Auditable(parameters="nodeRef") java.util.List<org.alfresco.service.cmr.repository.NodeRef> getLinkedFromRuleNodes(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Get a list of the all the rule nodes that link to the passed rule node. Returns an empty list if none link.- Parameters:
nodeRef- node reference of a rule node- Returns:
- list of rule nodes that link to this passed rule node, empty if none
-
-