Skip to main content

Hi,


Someone please tell me how to migrate Datafield and XML field of already created Process(kprx) to another Process file.


Any tool is there to do this or to be created manually?


Best regards


Madhan


 


 

Are you saying that you want to migrate the existing running instance to a newer process version?


I believe this can be done in the Management APIs for 0807v450 and 4.5.


Neil wrote a neat tool around this.


http://www.k2underground.com/groups/process_version_migration_utility/default.aspx


 


Not sure if this helps.


I created a little VS Add-in that I use to create a new kprx files and selectively copy data fields from an existing process.  I'll post it to blackmarket one of these days.  I created it because I usually have a family of related processes that compose a solution and I want them to all have the exact same data fields.


Hi David,


I too have a same scenario- Sometime i will use already created process file of Datafield and XML field, now i am createing all manually for new process file if i want use the same strucuture.


Is it possible to provide me with this add-on and send me the BP link?


Best regards


Madhan


Hi madhann,


In the meantime you can use the authoring API and build a small tool that can do this.


Use the example provided in the K2 documentation under the Developer Reference > Processes > Authoring (http://help.k2.com/helppages/K2devref/Create_Process.html) to provide you with guidance.


Using the Authoring API you would even be able to create the activities and events if you need them as well.


A small code sample:


        public static void ConvertDataFields(SWD.DefaultProcess procOld, ref SWD.DefaultProcess procNew)
        {
            foreach (SWA.DataField dfOld in procOld.DataFields)
            {
                if (procNew.DataFields.Contains(dfOld.Name))
                    continue;
                SWA.DataField dfNew = new SWA.DataField();
                dfNew.Name = dfOld.Name;
                dfNew.Audit = dfOld.Audit;
                dfNew.Hidden = dfOld.Hidden;
                dfNew.MetaData = dfOld.MetaData;
                dfNew.Type = dfOld.Type;
                dfNew.OnDemand = dfOld.OnDemand;
                dfNew.Value = dfOld.Value;
                procNew.DataFields.Add(dfNew);
            }
        }


SWA = SourceCode.Workflow.Authoring


SWD = SourceCode.Workflow.Design


Regards,


Reply