ilog.rules.studio.model.base

Class IlrRuleProjectUtil

  • java.lang.Object
    • ilog.rules.studio.model.base.IlrRuleProjectUtil


  • public class IlrRuleProjectUtil
    extends java.lang.Object
    Some utility methods to deal with Rule Projects.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static void addSystemXomPathEntry(IlrRuleProject ruleProject, org.eclipse.core.runtime.IPath path)
      Adds a system xom path entry to this rule project.
      static void createDecisionServiceProject(org.eclipse.core.resources.IProject project, boolean mainRuleProject, org.eclipse.core.runtime.IProgressMonitor monitor)
      Create a new decision service project.
      static IlrRuleProject createDefaultRuleProject(org.eclipse.core.resources.IProject iProject, boolean createFolders, org.eclipse.core.runtime.IProgressMonitor monitor) 
      static IlrRuleProject createDefaultRuleProject(org.eclipse.core.resources.IProject iProject, org.eclipse.core.runtime.IProgressMonitor monitor)
      Creates a well-formed rule project in the workspace from a project handle.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IlrRuleProjectUtil

        public IlrRuleProjectUtil()
    • Method Detail

      • createDefaultRuleProject

        public static IlrRuleProject createDefaultRuleProject(org.eclipse.core.resources.IProject iProject,
                                              org.eclipse.core.runtime.IProgressMonitor monitor)
                                                       throws org.eclipse.core.runtime.CoreException
        Creates a well-formed rule project in the workspace from a project handle.

        More precisely:

        • creates the project if it does not exist
        • gives it a rule nature
        • creates the default model folders "rules", "boms", "queries", "templates" and "resources"
        • creates an output folder "output"
        • defines a default category "ANY"
        • creates an empty BOM path
        • creates a XOM path with the Java JRE library
        • marks the project with a UTF-8 encoding

        The resulting IlrRuleProject exists in the rule model and in the workspace: this method performs a workspace operation. Usually this method will be called from a newly created IProject handle, for example:

           IProject newProject = ResourcesPlugin.getWorkspace().getRoot().getProject("myNewProject");
           IlrRuleProject ruleProject = IlrRuleProjectUtil.createDefaultRuleProject(newProject, null);
         

        The resulting rule project is already saved and you do not need to call IlrResourceManager.saveElement(IlrResourceElement).

        Throws:
        org.eclipse.core.runtime.CoreException - If the creation failed or if this project already existed.
        Parameters:
        iProject - A handle to a project in the workspace.
        Returns:
        A new IlrRuleProject, or null if the creation failed.
      • createDefaultRuleProject

        public static IlrRuleProject createDefaultRuleProject(org.eclipse.core.resources.IProject iProject,
                                              boolean createFolders,
                                              org.eclipse.core.runtime.IProgressMonitor monitor)
                                                       throws org.eclipse.core.runtime.CoreException
        Throws:
        org.eclipse.core.runtime.CoreException
      • addSystemXomPathEntry

        public static void addSystemXomPathEntry(IlrRuleProject ruleProject,
                                 org.eclipse.core.runtime.IPath path)
                                          throws IlrModelException,
                                                 org.eclipse.core.runtime.CoreException
        Adds a system xom path entry to this rule project.

        The given path can be:

        • a Jar file
        • a class folder
        • a Java Project
        • a Rule Project

        The path can be an absolute path on the file system or a full path inside the workspace.

        Throws:
        IlrModelException - If it could not create the xom path entry.
        org.eclipse.core.runtime.CoreException
      • createDecisionServiceProject

        public static void createDecisionServiceProject(org.eclipse.core.resources.IProject project,
                                        boolean mainRuleProject,
                                        org.eclipse.core.runtime.IProgressMonitor monitor)
                                                 throws org.eclipse.core.runtime.CoreException
        Create a new decision service project.
        Throws:
        org.eclipse.core.runtime.CoreException
        Parameters:
        project - handle to the IProject to be initialized
        mainRuleProject - should the created project be a main decision service
        monitor -

© Copyright IBM Corp. 1987, 2017