Package org.infoglue.cms.entities.mydesktop

Examples of org.infoglue.cms.entities.mydesktop.WorkflowVO


      initializePrincipal(principalName, workflowName);
      initializeInputs((Map) serializer.deserialize(inputsArray), languageId);
     
      logger.debug("start(" + principalName + "," + workflowName + "," + languageId + "," + inputs + ")");
     
      final WorkflowVO workflowVO = WorkflowController.getController().initializeWorkflow(principal, workflowName, 0, inputs);
      if(hasTerminated(workflowVO))
      {
        logger.debug("The workflow has terminated.");
        return Boolean.FALSE;
      }
View Full Code Here


      final DynamicWebserviceSerializer serializer = new DynamicWebserviceSerializer();
      initializeInputs((Map) serializer.deserialize(inputsArray), languageId);
     
      logger.debug("start(" + principalName + "," + workflowId + "," + actionId + "," + languageId + "," + inputs + ")");
     
      final WorkflowVO workflowVO = WorkflowController.getController().invokeAction(principal, workflowId.longValue(), actionId.intValue(), inputs);
      if(hasTerminated(workflowVO))
      {
        logger.debug("The workflow has terminated.");
        return Boolean.FALSE;
      }
View Full Code Here

   * @return a WorkflowVO representing the newly created workflow instance
   * @throws SystemException if an error occurs while initiaizing the workflow
   */
  public WorkflowVO initializeWorkflow(InfoGluePrincipal principal, String name, int actionId, Map inputs) throws SystemException
  {
    WorkflowVO workflowVO = null;
   
    try
    {
      Session session = null;
      net.sf.hibernate.Transaction tx = null;
View Full Code Here

    return workflowVO;
  }

  public WorkflowVO getWorkflow(String workflowName, InfoGluePrincipal principal) throws SystemException, Exception
  {
    WorkflowVO workflow = null;
   
    List<WorkflowVO> workflows = getAvailableWorkflowVOList(principal);
    Iterator<WorkflowVO> workflowsIterator = workflows.iterator();
    while(workflowsIterator.hasNext())
    {
      WorkflowVO workflowVO = workflowsIterator.next();
     
      String fromEncoding = CmsPropertyHandler.getAssetKeyFromEncoding();
      if(fromEncoding == null)
        fromEncoding = "iso-8859-1";
     
      String toEncoding = CmsPropertyHandler.getAssetKeyToEncoding();
      if(toEncoding == null)
        toEncoding = "utf-8";
       
      String encodedName = new String(workflowName.getBytes(fromEncoding), toEncoding);
      logger.info("" + workflowVO.getName() + "=" + workflowName + "/" + encodedName);
     
      if(workflowVO.getName().equals(workflowName) || workflowVO.getName().equals(encodedName))
      {
        workflow = workflowVO;
        break;
      }
    }
View Full Code Here

    return workflow;
  }
 
  public WorkflowVO getCurrentWorkflow(Long workflowId, InfoGluePrincipal principal) throws SystemException
  {
    WorkflowVO workflow = null;
   
    List<WorkflowVO> workflows = getCurrentWorkflowVOList(principal, null);
    logger.info("workflows:" + workflows);
    if(workflows != null)
    {
      Iterator<WorkflowVO> workflowsIterator = workflows.iterator();
      while(workflowsIterator.hasNext())
      {
        WorkflowVO workflowVO = workflowsIterator.next();
        if(workflowVO.getWorkflowId().longValue() == workflowId.longValue())
        {
          workflow = workflowVO;
          break;
        }
      }
View Full Code Here

      WorkflowFacade wf = new WorkflowFacade(userPrincipal, hibernateSessionFactory, session);
      final List<WorkflowVO> allWorkflows = wf.getDeclaredWorkflows();
     
      for(final Iterator<WorkflowVO> i = allWorkflows.iterator(); i.hasNext(); )
      {
        final WorkflowVO workflowVO = i.next();
        if(getIsAccessApproved(workflowVO.getName(), userPrincipal))
        {
          accessibleWorkflows.add(workflowVO);
        }
      }
     
View Full Code Here

   * @return a WorkflowVO representing the current state of the workflow identified by workflowId
   * @throws WorkflowException if a workflow error occurs
   */
  public WorkflowVO invokeAction(InfoGluePrincipal principal, long workflowId, int actionId, Map inputs) throws WorkflowException
  {
    WorkflowVO workflowVO = null;

    Session session = null;
    net.sf.hibernate.Transaction tx = null;

    try
View Full Code Here

    assertEquals("Wrong number of available workflows:", 2, action.getAvailableWorkflowVOList().size());
  }

  public void testExecute2ActiveWorkflows() throws Exception
  {
    WorkflowVO workflow1 = controller.initializeWorkflow(getAdminPrincipal(), "Create News", 0, WorkflowController.createWorkflowParameters(request));
    WorkflowVO workflow2 = controller.initializeWorkflow(getAdminPrincipal(), "Create User", 0, WorkflowController.createWorkflowParameters(request));

    try
    {
      assertSuccess(action.doExecute());
      assertEquals("Wrong number of available workflows:", 2, action.getAvailableWorkflowVOList().size());
      assertTrue("There should be at least 2 current workflows", action.getWorkflowVOList().size() >= 2);

      List availableActions = action.getWorkflowActionVOList();
      assertTrue("There should be at least 2 current actions", availableActions.size() >= 2);
      assertContains(availableActions, createCreateNews(workflow1.getWorkflowId()));
      assertContains(availableActions, createRegisterUser(workflow2.getWorkflowId()));
    }
    finally
    {
      finishWorkflow(workflow1.getIdAsPrimitive());
      finishWorkflow(workflow2.getIdAsPrimitive());
    }
  }
View Full Code Here

   */
  protected WorkflowVO findWorkflow(List workflows)
  {
    for (Iterator i = workflows.iterator(); i.hasNext();)
    {
      WorkflowVO wf = (WorkflowVO)i.next();
      if (getWorkflowId() == wf.getWorkflowId().longValue())
        return wf;
    }

    return null;
  }
View Full Code Here

   */
  protected WorkflowVO findWorkflowByName(List workflows)
  {
    for (Iterator i = workflows.iterator(); i.hasNext();)
    {
      WorkflowVO wf = (WorkflowVO)i.next();
      if (getWorkflowName().equals(wf.getName()))
        return wf;
    }

    return null;
  }
View Full Code Here

TOP

Related Classes of org.infoglue.cms.entities.mydesktop.WorkflowVO

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.