Created
March 12, 2016 10:50
-
-
Save garethahealy/b6f26ea06536f8fdccd6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // instantiate and pre-populate driver and policy domain classes | |
| // useful for lab 20 that currently invokes execution server without including policy and driver | |
| if(driver == null) { | |
| driver = new Driver(); | |
| driver.setDriverName("Azra"); | |
| driver.setAge(22); | |
| driver.setNumberOfAccidents(0); | |
| driver.setNumberOfTickets(1); | |
| kcontext.setVariable("driver", driver); | |
| } | |
| if(policy == null) { | |
| policy = new Policy(); | |
| kcontext.setVariable("policy", policy); | |
| } | |
| if(policy.getPolicyType() == null) | |
| policy.setPolicyType( "AUTO" ); | |
| policy.setDriver(driver); | |
| System.out.println("** prepareData: will now add policy & driver to kruntime : "+policy); | |
| /* insert objects into working memory */ | |
| kcontext.getKnowledgeRuntime().insert( driver ); | |
| kcontext.getKnowledgeRuntime().insert( policy ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment