Copying a *.kpr or Save as

  • 4 April 2005
  • 5 replies
  • 0 views

Badge +3
Is there some way to copy a *.kpr into the same solution on the same server? Or save the *.kpr as another filename? I'd like to be able to use a base .kpr and copy/test another version separately as a separate process.

Thanks!

5 replies

Badge +6
The following steps assume the K2 Solution Project already has a Process defined and saved (aka 'original/existing' process), which is to be copied. In the steps below, the original Process is named 'Vacation Request'.

1.0 Select the existing Process (i.e. 'Vacation Request') and rename it (i.e. 'Vacation Request-old').
(*K2 will not allow a duplicate Process to be created, so the original Processes name needs to be changed so the copy's name will not conflict with the existing process.)
2.0 Click on the K2 'Processes' folder under the proper K2 Solution & Project.
3.0 Right-mouse click and select 'Add Existing Process'.
4.0 Select the desired Process to be copied:
4.1 Navigate to the folder location containing the Process to be copied:
4.2 Select the desired folder (note: you can not change it's name within this screen).
4.3 Click on the OPEN button to create the new Process.
5.0 The duplicated process should have the original's former name ('Vacation Request').

You may also want to create Process sub-folders to organize the Processes.
Badge +6
Original resolution was not accurate. It only worked due to the Solution/Project not being saved prior to importing existing process back into same Solution/Project. When the Solution/Project is saved prior to import, the import fails with 'Process name already exists' error.

IMPORTANT: If using original (incorrect) resolution, both Processes (original and copy) will be pointing to the same KPR file - updates to one will overwrite the other ('code/design stomping').

Actual options for copying existing Process:
1) On the K2 design canvas, select all of the original process objects (Activities, Lines, etc) to be copied and select 'Copy'. Create a new Process and paste the copied objects into it (some lines may need to be manually added). This will create a seperate KPR file avoiding the 'stomping' problem.

2) Copy the existing KPR file of theoriginal Process to be duplicated and rename it. Select 'Add Existing Process' option and point to the copied file instead of the original KPR file. All functionality should remain intact.

Note: In both cases, the ASPX file and mappings (Solution, Project, and Process) to K2 will need to be updated to point to the new Process.

InfoPath form pointers to K2 may need to be updated as well.
Badge +3

Hi,


I have a similar query to the original one on this thread.


I have a K2 solution, with many processes, code modules, etc... I wish to make an exact copy of this for a test server. Obviously i know I will need to copy all the files aI mentioned before as well as the .ksn file. My question is, will I need to copy across the library .dll files (e.g. K2Mng.dll)? I know I can recreate my own dll files by just recompiling the solution in it's new location but i was unsure about these other ones...


 I also wish to use source control on the solution as we are trying to keep a track of changes made and have a backuo type store. Will I need to store these dll files I mentioned above in the source control area too?


 


TIA


Matt

Badge +3

In addition to the question I raised above, I would like to know whether when I copy the K2 solution to a new server I will need to change the references to the processes etc. to reflect the fact that they are on a new server. For completeness' sake, the solution and files have the same filepath on the new server except for the fact that it is a different server.


 If I do need to change the reference to each of these files, could someone please let me know how this is done?


 Thanks,


 Matt


 


(apologies that this thread is moving away from the title topic)

Badge +3

I think I just managed to answer that second question for myself. I'll post the answer here for anyone who has a similar issue.


I made a copy of my files onto a local machine to test this out...


I then opened a .kcm file and changed some of the characters before looking at the code module in my solution. When I opened this up I was pleased to find that the changes I had made locally were represented in what was essentially a copy of the server version of the solution. This leads me to think that the reference K2 uses is just from the folder that the solution is in (i.e. if your solution was in a folder called K2 and you code files were in a sub folder of that called Files, then, as long as the subfolder still had the same name, the path to the folder called K2 was not taken to be part of the refernce to the files.)


I hope this makes sense to anybody who is trying to look for a solution to this problem as I know how frustrating it can be to get close to a solution only for it to be a garbled mess (as I feel this may be).


Matt

Reply