Class RuleExecutionResult

    • Field Detail

      • result

        private java.util.List<IArtifact> result
      • allResults

        private java.util.List<IArtifact> allResults
      • failReason

        private java.lang.String failReason
      • failCode

        private java.lang.Integer failCode
      • hasChanges

        private boolean hasChanges
    • Constructor Detail

      • RuleExecutionResult

        public RuleExecutionResult​(RuleExecutionResult.Status status,
                                   RuleExecutionContext context)
        Creates a new rule execution result.
        Parameters:
        status - the execution status
        context - the actual rule execution context to take the data from
    • Method Detail

      • transfer

        private static java.util.List<IArtifact> transfer​(java.util.Collection<IArtifact> in)
        Transfers the data in in into a new list to be stored in an instance of this class.
        Parameters:
        in - the collection to be considered as input
        Returns:
        the created list
      • result

        public Set<IArtifact> result()
        The immediate result of the execution.
        Returns:
        the immediate result
      • allResults

        public Set<IArtifact> allResults()
        All results achieved so far.
        Returns:
        all results
      • allResultsAsCollection

        java.util.Collection<IArtifact> allResultsAsCollection()
        Returns all results collected so far as a Java collection.
        Returns:
        all results
      • resultAsCollection

        java.util.Collection<IArtifact> resultAsCollection()
        Returns the results of the execution of the related rule as a Java collection.
        Returns:
        the immediate results
      • getStatus

        public RuleExecutionResult.Status getStatus()
        Returns the execution status of the rule.
        Returns:
        the execution status
      • getFailReason

        public java.lang.String getFailReason()
        Returns the fail reason (if the execution failed).
        Returns:
        the reason or null if unknown, not set or not failing
      • getFailCode

        public java.lang.Integer getFailCode()
        The failure code.
        Returns:
        the failure code (may be null if not set)
      • setChanges

        public void setChanges​(boolean hasChanges)
        Defines whether the rule call represented by this instance changed the configuration and committed the changes.
        Parameters:
        hasChanges - true for changes, false else
      • hasChanges

        public boolean hasChanges()
        Returns whether the rule call represented by this instance changed the configuration and committed the changes.
        Returns:
        true for changes, false else
      • convert

        public static Set<IArtifact> convert​(RuleExecutionResult res)
        Conversion operation.
        Parameters:
        res - the rule execution result to be converted/projected
        Returns:
        the converted value
      • getStringValue

        public java.lang.String getStringValue​(IStringValueProvider.StringComparator comparator)
        Description copied from interface: IStringValueProvider
        Returns the string value of this object.
        Specified by:
        getStringValue in interface IStringValueProvider
        Parameters:
        comparator - if the sequence of elements, e.g., in case of collections, shall be ordered according to the comparator, null if the original sequence shall be returned
        Returns:
        the string value