Datapolis Process System SDK
WBAdministration
WBAdministration is an interface in Datapolis Process System which contains below methods.
In this section you will find examples how to use this interface in PowerShell.
Just like in WBInterface, you can use two different methods of consuming the interface.
Setting Variables
There are a few variables which should be declared before moving on, as they are required by functions in both methods. They are:
This values can be typed inline
$uri
=
"http://wb2013-dev-ab/"
$workflowname
"SomeWorkflow"
$xaml
= [IO.File]::ReadAllText(
'C:\Users\Alf\Desktop\workflow_definition.xaml'
)
Object Model
First you need to load SharePoint module in PowerShell. Run this command only if you are using regular PowerShell (not SharePoint Management Shell)
Add-PSSnapin Microsoft.Sharepoint.Powershell
Then Load Datapolis Process System dll files
[Reflection.Assembly]::LoadWithPartialName(
"Datapolis.WorkBox.Common"
"Datapolis.WorkBox.Utilities"
Get demanded SPWeb (this one where matching / deploying will be performed)
$web
= Get-SPWeb
Get Datapolis Process System Administration Manager. Pass SPWeb as parameter.
$manager
= New-Object Datapolis.WorkBox.Common.WBInterface.WBAdministrationManager(
This variable will store result of an operation. WBResultInfo. Result tells whether operation succeeded, WBResultInfo.Message contains communicates about method execution.
$result
= New-Object Datapolis.WorkBox.Utilities.WBInterface.WBResultInfo
Match workflow xaml file. If matching was done without errors, xaml file of workflow will be replaced with given one
.MatchXaml(
,
Deploy workflow definition (association)
.DeployWorkflow(
Web Service
The Service is accessible the same way as WBInterface. It can be found under the following url: http://[WebUrl]/_layouts/15/Datapolis.WorkBox/WBAdministration.asmx
So first change a little previous code:
"http://wb2013-dev-ab/_layouts/15/Datapolis.WorkBox/WBAdministration.asmx?WSDL"
Create a service object. Command below uses default credentials (logged windows user account)
$service
= New-WebServiceProxy -Uri
-UseDefaultCredential
Add calling Web Methods