Invoke-KFLinkEventSimulation
Syntax
Invoke-KFLinkEventSimulation
-ItemId <id>
-Data <hashtable>
[-Validation <hashtable>]
[-ValidUntil <datetime>]
[-NTLM[:$false]]
[-SimulatedUserName <username> (the current user)]
[-SimulatedUserPassword <password> ("123")]
[-ThrowErrors[:$true]]
Support
>= kenaflow 2.0.46
Return
An object of type kenaflow.EventDataSimResult
:
public class EventDataSimResult
{
public RemoteEventSource EventSource { get; set; }
public object EventData { get; set; }
public int OutputFormat { get; set; } = 0;
}
RemoteEventSource
will have the value Link
for this cmdlet.
Description
This cmdlet is used to simulate a link remote event to be able to debug workflow scripts in the event execution context.
Please read Debugging and Remote Event for details!
The cmdlet can only be used in a script block that is specified for parameter -EventData
of cmdlet Invoke-Kenaflow.
The return object of this cmdlet is used by Invoke-Kenaflow
to configure the runtime environment for kenaflow to execute the remote event.
Parameters
-ItemId <id>
The id of the SharePoint item the simulared link remote event belongs to.
-Data <hashtable>
The field values to be set if the link remote event is considered to be valid.
[-Validation <hashtable>]
The given object contains field values that MUST ALL match the specified item's current field values to consider the remote event to be valid.
[-ValidUntil <datetime>]
If specified the link remote event is only valid until this point in time.
[-MarkAsAuthenticated[:$true]]
This can be used to simulate a not successful authenticated request. It is passed to the script as part of the
$eventData
object.
[-NTML[:$false]]
Currently link events can be anonymous (not authenticated) or authenticated with NTLM. We're working on it to support basic authentication.
[-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.
Currently not used (we are working on "Basic Authentication" for link remote events):
[-SimulatedUserName <username> (the current user)]
This is used to simulate an authenticated request. It is passed to the script as part of the
$eventData
object. It is only used in case of 'Basic' authentication.
[-SimulatedUserPassword <password> ("123")]
This is the simulated password for the authentication. Default is "123".
Example
Import-Module "C:\Program Files\kenaflow\kenaflow.runtime.dll";
Invoke-Kenaflow -EventData {
Invoke-KFLinkEventSimulation `
-ItemId 1 -Data @{Title="kenaflow is cool!"} `
-Validation @{AControlField="7f53e8e3"} `
-SimulatedUserName "sharepoint\ingo" `
-SimulatedPassword "kr@ftwerk" `
-Data @{Title = "kenaflow is cool!"}
}