> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eorion.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 获取活动实例

> Retrieves an Activity Instance (Tree) for a given process instance by id.



## OpenAPI

````yaml GET /process-instance/{id}/activity-instances
openapi: 3.0.2
info:
  title: ORION Platform REST API
  description: OpenApi Spec for ORION Camunda Platform REST API.
  version: 7.22.6-ee
  license:
    name: Apache License 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: http://{host}:{port}/{contextPath}
    description: The API server for the default process engine
    variables:
      host:
        default: localhost
      port:
        default: '8080'
      contextPath:
        default: engine-rest
  - url: http://{host}:{port}/{contextPath}/engine/{engineName}
    description: The API server for a named process engine
    variables:
      host:
        default: localhost
      port:
        default: '8080'
      contextPath:
        default: engine-rest
      engineName:
        default: default
  - url: '{url}'
    description: The API server with a custom url
    variables:
      url:
        default: ''
security:
  - basicAuth: []
tags:
  - name: Authorization
  - name: Batch
  - name: Condition
  - name: Decision Definition
  - name: Decision Requirements Definition
  - name: Deployment
  - name: Engine
  - name: Event Subscription
  - name: Execution
  - name: External Task
  - name: Filter
  - name: Group
  - name: Historic Activity Instance
  - name: Historic Batch
  - name: Historic Decision Definition
  - name: Historic Decision Instance
  - name: Historic Decision Requirements Definition
  - name: Historic Detail
  - name: Historic External Task Log
  - name: Historic Identity Link Log
  - name: Historic Incident
  - name: Historic Job Log
  - name: Historic Process Definition
  - name: Historic Process Instance
  - name: Historic Task Instance
  - name: Historic User Operation Log
  - name: Historic Variable Instance
  - name: History Cleanup
  - name: Identity
  - name: Incident
  - name: Job
  - name: Job Definition
  - name: Message
  - name: Metrics
  - name: Migration
  - name: Modification
  - name: Process Definition
  - name: Process Instance
  - name: Signal
  - name: Schema Log
  - name: Task
  - name: Task Attachment
  - name: Task Comment
  - name: Task Identity Link
  - name: Task Local Variable
  - name: Task Variable
  - name: Telemetry
  - name: Tenant
  - name: User
  - name: Variable Instance
  - name: Version
externalDocs:
  description: Find out more about ORION Rest API
  url: https://docs.eorion.com
paths:
  /process-instance/{id}/activity-instances:
    get:
      tags:
        - Process Instance
      summary: Get Activity Instance
      description: >-
        Retrieves an Activity Instance (Tree) for a given process instance by
        id.
      operationId: getActivityInstanceTree
      parameters:
        - name: id
          in: path
          schema:
            type: string
          required: true
          description: >-
            The id of the process instance for which the activity instance
            should be retrieved.
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActivityInstanceDto'
              examples:
                example-1:
                  summary: >-
                    GET
                    `/process-instance/aProcessInstanceId/activity-instances`
                  value:
                    id: eca75c6b-f70c-11e9-8777-e4a7a094a9d6
                    parentActivityInstanceId: null
                    activityId: invoice:2:e9d77375-f70c-11e9-8777-e4a7a094a9d6
                    activityType: processDefinition
                    processInstanceId: eca75c6b-f70c-11e9-8777-e4a7a094a9d6
                    processDefinitionId: invoice:2:e9d77375-f70c-11e9-8777-e4a7a094a9d6
                    childActivityInstances:
                      - id: approveInvoice:eca89509-f70c-11e9-8777-e4a7a094a9d6
                        parentActivityInstanceId: eca75c6b-f70c-11e9-8777-e4a7a094a9d6
                        activityId: approveInvoice
                        activityType: userTask
                        processInstanceId: eca75c6b-f70c-11e9-8777-e4a7a094a9d6
                        processDefinitionId: invoice:2:e9d77375-f70c-11e9-8777-e4a7a094a9d6
                        childActivityInstances: []
                        childTransitionInstances: []
                        executionIds:
                          - eca75c6b-f70c-11e9-8777-e4a7a094a9d6
                        activityName: Approve Invoice
                        incidentIds:
                          - 648d7e21-f71c-11e9-a725-e4a7a094a9d6
                        incidents:
                          - id: 648d7e21-f71c-11e9-a725-e4a7a094a9d6
                            activityId: AttachedTimerBoundaryEvent
                        name: Approve Invoice
                    childTransitionInstances: []
                    executionIds:
                      - eca75c6b-f70c-11e9-8777-e4a7a094a9d6
                    activityName: Invoice Receipt
                    incidentIds: null
                    incidents: null
                    name: Invoice Receipt
          description: Request successful.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionDto'
          description: Process instance with given id does not exist.
components:
  schemas:
    ActivityInstanceDto:
      type: object
      description: >-
        A JSON object corresponding to the Activity Instance tree of the given
        process instance.
      properties:
        id:
          type: string
          nullable: true
          description: The id of the activity instance.
        parentActivityInstanceId:
          type: string
          nullable: true
          description: >-
            The id of the parent activity instance, for example a sub process
            instance.
        activityId:
          type: string
          nullable: true
          description: The id of the activity.
        activityName:
          type: string
          nullable: true
          description: The name of the activity
        name:
          type: string
          nullable: true
          description: >-
            The name of the activity. This property is deprecated. Please use
            'activityName'.
        activityType:
          type: string
          nullable: true
          description: >-
            The type of activity (corresponds to the XML element name in the
            BPMN 2.0, e.g., 'userTask')
        processInstanceId:
          type: string
          nullable: true
          description: The id of the process instance this activity instance is part of.
        processDefinitionId:
          type: string
          nullable: true
          description: The id of the process definition.
        childActivityInstances:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/ActivityInstanceDto'
          description: A list of child activity instances.
        childTransitionInstances:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/TransitionInstanceDto'
          description: >-
            A list of child transition instances.

            A transition instance represents an execution waiting in an
            asynchronous continuation.
        executionIds:
          type: array
          nullable: true
          items:
            type: string
          description: A list of execution ids.
        incidentIds:
          type: array
          nullable: true
          items:
            type: string
          description: A list of incident ids.
        incidents:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/ActivityInstanceIncidentDto'
          description: |-
            A list of JSON objects containing incident specific properties:
            * `id`: the id of the incident
            * `activityId`: the activity id in which the incident occurred
    ExceptionDto:
      title: ExceptionDto
      type: object
      properties:
        type:
          type: string
          nullable: true
          description: An exception class indicating the occurred error.
        message:
          type: string
          nullable: true
          description: A detailed message of the error.
        code:
          type: number
          description: >-
            The code allows your client application to identify the error in an
            automated fashion.

            You can look up the meaning of all built-in codes and learn how to
            add custom codes

            in the [User
            Guide](https://docs.camunda.org/manual/7.22/user-guide/process-engine/error-handling/#exception-codes).
    TransitionInstanceDto:
      type: object
      description: >-
        A JSON object corresponding to the Activity Instance tree of the given
        process instance.
      properties:
        id:
          type: string
          nullable: true
          description: The id of the transition instance.
        parentActivityInstanceId:
          type: string
          nullable: true
          description: >-
            The id of the parent activity instance, for example a sub process
            instance.
        activityId:
          type: string
          nullable: true
          description: >-
            The id of the activity that this instance enters (asyncBefore job)
            or leaves (asyncAfter job)
        activityName:
          type: string
          nullable: true
          description: >-
            The name of the activity that this instance enters (asyncBefore job)
            or leaves (asyncAfter job)
        activityType:
          type: string
          nullable: true
          description: >-
            The type of the activity that this instance enters (asyncBefore job)
            or leaves (asyncAfter job)
        processInstanceId:
          type: string
          nullable: true
          description: The id of the process instance this instance is part of.
        processDefinitionId:
          type: string
          nullable: true
          description: The id of the process definition.
        executionId:
          type: string
          nullable: true
          description: The execution id.
        incidentIds:
          type: array
          nullable: true
          items:
            type: string
          description: A list of incident ids.
        incidents:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/ActivityInstanceIncidentDto'
          description: |-
            A list of JSON objects containing incident specific properties:
            * `id`: the id of the incident
            * `activityId`: the activity id in which the incident occurred
    ActivityInstanceIncidentDto:
      type: object
      description: An activity instance, incident pair.
      properties:
        id:
          type: string
          nullable: true
          description: The id of the incident.
        activityId:
          type: string
          nullable: true
          description: The activity id in which the incident happened.
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````