Class Reference
IRIS for UNIX 2019.2
InterSystems: The power behind what matters   
Documentation  Search
  [ENSLIB] >  [EnsLib] >  [Workflow] >  [RoleDefinition]
Private  Storage   

persistent class EnsLib.Workflow.RoleDefinition extends %Persistent, %XML.Adaptor, %CSP.Util.AutoForm

Defines a workflow role and its members.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
1 3 7 4 1 1


Summary

Properties
Capacity Description Name

Methods
%AddToSaveSet %AddToSyncSet %BMEBuilt %CheckConstraints
%CheckConstraintsForExtent %ClassIsLatestVersion %ClassName %ComposeOid
%ConstructClone %Delete %DeleteExtent %DeleteId
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Exists
%ExistsId %Extends %GUID %GUIDSet
%GetLock %GetParameter %GetSwizzleObject %Id
%InsertBatch %IsA %IsModified %IsNull
%KillExtent %KillExtentData %LoadFromMemory %LockExtent
%LockId %New %NormalizeObject %ObjectIsNull
%ObjectModified %Oid %OnBeforeAddToSync %OnDelete
%OnDetermineClass %Open %OpenId %OriginalNamespace
%PackageName %PhysicalAddress %PurgeIndices %Reload
%RemoveFromSaveSet %ResolveConcurrencyConflict %RollBack %Save
%SaveDirect %SaveIndices %SerializeObject %SetModified
%SortBegin %SortEnd %SyncObjectIn %SyncTransport
%UnlockExtent %UnlockId %ValidateIndices %ValidateObject
AddUserToRole CreateInstance CreateRole DispatchSubmit
DoSubmit DrawFormButtons DrawHTMLForm DrawHTMLFormFields
DrawHTMLTable GetComboBoxHTML GetFormError GetUserSet
OnDefineButtons OnSubmit ProcessSubmit RemoveUserFromRole
SetFormError Submit XMLDTD XMLExport
XMLExportToStream XMLExportToString XMLNew XMLSchema
XMLSchemaNamespace XMLSchemaType


Parameters

• parameter DOMAIN = "Ensemble";
Use our own domain for localization

Properties

• property Capacity as %Integer(CAPTION="@EnsColumns:Capacity@Capacity",MINVAL=1) [ InitialExpression = 100 ];
Defines the capacity of this Role.
This value is used to report the number of active tasks assigned to a Role as a percentage value.
• property Description as %String(CAPTION="@EnsColumns:Description@Description",MAXLEN=2000,XMLNAME="description",XMLPROJECTION="element");
(Optional) Description for this role.
• property Name as %String(CAPTION="@Ensemble:Name@Name",MAXLEN=128,XMLNAME="name",XMLPROJECTION="attribute") [ Required ];
The (unique) name of this role.

Methods

• classmethod %OnDelete(oid As %ObjectIdentity) as %Status
This callback method is invoked by the %Delete method to provide notification that the object specified by oid is being deleted.

If this method returns an error then the object will not be deleted.

• classmethod AddUserToRole(pRoleName As %String, pUserName As %String, pRanking As %Integer = 3, pTitle As %String = "") as %Status
Add an additional user to the specified workflow role. pRoleName is the name of the role.
pUserName is the name of the user.
pRanking is the optional rank of this user within the role.
pTitle is the optional title of this user within the role.
• classmethod CreateRole(pRoleName As %String) as %Status
Create a Workflow role
• classmethod DrawHTMLFormFields(pObj As %RegisteredObject) as %Status
• method GetUserSet(pTitle As %String = "") as %ResultSet
Returns a %ResultSet of all active users for this role. The returned result set is executed and ready to be read from. If pTitle is provided, filter results by Title.
• method OnSubmit(ByRef pID As %String, pSubmit As %String) as %Status
This callback is called when this form is submitted. pID is the ID value associated with the form. The default implementation will perform a Save if the AutoForm is a persistent object.
pSubmit is the name of the submit button (i.e., $AUTOFORM_SAVE).
• classmethod RemoveUserFromRole(pRoleName As %String, pUserName As %String) as %Status
Remove an existing user from the specified workflow role. pRoleName is the name of the role.
pUserName is the name of the user.

Queries

• query ActiveUsersForRole(pRoleName As %String = "")
SQL Query :
SELECT UserName, Ranking, Title
FROM RoleMembership
WHERE RoleName = :pRoleName AND UserName->IsActive = 1
ORDER BY Ranking
Returns set of active Users for a given Role ordered by ranking
• query ActiveUsersForRoleByTitle(pRoleName As %String = "", pTitle As %String = "")
SQL Query :
SELECT UserName, Ranking, Title
FROM RoleMembership
WHERE RoleName = :pRoleName AND
Title = :pTitle AND
UserName->IsActive = 1
ORDER BY Ranking
Returns set of active Users for a given Role with a given title ordered by ranking.
• query Roles()
SQL Query :
SELECT R.Name As Name,
R.Description,
R.Capacity,
(SELECT COUNT(*) FROM RoleMembership WHERE RoleName = R.Name) As Users
FROM RoleDefinition R
ORDER BY R.Name
Returns set of all available Roles.
• query UsersForRole(pRoleName As %String = "")
SQL Query :
SELECT UserName, Ranking, Title, UserName->IsActive As IsActive, User As CurrUser
FROM RoleMembership
WHERE RoleName = :pRoleName
ORDER BY Ranking
Returns set of all Users for a given Role ordered by Ranking.

Indices

•index (ID on Name) [IdKey];

Triggers

•trigger SQLDelete (BEFORE event DELETE)
SQL Delete Trigger


Copyright (c) 2019 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.