locked
Windows Workflow Foudation - GetWorkflow

    Question

  • How do I load a instance of workflow persisted on database, I tried the following 

     

     private List<WorkflowInstance> m_ListaInstancias;
        public void ObterWorkflowsBD()
        {
    
          foreach (SqlPersistenceWorkflowInstanceDescription inst in m_persistenceService.GetAllWorkflows())
          {
            Console.WriteLine("id: " + inst.WorkflowInstanceId.ToString() + " status: " + inst.Status.ToString());
            
            
    
            
               WorkflowInstance intancia_bd = workflowRuntime.GetWorkflow(inst.WorkflowInstanceId);
            m_ListaInstancias.Add(intancia_bd);
          
          }
        
    
        }
    
    
        public void ContinuarWorkflow(Guid Guid)
        {
          foreach (WorkflowInstance item in m_ListaInstancias)
          {
            if (item.InstanceId == Guid)
            {
              item.Resume();
            }
          }
          
        }
    

    when debbuging the program stays blocked in this line             WorkflowInstance intancia_bd = workflowRuntime.GetWorkflow(inst.WorkflowInstanceId);

     

    Can someone help me?

     

    Best Regards

    Paulo RB 

    ASP NET Developer

    Wednesday, October 6, 2010 2:31 AM

Answers

  • Hi, Paulo

    The error message is not English and the code is uncomplete. I am not sure what is going wrong in your program.
    basiclly, if you want to resume a workflow instance from database.
        1. Add a persistence service to the WorkflowRuntime. 
        2. There are indeed workflow instances persisted in the database.
        3. use the Workflow Instance ID to resume the workflow.
    The document:
    http://msdn.microsoft.com/en-us/library/aa349366(VS.90).aspx
    And samples
    http://msdn.microsoft.com/en-us/library/ms741723(VS.90).aspx
    Could be helpful.

    Regards


    This posting is provided "AS IS" with no warranties, and confers no rights. Microsoft Online Community Support. My Blog:http://xhinker.com "Microsoft Windows Workflow Foundation 4.0 Cookbook"
    Monday, October 11, 2010 9:14 AM
    Moderator

All replies

  • How do I load a instance of workflow persisted on database, I tried the following 

     

     

     

     private List<WorkflowInstance> m_ListaInstancias;
      public void ObterWorkflowsBD()
      {
    
       foreach (SqlPersistenceWorkflowInstanceDescription inst in m_persistenceService.GetAllWorkflows())
       {
        Console.WriteLine("id: " + inst.WorkflowInstanceId.ToString() + " status: " + inst.Status.ToString());
        
        
    
        
          WorkflowInstance intancia_bd = workflowRuntime.GetWorkflow(inst.WorkflowInstanceId);
        m_ListaInstancias.Add(intancia_bd);
       
       }
      
    
      }
    
    
      public void ContinuarWorkflow(Guid Guid)
      {
       foreach (WorkflowInstance item in m_ListaInstancias)
       {
        if (item.InstanceId == Guid)
        {
         item.Resume();
        }
       }
       
      }
    

     

    when debbuging the program stays blocked in this line             WorkflowInstance intancia_bd = workflowRuntime.GetWorkflow(inst.WorkflowInstanceId);

     

     

    Can someone help me?

     

    Best Regards

    Paulo RB 

    ASP NET Developer

     

    Then 3 minutes later it appears an exception 

    Não foi possível carregar arquivo ou assembly 'WorkflowConsoleApplication_teste1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' ou uma de suas dependências. O sistema não pode encontrar o arquivo especificado.

     

    What error is this one here?

    Paulo RB

    Wednesday, October 6, 2010 2:36 AM
  • Hi, Paulo

    The error message is not English and the code is uncomplete. I am not sure what is going wrong in your program.
    basiclly, if you want to resume a workflow instance from database.
        1. Add a persistence service to the WorkflowRuntime. 
        2. There are indeed workflow instances persisted in the database.
        3. use the Workflow Instance ID to resume the workflow.
    The document:
    http://msdn.microsoft.com/en-us/library/aa349366(VS.90).aspx
    And samples
    http://msdn.microsoft.com/en-us/library/ms741723(VS.90).aspx
    Could be helpful.

    Regards


    This posting is provided "AS IS" with no warranties, and confers no rights. Microsoft Online Community Support. My Blog:http://xhinker.com "Microsoft Windows Workflow Foundation 4.0 Cookbook"
    Monday, October 11, 2010 9:14 AM
    Moderator