Human Tasks in Detail
Human tasks represent activities that require human judgment, approval, or interaction. They are a core component in business processes that need human involvement. The Aletyx Enterprise Build of Kogito and Drools provides robust human task management capabilities through its task service APIs.Human Task Lifecycle
Human tasks in the Aletyx Enterprise Build of Kogito and Drools follow a defined lifecycle with well-established states and transitions.Core Task States
When a process execution reaches a user task node, the task enters the following states as it progresses:- Created : Initial state when the task is instantiated
- Ready : The task is available to be worked on by potential owners
- Reserved/Claimed : The task has been claimed by a specific user
- In Progress : Work on the task has begun
- Completed : The task has been successfully finished
- Failed : The task could not be completed successfully
- Error : The task encountered an error during execution
- Exited : The task was ended before normal completion
- Obsolete : The task is no longer relevant
Task Phase Transitions
Tasks transition between phases through specific operations:- Claim : Assigns the task to a specific user, restricting access to others
- Start : Indicates that work on the task has begun
- Complete : Finishes the task successfully with result data
- Fail : Marks the task as failed with fault data
- Skip : Bypasses the task if it’s optional
- Release : Unassigns the task from a user, making it available to others
- Delegate : Temporarily transfers ownership to another user
- Forward : Completely changes ownership to another user
- Suspend : Temporarily prevents work on the task
- Resume : Allows a suspended task to be worked on again
Task Assignment
The Aletyx Enterprise Build of Kogito and Drools provides multiple ways to assign tasks to users or groups.Assignment Methods
-
Direct Assignment : Assigning to a specific user
-
Group Assignment : Assigning to a group of users
-
Expression-Based Assignment : Using expressions to calculate assignment at runtime
Assignment Parameters
The Aletyx Enterprise Build of Kogito and Drools supports the following assignment parameters:Assignment Best Practices
- Prefer Group Assignment : Assign to groups rather than individuals to avoid bottlenecks
- Use Claim Pattern : Have users claim tasks rather than directly assigning them
- Define Escalation Paths : Configure what happens if tasks aren’t completed in time
- Use Dynamic Assignment : Calculate assignments at runtime based on workload, skills, etc.
- Consider Business Admins : Designate administrators who can intervene if needed
Task Data Management
Tasks consume and produce data through a well-defined data mapping system.Input and Output Data Handling
- Task Input : Data passed to the task when it is created
- Task Output : Data produced when the task is completed
- Content Storage : Task data is stored separately from process data
Data Mapping Example
Data Access Patterns
Tasks provide several ways to access their data:- Through the Task Service API : Programmatically access task content
- Through Task Forms : Render forms based on task data
- Through Task Listeners : React to task lifecycle events
Task API Interaction
The Aletyx Enterprise Build of Kogito and Drools provides comprehensive APIs for interacting with human tasks.Core Task Services
TaskService API
TheTaskService is the main API for interacting with human tasks:
UserTaskService API
TheUserTaskService provides methods specific to user task management:
Authentication and Authorization
Task operations are protected by authentication and authorization:REST API Endpoints
Tasks can also be managed through REST endpoints:Task Lifecycle Management
http://localhost:8080/approval/ec44f890-d21d-444f-a4ec-cb88589bd79/firstLineApproval/7a520588-d5ab-464a-8378-d34fda3ff7e9/phase/complete
Collaborative Features
Tasks support comments and attachments through REST:Task Forms
Human tasks typically include a form for collecting user input.Form Types
- Generated Forms : Automatically generated based on task data
- Form Modeler Forms : Designed using the Form Modeler
- Custom Forms : Custom HTML/JavaScript forms for maximum flexibility
Form Integration
Forms are associated with tasks through form names that follow specific conventions:{processId}.{taskName}: Task-specific form{taskName}: Generic form for a task name{processId}.{taskName}-taskform: Alternative naming convention
Displaying Forms
Forms can be displayed in several ways:- Via Tasklist UI : Default user interface for task management
- Via Embedded Form Renderer : Embedding forms in custom UIs
- Via Custom UI Integration : Building custom task interfaces
Task Notifications and Deadlines
Tasks can have notifications and deadlines to ensure timely processing.Deadline Configuration
Notification Types
- Email Notifications : Send emails when deadlines approach
- Reassignments : Automatically reassign tasks when deadlines are missed
- Custom Notifications : Implement custom notification handlers
Task Event Listeners
Task event listeners allow you to react to task state changes.Custom Task Lifecycle Implementation
The Aletyx Enterprise Build of Kogito and Drools allows for custom task lifecycle definitions:Integration with External Systems
Task management can be integrated with external systems:Human Task Best Practices
Task Design Principles
- Clear Ownership : Make it obvious who should work on the task
- Sufficient Context : Provide enough information to perform the task
- Appropriate Granularity : Neither too large nor too small
- Realistic Timeframes : Set reasonable deadlines and notifications
- Error Recovery : Design for handling exceptions and error conditions
Common Anti-Patterns
- Orphaned Tasks : Tasks without clear owners or groups
- Overburdened Actors : Too many tasks assigned to the same person
- Bottleneck Users : Critical processes dependent on specific individuals
- Unclear Task Purpose : Tasks without clear instructions or outcomes
- Missing Escalation Paths : No handling for missed deadlines
Performance Considerations
- Task Indexing : Use appropriate indexing for task queries
- Task Archiving : Move completed tasks to archives
- Task Data Size : Keep task data reasonably sized
- Batch Operations : Use batch operations for bulk task management
- Monitoring : Track task performance and bottlenecks