0

실행중인 워크 플로 내에서 워크 플로를 시작하기위한 적절한 방법은 무엇입니까?상태 워크 플로 내에서 순차 워크 플로 시작

현재 Visual Studio 2010을 사용하고 있으며 워크 플로는 Sharepoint 2010입니다. 이전에는이 ​​워크 플로가 Sharepoint 2007에서 문제없이 작동했습니다. 패키지를 2010으로 마이그레이션 한 후 상태 워크 플로가 정상적으로 실행되지만 순차 워크 플로가 제대로 시작되지 않습니다. 순차가 수동으로 시작되면 정상적으로 실행됩니다.

다음은 상태 내에서 순차를 호출하는 데 사용하는 코드입니다.

// Starts CAB Implementation Workflow. 
SPWorkflowManager wfManager = this.workflowProperties.Site.WorkflowManager; 
     SPWorkflowAssociationCollection associationCol = this.workflowProperties.List.WorkflowAssociations; 
     foreach (SPWorkflowAssociation association in associationCol) 
     { 
      // Replace {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} with the Id of the workflow you want to invoke 
      if (association.BaseId.ToString("B").Equals("{af0775b9-8f10-468d-9201-792a4f539c03}")) 
      { 
       wfManager.StartWorkflow(this.workflowProperties.Item, association, "", true); 
       break; 
      } 
     } 
+0

글자가 아닌 guid를 더 잘 배웁니다. association.BaseId == new Guid ("{af0775b9-8f10-468d-9201-792a4f539c03}") –

답변

0

이 질문을 만들면서 해결책을 찾았습니다. 연관 데이터가 null 인 경우 MOSS 2007은 신경 쓰지 않는 것으로 보입니다. MOSS 2010은 null 데이터를 좋아하지 않으며 워크 플로를 시작하지만 곧 실패 할 것입니다. 해결책은 빈 xml 태그를 연결 데이터로 제공하는 것이 었습니다.

// Starts CAB Implementation Workflow. 
     SPWorkflowManager wfManager = this.workflowProperties.Site.WorkflowManager; 
     SPWorkflowAssociationCollection associationCol = this.workflowProperties.List.WorkflowAssociations; 
     foreach (SPWorkflowAssociation association in associationCol) 
     { 
      // Replace {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} with the Id of the workflow you want to invoke 
      if (association.BaseId.ToString("B").Equals("{af0775b9-8f10-468d-9201-792a4f539c03}")) 
      { 
       wfManager.StartWorkflow(this.workflowProperties.Item, association, "<root />", true); 
       break; 
      } 
     } 

이제 순차적 워크 플로가 문제없이 상태에서 성공적으로 시작됩니다.

관련 문제