Sometimes it really kills you to setup a (technical) 3.5 workflow in FIM 2010. You get an error like: “FIM was unable to deserialize the xoml…”
Okay – what can I use that for?
So to generate (not write!) the xoml that actually will work; a simple trick can be used as seen below.
Create a console application with these simple lines of code, and you are having the needed xoml presented to you directly into a text-file. This code will generate a file (customWF.xoml) containing the working xoml that you can next paste into FIM 2010 to register the workflow.
static void Main(string[] args)
{
//instance of my workflow to go into FIM
var owb = new KMD.FimNativeWF.Contractor.StartContractorOWB();
//parent = special FIM SeqWF!
var seqWorkflow = new SequentialWorkflow();
seqWorkflow.Activities.Add(owb); //add owb as childworkflow
//generate xoml using the WorkflowMarkupSerializer
var settings = new XmlWriterSettings();
settings.OmitXmlDeclaration = true;
using (var xmlWriter = XmlWriter.Create("CustomWF.xoml", settings))
{
var ser = new WorkflowMarkupSerializer();
ser.Serialize(xmlWriter, seqWorkflow);
xmlWriter.Flush();
}
}
That’s what it takes ;-)
No comments:
Post a comment