KnowledgeBase knowledgeBase = RulesDeployer.getKnowledgeBase(deploymentId);
StatelessKnowledgeSession knowledgeSession =
knowledgeBase.newStatelessKnowledgeSession();
ExecutionGlobals executionGlobals = new ExecutionGlobals(execution);
knowledgeSession.getGlobals().setDelegate(executionGlobals);
knowledgeSession.execute(execution);
if (!executionGlobals.getOutcome().isDefined()) {
execution.takeDefaultTransition();
} else {
execution.take(executionGlobals.getOutcome().get());
}
}