Skip to main content

Hi All,


I need to start K2 Workflow manually from the code. I am using code below and my code actually starts K2 workflow but workflow instance immediately fails with the error. The error is "DefaultLine - String was not recognized as a valid Boolean. " Looks like workflow fails on first line rule. My workflow is tested and works fine if it is started automatically from Item Updated. What is wrong with my code?


 SPWorkflow wf = null;


SPList parentList = afeafd.Project.Item.ParentList;


SPWorkflowAssociationCollection associationCollection = parentList.ContentTypesTContentTypeName].WorkflowAssociations;


foreach (SPWorkflowAssociation association in associationCollection)


{


    wf = SPContext.Current.Site.WorkflowManager.StartWorkflow(afeafd.Project.Item, association, association.AssociationData);


}

Is Business rule added to the Default Line rule?  Or simply delete the line rule and recreate it.

Thanks,


I dont think the code is wrong. I am sure you get the same error if you start the workflow from workspace


change the data type of the data field that was used in the line rule to Boolean.


Reply