Renew K2 Licence Key
Showing hidden fields and the SPComments datafield

| Field | Value Stored | Sample Value |
| Comments | A repeating node containing all the comments entered by various users during the workflow Client Events | n/a |
| EventName | The name of the Client Event for the user task | Manager Approval |
| Comment | A repeating node, since a task may have had more than one user’s input | n/a |
| UserName | The user name of the user that completed the task | DENALLIXadministrator |
| DisplayName | Display Name of the user that completed the task | DENALLIXadministrator |
| DateTime | The date that the task was completed | 1/26/2012 2:40 PM |
| Body | The comment body entered by the approver | Not _x0020_enough _x0020_leave _x0020_days Note that the special characters like space are encoded.
|
| Action | The action selected by the user when completing the item | Rejected |
Structure of the SharePoint_Item XML datafield

The SPIntegrationData XML Field Structure

| Field | Value Stored | Sample Value |
| HistoryListId | Internal SharePoint ID of the List used to save the Workflow History | 38ac23da-22cf-4628-b56d-708a5c887f65 |
| HistoryListURL | The relative URL of the workflow history list
The URL is relative form the root site of the site collection
|
/K2Learning/Lists/Workflow History |
| HistoryListName | The Display Name of the workflow history list | Workflow History |
| ItemName | The Name of the item submitted to workflow | Test Item |
| ItemTitle | The Title of the item submitted to workflow | Test Item |
| ItemId | The SharePoint ID of the item submitted to worfklow | 2 |
| ItemUniqueId | The internal SharePoint ID of the item submitted to workflow | 28fe05a3-6563-4d9d-906d-bc59c4bbe70e |
| ItemURL | The relative locaiotn of the item submitted to workflow.
The URL is relative to the URL of the Site where the list is defined.
|
Lists/SharePointWorkflowList/2_.000 |
| ListTitle | The title of the list where the item resides | SharePointWorkflowList |
| ListId | The internal SharePoint ID of the list where the item resides | 675684a7-8090-461c-8076-e18c83ed83c7 |
| ListURL | The relative URL of the list where the item resides.
The URL is relative from the root site of the site collection
|
/K2Learning/Lists/SharePointWorkflowList |
| OriginatorName | The name of the user that submitted the workflow | DENALLIXadministrator |
| OriginatorLoginName | The login name of the user that submitted the item to workflow | DENALLIXadministrator |
| OriginatorId | The internal SharePoint ID if the user that submitted the item to workflow | 1 |
| OriginatorEmail | Email of the person who submitted the item to workflow | administrator@denallix.com |
| SiteTitle | The title of the root site of the site collection | PortalRootSite |
| SiteId | The internal SharePoint ID for the root site of the site collection | 54707d5b-9e8d-410e-aec7-84ebca121dbb |
| SiteURL | The URL of the root site of the site collection | http://portal.denallix.com |
| TaskListTitle | The title of the task lists where user tasks will be displayed | Tasks |
| TaskListId | The internal SharePoint ID of the task list where user tasks are displayed | a0dbb13c-9ba3-4d59-a086-74c52a24efcd |
| TaskListURL | The relative URL of the task list where user tasks are displayed.
The URL is relative to the URL of the root site on the site collection
|
/K2Learning/Lists/Tasks |
| WebId | The internal SharePoint ID of the site where the list resides | 4217499d-9fa3-4715-9c32-f02cb9086d05 |
| WebURL | The full URL of the site where the list resides | http://portal.denallix.com/K2Learning |
| WorkflowId | The unique SharePoint ID for the SharePoint workflow | 5840d436-8b67-4808-ac2c-03e9921c1871 |
| TemplateName | The name of the SharePoint workflow | K2LearningTestsSharePointWorkflowIntegrationProcess |
| InternalState | A list of valid sates for the SharePoint workflow | Locked, Running, NotStarted |
| AuthorUserLoginName | Login name of the author of the item | DENALLIXadministrator |
| InstantiationData | A collection of instantiation data when the workflow was started | (depends on the item being submitted) |
| CustomData | Custom data (not used) |
The structure of the WFIProcessField

| Field | Value Stored | Sample Value |
| Type | The Content Type of the item | ListItems |
| Item (repeating node) | This is a repeating XML node. Multiple Items can be listed under this repeating node. | |
| ID | The index of the current item in the Item repeating node | 1 |
| SiteURL | The URL of the site where the item list is located | http://portal.denallix.com/K2Learning |
| ListURL | The relative URL of the list where the item is located.
The URL is relative to the Site where the list exists.
|
Lists/SharePointEventsList |
| FolderURL | The name of the folder where the item exists.
If no folder, the Item ID is used.
|
TestFolder
or
2_.000
|
| Item | The ID of the item that started the process | 2 |
| URL | The full URL to the item.
Can be used as a hyperlink to open the Display Page of the item.
|
http://portal.denallix.com/K2Learning/Lists/SharePointEventsList/DispForm.aspx?ID=2 |
| Source | (Not relevant for the SharePoint workflow integration wizard) |
Selecting whether to save the metadata of the item that started the workflow

