Package org.drools.core.process.instance

Examples of org.drools.core.process.instance.WorkItem


            workItemInfo = context.findWorkItemInfo( id );
        }
       
        // work item may have been aborted
        if (workItemInfo != null) {
            WorkItem workItem = (WorkItemImpl) internalGetWorkItem(workItemInfo);
            ProcessInstance processInstance = kruntime.getProcessInstance(workItem.getProcessInstanceId());
            workItem.setState(WorkItem.ABORTED);
            // process instance may have finished already
            if (processInstance != null) {
                processInstance.signalEvent("workItemAborted", workItem);
            }
            context.remove(workItemInfo);
            if (workItems != null) {
                workItems.remove(workItem.getId());
            }
        }
    }
View Full Code Here


    }

    private WorkItem internalGetWorkItem(WorkItemInfo workItemInfo) {
        Environment env = kruntime.getEnvironment();
        InternalRuleBase ruleBase = (InternalRuleBase) ((KnowledgeBaseImpl) kruntime.getKieBase()).getRuleBase();
        WorkItem workItem = workItemInfo.getWorkItem(env, ruleBase);
        return workItem;
    }
View Full Code Here

    }

    @Override
    public Response getWorkItem(Long workItemId) {
        String oper = getRelativePath();
        WorkItem workItem = (WorkItem) processRequestBean.doKieSessionOperation(
                new GetWorkItemCommand(workItemId),
                deploymentId,
                (Long) getNumberParam(PROC_INST_ID_PARAM_NAME, false, getRequestParams(), oper, true));
              
        if( workItem == null ) {
View Full Code Here

      return this.workItemHandlers.get(name);
    }
   
    @Override
    public void retryWorkItem(long workItemId) {
      WorkItem workItem = getWorkItem(workItemId);
      if (workItem != null) {
            WorkItemHandler handler = (WorkItemHandler) this.workItemHandlers.get(workItem.getName());
            if (handler != null) {
                handler.executeWorkItem(workItem, this);
            } else {
                throwWorkItemNotFoundException( workItem );
            }
View Full Code Here

       
        WorkItemInfo workItemInfo = context.findWorkItemInfo( id );
       
        // work item may have been aborted
        if (workItemInfo != null) {
            WorkItem workItem = internalGetWorkItem(workItemInfo);
            workItem.setResults(results);
            ProcessInstance processInstance = kruntime.getProcessInstance(workItem.getProcessInstanceId());
            workItem.setState(WorkItem.COMPLETED);
            // process instance may have finished already
            if (processInstance != null) {
                processInstance.signalEvent("workItemCompleted", workItem);
            }
            context.remove(workItemInfo);
View Full Code Here

        WorkItemInfo workItemInfo = context.findWorkItemInfo( id );
       
        // work item may have been aborted
        if (workItemInfo != null) {
            WorkItem workItem = (WorkItemImpl) internalGetWorkItem(workItemInfo);
            ProcessInstance processInstance = kruntime.getProcessInstance(workItem.getProcessInstanceId());
            workItem.setState(WorkItem.ABORTED);
            // process instance may have finished already
            if (processInstance != null) {
                processInstance.signalEvent("workItemAborted", workItem);
            }
            context.remove(workItemInfo);
View Full Code Here

    }

    private WorkItem internalGetWorkItem(WorkItemInfo workItemInfo) {
        Environment env = kruntime.getEnvironment();
        InternalKnowledgeBase ruleBase = (InternalKnowledgeBase) kruntime.getKieBase();
        WorkItem workItem = workItemInfo.getWorkItem(env, ruleBase);
        ((WorkItemImpl) workItem).setId(workItemInfo.getId());
        return workItem;
    }
View Full Code Here

    public WorkItemHandler getWorkItemHandler(String name) {
      return this.workItemHandlers.get(name);
    }
   
    public void retryWorkItem(long workItemId) {
      WorkItem workItem = getWorkItem(workItemId);
      if (workItem != null) {
            WorkItemHandler handler = (WorkItemHandler) this.workItemHandlers.get(workItem.getName());
            if (handler != null) {
                handler.executeWorkItem(workItem, this);
            } else {
                throwWorkItemNotFoundException( workItem );
            }
View Full Code Here

            workItemInfo = context.findWorkItemInfo( id );
        }
       
        // work item may have been aborted
        if (workItemInfo != null) {
            WorkItem workItem = internalGetWorkItem(workItemInfo);
            workItem.setResults(results);
            ProcessInstance processInstance = kruntime.getProcessInstance(workItem.getProcessInstanceId());
            workItem.setState(WorkItem.COMPLETED);
            // process instance may have finished already
            if (processInstance != null) {
                processInstance.signalEvent("workItemCompleted", workItem);
            }
            context.remove(workItemInfo);
            if (workItems != null) {
                this.workItems.remove(workItem.getId());
            }
        }
    }
View Full Code Here

            workItemInfo = context.findWorkItemInfo( id );
        }
       
        // work item may have been aborted
        if (workItemInfo != null) {
            WorkItem workItem = (WorkItemImpl) internalGetWorkItem(workItemInfo);
            ProcessInstance processInstance = kruntime.getProcessInstance(workItem.getProcessInstanceId());
            workItem.setState(WorkItem.ABORTED);
            // process instance may have finished already
            if (processInstance != null) {
                processInstance.signalEvent("workItemAborted", workItem);
            }
            context.remove(workItemInfo);
            if (workItems != null) {
                workItems.remove(workItem.getId());
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.drools.core.process.instance.WorkItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.