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);
}