Git Product home page Git Product logo

optaweb-employee-rostering's Introduction

Employee Rostering Optimization as a Service

An end-to-end OptaPlanner web application ready to deploy on OpenShift 3.

Running on OpenShift Dedicated (paid edition)

Prerequisites

To copy-paste your command, go to the OpenShift Online web console and look for Help > Command line tools.

Setup

  1. Login to OpenShift Dedicated from command line:

    oc login https://api.YOUR_SERVER.openshift.com --token=<tokenId>

    If you don’t know your <tokenId>, log in at the OpenShift web console and look for Help > Command Line Tools.

  2. Create, build and deploy the project.

    ./provision.sh setup --project-suffix mydemo

    The --project-suffix is optional.

  3. It should now be building the pod and running it on OpenShift. Go to the OpenShift Online web console to get the *.openshiftapps.com URL to visit.

Updates

To build and deploy new changes, use:

./provision.sh deploy

Deletion

To delete the OpenShift application and project, run:

./provision.sh delete

Running on OpenShift Online (free edition)

This is not possible to due to resource limitations.

Running on a local OpenShift Origin

  1. If you just installed oc client tools, follow the OpenShift Local Cluster Management docs to get oc cluster (up|down) working.

  2. oc cluster up

  3. oc login, enter developer for both username and password when prompted

  4. oc new-project optaweb-employee-rostering

  5. oc new-app --image-stream="openshift/wildfly:10.1" https://github.com/kiegroup/optaweb-employee-rostering.git#master

To trigger a new build with the latest updates from the master branch, run

oc start-build optaweb-employee-rostering

To delete the OpenShift application and project, run

oc delete project optaweb-employee-rostering

Development

Code formatter

Both IntelliJ and Eclipse formatters are available here: https://github.com/kiegroup/droolsjbpm-build-bootstrap/tree/master/ide-configuration

Building from source

mvn clean install

Under the covers, OpenShift builds activate the openshift profile. To reproduce locally, add it explicitly (the provision.sh script already does this):

mvn clean package -P openshift

IntelliJ IDEA Ultimate 2018.1

To run SuperDevMode and debug both backend and client code from IDEA you need to create two separate run configurations.

CodeServer run configuration

  1. Create Maven configuration and set following parameters:

    • Working directory: /absolute/path/optaweb-employee-rostering

    • Command line: gwt:codeserver

  2. Make sure launcherDir is configured to point to optaweb-employee-rostering-webapp/target/optaweb-employee-rostering-webapp-${version}/.

    The launcherDir property can be set in pom.xml or via system property.

AppServer run configuration

  1. Add local JBoss Server configuration.

  2. Configure the Application server field to point to a local WildFly 11 installation.

  3. Click Fix button at the bottom of the dialogue and select optaweb-employee-rostering-webbab:war exploded.

  4. Remove any steps that were automatically added to the Before launch phase.

  5. Configure JavaScript debugger:

    • Check After launch and select Chrome browser.

    • Check with JavaScript debugger.

    • Set start page to http://localhost:8080/gwtui/gwtui.html.

    • Set both On Update action and On frame deactivation to Update classes and resources.

Run SuperDevMode in IDEA

  1. Do a clean build:

    mvn clean install -DskipTests
  2. Run the CodeServer configuration in normal mode.

  3. Run the AppServer configuration in debug mode.

You get live update for backend code. You can see client code changes after refreshing the browser or Rerunning the JavaScript debugger. And you can debug both client and backend code in IDEA.

If something goes wrong, do a clean build and click Maven Projects > Reimport All Maven Projects.

IntelliJ IDEA 2017.2 (and below) + CLI

The steps below make sure that the GWT Codeserver will recompile the application after files under src/main/resources are saved.

  1. Import the maven project by choosing the root pom.xml file and selecting Open as project

  2. Install the Save Actions plugin

  3. Restart IntelliJ (required after installing the plugin)

  4. Under Other settings, go to the Save Actions submenu and check either the first or the second options in the General section

  5. Check the Compile file option in the Build actions section

After configuring the Save Actions plugin, you should be able to start Wildfly and deploy the application from the CLI. Note that if you need to restart the GWT Code Server, it’s not mandatory to restart Wildfly.

mvn -N wildfly:start wildfly:deploy
mvn gwt:codeserver

To stop the Wildfly server, use mvn -N wildfly:shutdown.

Eclipse

  1. TODO: Document

optaweb-employee-rostering's People

Contributors

christopher-chianelli avatar ge0ffrey avatar tiagobento avatar duncandoyle avatar mbiarnes avatar yurloc avatar rsynek avatar ddoyle-redhat avatar kiereleaseuser avatar kkufova avatar mareknovotny avatar agiertli avatar

Watchers

Satish Kotadiya avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.