This class is a wrapper container for a PConnect object.

When constructed will store a copy of the fully resolved component props (see getComponentProps). The container holds a reference to all instantiated children.

A few life cycle hooks are initiated

  • initContainer is called immediately after construction
  • updateContainer is called anytime the state associated with the pconnect is changed
  • destroyContainer is called on all children whenever

Hierarchy (view full)

Constructors

  • The constructor for PContainer.

    Parameters

    • pconnect: PConnect

      The PConnect object which is the configuration for this container

    • id: string

      The ID of the container, used as a key to retrieve the container later.

    Returns FlowContainer

Properties

componentName: string

The name of this container as retrieved by container.getComponentName()

The configuration of this container.

id: string

The ID of the container, used as a key to retrieve the container later.

pconnect: PConnect

The PConnect object which is the configuration for this container

unsubscribe: (() => void)

A method to unsubscribe this container from listening to state changes

updates: EventObserver = ...

A stream of state update events.

In general updates are managed by the DX Engine. However, in some cases you may need to react to state changes in the component directly. In this scenario a consumer can call container.updates.subscribe(fn), where the fn will be called when the state of the container changes. Use container.config to retrieve the latest state of the container.

counter: number = 0

Accessors

  • get actionButtons(): ActionButtons
  • Gets the action buttons that are associated with the assignment.

    Returns ActionButtons

    The action buttons as an object with two properties:

    • "main": an array of ActionButton objects that are always displayed.
    • "secondary": an array of ActionButton objects that are displayed secondary to the main action buttons.
  • get children(): PContainer<any>[]
  • Get the children of this container. This list of children is managed by the DX Engine, where each child itself is the correct PContainer instance for a PConnect object coming from the Constellation Core.

    Returns PContainer<any>[]

  • set children(children): void
  • Fully replace the children of this container.

    To allow for cleanupm, the onDestroy method of the existing children are called before they are replaced.

    Parameters

    Returns void

  • The navigation associated with the assignment. This is an object with two properties:

    • "steps": an array of Step objects that define the steps of the navigation.
    • "level": the current level of the navigation.

    Returns Navigation

Methods

  • Handles a click of the user on an action button. The jsAction associated with each button is used to call the corresponding method on the ActionsAPI of the container. When an assignment is canceled, the EVENT_CANCEL event will be published additionaly.

    Parameters

    • button: ActionButton

      The action button on which the click is iniated

    Returns Promise<void>

    an error when the action associated with the button can not be completed.

  • Create a new child PContainer of the given type, with the given label.

    The child will be created with the same context and container name as the current PContainer. The label will be used to construct a new property name, and the value will be set to @P .<label>.

    Parameters

    • type: string

      The type of the child to be created.

    • label: string

      The label of the child to be created.

    Returns Promise<PContainer<any>>

    The newly created PContainer.

  • Returns the label of the active view of the assignment.

    Returns string

    the label of the active view.

  • Retrieves the name of the first assignment from the case information.

    Returns string

    The name of the first assignment, or an empty string if no assignments are present.

  • Determines if the container contains an assignment.

    Returns boolean

    true if the container caseViewMode is perform, false otherwise.

  • Determines if the container has any items, using the getContainerUtils() from PCore.

    Returns boolean

    Whether the container has any items.

  • Initializes the container by setting up its configuration and component name, and generating a unique identifier. It subscribes to the store for state changes to determine when updates are necessary.

    Returns void

  • Clean up all resources when the container is destroyed. This is called when the container is no longer referenced by the core.

    Returns void

  • Abstract initialization method to be implemented by instances of container types. onInit is called after default initialization of the PContainer is completed

    Returns Promise<void>

  • Parameters

    • id: string
    • className: string
    • isFromCasePreview: boolean
    • isChild: boolean

    Returns void

  • Abstract update method to be implemented by instances of container types. onUpdate is called everytime the state association with this container instance is updated by the Constellation Core.

    Returns Promise<void>

  • Parameters

    Returns void