Category: Work > K2 Inline Functions

Notes on K2 Inline functions

Yesteday I tweeted about inline functions and how to get your Icon working properly.

Appart from all the info in Johnny’s blogpost, there are some other catches as well. Just because i keep forgetting them, here’s a mental note to myself.

 

It’s a normal class library

Start your project with a normal .NET class library. Make sure it’s .NET 3.5. Add references to the following files:

  1. SourceCode.Framework
  2. SourceCode.Workflow.Functions – this one isn’t always needed.
  3. SourceCode.Workflow.Functions.Design
  4. System.Drawing

Another thing you have to make sure is the platform type. Make sure you set it to Any CPU. Here are my Project settings:

Make sure you sign the assembly as well!

The PNG Icon itself

The icon itself is a 16x16pixel PNG file.

Something that a lot of  people do wrong is add it via the resource configuration page (if you double click on Resource.resx). You do not need to do this, you can simply add the file to a folder called resources and change the properties of the file to ‘Embedded resource’.

Deployment

K2 has multiple designers and for that reason requires the assembly to be placed in different locations. In general, deployment is as follows:

  • K2 Server – Copy the assembly to the Host Server\bin folder of your K2 installation.
  • K2 Designer for SharePoint – Copy to the GAC of the SharePoint WFE. The image should work if you copy the PNG to “12(or 14)-hive\TEMPLATE\LAYOUTS\WebDesigner\Images\Functions”
  • K2 Studio/K2 designer for SharePoint – Copy the assembly to the “Bin\Functions” of the K2 installation directory.

 

More info?

Together with this info and Johnny’s blogpost, plus the k2 manual, you should now be able to create your perfect inline function! If you still have questions, feel free to comment!

 

K2’s KB001200 release

Since the release of K2 4.5 back in April, it’s been a bit quite of time before we got something new. We’ve seen the K2 components for SharePoint 2010 been release, but that didn’t bring any new functionality to the table. For those who don’t know, it “only” provides the same functionality of the SharePoint 2007 components. This doesn’t mean guys in South Africa have only been watching the worldcup, they’ve been working on a beauty called the 1200 series, which starts with the KB001200 update release.

In other 1200 releases (KB001230 and KB001260), we’ll see new functionality being added. This will be in the form of new features on the UI side, new Inline Functions, Wizards and Service Broker Objects.
So, what does the KB001200 release have:

  • New installer
  • Single sign-on for Workspace UI
  • Document Management Inline functions – Included in BlackPoint
  • Dynamic SQL Service Object
  • Workflow Client Services
  • Updated Create Item wizard – Included in BlackPoint

I’m going to jump into a few of the once I find the most interesting.

New Installer

Huh, again? Yes, again. The installer has not changed a lot. It has some new things to lay the foundation for the 1200 series. So, don’t expect a big change, you’ll still have that nice 4.5 feeling when you install the product. What is new, it includes the VS2010 extension and the K2 Components for SharePoint 2010.

Document Management Inline Functions

The 4.5 release brought us Inline Functions. In this post you can see what that is and read why it’s so important. K2 is now expanding the current list of inline functions to allow some document management functions. Below is a list of functions you’ll get.

Get Word Content

This allows you to get the content of a content control in word. Content Controls in word are useful for forms and getting data a bit more structured in a word document. Having the option to get the value of such a control allows you to make business decisions based on what a user entered in the word document/form.

Example of GetWordContent being used.

Get Cell

The Inline Function that started as a K2 underground blackmarket project. A good example of K2 looking what the field uses and then adding it to the product features. Some might think this is an easy way to add value, but don’t forget that because it’s in the product, it’s now supported and maintained by SourceCode. With the community stuff, you’re on your own. The function allows you to get the value of a given cell in an excel sheet.

Get Cell with Input

Roughly the same as the above, but it allows you to change a value in a cell, recalculate the workbook and return the information from a different cell. It uses Excel Services to calculate the workbook.

Get Range

Returns an array of values from the cells that have been specified. It looks at the first column if the range includes multiple columns.

Get Range with Input

See a trend here? Get Cell -> Get Cell with Input. Get Range -> Get Range with Input. It does the same as Get Cell with Input, but now with a range.

Example of GetRangeWithInput being used

Dynamic SQL Service Object

Way back in the RTM timeframe, the awesome Seb Garrioch created the Dynamic SQL Service Object. The labs team has updated it a bit and included it in the (supported!) product. What it does? It allows you to use Microsoft SQL tables, stored procedures and views as the base of your SmartObjects. We already got this in 4.5, but you had to create the SmartObject yourself. In this release, a niceUI has been added to SharePoint 2010 for you to create and manage the SmartObjects.

Create a Dynamic SQL SmartObject from the UI

Workflow Client Services

K2 is slowly creating WS/WCF/REST services for a lot of their API’s. The other 1200 series releases will have some more goodness for that. This KB001200 release features the ability to start and participate in workflow. It basically is the web serviced version of the SourceCode.Workflow.Client assembly. It will not feature everything, since it’s a bit hard to get all those API calls into a web services, but you’ll be able to complete tasks, get worklist information, start processes and more. The different endpoints support different functionality, with WCF being the one with the most features. The others (REST and old-fasion-asp.net web services) have less features, but that’s logical because you simply can’t specify a full ProcessInstance via REST. This KB001200 release will only have the Workflow Client Services, the other releases of the 1200 series will include more. Expect a full article on all the web services later…

Updated Create Item Wizard

When you build K2 workflows that are linked to a SharePoint site, you’re able to create items in that site. This updated wizard allows you to create those items in a different site/site collection then the one you’ve bind the workflow too.

Conclusion

I’m happy to see K2 is moving forward and expanding the functional artifects of K2, it shows how important the 4.5 release was and that is truly is the foundation for more things to come. A lot of new items are things you would be able to create yourself using SmartObjects or Inline Functions. K2 is simply adding them to the product which makes the OOTB experience better and it’s becoming a more complete product.

Thanks to Holly for the help and screenshots…

K2′s 4.5 RC is here.

Nearly every SharePoint blog is reporting on the release date of SharePoint 2010. You might have not noticed that K2 has released the RC version of the all important 4.5 :)
The RC version is available via the K2 Portal site under the beta download section. This also means it’s only available for the current partners, customers and insiders.

Here are the main enhancements (copied from the release notes):

  1. New support for:
    • Windows Server 2008, including R2
    • SQL Server 2008
    • Visual Studio 2008
  2. Non- AD Installation
  3. SSL Support
  4. Inline Functions
  5. Reports
    • New filters and parameters
    • Using SmartObject direct execution functionality
  6. Performance enhancements to SmartObjects and the K2 Workflow Server
  7. In MOSS/WSS K2 configuration Features are deployed as solutions
  8. K2 Designer for SharePoint enhancements include:
    • Inline Functions
    • SmartObject Filters
    • Custom Work Item Notification
    • Process Data Fields
    • New Wizards
  9. Internationalization of the codebase
  10. Numerous documentation updates
  11. Inclusion of all Updates

For more info, here are some links:
K2 Underground 4.5 RC Forum

Registration form for What’s new to K2 4.5

Check out the K2 Event Calendar for other webinars and events.

Jey’s report on the release!

PeteStilGoe.com’s post on 4.5

The new K2.com website showing 4.5 info!

More URL’s coming…

WordPress Themes