this.command = command;
this.disconnected = disconnected;
}
public ExecutionResults execute(Context context) {
KieSession ksession = ((KnowledgeCommandContext) context).getKieSession();
ExecutionResults kresults = null;
if( ksession instanceof StatefulKnowledgeSessionImpl ) {
kresults = ((StatefulKnowledgeSessionImpl)ksession).execute(context, this.command );
}
else {
// Graceful failure
kresults = ksession.execute(this.command);
}
if ( this.outIdentifier != null ) {
((ExecutionResultImpl)((KnowledgeCommandContext) context ).getExecutionResults()).getResults().put( this.outIdentifier, kresults );
}