Skip to content

Drools Workbench is the web application and repository to govern Drools assets.

Notifications You must be signed in to change notification settings

scandihealth/drools-wb

 
 

Repository files navigation

DXC version of Drools Workbench for LPR

This repository is used by DXC (CSC Scandihealth) to modify Drools Workbench for use with LPR.
This branch contains modifications to 6.5.0.Final made by DXC (CSC Scandihealth).

New Dependency to csc-gwt-maven-plugin

Running the gwt-maven-plugin to compile the gwt code in the drools-wb-webapp project under Windows 7 gives an error (see gwt-maven-plugin/gwt-maven-plugin#113).
To fix this we have backported the 2.8.0 fix to our own fork of gwt-maven-plugin 2.7.0 found here: https://github.com/scandihealth/gwt-maven-plugin/tree/csc-2.7.0
We have packaged that fork using maven and uploaded the jar to our own internal Artifactory maven repository so that it can be resolved when building this drools-wb fork internally at DXC.

How To Setup For Development (Windows 7 64bit)

Setting Up Build Configuration

  1. Install Git for windows, IntelliJ IDEA & Java JDK 8 64bit
  2. Configure Maven to use our internal Scandihealth Artifactory maven repository
    • Copy \\sh\shares\scvcomn\LPR3\udviklersetup\settings.xml to your %USERPROFILE%\.m2 folder (create folder if necessary)
  3. Configure Git to use long paths
    • Open a command prompt with administrator rights and run: git config --system core.longpaths true
  4. Open IDEA (64 bit) by opening idea64.exe -> Default Settings -> Maven
    • Change Maven -> Runner -> VM Options to -Xms256m -Xmx3G
  5. Using IDEA (64 bit): Checkout the repository from Git https://github.com/scandihealth/drools-wb.git
    • Open the root pom.xml as a project
    • Make sure to "Enable Auto Import" in Maven and add GWT facets (IDEA should ask you these questions in popup balloons)
    • Change File -> Project Structure -> Project -> Project SDK to 1.8 (64bit)
  6. (Optional) Click the "Toggle 'Skip Tests' Mode" button in the Maven Projects sidebar window
  7. You are now ready to run Maven commands and develop
    • Run Drools Workbench (root) -> install (takes 10-15 minutes)
    • Note: The build output of drools-wb-webapp is copied to ${env.JBOSS_HOME}/standalone/deployments

Setting Up Run Configuration

  1. Download and unzip WildFly 10.1.0.Final
    • Copy kie.maven.settings.custom.xml to your WildFly installation (e.g. \standalone\drools\configuration)
    • Insert this into wildfly-10.1.0.Final\standalone\configuration\standalone.xml after the <extensions> element (modify to your liking)
        <system-properties>
            <property name="org.uberfire.nio.git.dir" value="C:\dev\drools-wb-devdb"/>
            <property name="org.uberfire.nio.git.ssh.cert.dir" value="C:\dev\drools-wb-devdb"/>
            <property name="org.uberfire.metadata.index.dir" value="C:\dev\drools-wb-devdb"/>
            <property name="org.guvnor.m2repo.dir" value="C:\dev\drools-wb-devdb"/>
            <property name="kie.maven.settings.m2repo.dir.local" value="${env.JBOSS_HOME}\standalone\drools\m2localrepo"/>
            <property name="kie.maven.settings.custom" value="${env.JBOSS_HOME}\standalone\drools\configuration\kie.maven.settings.custom.xml"/>
        </system-properties>
    
  2. Setup a new Run configuration in IDEA
    • First make sure you have enabled JBoss integration
    • Run -> Edit confiugrations -> Add New Configuration (+ button) -> JBoss -> Local
      • Application server: JBoss 10.1.0.Final (if not present then click Configure... and choose the folder where you unzipped Wildfly 10.1.0.Final)
      • Deployment tab -> Add (+ button) -> pick drools-wb-webapp:war exploded
  3. Now you should be able to run this configuration and the Drools Workbench login page should open automatically
    • Remember on Drools Workbench - WebApp to run Maven 'clean' and then 'install' if you have made changes to GWT code you want to include
    • Remember on Drools Workbench - WebApp to run Maven 'clean' and then 'install' if switching from debugging GWT to running normally
  4. Login with admin/admin

Setting Up Code Style

  1. Download the official droolsjbpm IDEA Code Style and save it in %USERPROFILE%\.<YOUR IDEA VERSION>\config\codestyles
  2. Change the Code Style used by IDEA for this project
    • Select Settings -> Editor -> Code Style -> Scheme: Drools and jBPM: Java Conventions
  3. Change .properties file encoding to UTF-8
    • Settings -> Editor -> File Encodings -> Set Default encoding for properties files to UTF-8
    • Note: normal i18n properties files must be in ISO-8859-1 as specified by the java ResourceBundle contract.
    • Note on note: GWT i18n properties files override that and must be in UTF-8 as specified by the GWT contract.
  4. Follow some of the other (TBD) code style recommendations described here (e.g. XML tab spaces)

Debugging client code with GWT Super Dev Mode

  1. On Drools Workbench - WebApp run Maven 'clean' then 'csc-gwt:debug'
    • This can be setup as a 1-click job by using the "Execute Maven Goal" button in IDEA and set Working directory to the drools-wb-webapp folder and enter 'clean csc-gwt:debug -e' in Command line
  2. Attach a IDEA Remote debugger on port 8000 (Now the GWT Development Mode window should pop up)
  3. Click the "Launch Default Browser" button when it is available

Troubleshooting

  • If deployment to WildFly fails with a file system or persistence related error it most likely means that a previous Drools-WB Java process was not terminated and has taken a file lock or JVM address binding
    • Make sure drools-wb-webapp is not already deployed (check standalone.xml <deployment> tags and check \wildfly-10.1.0.Final\standalone\deployments folder)
    • Close the server and kill all instances of java.exe in your Windows task manager
  • If this doesn't fix the problem, then stop the server and delete the .index and .niogit folders in the dir specified by "org.uberfire.nio.git.dir" and "org.uberfire.metadata.index.dir" and try again
    • Note: This will reset all your application data (Data Model, rules, etc)

Tips & Tricks

About

Drools Workbench is the web application and repository to govern Drools assets.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 98.1%
  • JavaScript 1.0%
  • CSS 0.5%
  • HTML 0.2%
  • Shell 0.1%
  • Batchfile 0.1%