IWFWorkflowService svc = GetWorkflowService();
string xml = …// Process definition XML as string
if( set release date )
{
WFProcessDefinition pd = new WFProcessDefinition();
GraphicImage g = new GraphicImage();
ProcDefXmlParser parser = new ProcDefXmlParser(new
WFDefaultActivityInstantiator(), pd, g);
parser.Parse(xml);
pd.ReleaseDate = DateTime.Now; //Set release date
ProcDefXmlWriter w = new ProcDefXmlWriter(pd, g);
xml = w.WriteTostring();
string procDefID = svc.CreateProcDef(xml);
}
else // not to release process template
{
string procDefID = svc.CreateProcDef(xml);
}