Package it.eng.spagobi.engines.commonj.runtime

Examples of it.eng.spagobi.engines.commonj.runtime.CommonjWorkContainer


      ProcessesStatusContainer processesStatusContainer = ProcessesStatusContainer.getInstance();
      Object o=processesStatusContainer.getPidContainerMap().get(pid);

      // if process still in session stop the process and delete the attribute, otherwise it could have been finished
      if(o!=null){
        CommonjWorkContainer container=(CommonjWorkContainer)o;
        FooRemoteWorkItem fooRwi=container.getFooRemoteWorkItem();
        // release the resource
        fooRwi.release();
        // Use it to give time to set the status
        Thread.sleep(1000);
        statusWI=container.getWorkItem().getStatus();
        //session.removeAttribute("SBI_PROCESS_"+document_id);
        processesStatusContainer.getPidContainerMap().remove(pid);


      } // if no more in session is completed
View Full Code Here


      // Get the container object from session: it MUST be present if start button is enabled
      //Object o=session.getAttribute("SBI_PROCESS_"+document_id);
      ProcessesStatusContainer processesStatusContainer = ProcessesStatusContainer.getInstance();
      Object o=processesStatusContainer.getPidContainerMap().get(pId);
      CommonjWorkContainer container=(CommonjWorkContainer)o;

      WorkManager wm=container.getWm();
      Work workToDo=container.getWork();
      CommonjWorkListener listener=container.getListener();
      FooRemoteWorkItem fooRemoteWorkItem=wm.buildFooRemoteWorkItem(workToDo, listener);

      int statusWI;

      // Check if work was accepted
      if(fooRemoteWorkItem.getStatus()==WorkEvent.WORK_ACCEPTED){
        container.setFooRemoteWorkItem(fooRemoteWorkItem);
        // run work!
        WorkItem workItem=(WorkItem)wm.runWithReturnWI(workToDo, listener);
        container.setWorkItem(workItem);
        statusWI=workItem.getStatus();
        // put new Object in singleton!!!

        processesStatusContainer.getPidContainerMap().put(pId, container);
        //session.setAttribute("SBI_PROCESS_"+document_id, container);
View Full Code Here

//      document_id="";
//      logger.error("could not retrieve document id");
//      throw new SpagoBIEngineServiceException(getActionName(), "could not find document id");
//    }

    CommonjWorkContainer container=null;
    ProcessesStatusContainer processesStatusContainer = ProcessesStatusContainer.getInstance();
    Object o=processesStatusContainer.getPidContainerMap().get(pid);
    //recover from session, if does not find means work is completed
    //Object o=session.getAttribute("SBI_PROCESS_"+document_id);
    try{
      int statusWI;

      if(o!=null){      // object found in session, work could be not started, running or completed

        container=(CommonjWorkContainer)o;
        FooRemoteWorkItem fooRwi=container.getFooRemoteWorkItem();
        WorkItem wi=container.getWorkItem();

        // if WorkItem is not set means work has never been started
        if(fooRwi!=null && wi!=null){
          statusWI=wi.getStatus();
          // if finds that work is finished delete the attribute from session
View Full Code Here

TOP

Related Classes of it.eng.spagobi.engines.commonj.runtime.CommonjWorkContainer

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.