DigiOffice API Services Services

<back to all web services

FinishTaskOperation

Requires Authentication
The following routes are available for this service:
POST/api/workflowtasks/finish
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


class WorkflowTransitionDTO implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $ID='',
        /** @var string|null */
        public ?string $Name=null,
        /** @var bool|null */
        public ?bool $AssignmentAtStartWorkflowIsAdHoc=null,
        /** @var bool|null */
        public ?bool $AssignmentIsAdHocRequired=null,
        /** @var bool|null */
        public ?bool $DeferAtStartWorkflowIsAdHoc=null,
        /** @var bool|null */
        public ?bool $IsNext=null,
        /** @var array<int>|null */
        public ?array $UserIDs=null,
        /** @var array<int>|null */
        public ?array $GroupIDs=null,
        /** @var array<int>|null */
        public ?array $RoleIDs=null,
        /** @var DateTime|null */
        public ?DateTime $DeferUntil=null,
        /** @var string|null */
        public ?string $DeferralNote=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ID'])) $this->ID = $o['ID'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['AssignmentAtStartWorkflowIsAdHoc'])) $this->AssignmentAtStartWorkflowIsAdHoc = $o['AssignmentAtStartWorkflowIsAdHoc'];
        if (isset($o['AssignmentIsAdHocRequired'])) $this->AssignmentIsAdHocRequired = $o['AssignmentIsAdHocRequired'];
        if (isset($o['DeferAtStartWorkflowIsAdHoc'])) $this->DeferAtStartWorkflowIsAdHoc = $o['DeferAtStartWorkflowIsAdHoc'];
        if (isset($o['IsNext'])) $this->IsNext = $o['IsNext'];
        if (isset($o['UserIDs'])) $this->UserIDs = JsonConverters::fromArray('int', $o['UserIDs']);
        if (isset($o['GroupIDs'])) $this->GroupIDs = JsonConverters::fromArray('int', $o['GroupIDs']);
        if (isset($o['RoleIDs'])) $this->RoleIDs = JsonConverters::fromArray('int', $o['RoleIDs']);
        if (isset($o['DeferUntil'])) $this->DeferUntil = JsonConverters::from('DateTime', $o['DeferUntil']);
        if (isset($o['DeferralNote'])) $this->DeferralNote = $o['DeferralNote'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ID)) $o['ID'] = $this->ID;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->AssignmentAtStartWorkflowIsAdHoc)) $o['AssignmentAtStartWorkflowIsAdHoc'] = $this->AssignmentAtStartWorkflowIsAdHoc;
        if (isset($this->AssignmentIsAdHocRequired)) $o['AssignmentIsAdHocRequired'] = $this->AssignmentIsAdHocRequired;
        if (isset($this->DeferAtStartWorkflowIsAdHoc)) $o['DeferAtStartWorkflowIsAdHoc'] = $this->DeferAtStartWorkflowIsAdHoc;
        if (isset($this->IsNext)) $o['IsNext'] = $this->IsNext;
        if (isset($this->UserIDs)) $o['UserIDs'] = JsonConverters::toArray('int', $this->UserIDs);
        if (isset($this->GroupIDs)) $o['GroupIDs'] = JsonConverters::toArray('int', $this->GroupIDs);
        if (isset($this->RoleIDs)) $o['RoleIDs'] = JsonConverters::toArray('int', $this->RoleIDs);
        if (isset($this->DeferUntil)) $o['DeferUntil'] = JsonConverters::to('DateTime', $this->DeferUntil);
        if (isset($this->DeferralNote)) $o['DeferralNote'] = $this->DeferralNote;
        return empty($o) ? new class(){} : $o;
    }
}

class FinishTaskOperation implements JsonSerializable
{
    public function __construct(
        /** @var int[]|null */
        public ?array $TaskIDs=null,
        /** @var string|null */
        public ?string $WSVerbindingID=null,
        /** @var array<WorkflowTransitionDTO>|null */
        public ?array $Transitions=null,
        /** @var DateTime|null */
        public ?DateTime $DeferTo=null,
        /** @var string|null */
        public ?string $Reason=null,
        /** @var string|null */
        public ?string $Comment=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['TaskIDs'])) $this->TaskIDs = JsonConverters::fromArray('int', $o['TaskIDs']);
        if (isset($o['WSVerbindingID'])) $this->WSVerbindingID = $o['WSVerbindingID'];
        if (isset($o['Transitions'])) $this->Transitions = JsonConverters::fromArray('WorkflowTransitionDTO', $o['Transitions']);
        if (isset($o['DeferTo'])) $this->DeferTo = JsonConverters::from('DateTime', $o['DeferTo']);
        if (isset($o['Reason'])) $this->Reason = $o['Reason'];
        if (isset($o['Comment'])) $this->Comment = $o['Comment'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->TaskIDs)) $o['TaskIDs'] = JsonConverters::toArray('int', $this->TaskIDs);
        if (isset($this->WSVerbindingID)) $o['WSVerbindingID'] = $this->WSVerbindingID;
        if (isset($this->Transitions)) $o['Transitions'] = JsonConverters::toArray('WorkflowTransitionDTO', $this->Transitions);
        if (isset($this->DeferTo)) $o['DeferTo'] = JsonConverters::to('DateTime', $this->DeferTo);
        if (isset($this->Reason)) $o['Reason'] = $this->Reason;
        if (isset($this->Comment)) $o['Comment'] = $this->Comment;
        return empty($o) ? new class(){} : $o;
    }
}

PHP FinishTaskOperation DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /api/workflowtasks/finish HTTP/1.1 
Host: test-do-services.klokgroep.nl 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"TaskIDs":[0],"WSVerbindingID":"00000000-0000-0000-0000-000000000000","Transitions":null,"DeferTo":"0001-01-01T00:00:00.0000000","Reason":"String","Comment":"String"}