Package org.apache.oodt.cas.workflow.structs

Examples of org.apache.oodt.cas.workflow.structs.WorkflowInstancePage


         throws CmdLineActionException {
      Validate.isTrue(pageNum != -1);

      try {
         XmlRpcWorkflowManagerClient client = getClient();
         WorkflowInstancePage page = null;
         if (status != null && !status.equals("")) {
            page = client.paginateWorkflowInstances(pageNum - 1, status);
         } else {
            page = client.paginateWorkflowInstances(pageNum - 1);
         }

         printer.println("Page: [num=" + page.getPageNum() + ","
               + "pageSize=" + page.getPageSize() + ",totalPages="
               + page.getTotalPages() + "]");
         if (page.getPageWorkflows() == null) {
            throw new Exception(
                  "WorkflowManager returned null page of workflows");
         }
         for (WorkflowInstance inst : (List<WorkflowInstance>) page
               .getPageWorkflows()) {
            printer.println("Instance: [id=" + inst.getId() + ", status="
                  + inst.getStatus() + ", currentTask="
                  + inst.getCurrentTaskId() + ", workflow="
                  + inst.getWorkflow().getName() + ",wallClockTime="
View Full Code Here


   @Override
   public void execute(ActionMessagePrinter printer)
         throws CmdLineActionException {
      try {
         XmlRpcWorkflowManagerClient client = getClient();
         WorkflowInstancePage page = null;
         if (status != null && !status.equals("")) {
            WorkflowInstancePage firstPage = client.paginateWorkflowInstances(
                  1, status);
            page = client.paginateWorkflowInstances(firstPage.getTotalPages(),
                  status);
         } else {
            page = client.getLastPage();
         }
View Full Code Here

      final Class<? extends WebPage> workflowTaskViewer,
      final Class<? extends WebPage> workflowInstViewer) {
    super(id);
    this.wm = new WorkflowMgrConn(workflowUrlStr);
    this.pageNum = pageNum;
    WorkflowInstancePage page = null;
    System.out.println("STATUS IS "+status);
    if (status.equals("ALL")) {
      page = this.wm.safeGetWorkflowInstPageByStatus(pageNum);
    } else {
      page = this.wm.safeGetWorkflowInstPageByStatus(pageNum, status);
    }

    this.computeStartEndIdx(page);
    add(new ListView<String>("workflow_statuses", new ListModel<String>(
        wStatuses)) {
      /*
       * (non-Javadoc)
       *
       * @see
       * org.apache.wicket.markup.html.list.ListView#populateItem(org.apache
       * .wicket.markup.html.list.ListItem)
       */
      @Override
      protected void populateItem(ListItem<String> item) {
        Link<String> wStatusLink = new Link<String>("wstatus_link", new Model(
            item.getModelObject())) {
          /*
           * (non-Javadoc)
           *
           * @see org.apache.wicket.markup.html.link.Link#onClick()
           */
          @Override
          public void onClick() {
            PageParameters params = new PageParameters();
            params.add("status", getModelObject());
            setResponsePage(getPage().getClass(), params);

          }
        };

        Label wStatusLabel = new Label("wstatus", item.getModelObject());
        if (item.getModelObject().equals(status)) {
          wStatusLabel.add(new SimpleAttributeModifier("class", "selected"));
        }
        wStatusLink.add(wStatusLabel);
        item.add(wStatusLink);
      }
    });

    add(new Label("start_idx", String.valueOf(this.startIdx)));
    add(new Label("end_idx", String.valueOf(this.endIdx)));
    add(new Label("num_insts", String.valueOf(this.totalWorkflowInsts)));

    add(new ListView<WorkflowInstance>("workflow_insts",
        new ListModel<WorkflowInstance>(page.getPageWorkflows())) {
      /*
       * (non-Javadoc)
       *
       * @see
       * org.apache.wicket.markup.html.list.ListView#populateItem(org.apache
 
View Full Code Here

    } else {
      this.totalWorkflowInsts = (page.getTotalPages() - 1) * PAGE_SIZE;
      this.pageNum = page.getPageNum();

      // get the last page
      WorkflowInstancePage lastPage = null;
      lastPage = wm.safeGetWorkflowInstPageByStatus(page.getTotalPages());
      this.totalWorkflowInsts += lastPage.getPageWorkflows().size();

    }
    this.endIdx = this.totalWorkflowInsts != 0 ? Math.min(
        this.totalWorkflowInsts, (PAGE_SIZE) * (this.pageNum)) : 0;
    this.startIdx = this.totalWorkflowInsts != 0 ? ((this.pageNum - 1) * PAGE_SIZE) + 1
View Full Code Here

        }

    }

    public Hashtable getFirstPage() {
        WorkflowInstancePage page = engine.getInstanceRepository()
                .getFirstPage();
        if (page != null) {
            populateWorkflows(page.getPageWorkflows());
            return XmlRpcStructFactory.getXmlRpcWorkflowInstancePage(page);
        } else
            return XmlRpcStructFactory
                    .getXmlRpcWorkflowInstancePage(WorkflowInstancePage
                            .blankPage());
View Full Code Here

    }

    public Hashtable getNextPage(Hashtable currentPage) {
        // first unpack current page
        WorkflowInstancePage currPage = XmlRpcStructFactory
                .getWorkflowInstancePageFromXmlRpc(currentPage);
        WorkflowInstancePage page = engine.getInstanceRepository().getNextPage(
                currPage);
        if (page != null) {
            populateWorkflows(page.getPageWorkflows());
            return XmlRpcStructFactory.getXmlRpcWorkflowInstancePage(page);
        } else
            return XmlRpcStructFactory
                    .getXmlRpcWorkflowInstancePage(WorkflowInstancePage
                            .blankPage());
View Full Code Here

                            .blankPage());
    }

    public Hashtable getPrevPage(Hashtable currentPage) {
        // first unpack current page
        WorkflowInstancePage currPage = XmlRpcStructFactory
                .getWorkflowInstancePageFromXmlRpc(currentPage);
        WorkflowInstancePage page = engine.getInstanceRepository().getPrevPage(
                currPage);
        if (page != null) {
            populateWorkflows(page.getPageWorkflows());
            return XmlRpcStructFactory.getXmlRpcWorkflowInstancePage(page);
        } else
            return XmlRpcStructFactory
                    .getXmlRpcWorkflowInstancePage(WorkflowInstancePage
                            .blankPage());
View Full Code Here

                    .getXmlRpcWorkflowInstancePage(WorkflowInstancePage
                            .blankPage());
    }

    public Hashtable getLastPage() {
        WorkflowInstancePage page = engine.getInstanceRepository()
                .getLastPage();
        if (page != null) {
            populateWorkflows(page.getPageWorkflows());
            return XmlRpcStructFactory.getXmlRpcWorkflowInstancePage(page);
        } else
            return XmlRpcStructFactory
                    .getXmlRpcWorkflowInstancePage(WorkflowInstancePage
                            .blankPage());
View Full Code Here

                            .blankPage());
    }

    public Hashtable paginateWorkflowInstances(int pageNum, String status)
            throws InstanceRepositoryException {
        WorkflowInstancePage page = engine.getInstanceRepository()
                .getPagedWorkflows(pageNum, status);
        if (page != null) {
            populateWorkflows(page.getPageWorkflows());
            return XmlRpcStructFactory.getXmlRpcWorkflowInstancePage(page);
        } else
            return XmlRpcStructFactory
                    .getXmlRpcWorkflowInstancePage(WorkflowInstancePage
                            .blankPage());
View Full Code Here

    }

    public Hashtable paginateWorkflowInstances(int pageNum)
            throws InstanceRepositoryException {
        WorkflowInstancePage page = engine.getInstanceRepository()
                .getPagedWorkflows(pageNum);
        if (page != null) {
            populateWorkflows(page.getPageWorkflows());
            return XmlRpcStructFactory.getXmlRpcWorkflowInstancePage(page);
        } else
            return XmlRpcStructFactory
                    .getXmlRpcWorkflowInstancePage(WorkflowInstancePage
                            .blankPage());
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.workflow.structs.WorkflowInstancePage

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.