Class RuleConditionDmrUtil


  • public final class RuleConditionDmrUtil
    extends java.lang.Object
    Utility class for common functionality needed for rule condition DMR tooling.
    Since:
    1.21
    Author:
    Lucas Koehler
    • Method Detail

      • getDmrRootEClass

        public static java.util.Optional<org.eclipse.emf.ecore.EClass> getDmrRootEClass​(EMFFormsDatabindingEMF databinding,
                                                                                        ReportService reportService,
                                                                                        org.eclipse.emf.ecore.EObject owner)
        Get the root EClass for the VDomainModelReference to create. If the rule Condition is contained in another Condition with a DMR, the root EClass is determined by resolving the container Condition(s) down from the domain root. Otherwise, the root EClass is the EClass of the domain root.
        Parameters:
        databinding - The EMFFormsDatabindingEMF used to resolve DMRs
        reportService - The ReportService used to report databinding failures
        owner - The condition containing the the DMR whose root EClass is needed
        Returns:
        The root EClass or nothing if it could not be determined
      • getDmrRootObject

        public static java.util.List<org.eclipse.emf.ecore.EObject> getDmrRootObject​(EMFFormsDatabindingEMF databinding,
                                                                                     ReportService reportService,
                                                                                     org.eclipse.emf.ecore.EObject domainRoot,
                                                                                     org.eclipse.emf.ecore.EObject owner)
        Get the root EObjects for the owner's domain model reference. IF the owner is not nested in another Condition, the result list simply contains the given domainRoot. IF the owner is nested in one or more IterateConditions, the iterate conditions' dmrs are resolved and all possible root objects collected and returned.
        Parameters:
        databinding - The EMFFormsDatabindingEMF used to resolve dmrs
        reportService - The ReportService to report databinding errors
        domainRoot - The domain root (usually the view model context's domain model)
        owner - The eObject containing the dmr (usually a Condition)
        Returns:
        the roots of the owner's dmr. If the owner condition is not nested, the result list contains only the given domain root. May return an empty list if no root could be determined but never returns null