List<Step> steps = new ArrayList<Step>();
List<Command> cmds = new ArrayList<Command>();
cmds.add( new SetVariableCommand( "path1",
"kbuilder",
new NewKnowledgeBuilderCommand( null ) ) );
cmds.add( new KnowledgeContextResolveFromContextCommand( new KnowledgeBuilderAddCommand( ResourceFactory.newByteArrayResource( str.getBytes() ),
ResourceType.DRL,
null ),
"kbuilder",
null,
null, null ) );
cmds.add( new SetVariableCommand( "path1",
"kbase",
new NewKnowledgeBaseCommand( null ) ) );
cmds.add( new KnowledgeContextResolveFromContextCommand( new KnowledgeBaseAddKnowledgePackagesCommand(),
"kbuilder",
"kbase",
null, null ) );
KnowledgeSessionConfiguration ksessionConf = KnowledgeBaseFactory.newKnowledgeSessionConfiguration();
ksessionConf.setOption( ClockTypeOption.get( "pseudo" ) );
cmds.add( new SetVariableCommand( "path1",
"ksession",
new KnowledgeContextResolveFromContextCommand( new NewStatefulKnowledgeSessionCommand( ksessionConf ),
"kbuilder",
"kbase",
null, null ) ) );