Interface IRuleMechanics

All Superinterfaces:
IAccessMechanics, IBasicMechanics, IClipboardMechanics, IComponent, IInitializable, IMechanics, ISubscribableMechanics, ISystemHandler, IViewableMechanics
All Known Subinterfaces:
IPortalRulesMechanics

public interface IRuleMechanics extends IBasicMechanics
extended by IPortalRulesMechanics
  • Method Details

    • getTargetURI

      IURI getTargetURI(IThingID rule) throws PortalException
      Get the URI of the target object for this rule
      Parameters:
      rule - the rule instance to get the target URI for
      Returns:
      the target URI for the given rule.
      Throws:
      PortalException
    • getRuleForUser

      IThingID getRuleForUser(IThingID ruleRootContainer, IThingID userID) throws PortalException
      Get the rule for the given user.
      Parameters:
      ruleRootContainer - the container holding the rule instances
      userID - the user to evaluate the rules for
      Returns:
      the ThingID of the target of the rule
      Throws:
      PortalException
    • getAllMatchingRulesForUser

      Collection<IThingID> getAllMatchingRulesForUser(IThingID ruleRootContainer, IThingID userID) throws PortalException
      Get a list of all the rules that match for the given user.
      Parameters:
      ruleRootContainer - the container holding the rule instances
      userID - the user to evaluate the rules for
      Returns:
      the collection of ThingID of the matched rules
      Throws:
      PortalException
    • getRuleResultForUser

      IThingID getRuleResultForUser(IThingID ruleRootContainer, IThingID userID) throws PortalException
      Finds matching rule (condition) for given user, evaluates and returns its results as IThingID
      Parameters:
      ruleRootContainer - the container holding the rule instances
      userID - the user to evaluate the rules for
      Returns:
      the ThingID of the target of the rule
      Throws:
      PortalException
    • evaluateQuery

      boolean evaluateQuery(IThingID userID, IThingID ruleID)
      Determine whether this rule is a match for this user executes the matching algorithm for the given QueryMapping
      Parameters:
      userID - the user to evaluate the rules for
      ruleID - a specific rule
      Returns:
      true if it's a match, false otherwise
    • getOrderedRules

      IListView<IRuleView> getOrderedRules(IThingID ruleRootContainer) throws PortalException
      Gets the set of rules ordered by their orderID custom attribute. The list is returned in the order in which the rules should be evaluated.
      Parameters:
      ruleRootContainer - the container holding the rule instances
      Returns:
      ordered list of rule views
      Throws:
      PortalException