How does K2 Handle Changes to Site Asset in Development using Visual Studio


Badge +3

Good Day All,... trying not to make this TLDR :-)


 


So, as part of my development I build out my Site Assets and package them up as a WSP provisioning my Site Cols, CT's, List Instances. I currently have a K2 Workflow built using K2 Studio SharePoint Workflow Integration Project started by mapping back to a my Content Type. I also have a Smart Object I use to get Metadata Info where needed.


 


My Question: If I need to add lets say an additional choice option to a choice field (so there is a change to an existing field being used in the K2 Smart Object in an existing workflow) and I want to add additional site columns to be used in other "yet to be created" workflows, how does that impact an Existing K2 Project.


 


Qualifiers: I understand as part of the Visual Studio Deploy/Redeploy process that my solution is going to go a way and be replaced BUT the key thing i want to know is since the GUIDS, Field Names dont change at all. WIll K2 freak out or just run the same when it sees the new deployed List Instance.


Thanks in advance


 


17 replies

Badge +9

Hi Fabian,


 


Glad to see you joined the K2 Community.


 


Based on your information I am making the assumption that you are working on SharePoint 2010. Two parts to deal with, let’s take adding additional columns first - for this you will have no issue, removing columns on the other hand can potentially create problems in scenarios where a workflow or smartobject makes use of the column that no longer exist.


 


Adding additional option to choice field - Are you using the choice field for flow logic i.e. Line rule logic or task routing in destination rules? If the answer is yes to any of these please consider the following:


 


Flow logic – If the workflow has a 1 to 1 mapping for each choice you can sit with a scenario where a new option can cause the workflow to end prematurely due to none of your lines evaluating to true.


Destination Rule – Same counts for Destination rule if you do not cater for anything other than the initial available choices the new choice can cause the workflow to evaluate all destination rule logic and come up with zero destinations, in this case the workflow will go into error state.


 


These are 2 quick consideration I can think of.


 


Let me know if you have any additional questions related to this.

Badge +3

Thank you for the feedback @Renier29

 

I appreciate your time and responsiveness, insofar as line and destination rules, for my "only" workflow now in development in K2 Studio it does not rely on any changes I will be making in the choice fields. I have three other workflows I need to build but I was taked to prototype one ahead of time so I am simply trying to preserve work I already did. My plan is to build out all my Site Columns now as well as Content Type, List Def and List Instances so that "hopefully" I wont have to make these decisions anymore. 

 

Finally, I also heard that there is a REFRESH option on the Smart Object Instance using the Smart Objects Service Tester utility if I do make changes that will affect the smart object, do you have any feedback for that? does it take care of any changes that I may do on the Site Asset part that may have impact to Line and Destination rules.. and this is my last follow up :-)

Thanks in advance for your valuable feedback

Cheers

Badge +9

You are very welcome!


 


For SharePoint 2010 based SmartObject I would recommend that you make use of the SmartObject Management page located under “Site Actions >  K2 Site Settings > K2 SmartObject Site Lists and Libraries” From this page you have the ability to generate SmartObjects for SharePoint based artifacts as well as refresh existing SmartObject once you have made changes to the SharePoint artifact. It’s not 100% clear that this page refreshes as it does not call it out, however access this page after the changed made you can simply click Create and it will 1 – Create any new SmartObjects for artifacts you have selected and 2 – refresh existing SmartObjects. In the background 2 things happens 1 – Refresh the service Instance and 2 – Refresh the SmartObject based on the updated ServiceObject from 1.


 


You can make use of the SmartObject tester however this is a manual multiple step process, 1st refresh the SharePoint ServiceInstance that will update the ServiceObjects followed by manually refreshing each SmartObject that you need to update.


 


Let me know if you have more questions.

Badge +3

Well now :-)

 

