Skip to content
🚀 Play in Aletyx Sandbox to start building your Business Processes and Decisions today! ×

GraphQL in Aletyx Enterprise Build of Kogito and Drools 10.0.0

Introduction

GraphQL provides a powerful way to query and retrieve data about process instances and user tasks. This guide covers essential queries and filtering techniques to help you effectively manage your workflow processes.

Key Query Types

1. Process Instance Queries

Retrieve information about process instances including their state, variables, and related nodes.

{
  ProcessInstances {
    id
    processId
    state
    parentProcessInstanceId
    rootProcessInstanceId
    variables
  }
}

2. User Task Queries

Retrieve details about user tasks within process instances.

{
  UserTaskInstances {
    id
    name
    actualOwner
    description
    priority
    processId
    processInstanceId
    state
  }
}

Filtering Techniques

Available Operators by Data Type

Summary of operators available

Operator String String Array ID Boolean Numeric Date
equal ✓ ✓ ✓ ✓ ✓
in ✓ ✓ ✓
like ✓
isNull ✓ ✓ ✓ ✓ ✓ ✓
contains ✓
containsAll ✓
containsAny ✓
greaterThan ✓ ✓
greaterThanEqual ✓ ✓
lessThan ✓ ✓
lessThanEqual ✓ ✓
between ✓ ✓

Basic Filtering with where

Filter results based on specific criteria:

{
  UserTaskInstances(where: {processId: {equal: "travel-booking"}}) {
    id
    name
    actualOwner
    state
  }
}

Combining Filters with Logic Operators

Use and and or operators to create complex filters:

{
  ProcessInstances(where: {
    and: {
      processId: {equal: "docReview"},
      or: [
        {state: {equal: ACTIVE}},
        {state: {equal: PENDING}}
      ]
    }
  }) {
    id
    processName
    state
  }
}

Sorting and Pagination

Sorting with orderBy

Sort results based on specific attributes:

{
  UserTaskInstances(
    where: {state: {equal: "Ready"}},
    orderBy: {priority: DESC}
  ) {
    id
    name
    priority
  }
}

Pagination

Limit and offset results:

{
  ProcessInstances(
    pagination: {limit: 10, offset: 0},
    orderBy: {start: DESC}
  ) {
    id
    processName
    state
  }
}