Skip to main content

EnsLib.Workflow.TaskResponse

persistent class EnsLib.Workflow.TaskResponse extends Ens.Response

SQL Table Name: EnsLib_Workflow.TaskResponse

Response from a Workflow Task request.
The Workflow Engine creates an instance of TaskResponse object as soon it receives a TaskRequest. This object is used to maintain the status of the task while it is under the control of the Workflow Engine. It also serves as the final response returned by the Workflow Engine when the task is complete.

Property Inventory

Method Inventory

Parameters

parameter DOMAIN = Ensemble;
Use our own domain for localization

Properties

property %Action as %String (MAXLEN = 128);
The user action for this task. This value is set when the task is completed.
Property methods: %ActionDisplayToLogical(), %ActionGet(), %ActionGetStored(), %ActionIsValid(), %ActionLogicalToDisplay(), %ActionLogicalToOdbc(), %ActionNormalize(), %ActionSet()
property %Actions as %String (MAXLEN = 255);
(Optional) Comma-delimited list of Actions defined for this response. This is a copy of the value provided from the initial request for this task.
Property methods: %ActionsDisplayToLogical(), %ActionsGet(), %ActionsGetStored(), %ActionsIsValid(), %ActionsLogicalToDisplay(), %ActionsLogicalToOdbc(), %ActionsNormalize(), %ActionsSet()
property %FormFields as %String (MAXLEN = 2000);
(Optional) comma-separated list of fields that should appear in the form associated with this Task.
This is a copy of the value provided from the initial request for this task.
Property methods: %FormFieldsDisplayToLogical(), %FormFieldsGet(), %FormFieldsGetStored(), %FormFieldsIsValid(), %FormFieldsLogicalToDisplay(), %FormFieldsLogicalToOdbc(), %FormFieldsNormalize(), %FormFieldsSet()
property %FormTemplate as %String (MAXLEN = 255);
(Optional) Name of csp page that provides the form template for this task.
This is a copy of the value provided from the initial request for this task.
Property methods: %FormTemplateDisplayToLogical(), %FormTemplateGet(), %FormTemplateGetStored(), %FormTemplateIsValid(), %FormTemplateLogicalToDisplay(), %FormTemplateLogicalToOdbc(), %FormTemplateNormalize(), %FormTemplateSet()
property %FormValues as array of %String) [ SqlFieldName = FormValues ];
Collection of values from the form associated with this task (if any).
Property methods: %FormValuesBuildValueArray(), %FormValuesCollectionToDisplay(), %FormValuesCollectionToOdbc(), %FormValuesDisplayToCollection(), %FormValuesDisplayToLogical(), %FormValuesGet(), %FormValuesGetObject(), %FormValuesGetObjectId(), %FormValuesGetStored(), %FormValuesGetSwizzled(), %FormValuesIsValid(), %FormValuesLogicalToDisplay(), %FormValuesLogicalToOdbc(), %FormValuesNormalize(), %FormValuesOdbcToCollection(), %FormValuesSet(), %FormValuesSetObject(), %FormValuesSetObjectId()
property %Message as %String (MAXLEN = 2000);
(Optional) Detailed message body for this task This is a copy of the value provided from the initial request for this task.
Property methods: %MessageDisplayToLogical(), %MessageGet(), %MessageGetStored(), %MessageIsValid(), %MessageLogicalToDisplay(), %MessageLogicalToOdbc(), %MessageNormalize(), %MessageSet()
property %Priority as %Integer;
Priority of the requested Task: 1 is highest; This is a copy of the value provided from the initial request for this task.
Property methods: %PriorityDisplayToLogical(), %PriorityGet(), %PriorityGetStored(), %PriorityIsValid(), %PriorityLogicalToDisplay(), %PriorityNormalize(), %PrioritySet(), %PriorityXSDToLogical()
property %RoleName as %String (MAXLEN = 128);
The name of the role that handled this task. This value is set when the task is created.
Property methods: %RoleNameDisplayToLogical(), %RoleNameGet(), %RoleNameGetStored(), %RoleNameIsValid(), %RoleNameLogicalToDisplay(), %RoleNameLogicalToOdbc(), %RoleNameNormalize(), %RoleNameSet()
property %Status as %String (MAXLEN = 50);
The external Status of this task. Used to query the current status of a task.
Property methods: %StatusDisplayToLogical(), %StatusGet(), %StatusGetStored(), %StatusIsValid(), %StatusLogicalToDisplay(), %StatusLogicalToOdbc(), %StatusNormalize(), %StatusSet()
property %Subject as %String (MAXLEN = 255);
(Optional) Short summary of this task. This is a copy of the value provided from the initial request for this task.
Property methods: %SubjectDisplayToLogical(), %SubjectGet(), %SubjectGetStored(), %SubjectIsValid(), %SubjectLogicalToDisplay(), %SubjectLogicalToOdbc(), %SubjectNormalize(), %SubjectSet()
property %TaskStatus as EnsLib.Workflow.TaskStatus [ SqlFieldName = TaskStatus ];
The internal Status of this task. Used by the Workflow Engine to manage this task. User-code should not modify the contents of this object.
Property methods: %TaskStatusGet(), %TaskStatusGetObject(), %TaskStatusGetObjectId(), %TaskStatusGetStored(), %TaskStatusGetSwizzled(), %TaskStatusIsEmpty(), %TaskStatusIsValid(), %TaskStatusNewObject(), %TaskStatusSet(), %TaskStatusSetObject(), %TaskStatusSetObjectId(), %TaskStatusUnSwizzle()
property %UserName as %String (MAXLEN = 128);
The name of the user that (last) handled this task. This value is set when the task is completed.
Property methods: %UserNameDisplayToLogical(), %UserNameGet(), %UserNameGetStored(), %UserNameIsValid(), %UserNameLogicalToDisplay(), %UserNameLogicalToOdbc(), %UserNameNormalize(), %UserNameSet()
property %UserRanking as %Integer;
Ranking associated with User that (last) handled this task (if the user has a role-assigned ranking).
Property methods: %UserRankingDisplayToLogical(), %UserRankingGet(), %UserRankingGetStored(), %UserRankingIsValid(), %UserRankingLogicalToDisplay(), %UserRankingNormalize(), %UserRankingSet(), %UserRankingXSDToLogical()
property %UserTitle as %String (MAXLEN = 128);
Title associated with User that (last) handled this task (if the user has a role-assigned title).
Property methods: %UserTitleDisplayToLogical(), %UserTitleGet(), %UserTitleGetStored(), %UserTitleIsValid(), %UserTitleLogicalToDisplay(), %UserTitleLogicalToOdbc(), %UserTitleNormalize(), %UserTitleSet()

