Official Content

This Data Type, provided by the Workflow API, represents the execution of an activity in the context of a process instance (it is the equivalent of a task in the GXflow inbox).

Properties

Property Type Access Description
Id Numeric Read Identifier
ProcessDefinition WorkflowProcessDefinition Read Process Definition
ProcessDefinitionId Numeric Read Identifier of the process definition
Priority Numeric (WorkflowPriority) Read/ Write Priority
Comments Character Read/ Write Associated comments
State Character Read State
Created DateTime Read Creation date
Ended DateTime Read Ending date
WarningTime DateTime Read/Write Deadline warning date and time
DeadlineTime DateTime Read/Write Deadline date and time
Activity WorkflowActivity Read Activity
ActivityId Numeric Read Activity Identifier
ProcessInstance WorkflowProcessInstance Read Process Instance
ProcessInstanceId Numeric Read Process instance identifier
isSubprocess Boolean Read Indicates if it is a subprocess
isDocumentActionAuthorized Boolean Read Indicates if a document action is authorized
isDocumentActionRequired Boolean Read Indicates if a document action is needed
Subprocess WorkflowProcessInstance Read Associated Subprocess
Participant WorkflowUser Read Participant User (that has the workitem assigned)
ParticipantCandidates Collection (WorkflowUser) Read Candidate users to participate in the workitem execution
DocumentInstances Collection (WorkflowDocumentInstance) Read Associated document instances
States Collection Character(WorkflowWorkitemState) Read States that a workitem may take
Collaborators Collection (WorkflowUser) Read It returns the list of users that participate in the workitem execution
Index Numeric Read Workitem index when the task defining it is array type
PreviousActivity WorkflowActivity Read Activity that was executed before
Previous WorkflowWorkitem Read Workitem that was executed before
Error WorkflowError Read Error
NodeInstance WorkflowNodeInstance Read Node instance associated with the workitem
Duration Numeric Read Workitem active time (in seconds)
ExtendedAtrributes WorkflowAttribute Read Workitem extended attributes

 

Methods

  • Load

It allows loading a workitem from its Identifier.

Load (id)

Name Type Movement Description
Id WorkflowWorkitemId Input Workitem to be loaded identifier

 

  • Complete

Completes the workitem. Before completing the workitem, the method verifies that the corresponding post-conditions are completed. The ideal condition to execute Complete() is when the workitem is in process (open.active.in_process state; see Workflow States document). Nevertheless, with the purpose of making the use of this method easier, in case the workitem is currently in assignment-pending or assigned state (but not in process), the method takes care of going through the intermediate states before the workitem is considered completed. If the workitem is in assignment-pending state, it is recommended to call the Assign()method previously, so that the user remains registered in the process history.

Complete ()

 

  • Assign

Assigns the workitem to the specified user. If the workitem is assigned, it cannot be assigned to another user (in this case, see Reassign method).

Assign (User)

Name Type Movement Description
User WorkflowUser Input User to which the workitem will be assigned

 

  • Unassign

Unassigns a workitem that was already assigned to a user.

 

  • Reassign

Reassigns a workitem that was already assigned to a user, to another user.

Reassign (sourceUser, targetUser)

Name Type Movement Description
sourceUser WorkflowUser Input User to which the workitem was assigned.
targetUser WorkflowUser Input User to which the workitem will be assigned.

 

  • ChangeState

Changes workitem state. This method only works when the workitem is in certain states, for more information you can read: Workflow Engine States.

ChangeState (state)

Name Type Movement Description
State Character (WorkflowWorkitemState) Input State that the workitem will take.

 

  • SelectSuccessiveOptionalActivity

Selects a successive optional activity. Once the workitem is completed, the instances of all the selected successive activities will be created.

SelectSuccesiveOptionalActivity (Activity)

Name Type Movement Description
Activity WorkflowActivity Input Selected Successive Activity
  • PostConditionFailed

This method allows the programmer to determine if the postconditions of a task were fulfilled or not. The programmer must evaluate postconditions before the completion of the workitem. This method receives a string as a parameter which is the error message for the user who is attempting to complete the workitem.

PostConditionFailed (Message)

Name Type Movement Description
Message Char Input Error Code

 

  • Collaborate

It allows adding collaborators to the workitem.

Collaborate (User) : WorkflowWorkitem

Name Type Movement Description
User WorkflowUser Input User to be added as a collaborator

 

  • AssignRole

It allows assigning the workitem to a specified role.

AssignRole (Role)

Name Type Movement Description
Role WorkflowRole Input Role to assign the workitem

 

  • Delegate

This method allows you to delegate a workitem to a specific user.

Delegate (User): WorkflowWorkitem

Name Type Movement Description
User WorkflowUser Input User to which the workitem will be displayed
Workitem WorkflowWorkitem Input Workitem to be delegated

 

  • DelegateToRole

This method allows you to delegate a workitem to a specific role so that all users with this role will be able to see the workitem.

DelegateToRole(Role): WorkflowWorkitem

Name Type Movement Description
Role
 
WorkflowRole Input Role to which the workitem will be delegated

 

  • AddAttribute

This method allows adding an attribute to the workitem.

AddAttribute(Attribute)

Name Type Movement Description
Attribute
 
WorkflowAttribute Input Attribute to be added

 

  • Skip

This method allows skipping this workitem.

Skip()

 

  • Undo

This method allows undoing this workitem.

Undo()

 

  • ThrowError

This method allows throwing a message as an error.

ThrowError(error)

Name Type Movement Description
error Character Input Workitem error
  • GetAttributeByName

Returns the Attribute Data type object whose name coincides with the specified one.

GetAttributeByName(name): Attribute

Name Type Movement Description
name Character Input Attribute name

 

  • RemoveAttribute

Removes an attribute from the process instance.

RemoveAttribute(attribute)

Name Type Movement Description
attribute WorkflowAttribute Input Attribute to be removed from the process instance
 

See Also

Workflow Error Codes

Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant