In SP2013, I have a drop off library and destination library created using content organizer. I have a simple SPD 2010 workflow with associated site columns (some of them metadata and other oob site column like Email) that is associated with destination library.
I created a VS event receiver on Itemadded which triggers the workflow. When I manually start the workflow, I can see the values from the item in the history log. But when it is triggered using the event receiver, I dont see the values in the history log.
public override void ItemAdded(SPItemEventProperties properties)
{
base.ItemAdded(properties);
SPList parentList = properties.ListItem.ParentList;
SPWorkflowAssociation associationTemplate =
parentList.WorkflowAssociations.GetAssociationByName("DocumentExpirySPD", new CultureInfo(Convert.ToInt32(parentList.ParentWeb.RegionalSettings.LocaleId)));
SPSite siteCollection = properties.ListItem.ParentList.ParentWeb.Site;
siteCollection.WorkflowManager.StartWorkflow(properties.ListItem, associationTemplate, String.Empty);
}For eg: Workflow manually started displays below in history: E-mail: tesss@testtt.com (associated site column) City: NY|343a8f02-e64a-4da9-85a6-44834d433e4f (associated site metadata column) Title: Test
But workflow started using event receiver displays no values on associated site columns E-mail: City: Title: Test
Any idea why values are not returning on event receiver triggered workflow?
Thanks Venky