Can client events Hold windows forms?

  • 20 August 2009
  • 9 replies
  • 1 view

Badge +11

Hi


I have a problem where i need to have the client event open a windows form -not a web form- and interact with it and respond to buttons events. Is that possible?


9 replies

Badge +8

I'm guessing that you will be building a Windows Task list and not use the default web based one since one cannot open Windows forms from the browser.

For this kind of mixed solution, there are usually 2 parts:




  1. WinForm Items need to be hidden from the web worklist. To do that, after running your default client event, view the code behind and find the line where the K2.AddWorklist method is called. Change the Platform parameter to something unique, e.g. "Win32". Its just a string so anything that is not in the current enum should do. The default Worklist opens ASP, so these items won't show up.


  2. When you open the worklist in the Windows worklist, you will need the same value for the Platform parameter in the OpenWorklist method.
    K2Conn.OpenWorklist("Win32");
Badge +11

Thanks Dc for your valuable information.


The thing is that i want to open a windows form that contains accept and reject buttons not a worklist. this forms is similar to a web form in action but i want it in a desktop form.


I have doubts in this but i want to make sure that it is not possible at all.

Badge +8
Help me understand, if you dont have a Worklist, how will you know which Worklist item to open and action?
Badge +11

OK


Let's have a worklist that is made of a custom GridView that is located in a windows form. if a worklist item is selected and openned, can it be openned in a windows form that has some buttons that map events of the client event?


Imagine a desktop printing screen that the current activity has to execute via a client event where the user select's a printer and he either click's the print button or return's it for correction.


excuse me DC, but I cant describe it simpler.

Badge +8

Understood, but this contrasts your previous posts stating that you will NOT be using a Worklist.


 


In this case, my previous solution still stands. Working with the API will be exactly the same as was done for web pages, except you will be using the different platform parameter. And I guess you will also need to decide which WinForm to display based on the Worklist Item opened.

Badge +11

Thanks DC and please bare with me, guys like you hold a big deal of knowledge and i want to benefit from it.


Just one more question


I created a k2workflow project, added an activity and inside that activity i dropped the cleint event.


I also created a desktop application "Application1" with one form "FrmPrint"


How am i going to let the cleint event recognize the "frmPrint" in the "Application1" desktop application?


this is a big delimma for me.

Badge +8

No worries, gald to share.

For your case, you have two options I can think of from the top of my head:




  1. Add a dummy URL in your client event, with the last part the form name:
    http://dummy/FrmPrint
    When you open the Worklist item in your Windows Form Worklist, the Data property of each WL item will be:
    http://dummy/FrmPrint?sn=x_y
    You can replace the dummy string (http://dummy/) with "" and then open the FrmPrint window, passing along the sn as public property of the form. Remember, Application1 will be your WinForm Worklist, so you can do the manipulation in there.


  2. Use a real URL and set the name of the form to load in the Description or Meta data fields of the event. This is useful if you face scenarios where certain users use WinForms, others web. So when you open from the web, use the URL (no change). But when using a WinForm Worklist, use the Description or Meta Data field to get the form to display. You will need to have the Platform parameter set to the default however.

Hope this makes sense.

Badge +11

Brilliant...Absolutely Brilliant


I WAS RIGHT ...I WAS RIGHT ....You really hold a big deal of knowledge


MANY MANY THANKS DC....


It's really nice to know another great mind

Badge +13
For our K2 .NET 2003 solution we display Winform apps alongside web apps in the standard workspace.   We created a DLL that's registered on the client machine that allows us to launch exes and pass sn to it via createobject.   The same solution should continue to work with BP.

Reply