Methods

final method AssignTask(pUser As %String, ByRef pCount As %Integer) as %Status
This Workflow API method assigns a Task to a specific User.
final method CompleteTask(pAction As %String = "") as %Status
This Workflow API method marks a task as complete and returns a response to the original requestor.
final method FindLeastBusyUser(Output pUserName As %String, Output pCount As %Integer) as %Status
Find the name of the highest-ranked, active user within the given role that has the least number of tasks (for any role) assigned to them. On return pCount has current number of tasks for this user.
method OnAction(pAction As %String) as %Status
This method is called when a user takes an action on a Task.
Default implementation completes the task.
method OnAssign(pUser As %String) as %Status
This method is called by the Workflow Engine when a user wishes to take ownership of the related task.
Default implementation performs the assignment.
method OnCancel() as %Status
This method is called by the Workflow Engine when a Task is cancelled.
This happens when the original request times out.
This method is called after all the Worklist items for this task have been deleted and before this Task is deleted.
method OnFormSubmit() as %Status
This callback is invoked when the form associated with this task is submitted.
method OnNewTask(pRequest As EnsLib.Workflow.TaskRequest) as %Status
This method is called when a new Task is received by the Workflow Engine. Default implementation does the following:
If the request includes a valid, active UserName, assign task to that user. Otherwise, make task available to all members of the current Role.
method OnRelinquish(pUser As %String) as %Status
This method is called by the Workflow Engine when a user wishes to relinquish ownership of the related task.
Default implementation unassigns the task.
method OnRoleChange(pName As %String, pReason As %String, pOwned As %Boolean = 0) as %Status
This method is called by the Workflow Engine when a User or Role definition associated with this task is modified.
pName is the User or Role name.
pOwned is true if this user was the owner of this task.
pReason describes the change and is one of the following:
  • $$$WfUserDeleted
  • $$$$$$WfUserInactivated
  • $$$WfRoleDeleted
final method SendTask(pUser As %String, Output pCount As %Integer) as %Status
This Workflow API method sends (but does not assign) a Task to a specific User. pUser is the name of the user. On return, pCount is number of users task was sent to.
final method SendTaskToAll(Output pCount As %Integer) as %Status
This Workflow API method sends (but does not assign) a Task to all Users within the current Role. On return, pCount is number of users task was sent to.
final method SendTaskToTitle(pTitle As %String = "", Output pCount As %Integer) as %Status
This Workflow API method sends (but does not assign) a Task to all Users within the current Role with title pTitle. On return, pCount is number of users task was sent to.
final method SendTaskToTop(pNum As %Integer = 1, Output pCount As %Integer) as %Status
This Workflow API method sends (but does not assign) a Task to pNum top ranked Users within the current Role. On return, pCount is number of users task was sent to.
final method UnassignTask(pUser As %String = "") as %Status
This Workflow API method unassign a Task associated with specific User. Tests if pUser owns the task (if provided).

Indexes

index ($EnsLib.Workflow.TaskResponse on ) [Extent, Type = bitmap];
index (RequestIdx on %TaskStatus.Request);
Index methods: RequestIdxExists()
index (RoleIdx on %TaskStatus.Role:Exact) [Type = bitmap];

Inherited Members

Inherited Methods

Storage

Gray indicates storage defined by superclasses.

Storage Model: CacheStorage (Ens.MessageBody)

^Ens.MessageBodyD(ID)
=
%%CLASSNAME

Storage Model: CacheStorage (EnsLib.Workflow.TaskResponse)

^Ens.MessageBodyD(ID,"%FormValues",n)
=
%FormValues(n)

Storage Model: CacheStorage (EnsLib.Workflow.TaskResponse)

^Ens.MessageBodyD(ID,"TaskResponse")
=
%Action
%Form
%UserName
%RoleName
%TaskStatus
%FormFields
%FormTemplate
%Actions
%Message
%Subject
%Priority
%Status
%UserRanking
%UserTitle
FeedbackOpens in a new tab