Add this rule to the group that should receive the disabled date.


Grouper rules

If an employee is no longer a member of the employee ref group, and that employee ref group is in a policy subgroup, and there should be a grace period assigned, then add that user to a grace period group with an end date. You could also have a rule like this for people added to a lock-out group. The overall policy group would include the policy subgroup and the grace period group.

GSH example

grouperSession = GrouperSession.startRootSession();
mustBeInGroup = GroupFinder.findByName(grouperSession, "test:base-eligible", true);
ruleGroup = GroupFinder.findByName(grouperSession, "test:grace-eligible", true);
actAs = grouperSession.getSubject();


AttributeAssign attributeAssign = ruleGroup.getAttributeDelegate().addAttribute(RuleUtils.ruleAttributeDefName()).getAttributeAssign();
 
AttributeValueDelegate attributeValueDelegate = attributeAssign.getAttributeValueDelegate();
 
attributeValueDelegate.assignValue(RuleUtils.ruleActAsSubjectSourceIdName(), actAs.getSourceId());
attributeValueDelegate.assignValue(RuleUtils.ruleActAsSubjectIdName(), actAs.getId());
 
attributeValueDelegate.assignValue(RuleUtils.ruleCheckOwnerIdName(), mustBeInGroup.getId());
attributeValueDelegate.assignValue(RuleUtils.ruleCheckTypeName(), RuleCheckType.flattenedMembershipRemove.name());
attributeValueDelegate.assignValue(RuleUtils.ruleThenEnumName(), RuleThenEnum.assignMembershipDisabledDaysForOwnerGroupId.name());
 
attributeValueDelegate.assignValue(RuleUtils.ruleThenEnumArg0Name(), "7");
 
attributeValueDelegate.assignValue(RuleUtils.ruleThenEnumArg1Name(), "T");
 
//should be valid
String isValidString = attributeValueDelegate.retrieveValueString(RuleUtils.ruleValidName());
 
if (!"T".equals(isValidString)) {
  throw new RuntimeException(isValidString);
}

The base-eligible also has an employee group


When an employee is no longer an employee, you will see a rule fire here: