@camunda8/sdk
    Preparing search index...

    Class TasklistApiClient

    The high-level client for the Tasklist REST API

    
    
    Index

    Constructors

    • Tasklist API Client. All constructor parameters for configuration are optional. If no configuration is provided, the SDK will use environment variables to configure itself. See CamundaSDKConfiguration for the complete list of configuration parameters. Values can be passed in explicitly in code, or set via environment variables (recommended: separate configuration and application logic). Explicitly set values will override environment variables, which are merged into the configuration.

      Parameters

      • Optionaloptions: {
            config?: DeepPartial<
                {
                    CAMUNDA_AUTH_STRATEGY: | "BASIC"
                    | "OAUTH"
                    | "BEARER"
                    | "COOKIE"
                    | "NONE";
                    CAMUNDA_BASIC_AUTH_PASSWORD: undefined
                    | string;
                    CAMUNDA_BASIC_AUTH_USERNAME: undefined | string;
                    CAMUNDA_CONSOLE_BASE_URL: undefined | string;
                    CAMUNDA_CONSOLE_CLIENT_ID: undefined | string;
                    CAMUNDA_CONSOLE_CLIENT_SECRET: undefined | string;
                    CAMUNDA_CONSOLE_OAUTH_AUDIENCE: string;
                    CAMUNDA_COOKIE_AUTH_PASSWORD: string;
                    CAMUNDA_COOKIE_AUTH_URL: string;
                    CAMUNDA_COOKIE_AUTH_USERNAME: string;
                    CAMUNDA_CUSTOM_CERT_CHAIN_PATH: undefined | string;
                    CAMUNDA_CUSTOM_PRIVATE_KEY_PATH: undefined | string;
                    CAMUNDA_CUSTOM_ROOT_CERT_PATH: undefined | string;
                    CAMUNDA_CUSTOM_ROOT_CERT_STRING: undefined | string;
                    CAMUNDA_CUSTOM_USER_AGENT_STRING: undefined | string;
                    CAMUNDA_JOB_WORKER_MAX_BACKOFF_MS: number;
                    CAMUNDA_LOG_LEVEL:
                        | "none"
                        | "error"
                        | "http"
                        | "warn"
                        | "info"
                        | "verbose"
                        | "debug"
                        | "silly";
                    CAMUNDA_MODELER_BASE_URL: string;
                    CAMUNDA_MODELER_OAUTH_AUDIENCE: undefined
                    | string;
                    CAMUNDA_OAUTH_DISABLED: boolean;
                    CAMUNDA_OAUTH_TOKEN: undefined | string;
                    CAMUNDA_OAUTH_TOKEN_REFRESH_THRESHOLD_MS: number;
                    CAMUNDA_OAUTH_URL: undefined | string;
                    CAMUNDA_OPERATE_BASE_URL: undefined | string;
                    CAMUNDA_OPERATE_OAUTH_AUDIENCE: string;
                    CAMUNDA_OPTIMIZE_BASE_URL: undefined | string;
                    CAMUNDA_OPTIMIZE_OAUTH_AUDIENCE: string;
                    CAMUNDA_SECURE_CONNECTION: undefined | boolean;
                    CAMUNDA_SUPPORT_LOG_ENABLED: boolean;
                    CAMUNDA_SUPPORT_LOG_FILE_PATH: undefined | string;
                    CAMUNDA_TASKLIST_BASE_URL: undefined | string;
                    CAMUNDA_TASKLIST_OAUTH_AUDIENCE: string;
                    CAMUNDA_TENANT_ID: undefined | string;
                    CAMUNDA_TOKEN_CACHE_DIR: undefined | string;
                    CAMUNDA_TOKEN_DISK_CACHE_DISABLE: boolean;
                    CAMUNDA_TOKEN_SCOPE: undefined | string;
                    CAMUNDA_ZEEBE_OAUTH_AUDIENCE: undefined | string;
                    ZEEBE_ADDRESS: undefined | string;
                    ZEEBE_CLIENT_ID: undefined | string;
                    ZEEBE_CLIENT_SECRET: undefined | string;
                    ZEEBE_GRPC_ADDRESS: string;
                    ZEEBE_REST_ADDRESS: string;
                    ZEEBE_TOKEN_AUDIENCE: string;
                    zeebeGrpcSettings: {
                        GRPC_HTTP2_MAX_PINGS_WITHOUT_DATA: number;
                        GRPC_HTTP2_MIN_PING_INTERVAL_WITHOUT_DATA_MS: number;
                        GRPC_HTTP2_MIN_TIME_BETWEEN_PINGS_MS: number;
                        GRPC_INITIAL_RECONNECT_BACKOFF_MS: string | 1000;
                        GRPC_KEEPALIVE_PERMIT_WITHOUT_CALLS: number;
                        GRPC_KEEPALIVE_TIME_MS: number;
                        GRPC_KEEPALIVE_TIMEOUT_MS: number;
                        GRPC_MAX_RECONNECT_BACKOFF_MS: string | 10000;
                        GRPC_MIN_RECONNECT_BACKOFF_MS: string | 5000;
                        ZEEBE_CLIENT_LOG_LEVEL: "NONE" | "DEBUG" | "INFO";
                        ZEEBE_CLIENT_LOG_TYPE: "JSON" | "SIMPLE";
                        ZEEBE_GRPC_CLIENT_CONNECTION_TOLERANCE_MS: number;
                        ZEEBE_GRPC_CLIENT_EAGER_CONNECT: boolean;
                        ZEEBE_GRPC_CLIENT_INITIAL_CONNECTION_TOLERANCE_MS: undefined | number;
                        ZEEBE_GRPC_CLIENT_MAX_RETRIES: number;
                        ZEEBE_GRPC_CLIENT_MAX_RETRY_TIMEOUT_SECONDS: number;
                        ZEEBE_GRPC_CLIENT_RETRY: boolean;
                        ZEEBE_GRPC_WORKER_LONGPOLL_SECONDS: number;
                        ZEEBE_GRPC_WORKER_POLL_INTERVAL_MS: number;
                        ZEEBE_INSECURE_CONNECTION: undefined | boolean;
                    };
                },
            >;
            oAuthProvider?: IHeadersProvider<AuthHeader>;
        }

      Returns TasklistApiClient

      const tasklist = new TasklistApiClient()
      const tasks = await tasklist.getTasks({ state: TaskState.CREATED })

    Methods

    • Assign a task with taskId to assignee or the active user.

      Parameters

      • __namedParameters: { allowOverrideAssignment?: boolean; assignee?: string; taskId: string }

      Returns Promise<TaskResponse>

      Status 400 - An error is returned when the task is not active (not in the CREATED state). Status 400 - An error is returned when task was already assigned, except the case when JWT authentication token used and allowOverrideAssignment = true. Status 403 - An error is returned when user doesn't have the permission to assign another user to this task. Status 404 - An error is returned when the task with the taskId is not found.

    • Complete a task with taskId and optional variables

      Parameters

      • taskId: string
      • Optionalvariables: JSONDoc

      Returns Promise<TaskResponse>

      Status 400 An error is returned when the task is not active (not in the CREATED state).

      Status 400 An error is returned if the task was not claimed (assigned) before.

      Status 400 An error is returned if the task is not assigned to the current user.

      Status 403 User has no permission to access the task (Self-managed only).

      Status 404 An error is returned when the task with the taskId is not found.

    • Get the form details by form id and processDefinitionKey.

      Parameters

      • formId: string
      • processDefinitionKey: string
      • Optionalversion: string | number

      Returns Promise<Form>

    • This method returns a list of task variables for the specified taskId and variableNames. If the variableNames parameter is empty, all variables associated with the task will be returned.

      Parameters

      • __namedParameters: {
            includeVariables?: { alwaysReturnFullValue: boolean; name: string }[];
            taskId: string;
            variableNames?: string[];
        }

      Returns Promise<VariableSearchResponse[]>

    • Unassign a task with taskId

      Parameters

      • taskId: string

      Returns Promise<TaskResponse>

      Status 400 An error is returned when the task is not active (not in the CREATED state).

      Status 400 An error is returned if the task was not claimed (assigned) before.

      Status 404 An error is returned when the task with the taskId is not found.