I can safely tell you emperically that K2 does not like you retracting and redeploying Artifacts after a Worklfow is inside K2 Studio and deployed, Ive tested it. Fortunatley, I did my prototype demo so this became a "throwaway" if it didnt work, and it didnt.  I just wanted to circle back since I asked the quesiton initially and let everyone know "my" experinece.

 

Specifically I DIDNT even modify ANY fields in my exisiting workflow [i.e. i didnt add anything to the choice column as i was planning to], I just wanted to see what would happen if I just added new site columns to my Assets without even inluding them in my existing K2 projects. to be clear, all i did was add more site columns to sharepoint, nothing else

 

I got the error in the file i have attached. I redacted the login name and the name of the process as it is specific to my client. but all the releveant points are there. It seems that its looking for my content type and cant find it based on the error message in the descripiton. However it says ServiceGUID so Im thinking that K2 created its own GUID assignment against the Original Content Type even though the CT GUID Is the same and some reference is broken.

I even went as far as Going back to the Start Activity and refreshed the Properties in the K2 Studio, and re did another test.. same failure.. So, unless there is a remedy to this, I will have to recreate all my work or come up with a hack IMO, i may be wrong. does anyone have any thoughts on this.

 

If this is the normal behaviour of the product, that is NOT good at all.


12795i48149C9508FEE020.jpg
Badge +3

I think you and I were replying at the same time. I am writing this to let you know I didnt see your reply before my last post. I will go and try your suggestions now and provide some feedback.

 

Cheers.

Badge +3

Ok, so this time I have tried the suggestion provided. Thanks for the feedback but I got the same error, perhaps it was too little too late or perhaps its the way i set about creating the Smart Object in the first go around. I used the Smart Object Tester and created it. Now that i did it the way you described, I see another node for the site and then i can see my conten type under there. I will figure out how to proceed.

 

Thanks

Badge +9

Fabian, thank you for the additional information.


 


Please try the following, once you have retracted > redeployed your SharePoint artifacts can you perhaps in K2 Studio rerun the SharePoint Workflow Integration wizards (no need to make any changes) once done redeploy your workflow.


 


Let me know if you still get the same errors.

Badge +3
Thanks again for keeping at this with me, I appreciate your time. So I tried that as well, I think I know what you are asking let me spell it out. I went to the start activity in k2 studio, right click, properties, went to the last icon on the left and step through the wizard... If that is what you are asking... Yes I did that too.

Thanks
Badge +9

That’s is what I asked.


 


As a last resort, the order in which I would do this:


 


1 – Retract > Redeploy the SharePoint artifacts


2 – Using the “K2 SmartObject Site Lists and Libraries” page refresh all SmartObjects


3 – Rerun the K2 SharePoint integration process wizard


4 – Redeploy the workflow


 


The best suggestion I have at this point is to open a support ticket related to this so that we can get to the bottom of what is going wrong, please provide me the ticket number so that I can track the progress.

Badge +3

Thanks, I will tackle that in the morning. I was too frustrated and stut down my VM. Time for a Pint.. Beer O Clock mate

 

Cheers. but perhaps around 2 am or so Ill fire it up agian, you know how it goes..

Badge +3

Good day,

 

I jotting notes down as I go with observation so forgive me if it seems haphazard.

1. As this was a sandbox solution and I had items already in the Doc Library tied to the Content Type, I used LIbrary settings to Delete the Library -- this way we wouldnt get Content Type in use Conflicts

2. I Deactivated the Sandbox Solution, then Deleted the Sandbox Solution

3. Observation -- I waent to the Smart Objects Service Tester and did a RefreshAll from the toolbar, I could still see under [sitename]/sites/sitecollectionname two Content Type one for Document and the other for the one I created

4. Observation - even when i tried to just Refresh the Node, it didnt go away

5. Thought.. Perhaps I need to delete them.. I dont know ???

6. I uploaded the WSP, and Activated it, now i have all my Site Columns, Content Types and My List Instance present

