Skip to main content

Hi,


Can someone please explain the why/what/how behind the "Upgrade design templates..." option you get when right-clicking on anything in the design canvas in VS2005 process designer?


What does it do? I discovered with shock and horror that all custom code is deleted when a design template is upgraded. I mean, I literally almost lost months and months of work if I didn’t check my code before saving.


I would have expected a huge red warning telling me that my code will be deleted, but there is only a warning about the upgrade process possibly taking a long time.


 

This option allows you to update the activity and event code to the latest version. 


Let's say you designed a process using SP1.  Later, you decide to upgrade to release 803.  When you open a process in Visual Studio after the upgrade, your processes are not upgraded--they are exactly the same SP1 events you had before.  This allows for consistency--the same events you had used and tested before will work exactly the same way they did previously.  When you add new events to the process, they will use the latest templates provided with 803.  If you want to upgrade your old templates to the newest ones, right-click and choose “Upgrade design templates”.  You will then see a dialog with a tree view of all the activities and events in your process.  You can either upgrade them all at once by checking the top-level box, or you can drill down into the tree and selectively choose the specific events you want to update.



When you update an event, the WF schedule &/or code that implements the event will be upgraded to the latest release.  If you have modified the default code, your changes will be replaced with the new template.


 


 


Yes, you have to be wary of this "feature" as it does wipe out all code customizations including server event templates.


 I have already logged an enhancement request to allow us to preserve the code changes while auto upgrading the templates (or at least I think that is how it should behave ideally).


 For the moment in 0803 (and the upcoming 0807), I guess only use this feature on items that don't have code customizations.


I found this out the hard way as well.  When I took the SP1 hot fix, I lost all the event's coding.  Our workaround is to copy/paste the code to a text file.  After we upgrade the templates, we copy/paste the code back into the event.  I reported this to the K2 support team but I haven't heard about any patches to fix this problem. 

FYI, should you ever lose any source code or project files due to any issue (this included), K2 keeps the entire VS process definition structure within the databases (it is put there as part of the deployment).  You can find it by:

1. Open Workspace

2. Goto Management Console

3. Expend tree view Server Name | Workflow Server| Processes

4. Select your desired project and process name

5. Select Versions

6. Click 'Download' for the desired (most likely the most recent) version

 

See attached screen shot.


15183iAA9A59763D049A4D.jpg

Excellent point Bob,


I sometimes forget about these new gems in BP.


It's already been logged to be changed but it will probably come post 0807 as 0807 is in it's final QA stages (code freeze).

I just wanted to update this thread...

blackpearl 807 released today.  The Upgrade Design Templates functionality changed slightly from what was described above.  With 807, Server Event code will not be touched by any execution of the "Upgrade Design Template" component.  Thus if the only code that is written within a process definition resides within server events then there should be no concern about upgrading the entire process definition.

 

 


Nice.... :)


Reply