1. spworkflowmodification contextdata is xmlserialized as string.
2. Get spworkflowmodification contextdata in modification page
Protected void getcontexdata ()
{
Spweb currentweb = spcontext. Current. Web;
String strworkflowinstanceid = convert. tostring (request ["workflowinstanceid"]);
String strmodificationid = convert. tostring (request ["modificationid"]);
String strlistid = convert. tostring (request ["list"]);
Spworkflow currentworkflow = new spworkflow (currentweb, new GUID (strworkflowinstanceid ));
If (currentworkflow! = NULL)
{
Spworkflowmodification currentmodification = currentworkflow. Modifications [New GUID (strmodificationid)];
Txt_context.text = currentmodification. contextdata;
}
}
3. Update spworkflowmodification contextdata in modification page
Spweb currentweb = spcontext. Current. Web;
String strworkflowinstanceid = convert. tostring (request ["workflowinstanceid"]);
String strmodificationid = convert. tostring (request ["modificationid"]);
String strlistid = convert. tostring (request ["list"]);
Spworkflow currentworkflow = new spworkflow (currentweb, new GUID (strworkflowinstanceid ));
If (currentworkflow! = NULL)
{
Currentweb. allowunsafeupdates = true;
Spworkflowmodification currentmodification = currentworkflow. Modifications [New GUID (strmodificationid)];
Currentweb. Site. workflowmanager. modifyworkflow (currentworkflow, currentmodification, "111; 222; 333; 444; 555; 666; 777 ;");
Sputility. Redirect ("wrkstat. aspx", spredirectflags. usesource, context );
Currentweb. allowunsafeupdates = false;
}
Else
{
// Sputility. Redirect ("wrkstat. aspx", spredirectflags. usesource, context );
}
4. Get spworkflowmodification contextdata in Workflow
Workflowproperties. workflow. Modifications [spworkflowmodificationid]