public Integer execute(Context context) { StatefulKnowledgeSession ksession = ((KnowledgeCommandContext) context).getStatefulKnowledgesession(); final ReteooWorkingMemoryInterface session = ((StatefulKnowledgeSessionImpl)ksession).session; new Thread(new Runnable() { public void run() { if ( agendaFilter != null ) { session.fireUntilHalt( new StatefulKnowledgeSessionImpl.AgendaFilterWrapper( agendaFilter ) ); } else { session.fireUntilHalt(); } } }).start(); return null; }
public ExecutionResults execute(Context context) { StatefulKnowledgeSession ksession = ((KnowledgeCommandContext) context).getStatefulKnowledgesession(); if (data != null) { for (Object o: data) { ksession.insert(o); } } ProcessInstance processInstance = (ProcessInstance) ksession.startProcess(processId, parameters); ((ExecutionResultImpl)((KnowledgeCommandContext) context ).getExecutionResults()).getResults().put( processId, getRemoteClient(processInstance) ); return ((ExecutionResultImpl)((KnowledgeCommandContext) context ).getExecutionResults()); }
public Void execute(Context context) { KnowledgeBuilder kbuilder = ((KnowledgeCommandContext) context).getKnowledgeBuilder(); if (kbuilder.hasErrors()) { throw new IllegalStateException("There are rule compilation errors:\n" + kbuilder.getErrors().toString()); } KnowledgeBase kbase = ((KnowledgeCommandContext) context).getKnowledgeBase(); kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() ); return null; }
public Collection<KnowledgePackage> execute(Context context) { KnowledgeBuilder kbuilder = ((KnowledgeCommandContext) context).getKnowledgeBuilder(); Collection<KnowledgePackage> knowledgePackages = kbuilder.getKnowledgePackages(); if ( this.outIdentifier != null ) { ((ExecutionResultImpl)((KnowledgeCommandContext) context).getExecutionResults()).getResults() .put( this.outIdentifier, knowledgePackages ); } return knowledgePackages; }
public WorkItemManager execute(Context context) { WorkItemManager workItemManager = ((KnowledgeCommandContext) context).getWorkItemManager(); ((ExecutionResultImpl)((KnowledgeCommandContext) context ).getExecutionResults()).getResults().put("workItemManager", getRemoteClient(workItemManager) ); return workItemManager; }
public Integer execute(Context context) { NodeData data = (NodeData) context.get( NodeData.NODE_DATA ); Integer sessionId = data.getSessionIdCounter().getAndIncrement(); if ( this.outIdentifier != null ) { ((ExecutionResultImpl)((KnowledgeCommandContext) context).getExecutionResults()).getResults().put( this.outIdentifier, sessionId ); } return sessionId; }
public KnowledgeBuilder execute(Context context) { KnowledgeBuilder kbuilder = null; if ( !StringUtils.isEmpty( kbaseId )) { attachedKnowledgeBase = ( KnowledgeBase ) context.get( kbaseId ); } if ( this.kbuilderConf == null ) { kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder( this.attachedKnowledgeBase ); } else { kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder( this.attachedKnowledgeBase, this.kbuilderConf ); } if( context instanceof KnowledgeCommandContext ) { ((KnowledgeCommandContext) context).setKnowledgeBuilder(kbuilder); } if ( this.outIdentifier != null ) { ((ExecutionResultImpl)((KnowledgeCommandContext) context).getExecutionResults()).getResults().put( this.outIdentifier, kbuilder ); } return kbuilder; }
public FactHandle execute(Context context) { WorkingMemoryEntryPoint ep = ((KnowledgeCommandContext) context).getWorkingMemoryEntryPoint(); FactHandle factHandle = ep.insert(object); DefaultFactHandle disconnectedHandle = ((DefaultFactHandle) factHandle).clone(); disconnectedHandle.disconnect(); if (outIdentifier != null) { if (this.returnObject) { ((ExecutionResultImpl) ((KnowledgeCommandContext) context).getExecutionResults()).getResults().put(this.outIdentifier, object); } ((ExecutionResultImpl) ((KnowledgeCommandContext) context).getExecutionResults()).getFactHandles().put(this.outIdentifier, disconnectedHandle); } return disconnectedHandle; }
public StatefulKnowledgeSession execute(Context context) { KnowledgeBase kbase = ((KnowledgeCommandContext) context).getKnowledgeBase(); StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession( this.ksessionConf, environment ); return ksession; }
public WorkItemManager execute(Context context) { WorkItemManager workItemManager = ((KnowledgeCommandContext) context).getWorkItemManager(); return workItemManager; }
public KnowledgeBuilder execute(Context context) { KnowledgeBuilder kbuilder = null; KnowledgeBuilderConfiguration kconf = null; if(kbuilderConfId != null){ kconf = (KnowledgeBuilderConfiguration) context.getContextManager().getContext( World.ROOT ).get(kbuilderConfId); } if ( kconf == null ) { kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); } else { kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder( kconf ); } if( context instanceof KnowledgeCommandContext ) { ((KnowledgeCommandContext) context).setKnowledgeBuilder(kbuilder); } return kbuilder; }
SimulationNodeInstance.class)); KieSession session = ((KnowledgeCommandContext)context).getKieSession(); simContext.setClock((SessionPseudoClock) session.getSessionClock()); simContext.setCurrentPath(path);
public Boolean execute(Context context) { KnowledgeBuilder kbuilder = ((KnowledgeCommandContext) context).getKnowledgeBuilder(); boolean errors = kbuilder.hasErrors(); if ( this.outIdentifier != null ) { ((ExecutionResultImpl)((KnowledgeCommandContext) context).getExecutionResults()).getResults().put( this.outIdentifier, errors ); } return errors; }
public Integer execute(Context context) { NodeData data = (NodeData) context.get( NodeData.NODE_DATA ); Integer sessionId = data.getSessionIdCounter().getAndIncrement(); if ( this.outIdentifier != null ) { ((ExecutionResultImpl) ((KnowledgeCommandContext) context).getExecutionResults()).getResults().put( this.outIdentifier, sessionId ); } return sessionId; }
public KnowledgeAgent execute( Context context ) { KnowledgeBase kbase = ( (KnowledgeCommandContext) context ).getKnowledgeBase(); KnowledgeAgentConfiguration kaConfig = KnowledgeAgentFactory.newKnowledgeAgentConfiguration(); kaConfig.setProperty( NewInstanceOption.PROPERTY_NAME, "false" );
public Object execute(Context context) { StatefulKnowledgeSession ksession = ((KnowledgeCommandContext) context).getStatefulKnowledgesession(); if (processInstanceId == null) { return null; } ksession.abortProcessInstance(processInstanceId); return null; }
public ProcessInstance execute(Context context) { StatefulKnowledgeSession ksession = ((KnowledgeCommandContext) context).getStatefulKnowledgesession(); if (data != null) { for (Object o: data) { ksession.insert(o); } } ProcessInstance processInstance = (ProcessInstance) ksession.createProcessInstance(processId, parameters); if ( this.outIdentifier != null ) { ((ExecutionResultImpl) ((KnowledgeCommandContext) context).getExecutionResults()).getResults().put(this.outIdentifier, processInstance.getId()); } return processInstance; }
public KnowledgeBuilderErrors execute(Context context) { KnowledgeBuilder kbuilder = ((KnowledgeCommandContext) context).getKnowledgeBuilder(); KnowledgeBuilderErrors errors = kbuilder.getErrors(); if ( this.outIdentifier != null ) { ((ExecutionResultImpl)((KnowledgeCommandContext) context).getExecutionResults()).getResults().put( this.outIdentifier, errors ); } return errors; }
public String execute(Context context) { NodeData data = (NodeData) context.get( NodeData.NODE_DATA ); String instanceId = (String) data.getRoot().get( identifier ); if ( this.outIdentifier != null ) { ((ExecutionResultImpl) ((KnowledgeCommandContext) context).getExecutionResults()).getResults().put( this.outIdentifier, instanceId ); } return instanceId; }
public Collection<ProcessInstance> execute(Context context) { StatefulKnowledgeSession ksession = ((KnowledgeCommandContext) context).getStatefulKnowledgesession(); Collection<ProcessInstance> instances = ksession.getProcessInstances(); Collection<ProcessInstance> result = new ArrayList<ProcessInstance>(); for ( ProcessInstance instance : instances ) { result.add( instance ); } return result; }