Package org.drools.gorm.session

Examples of org.drools.gorm.session.WorkItemInfo


  }

    @Override
    public void internalExecuteWorkItem(WorkItem workItem) {

        WorkItemInfo workItemInfo = GrailsIntegration.getGormDomainService().getNewWorkItemInfo(
                workItem,
                kruntime.getEnvironment());
        GrailsIntegration.getGormDomainService().saveDomain(workItemInfo);
        Long workItemId = workItemInfo.getId(); // XXX {bauna}(Long) ((GroovyObject) workItemInfo).invokeMethod("getId", null);
        ((WorkItemImpl) workItem).setId(workItemId);
        workItemInfo.generateBlob();
        WorkItemHandler handler = this.workItemHandlers.get(workItem.getName());
        if (handler != null) {
            handler.executeWorkItem(workItem, this);
        } else {
            throw new WorkItemHandlerNotFoundException("Could not find work item handler for "
View Full Code Here


  public void internalAddWorkItem(WorkItem workItem) {
  }

  @Override
  public void internalAbortWorkItem(long id) {
      WorkItemInfo workItemInfo = GrailsIntegration
          .getGormDomainService().getWorkItemInfo(id);
        // work item may have been aborted
        if (workItemInfo != null) {
            WorkItem workItem = workItemInfo.getWorkItem(this.kruntime.getEnvironment());
            WorkItemHandler handler = workItemHandlers.get(workItem.getName());
            if (handler != null) {
                handler.abortWorkItem(workItem, this);
            } else {
                if ( workItems != null ) {
View Full Code Here

    return wis;
  }

  @Override
  public WorkItem getWorkItem(long id) {
    WorkItemInfo workItemInfo = workItems.get(id);
    WorkItem workItem = null;
    if (workItemInfo == null) {
      workItemInfo = GrailsIntegration
          .getGormDomainService().getWorkItemInfo(id);
      if (workItemInfo != null) {
        workItem = workItemInfo.getWorkItem(kruntime.getEnvironment());
        workItems.put(workItemInfo.getId(), workItemInfo);
        this.internalAddWorkItem(workItem);
      }
    } else {
        workItem = workItemInfo.getWorkItem(kruntime.getEnvironment());
    }

    return workItem;
  }
View Full Code Here

  @Override
  public void completeWorkItem(long id, Map<String, Object> results) {
        Environment env = this.kruntime.getEnvironment();
       
        WorkItemInfo workItemInfo = null;
            workItemInfo = this.workItems.get(id);
            if (workItemInfo != null) {
                workItemInfo = (WorkItemInfo) GrailsIntegration.getGormDomainService()
                    .mergeDomain(workItemInfo);
            }
       
        if (workItemInfo == null) {
            workItemInfo = GrailsIntegration.getGormDomainService()
                .getWorkItemInfo(id);
        }
       
        // work item may have been aborted
        if (workItemInfo != null) {
            WorkItem workItem = (WorkItemImpl) workItemInfo.getWorkItem(env);
            workItem.setResults(results);
            ProcessInstance processInstance =
                kruntime.getProcessInstance(workItem.getProcessInstanceId());
            workItem.setState(WorkItem.COMPLETED);
            // process instance may have finished already
View Full Code Here

 
  @Override
  public void abortWorkItem(long id) {
      Environment env = this.kruntime.getEnvironment();
       
        WorkItemInfo workItemInfo =  this.workItems.get(id);
        if (workItemInfo != null) {
            GrailsIntegration.getGormDomainService().mergeDomain(workItemInfo);
        }
       
        if (workItemInfo == null) {
            workItemInfo = GrailsIntegration.getGormDomainService().getWorkItemInfo(id);
        }
       
        // work item may have been aborted
        if (workItemInfo != null) {
            WorkItem workItem = (WorkItemImpl) workItemInfo.getWorkItem(env);
            ProcessInstance processInstance = kruntime.getProcessInstance(workItem.getProcessInstanceId());
            workItem.setState(WorkItem.ABORTED);
            // process instance may have finished already
            if (processInstance != null) {
                processInstance.signalEvent("workItemAborted", workItem);
View Full Code Here

TOP

Related Classes of org.drools.gorm.session.WorkItemInfo

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.