Actions
On this page you will find how to create an action of the type Transition based in Data Source.
Block / Unblock
This action returns a list of documents that were blocked or unblocked accordingly with the rule of the query.
Parameter | Type | Required | Description |
---|---|---|---|
CurrentDocumentId | Uniqueidentifier | true | Id of the document |
Example
- Select: choose the name of the action - BlockDocuments
- Options: write the name of the query
Change Documents Stage
Affects the Stage of the Documents listed.
Parameter | Type | Required | Description |
---|---|---|---|
DocumentTypeName | String | true | The document type name: Estimate, Project, Deliverable... |
DocumentId | Uniqueidentifier | true | Id of the document |
WorkflowStageId | Uniqueidentifier | true | Id of the stage |
The query result must return the following columns:
Parameter | Type | Required | Description |
---|---|---|---|
DocumentTypeName | String | true | The Name of the Document to be updated |
DocumentId | Uniqueidentifier | true | The Id of the document to be updated |
WorkflowStageId | Uniqueidentifier | true | The Workflow Stage Id to move the given document |
Example
- Select: choose the name of the action - ChangeDocumentsStage
- Options: write the name of the query
select 'Deliverable' as DocumentTypeName,
sd.oid as DocumentId,
ws.Oid as WorkflowStageId
from Deliverable d, WorkflowState dws, Deliverable sd, Document doc, WorkflowState ws, WorkflowState sdws
where d.Oid = @CurrentDocumentId
and dws.Oid = d.WorkflowState
and sd.Parent = d.Oid
and sd.WorkflowState = sdws.Oid
and sdws.Name not in ('Delivered', 'Completed', 'Cancelled')
and doc.TypeName = 'Skill.Module.BusinessObjects.Deliverable'
and ws.Document = doc.Oid
and ws.Name = 'Cancelled'
Assign Team
When changing the stage of the document places Users in a set of Teams.
Below are the parameters available to execute the query:
Parameter | Type | Required | Description |
---|---|---|---|
CurrentDocumentId | Uniqueidentifier | true | The Id of the document that is executing the action |
CurrentUserId | Uniqueidentifier | false | The Id of the current user that triggers the action execution |
The query result must return the following columns:
Parameter | Type | Required | Description |
---|---|---|---|
UserId | Uniqueidentifier | true | The Id of the user to be added to the document |
TeamId | Uniqueidentifier | true | The Assignment Type Id which the user will be added |
Example
- Select: choose the name of the action - AssignTeam
- Options: write the name of the query
select
@CurrentUserId as UserId,
t.oid as TeamId
from Deliverable d, AssignmentType t
where
d.Oid = @CurrentDocumentId and
t.Name = 'Executor'
Custom Table Write
Adds or Updates entries in a Custom Table
Returns the entries to add in the Table
Useful to save Additional Information
Parameter | Type | Required | Description |
---|---|---|---|
CurrentDocumentId | Uniqueidentifier | true | Id of the document |
Example
- Select: choose the name of the action - CustomTableWrite
- Options: name of the custom table; name of the query
UpdateFieldValues
When the transition is executed, userfields will be updated accordingly.
Below are the parameters available to execute the query:
Parameter | Type | Required | Description |
---|---|---|---|
CurrentDocumentId | Uniqueidentifier | true | The Id of the document that is executing the action |
CurrentUserId | Uniqueidentifier | false | The Id of the current user that trigger the action execution |
The query result must return the following columns:
Parameter | Type | Required | Description |
---|---|---|---|
DocumentTypeName | Uniqueidentifier | true | The Document Type Name to be updated |
DocumentId | Uniqueidentifier | true | The Id of the document to be updated |
FieldName | Uniqueidentifier | true | The userfield column name |
Value | string | true | The value to update the userfield |
Example
select 'Deliverable' as DocumentTypeName,
j.Oid as DocumentId,
'PreviousVersion' as FieldName,
[Version] as Value
from Deliverable_UserFields j
where ProofID is null
and [Version] is not null
and j.Oid = @CurrentDocumentId
and charindex('.', [Version], 0) > 0