Skip to main content

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.

ParameterTypeRequiredDescription
CurrentDocumentIdUniqueidentifiertrueId of the document

Example

img-box-shadow

note
  • 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.

ParameterTypeRequiredDescription
DocumentTypeNameStringtrueThe document type name: Estimate, Project, Deliverable...
DocumentIdUniqueidentifiertrueId of the document
WorkflowStageIdUniqueidentifiertrueId of the stage

The query result must return the following columns:

ParameterTypeRequiredDescription
DocumentTypeNameStringtrueThe Name of the Document to be updated
DocumentIdUniqueidentifiertrueThe Id of the document to be updated
WorkflowStageIdUniqueidentifiertrueThe Workflow Stage Id to move the given document

Example

img-box-shadow

note
  • Select: choose the name of the action - ChangeDocumentsStage
  • Options: write the name of the query
Query to return the list of Deliverable children of a given Deliverable to be updated to Cancelled
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:

ParameterTypeRequiredDescription
CurrentDocumentIdUniqueidentifiertrueThe Id of the document that is executing the action
CurrentUserIdUniqueidentifierfalseThe Id of the current user that triggers the action execution

The query result must return the following columns:

ParameterTypeRequiredDescription
UserIdUniqueidentifiertrueThe Id of the user to be added to the document
TeamIdUniqueidentifiertrueThe Assignment Type Id which the user will be added

Example

img-box-shadow

note
  • Select: choose the name of the action - AssignTeam
  • Options: write the name of the query
Query to add the current user to the Executor team
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​

ParameterTypeRequiredDescription
CurrentDocumentIdUniqueidentifiertrueId of the document

Example

img-box-shadow

note
  • 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:

ParameterTypeRequiredDescription
CurrentDocumentIdUniqueidentifiertrueThe Id of the document that is executing the action
CurrentUserIdUniqueidentifierfalseThe Id of the current user that trigger the action execution

The query result must return the following columns:

ParameterTypeRequiredDescription
DocumentTypeNameUniqueidentifiertrueThe Document Type Name to be updated
DocumentIdUniqueidentifiertrueThe Id of the document to be updated
FieldNameUniqueidentifiertrueThe userfield column name
ValuestringtrueThe value to update the userfield

Example

Query to update the Version of a specific Deliverable
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