Wednesday, December 10, 2008

Free extra wizard for K2 [blackpearl]

You might be aware of the recent release of K2 [blackpoint] with the beta 2 label. If not please consider a quick revision. But assuming you are already familiar with product, let`s find out some of it`s hidden surprises.
Although a new development tool is been introduced as a environment for building workflows, the well-known approach of having wizards is kept. The grouping remained the same, obviously to suit developers already used to the previous tools like VisualStudio or Visio. So exploring down what we could rely on, it`s obvious that we encounter a new wizard not existing for the [blackpearl].

Data Event wizard, as being a client wizard, adds extra logic to run on the server side, but specified on activity level. In general it gives the ability to map a set of fields, and once it`s executed, all the related values will be copied. It maintains one to one relations, requiring a field for destination, but providing flexibility for the source as another field or a static value.

Still the Data Event wizard works with fields defined only at its activity or global process level fields, which makes it suitable for following tasks :
  • Maintain a counter - now you have the possibility without relying on an external system, to manually change a value of a local field.
  • Extra copy of a data set - if working with shared process level fields, now you can provide their local copy per activity, and later if approval, to copy back the values to the process fields.
I know you can find additional usage if this extra event for preventing the unnecessary need of external system or smart objects.

And now the promised surprise. How can we have this event at our [blackpearl] development stations. Well the approach is easy to follow and I`ll bring it up in a step by step followups. But first what you need : simply - having [blackpoint] K2 studio installed and a [blackpearl] development components (for VisualStudio or Visio). Mark at that point that no intervention with any K2 sever is required. It`s all about distributing the extra event wizard from one station to another. Underneath, it includes all the required code to run inside the process definition, so only the developer tools are under consideration here and later.
  1. Locate on the [blackpoint] station were the k2 files reside. It`s usually %ProgramFiles%\K2 blackpoint
  2. Under the bin folder locate the 2 files named : DataEvent.Design.dll and DataEvent.Wizard.dll
  3. Copy those 2 files to your [blackpearl] bin folder - usually %ProgramFiles%\K2 blackpearl\bin\
  4. Register those 2 files in the GAC of the [blackpearl] machine. Could be done by dropping the files at %windir%\assembly, using the command line tool - gacutil, or if Windows XP - use the Admin Tools -> .Net framework 2.0 Configuration tool
  5. Locate on the [blackpoint] station the folder "Design.DataEventItem", it`ll reside at %ProgramFiles%\K2 blackpoint\bin\DesignTemplates\CSharp\WindowsWorkflowExtender\1033\
  6. Copy the entire folder to your [blackpearl] location : %ProgramFiles%\K2 blackpearl\bin\DesignTemplates\CSharp\WindowsWorkflowExtender\1033\
  7. The easy part is over, so additional preparations are required before continuation - on both [blackpoint] and [blackpearl] locate the file "configurationmanager.config" and make a backup of it. It resides at the bin folder.
  8. You need the 2 files open (use wordpad or better text editor), and the transfer we`ll make is from the [blackpoint] file to the [blackpearl] file. The content is in XML, and you need to copy the entire xml elements (as specified underneath) to the same location on the other file.
  9. Copy the following xml elements (lines) from the [blackpoint]to the [blackpearl] file:
  • <propertywizard text="Data Event" description="Data Event Property Wizard" makeavailableoffline="false" minversionrequired="" type="SourceCode.Workflow.Wizards.DataEvent.DataEventPropertyWizard" assembly="DataEvent.Wizard, Version=, Culture=neutral, PublicKeyToken=16a2c5aaaa1b130d" name="F23B5E30-479F-436c-8771-7A949AA3F967"> </propertywizard>- this needs to go undernieth the xml element <propertywizards>
  • <wizard text="Data Event" showintoolbox="true" description="Data Event Wizard" makeavailableoffline="false" minversionrequired="" type="SourceCode.Workflow.Wizards.DataEvent.DataEventWizard" assembly="DataEvent.Wizard, Version=, Culture=neutral, PublicKeyToken=16a2c5aaaa1b130d" name="916261B2-1024-485f-89AD-A8E509CCEA8C">
    <add name="Event General Property Wizard"/>
    <add name="F23B5E30-479F-436c-8771-7A949AA3F967"/>
    - this needs to go underneath the the xml element <wizards>
  • <add name="916261B2-1024-485f-89AD-A8E509CCEA8C"></add>- this needs to go underneath the xml tree : <toolboxCategory default="Default Server Event Wizard" text="Event Wizards" name="ToolboxCategoryEvent"><toolboxImts>

That was the scary part, and now if you restart your [blackpearl] development tools, you`ll be able to see and use the Data Event Wizard. In case of VisualStudio, you`ll need an extra forced "Reset toolbox" to reload the configurations and bring up the new wizard.
In any case, keep the configurationmanager.config backup, if you want to get rid of the wizard, or you mess up with the xml file.
So the outcome is that if you register for the beta of [blackpoint] you can easily get stuffed with an extra wizard for your [blackpearl]. And if you were watching closely, you might have noticed there is another new wizard...
Bookmark and Share

No comments: