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 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 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 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 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 WorkItemManager execute(Context context) { WorkItemManager workItemManager = ((KnowledgeCommandContext) context).getWorkItemManager(); ((ExecutionResultImpl)((KnowledgeCommandContext) context ).getExecutionResults()).getResults().put("workItemManager", getRemoteClient(workItemManager) ); return workItemManager; }
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 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 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 String execute(Context context) { NodeData data = (NodeData) context.get( NodeData.NODE_DATA ); String instanceId = (String) data.getRoot().get( this.identifier ); if ( this.outIdentifier != null ) { ((ExecutionResultImpl) ((KnowledgeCommandContext) context).getExecutionResults()).getResults().put( this.outIdentifier, instanceId ); } return instanceId; }
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 ProcessInstance 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); if ( this.outIdentifier != null ) { ((ExecutionResultImpl) ((KnowledgeCommandContext) context).getExecutionResults()).getResults().put(this.outIdentifier, processInstance.getId()); } return processInstance; }
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; }
((ExecutionResultImpl)((KnowledgeCommandContext) context ).getExecutionResults()).getResults().put( this.outIdentifier, kresults );
public <T> T execute(Context context, Command<T> command) { ExecutionResultImpl results = null; if ( context != null ) { results = (ExecutionResultImpl) ((KnowledgeCommandContext) context).getExecutionResults(); } if ( results == null ) { results = new ExecutionResultImpl(); } if ( !(command instanceof BatchExecutionCommandImpl) ) { return (T) ((GenericCommand) command).execute( new FixedKnowledgeCommandContext( context, null, this.kbase, this, results ) ); } try { session.startBatchExecution( results ); ((GenericCommand) command).execute( new FixedKnowledgeCommandContext( context, null, this.kbase, this, results ) ); ExecutionResults result = session.getExecutionResult(); return (T) result; } finally { session.endBatchExecution(); } }