7. Open up K2 Studio, Re Ran the SP Integration Wizard as I did before.. I also reclicked Test on the SharePoint Site URL which passed, and I browsed under Content Type and selected the Content Type i created. I changed nothing else and finished the Wizard and then

8. Deployed the Solution to development and it completed successfully.

9. Tested by adding a item into the Doc Lib via Doc Set Content Type, The workflow fired but errored out with the same error as before referncing the Same GUID as before.

 

Thanks.

 

I have a guy I know Rob Joy maybe you know him as well that said he could get on the phone with me, I will see where that goes. but at this time,its probably more efficient for me to just kill everything and do over. :-)

 

Thanks for all your input, I did learn a lot.

 

Badge +3

Thanks Fabian. Let us know if you find out any other solution. 


 


Best,


Todd

Badge +3

I am meeting with Rob Joy in next 1 hour, I will circle back if he doesnt.

Badge +9

Let me know if you would like me to join the call, drop me a mail on r(at)k2.com


 


Some additional info for others following the post --


 


A couple of comments around the Refresh function in the K2 SmartObject tester:


 


The Refresh from the right click menu on a specific node will only reload the node, the Refresh All function on the toolbar reloads the all the nodes in the tree. What this function does not do is perform a Refresh on a registered service instance, to refresh a service instance you have to right click on the service instance and select “Refresh Service Instance”


 


Based on the error that you get I suspect that the your Service Instance is out of sync with the SmartObjects


 


The most reliable way to refresh/update SharePoint Service Instance would be using the SmartObject Management page hosted in SharePoint


 


I did a couple of checks on my side, using a list (the behavior will be the same with Content Types)



  1. Create  a List called “My List” added 2 fields
  2. Using the SmartObject Management page select the list created in step 1 and click Create

 


Looking at the K2 SmartObject tester – firstly we need to reload the SmartObject tester to reflect the changes made by the SmartObject Management page, Refresh All from the menu will do it.


 


Two observations –


-          The Service Instance will display the newly created Service Object


-          A SmartObject has been generated for this Service Object


 


Next I tested the behavior when removing the List from SharePoint



  1. From Lists settings delete the List
  2. Open the SmartObject Management page and click Create, this will refresh the Service Instance. What it will not do is delete the SmartObject created previously

 


Back in the SmartObject tester, Refresh all from the toolbar


 


Following observation –


-          The Service Instance no longer display the Service Object for the list as it does not exist


-          The SmartObject still exist, we don’t delete the SmartObjects


 


Now, if you execute the SmartObject you will get a similar error as what you mentioned in a previous post


 


Next I wanted to check what we do with GUID’s associated with the Service Object and SmartObjects, back in SharePoint I do the following:



  1. Create a list called “My List” and added the same fields as before
  2. Using the SmartObject Management page select the list created in step 1 and click Create

 


At this point if I execute the SmartObject again it will work as expected, the GUID remained the same


 


Let me know if you have questions or if something is unclear


 

Badge

I know we are meeting in a few minutes, but for the sake of posting back to the community.

 

I think the issue here is the original object was created with the SmartObect Service Testser.

 

So, the updates and refreshes done by the SharePoint integration are not being mapped back to the original object.

Badge +3

First of all. The K2 Community is fantastic. Very Prompt in the responses, Very Patient in explanations. 

 

As Rob Joy and Renier mentioned. the problem was I created my Smart Object using the Smart Object Tester and not the K2 Settings LIst and Library under Site Actions in SharePoint. In doing so I neeed to refresh my Service Instnace and Smart Object in the Tester to make my original Workflow operational agian. 

 

I will note that I will NOW use the K2 Settings List and Library in the future if for nothing else, it will allow me a easier path if I need to add additional fields to my Existing Worfklows that are Required Fields. 

 

Thanks again for all your help K2. Cheers.

Badge +9

Hi Fabian, thank you for your time. I am glad we managed to get this resolved. If you could mark the response which you believe contains the information most relevant as a solution that would be great.


 


Let us know if you have further questions.

Reply