A sample XML Datafield representing the Metadata of a List Item

| Field/Field Data Type | Notes | Sample Value |
| Choice | Saves the Name of the item selected in the choice drop-down | Option 1 |
| DateTime (e.g. Created, Modified or custom date field) |
Timestamp for the SharePoint server where the item was created | 2012-01-26T11:54:10 |
| Lookup | The ID and Value of the selected lookup item | 2;#Finance |
| User
(e.g. Author or custom user field)
|
Stores values in domainusername for AD users | DENALLIXadministrator |
| ID | The SharePoint List Item ID | 2 |
| Title | Stores the title | Test Item |
| YesNo | True or False value | True |
The structure of the SPEventsField

| Field | Value Stored | Sample Value |
| Type | The Content Type of the item | ListItems |
| Item (repeating node) | This is a repeating XML node. Multiple Items can be listed under this repeating node. | |
| ID | The index of the current item in the Item repeating node | 1 |
| SiteURL | The URL of the site where the item list is located | http://portal.denallix.com/K2Learning |
| ListURL | The relative URL of the list where the item is located.
The URL is relative to the Site where the list exists.
|
Lists/SharePointEventsList |
| FolderURL | The name of the folder where the item exists. If no folder the Item ID is used. | TestFolder
or
2_.000
|
| Item | The ID of the item that started the process | 2 |
| URL | The full URL to the item.
Can be used as a hyperlink to open the Display Page of the item.
|
http://portal.denallix.com/K2Learning/Lists/SharePointEventsList/DispForm.aspx?ID=2 |
| Source | (Not relevant for the SharePoint Events process wizard) |
The structure of the EventDetails Field

| Field | Value Stored | Sample Value |
| Scope | The scope at which the event occurred (e.g. ListItem or List) | ListItem |
| EventType | The event that caused the workflow to fire | ItemAdded |
| SiteURL | The full URL to the site where the list is defined | http://portal.denallix.com/K2Learning |
| SiteRelativeURL | The relative URL of the site where the list is located, relative to the Root Site URL of the Site Collection | /K2Learning |
| List | The Name of the list where the list item was created | SharePointEventsList |
| ListRelativeURL | The relative URL of the List where the item is located. The URL is relative to the Site where the list is defined |
Lists/SharePointEventsList |
| ListFullURL | The full URL of the List where the item is located. | http://portal.denallix.com/K2Learning/Lists/SharePointEventsList |
| ListItem | The ID if the list item that started the process | 2 |
| ListItemTitle | The title of the list item that started the process | Test Item |
| ListItemRelativeURL | The relative URL of the list item that started the workflow.
The URL is relative to the Site where the list item is defined.
|
Lists/SharePointEventsList/2_.000 |
| ListItemFullURL | The full URL to the list item that started the workflow.
This link can be used as a hyperlink to open the List Item display form.
|
http://portal.denallix.com/K2Learning/Lists/SharePointEventsList/DispForm.aspx?ID=2 |
| Folder | The folder where the list item is saved.
(If no folder, the list item ID is used, as shown here)
|
TestFolder
or
2_.000
|
| Fields | Stores the BEFORE and AFTER metadata values of the Item in two separate fields in CDATA format | (Depends on the Item’s Metadata) |
Structure of the Content Field/Item Reference Field

| Field | Value Stored | Sample Value |
| Type | The Content Type of the item | Documents |
| Item (repeating node) | This is a repeating XML node. Multiple Items can be listed under this repeating node. | |
| ID | The index of the current item in the Item repeating node | 2 |
| SiteURL | The URL of the site where the item list is located | http://portal.denallix.com/K2Learning/300.HLP |
| ListURL | The name of the List where the Item exists | Shared Documents |
| FolderURL | The name of the folder where the item exists | Demo Folder |
| Item | The Name/Title of the Item in SharePoint | My Document.docx |
| URL | The full URL to the item | http://portal.denallix.com/K2Learning/300.HLP/Shared Documents/Demo Folder/My Document.docx |
| Source | If this item was copied from another item, the source will contain the original item’s details in the same structure. This can be used to delete or otherwise modify the original item after creating a copy of the item. |





I was looking for a way to embed a Word document in to my SharePoint page. It seems the with Windows Live, this is allowed – but what if the documents are stored locally on a SharePoint 2010 Serve with Office Web Apps enabled? No. The URL doesn't allow for embedding, it detects the iframe and gives an error.
Looking around I found this post, it describes how to use the source of the WordViewer.aspx to grab the iframe for the actual document, this will then allow you to embed the document, but there is a problem. The source for the iframe is a URL that looks something like this:
http://portal.denallix.com/Sites/DocumentApprovalCase/WordViewerFrame.aspx?d=F01fa671c0367476c94cf7159cdd4363eme27788ac7945483ab227dcbf558bce4fme45d2577bbde4734aa37e73babe4af3bm&source=http%3a%2f%2fportal.denallix.com%2fSites%2fDocumentApprovalCase%2fDocuments%2fProjektverfahrensanweisungen.docx
Now in my case I had a dynamic SharePoint site that needed to be provided a parameter for which document to display. At first glance it seems simple to URL encode the source parameter and easily embed any document. This is not the case. What's actually going on is that the 'd' parameter is an encoded reference tot he document location and it's this that must be set correctly.
I embarked on a little session of Reflection (big R for Red Gate, not little r, where I might contemplate my life as a rock star).
I discovered that the requried 'd' parameter is simple a concat of four GUIDs of the site, web, library, and file IDs, prefixed with an F (O for a folder).
Internally MS's code refers to this encoding as a "String Representation". Here's some example code for the SharePoint Object Model to generate it from a URL, via an SPWeb. You should probably choose a better way to implement this but here are the fundamentals:
public class OfficeWebAppUtil
{
public static string GetWordViewerURL(string url)
{
url = HttpUtility.UrlPathEncode(url);
using (SPSite site = new SPSite(url))
{
using (SPWeb web = site.OpenWeb())
{
SPFile file = web.GetFile(url);
string rep = StringRepFromItem(file);
return web.Site.Url + "/_layouts/WordViewerFrame.aspx?d=" + rep;
}
}
}
protected static string StringRepFromItem(SPFile item)
{
StringBuilder builder = new StringBuilder();
builder.Append("F");
builder.Append(item.Web.Site.ID.ToString("N"));
builder.Append('m');
builder.Append(item.Web.ID.ToString("N"));
builder.Append('m');
builder.Append(item.UniqueId.ToString("N"));
builder.Append('m');
return builder.ToString();
}
}
As for the soruce parameter – you might want to append that also as this is where you will be redirected to if you close the document or click the popout icon.
I'm sure the same technique will work for other document types. If I get some time I'll wrap this in to a web part that can handle different document types… maybe
Cheers,
Hoshy, the K2 Pirate
Use the web interface: http://hoshy.co.uk/cgi-bin/mailman/listinfo/k2tech
Hello!
I want to tell you about an underused tool in the K2 Blackmarket community arsenal: The Process Instance Version Migrator.
This tool allows you to make inflight migrations of process instances between process versions.
It uses an API called LIM - Live Instance Management. This API /is/ a K2 Supported API however the tool itself is community supported.
Credits for this tool go to Neil Maartens – A K2 Consultant now working in the US. K2 Underground username: NeilM
So – on with the tool. Download it from here: http://www.k2underground.com/groups/process_version_migration_utility/default.aspx
Extract the tool – full source code is included however you'll want to navigate to the folder: ProcessInstanceVersionMigrator\ProcessInstanceVersionMigrator\bin\Debug
Here you'll find a .exe which is to run the program and a .config thatcontains the server connection strings.
FIRST MODIFY THE .config
You'll need to modify the following:
<add key="K2SqlConnString" value="Data Source=localhost;Initial Catalog=k2server;Integrated Security=True;MultipleActiveResultSets=True"/>
<add key="K2ServerName" value="localhost"/>
<add key="K2ServerPort" value="5555"/>
By default the tool will work best if you're running on the (a) K2 Server as the K2 Server Service account.
Next run the tool .exe
Use of the tool should be quite straight forward. When it runs you are presented with a window that describes 7 steps – each with a button associated.
Step 1 – Check the config file!
Step 2 – Click "Get list of processes" – this populates a drop down list with the process types on the specified server, select the process type you with you migrate.
Step 3 – Click on "Get Active Instances" – this will fill the table with a list of running instances of the selected process type, including the status and version of the instances.
Step 4 – Select each instance you wish to migrate – processes in error state can be migrated also.
Step 5 – Click on "Get process versions" – this will load a list of versions for the selected process type – then select which verson you wish to migrate the above instances to.
Step 6 – Click on "Get process version activites" – this loads a list of activites in the selected version that you can then select. The tool will then perform a goto to the selected activity after migration. You can also choose not to redirect at all, or redirect to the current activity if you want to rexecute the current step (useful if the instance is in error and you want to restarted from the failed point).
Step 7 – Perform the migration! This is the final step and the act can not be un-done. By now you should have thoroughly tested the migration scenario in you test environments.
The table will show Migrating, followed by Migrated for each selected process instance.
Good luck!
P.S: Some other things to know.
Cheers,
The K2 Pirate
Join the new K2Tech mailing list by clicking here to send a mail to the list subscription address Click here
Also visit the K2Tech archieves: Here
Hello!
Welcome to my blog.
Over the coming months I'll be using this spot to communicate idea, best practices, code and insights in to all things K2 related.
Powered by WordPress