Workflows

Basics

--new [--wftype]

This allows you to create a new workflow.

The command must be executed in an empty directory.

You can specify --wftype=<workflow-template> with

  • "statemachine"
  • "list"
  • "site" (default is "statemachine")

Example:

--new --wftype=statemachine

HistoryList

These commands can be used to create, hide or display the history list according to the workflow configuration file in the current directory or the workflow configuration file specified with --workflow=<full path>.

  • --createhistorylist
  • --hidehistorylist
  • --showhistorylist

DataList

These commands can be used to create, hide or display the "Workflow Data" list according to the workflow configuration file in the current directory or the workflow configuration file specified with --workflow=<full-path>.

  • --createdatalist
  • --hidedatalist
  • --showdatalist

ConfigList

These commands can be used to create, hide or display the "Workflow Config" list according to the workflow configuration file in the current directory or the workflow configuration file specified with --workflow=<full-path>.

  • --createconfiglist
  • --hideconfiglist
  • --showconfiglist

StateList

These commands can be used to create, hide or display the "Workflow Config" list according to the workflow configuration file in the current directory or the workflow configuration file specified with --workflow=<full-path>.

  • --createstatelist
  • --hidestatelist
  • --showstatelist

Credentials User

These are used to store the credentials for SharePoint in a special credential file (_wfconfig-cred.ps1).

The workflow configuration file is stored in the same directory as _wfconfig.ps1. This is either in the current directory or is specified via --workflow=<full-path>.

  • --setusername
  • --setpassword

Credentials App

These are used to store the credentials for SharePoint Online in a special credential file (_wfconfig-cred.ps1).

The workflow configuration file is stored in the same directory as _wfconfig.ps1. This is either in the current directory or is specified via --workflow=<full-path>.

  • --appid
  • --appsecret

SharePoint Permissionsets

In the workflow configuration file, you can specify four permission sets that can be quickly and easily assigned to a user using the Add-KFPermission, Remove-KFPermission, and Update-KFPermission cmdlets.

We have compiled 4 meaningful SharePoint authorization levels that are often used. These follow the well-known CRUD model (Create, Read, Update, Delete). We have added "M" for "Manage" and "A" for "Approve".

Users or groups that have the corresponding permission set can perform very special tasks.

For example, anyone assigned "Create" may create elements, but not automatically read them. Accordingly, a user with "Read" authorization level may not automatically create elements.

You can specify names for the 4 authorization levels in the workflow configuration file.

With the program command --createpermissionsets these authorization levels are created in SharePoint and equipped with rights ("Base Permissions") according to our specifications.

Here is an overview of how the authorization levels are defined:

Create:

  • Add list Items (AddListItems)
  • Show List Items (ViewListItems)
  • Create Alerts (CreateAlerts)
  • View Pages (ViewPages)
  • Open (Open)

Read:

  • View list Items (ViewListItems)
  • Open List Items (OpenItems)
  • Show Version (ViewVersions)
  • Show Pages (ViewPages)
  • Open (Open)

Update:

  • Edit List Items (EditListItems)
  • Show List Items (ViewItems)
  • View Pages (ViewPages)
  • Open (Open)

Delete:

  • Delete List Items (DeketeListItems)
  • View List Items (ViewItems)
  • Show Versions (ViewVersions)
  • Delete Versions (DeleteVersions)
  • Use APIs (UseRemoteAPIs)
  • View Pages (ViewPages)
  • Open (Open)

Manage:

  • Edit list items (EditListItems)
  • View list items (ViewItems)
  • Approve list items (ApproveItems)
  • Open list Items (OpenItems)
  • Browse directories (BrowseDirectories)
  • Show Versions (ViewVersions)
  • Enumerate Permissions (EnumeratePermissions)
  • Manage Permissions (ManagePermissions)
  • Browse User Infos (BrowseUserInfo)
  • Open (Open)

Approve:

  • View list items (ViewItems)
  • Approve list items (ApproveItems)
  • Open list Items (OpenItems)
  • Show Versions (ViewVersions)
  • Browse directories (BrowseDirectories)
  • Enumerate Permissions (EnumeratePermissions)
  • Browse User Infos (BrowseUserInfo)
  • Open (Open)

--createpermissionsets

This command creates or updates the defined permissions in SharePoint according to the workflow directory.

Please take care, that you have the required rights for this or execute this command under a user who has the required rights.

Discussion