Set-KFData

Syntax

Set-KFData
  [-Key] <string>
  [-Data] <object>
  [-ThrowErrors[:$true]]

Support

>= kenaflow 1.0.0

Return

Nothing.

Description

This cmdlet writes the data as serialized string (CliXML format and JSON format) to the SharePoint workflow data list. (The actual name of the list is specified in the workflow configuration file _wfconfig.ps1.)

Serialization does not allow the entire state of a complex object to be transferred in CliXML or JSON, but ultimately only the data of the objects. This must be taken into account. For example, a SharePoint list element cannot be serialized as an object (ListItem object) so that it could be reloaded and modified later. This limitation is a typical problem in software development and not limited to kenaflow.

If an object was persisted before with the same key it gets overwritten without warning!

Parameters

[-Key] <string>

The key that is used to read the serialized data.

[-Data] <object>

The object that is to be persisted.

[-ThrowErrors[:$true]]

This is a default parameter for all kenaflow cmdlets. If set to $true (default!) the engine will pass exception within the cmdlet to the script for further handling.

Example

Set-KFData -Key "kenaflow" -Data @{"is" = "a workflow engine for SharePoint, Email and PowerShell"}
Write-KFLog (Get-KFData -Key "kenaflow")
Remove-KFData -Key "kenaflow"

Discussion