Advertisement
Guest User

Untitled

a guest
May 24th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. @Path("/candrink/{name}/{age}")
  2. public class CanDrinkResource {
  3.  
  4. @Named("canDrinkKS")
  5. RuleUnit<SessionMemory> ruleUnit;
  6.  
  7. @GET
  8. @Produces(MediaType.TEXT_PLAIN)
  9. public String canDrink( @PathParam("name") String name, @PathParam("age") int age ) {
  10.  
  11. SessionMemory memory = new SessionMemory();
  12.  
  13. Result result = new Result();
  14. memory.add(result);
  15. memory.add(new Person( name, age ));
  16.  
  17. ruleUnit.evaluate(memory);
  18.  
  19. return result.toString();
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement