How to efficiently clone K2 solution, views and SmartObjects especially

  • 1 December 2014
  • 6 replies
  • 87 views

I have to prepare several workflows (SmartForms, Views and SmartObjects as well) based on the same "template". These are for a customer which has several subsidiaries, with some local specifics. In the future more specifics are expected.

There is the only K2 server and the only SharePoint server. The workflows and related K2 objects are managed/executed by the same K2 server, each workflow will operate on the different data (separated SmartObjects connected to the separate service instances connected to the ShP lists in separate web-collections). The structure of the ShP lists is the same, at least at the moment.

 

I have supposed to create, test and deploy "pilot" K2 solution (i.e., a set of K2 objects like Workflow_01, ServiceInstance_01, SmartObject_01, View_01 and SmartForm_01) and then to SaveAs all of the pilot objects. And this led me to the problem.

I know how to clone the SmartForms and views. When saving the SmartForm system offers "cloning" of the views as well. But there is no way (at least, I do not know any) how to clone the SmartObjects in these views. I have tried to create the SmartObject "similar" (the same methods, the same properties, another service object) to the one used in the existing view. Then I cloned my view and changed its SmartObject. Unfortunately, all view fields (text boxes, data labels, etc.) have been unbounded from the SmartObject, the rules were "corrupted" as well.

 

So my questions are:

  • How to efficiently clone K2 solution as whole?
  • Is there a way how to replace SmartObject in a View with another one, while keeping the fields bounded and rules uncorrupted?

 

Thanks in advance for any suggestion.

Petr


6 replies

Badge +5

Hi,

 

You could try using K2 Package and Deploy for copying and transporting your standard solution to another environment. P&D allows you to package whole solutions with workflows, SmartObjects and in the case of forms, allows them to retain there rule sets. Upon deployment you can also specify alternate dependencies depending on what differences there are between the original environment and the one you are deploying to. 

 

Please see this link for further information: 

 

http://help.k2.com/onlinehelp/k2blackpearl/packageanddeployment/current/default.htm#K2_Package_and_Deployment.html%3FTocPath%3DPackage%20and%20Deployment%7C_____0

 

Regards

 

Peter

Hi Peter,
many thanks for your tip.
I appologize for being unresponsive. Till now I was deep in an important project.

 

I was thinking to use P&D as well. Unfortunately, I need to "clone" the solution as a whole in the only K2 server. Of course, it is a development server. There is a separate server for production.

 

To simplify scenario...
1. There is one View-SmartObject pair (View_A, SmObj_A). The SmartObject is connected to a particular SharePoint list (ShpList_A).
2. In the same K2 server, I need to create a copy of K2 objects (View_B, SmObj_B) and keep them bound one to another.
3. Also, I need to modify the copied SmartObject and make it to use another SharePoint list (ShpList_B). The original and new lists are of the same structure.
4. The above steps must be done while eliminating a manual updating of every particular reference to modified SmObject_B in View_B (e.g., binding of fields, redefinition of rules).

 

And that is the problem.
I failed when trying to use P&D to deploy "several copies" of my K2 objects to the production server. Maybe, because of a lack of my imagination.

 

Regards
Petr

Badge +2

I am in a very similar situation.  Did you ever figure out a solution to this?

Hi Tom.

 

Simple answer to your question is: I did.

More detailed answer is: It is a terrible work. :-(

 

Just the most important points on the procedure:

  1. Forms and views are cloned using SaveAs => the links to original SmartObjects are kept.
  2. New SmartObjects are created manualy (with the same methods and properties as original SMOs, but with the different data sources).
  3. The cloned forms and views and the original SMOs are packaged by a Package and Deployment Tool.
  4. The package is deployed back to the original K2 server:
    - The cloned forms and views are selected.
    - The original SMOs are selected.
  5. Deployment of every cloned form and view is configured as follows:
    - Create New Version of Form/View
  6. Deployment of every original SMO is configured as follows:
    - Use Existing SmartObject
    - Respective new SMO (see above, step 2) is mapped via Configure option in the toolbar.
    NOTE:
    After completing step 6 you can check Dependecies for the respective forms/views.
    The links to original SMOs will be replaced with the links to the new SMOs.
  7. Finally, deploy the forms, views and SMOs.

 

The cons:

  • A lot of manual work (create new SMOs, reconfigure SMOs mapping in P&D Tool).
  • You must be precise, so the interface of every new SMO is the same as the original one.
  • A lot of steps where you can do a mistake or omit something.
  • The cloned solution must be tested and tested and...

 

Finally a small tip.

As far as I know in SharePoint 2013 and later you can use web-based Package and Deployment (see SharePoint Lists or Libraries, a ribbon with K2 Application) to clone your application. Unfortunately, I haven't tested it yet.

 

Regards

Petr

 

 

Userlevel 3
Badge +16

Don't forget, there is a massive bug in P&D in v4.7... Cloning a fully working 100% solution from one v4.7 to another will fail if you use mapped fields in certain rules.

 

I have had a ticket open for months with k2 while they figure this out. I've spent weeks and weeks doing workaround after workaround with no joy.

First they released a fix in FP5 which only fixed the red exclamation cosmetically, but they are still present when using P&D.

 

We wait with bated breath for an eventual solution. Don't know about you guys, but i'm severely behind schedule in light of moving to v4.7

Hi Sharpharp.

 

Thanks for your update. I wasn't aware of the P&D bug you wrote about.

Please, could you attach text and/or number of your K2 ticket?

 

Anyway, your reply has remind me that my answer to Tom's question lacks something. Here it is: My procedure was tested and used on K2 4.6.7, 4.6.9-10. Fortunately, later on there was no need to clone the whole K2 solution.

Recently I ran into some troubles with K2 4.7 when packaging and deploying some SMOs and related views. But P&D allowed me to "remap" those SMOs without any problem. But it was not a whole solution.

 

Regards

Petr

Reply