...
- check: this is when the rule is fired. This will generally have a checkType, which tells grouper when to fire the check, and some data which narrows down the search. e.g. checkType could be flattenedMembershipRemove, and the data could be groupName: a:b:c. the data is stored in the checkOwner attribute
- ifCondition: this might not be needed if the check contains all the information about when the rule should fire. Otherwise you could put an EL here about something to check. e.g.
Code Block ${!RulesUtils.hasMember(groupName, subjectSourceId, subjectId)}
- then: this is a scriptlet or maybe some built in actions. e.g. thenType is removeMember and groupName is a:b, or a scriptlet:
Code Block ${RulesUtils.removeMember(groupName, subjectSourceId, subjectId}
Rule check
The check component will see if the rule should continue to the "if condition". The check part is an enum class: edu.internet2.middleware.grouper.rules.RuleCheckType
Look at the javadoc or source for the most recent check types, currently they are:
- flattenedMembershipRemove
- groupCreate
- membershipRemove
- stemCreate
Here is an example of setting a rule check:
Code Block |
---|
AttributeAssign attributeAssign = groupA.getAttributeDelegate().assignAttribute(
RuleUtils.ruleAttributeDefName()).getAttributeAssign();
attributeAssign.getAttributeValueDelegate().assignValue(RuleUtils.ruleCheckTypeName(), RuleCheckType.membershipRemove.name());
attributeAssign.getAttributeValueDelegate().assignValue(RuleUtils.ruleCheckOwnerNameName(), "stem:b");
|
The second part of the check is the owner. This can either be set by name or id.
Rule data
The rule will be an attribute of a grouper object (group, stem, etc). There are attributes on the assignment which configure the params
...