Class Specification

Encapsulates a DriveWorks Live Specification and enables the rendering and control of that specification via custom elements and callbacks.

Hierarchy

  • Specification

Index

Constructors

constructor

  • Creates a new Specification and registers all required delegates for rendering a fully interactive specification form.

    Parameters

    • client: DriveWorksLiveClient

      The DriveWorksLiveClient that will be used to send and receive data to and from the Integration Theme.

    • groupAlias: string

      The alias of the group the specification belongs to.

    • specificationId: string

      The unique identifier of this specification.

    Returns Specification

Accessors

id

  • get id(): number
  • Gets the unique identifier of the represented specification.

    Returns number

specificationFormElement

  • get specificationFormElement(): HTMLElement
  • Gets the HTML element for the specification form.

    Returns HTMLElement

Methods

addChildSpecification

  • addChildSpecification(childSpecificationListControlName: string, projectName: string, versionId?: string): Promise<FormData>
  • Adds a new child specification from the chosen project to a Child Specification List control in this Specification.

    throws

    ArgumentException if childSpecificationListControlName is null or empty.

    throws

    ArgumentException if projectName is null or empty.

    Parameters

    • childSpecificationListControlName: string

      The name of the Child Specification List control.

    • projectName: string

      The name of the project that the child specification will be created from.

    • Optional versionId: string

      The optional unique identifier of a specification form version used to calculate a differenced FormData result.

    Returns Promise<FormData>

    The provided versionId will be used to calculate a differenced FormData result between the supplied and latest version. If no versionId is provided, a complete FormData result will be returned. A version identifier can be retrieved from any FormData object.

addItemToList

  • addItemToList(itemListControlName: string, formName: string, versionId?: string): Promise<FormData>
  • Adds an item with the specified form name to an Item List control within this Specification.

    throws

    ArgumentException if itemListControlName is null or empty.

    throws

    ArgumentException if formName is null or empty.

    Parameters

    • itemListControlName: string

      The name of the Item List control.

    • formName: string

      The name of the form that the added dialog will show.

    • Optional versionId: string

      The optional unique identifier of a specification form version used to calculate a differenced FormData result.

    Returns Promise<FormData>

    The provided versionId will be used to calculate a differenced FormData result between the supplied and latest version. If no versionId is provided, a complete FormData result will be returned. A version identifier can be retrieved from any FormData object.

cancel

  • cancel(): Promise<void>
  • Cancels the current specification and clears the the inner HTML of the provided HTMLElement that the specification was rendered to.

    Returns Promise<void>

copyItemListItem

  • copyItemListItem(itemListControlName: string, formName: string, versionId?: string): Promise<FormData>
  • Copies an item from an Item List control within this Specification with the specified form name.

    throws

    ArgumentException if itemListControlName is null or empty.

    throws

    ArgumentException if formName is null or empty.

    Parameters

    • itemListControlName: string

      The name of the Item List control.

    • formName: string

      The name of the form which represents the type of item to copy.

    • Optional versionId: string

      The optional unique identifier of a specification form version used to calculate a differenced FormData result.

    Returns Promise<FormData>

    The provided versionId will be used to calculate a differenced FormData result between the supplied and latest version. If no versionId is provided, a complete FormData result will be returned. A version identifier can be retrieved from any FormData object.

deleteListItem

  • deleteListItem(itemListControlName: string, versionId?: string): Promise<FormData>
  • Deletes the currently selected item from an Item List control within this Specification.

    throws

    ArgumentException if itemListControlName is null or empty.

    Parameters

    • itemListControlName: string

      The name of the Item List control.

    • Optional versionId: string

      The optional unique identifier of a specification form version used to calculate a differenced FormData result.

    Returns Promise<FormData>

    The provided versionId will be used to calculate a differenced FormData result between the supplied and latest version. If no versionId is provided, a complete FormData result will be returned. A version identifier can be retrieved from any FormData object.

editItemListItem

  • editItemListItem(itemListControlName: string, formName: string, versionId?: string): Promise<FormData>
  • Edits an item from an Item List control within this Specification with the specified form name.

    throws

    ArgumentException if itemListControlName is null or empty.

    throws

    ArgumentException if formName is null or empty.

    Parameters

    • itemListControlName: string

      The name of the Item List control.

    • formName: string

      The name of the form which represents the type of item to edit.

    • Optional versionId: string

      The optional unique identifier of a specification form version used to calculate a differenced FormData result.

    Returns Promise<FormData>

    The provided versionId will be used to calculate a differenced FormData result between the supplied and latest version. If no versionId is provided, a complete FormData result will be returned. A version identifier can be retrieved from any FormData object.

getActions

getActiveFormTasks

  • getActiveFormTasks(): Promise<TaskList>
  • Gets the tasks for the active form or dialog of this Specification.

    Returns Promise<TaskList>

getConstantByName

  • getConstantByName(constantName: string): Promise<ConstantData>
  • Gets a constant with the provided name that belongs to this Specification.

    throws

    ArgumentException if constantName is null or empty.

    Parameters

    • constantName: string

      The name of the constant to retrieve.

    Returns Promise<ConstantData>

getConstants

getDocumentById

  • getDocumentById(documentId: string): Promise<DocumentData>
  • Gets the document belonging to this Specification with the provided identifier.

    throws

    ArgumentException if documentId is null or empty.

    Parameters

    • documentId: string

      The identifier of the document to retrieve.

    Returns Promise<DocumentData>

getDocumentUrl

  • getDocumentUrl(documentId: string, resourceName: string): Promise<string>
  • Gets the download url of a specified document belonging to this Specification.

    throws

    ArgumentException if documentId is null or empty.

    throws

    ArgumentException if resourceName is null or empty.

    Parameters

    • documentId: string

      The identifier of the document that you wish to retrieve the download url for.

    • resourceName: string

      The name of the document, or the name of a resource within a HTML file, with the provided documentId.

    Returns Promise<string>

getDocuments

getFormControlByName

  • getFormControlByName(controlName: string): ControlBase
  • Gets a form control of a supplied name.

    throw

    ArgumentException if controlName is null or empty.

    Parameters

    • controlName: string

      The name of the control you wish to access.

    Returns ControlBase

getFormData

  • getFormData(versionId?: string): Promise<FormData>
  • Gets the active form data for this Specification.

    Parameters

    • Optional versionId: string

      The optional unique identifier of a specification form version used to calculate a differenced FormData result.

    Returns Promise<FormData>

    The provided versionId will be used to calculate a differenced FormData result between the supplied and latest version. If no versionId is provided, a complete FormData result will be returned. A version identifier can be retrieved from any FormData object.

getOperationByName

  • getOperationByName(operationName: string): Promise<ActionData>
  • Gets information about the chosen operation for this Specification.

    throws

    ArgumentException if operationName is null or empty.

    Parameters

    • operationName: string

      The name of the operation to retrieve.

    Returns Promise<ActionData>

getProperties

  • getProperties(): Promise<object>
  • Gets the specification properties for this Specification.

    Returns Promise<object>

    An object containing 0 or more key value pairs, e.g. {"MyProperty": "MyValue"}.

getSpecificationReportById

  • getSpecificationReportById(reportId: string): Promise<ReportData>
  • Gets the specification report with the provided identifier for this Specification.

    throws

    ArgumentException if reportId is null or empty.

    Parameters

    • reportId: string

      The identifier of the report to retrieve.

    Returns Promise<ReportData>

getSpecificationReportJson

  • getSpecificationReportJson(reportId: string): Promise<ReportJsonData>
  • Gets the chosen specification report belonging to this Specification in JSON format.

    throws

    ArgumentException if reportId is null or empty.

    Parameters

    • reportId: string

      The identifier of the report to retrieve.

    Returns Promise<ReportJsonData>

getSpecificationReportUrl

  • getSpecificationReportUrl(reportId: string): Promise<string>
  • Gets the download url for the chosen specification report belonging to this Specification.

    throws

    ArgumentException if reportId is null or empty.

    Parameters

    • reportId: string

      The identifier of the report to retrieve the download url for.

    Returns Promise<string>

getSpecificationReports

  • getSpecificationReports(): Promise<ReportData[]>

getTransitionByName

  • getTransitionByName(transitionName: string): Promise<TransitionData>
  • Gets information about the chosen transition for this Specification.

    throws

    ArgumentException if transitionName is null or empty.

    Parameters

    • transitionName: string

      The name of the transition to retrieve.

    Returns Promise<TransitionData>

getVariableByName

  • getVariableByName(variableName: string): Promise<VariableData>
  • Gets a variable with the provided name from this Specification.

    throws

    ArgumentException if variableName is null or empty.

    Parameters

    • variableName: string

      The name of the variable to retrieve.

    Returns Promise<VariableData>

getVariables

invokeChildSpecificationOperation

  • invokeChildSpecificationOperation(childSpecificationListControlName: string, operationName: string, versionId?: string): Promise<FormData>
  • Invokes an operation on the currently selected specification in a Child Specification List control within this Specification.

    throws

    ArgumentException if childSpecificationListControlName is null or empty.

    throws

    ArgumentException if operationName is null or empty.

    Parameters

    • childSpecificationListControlName: string

      The name of the Child Specification List control.

    • operationName: string

      The name of the operation to invoke on the selected child specification.

    • Optional versionId: string

      The optional unique identifier of a specification form version used to calculate a differenced FormData result.

    Returns Promise<FormData>

    The provided versionId will be used to calculate a differenced FormData result between the supplied and latest version. If no versionId is provided, a complete FormData result will be returned. A version identifier can be retrieved from any FormData object.

invokeChildSpecificationTransition

  • invokeChildSpecificationTransition(childSpecificationListControlName: string, transitionName: string, versionId?: string): Promise<FormData>
  • Invokes a transition on the currently selected specification in a Child Specification List control within this Specification.

    throws

    ArgumentException if childSpecificationListControlName is null or empty.

    throws

    ArgumentException if transitionName is null or empty.

    Parameters

    • childSpecificationListControlName: string

      The name of the Child Specification List control.

    • transitionName: string

      The name of the transition to invoke on the selected child specification.

    • Optional versionId: string

      The optional unique identifier of a specification form version used to calculate a differenced FormData result.

    Returns Promise<FormData>

    The provided versionId will be used to calculate a differenced FormData result between the supplied and latest version. If no versionId is provided, a complete FormData result will be returned. A version identifier can be retrieved from any FormData object.

invokeDialogCancel

  • invokeDialogCancel(versionId?: string): Promise<FormData>
  • Cancels the active dialog within this Specification and closes it. The latest FormData will be returned.

    Parameters

    • Optional versionId: string

      The optional unique identifier of a specification form version used to calculate a differenced FormData result.

    Returns Promise<FormData>

    The provided versionId will be used to calculate a differenced FormData result between the supplied and latest version. If no versionId is provided, a complete FormData result will be returned. A version identifier can be retrieved from any FormData object.

invokeDialogOk

  • invokeDialogOk(versionId?: string): Promise<FormData>
  • Confirms the chosen items on a dialog within this Specification and closes it. The latest FormData will be returned.

    Parameters

    • Optional versionId: string

      The optional unique identifier of a specification form version used to calculate a differenced FormData result.

    Returns Promise<FormData>

    The provided versionId will be used to calculate a differenced FormData result between the supplied and latest version. If no versionId is provided, a complete FormData result will be returned. A version identifier can be retrieved from any FormData object.

invokeOperation

  • invokeOperation(operationName: string): Promise<any>
  • Invokes an operation on this Specification.

    throws

    ArgumentException if operationName is null or empty.

    Parameters

    • operationName: string

      The name of the operation to invoke.

    Returns Promise<any>

invokeTransition

  • invokeTransition(transitionName: string): Promise<any>
  • Invokes a transition on this Specification.

    throws

    ArgumentException if transitionName is null or empty.

    Parameters

    • transitionName: string

      The name of the transition to invoke.

    Returns Promise<any>

moveChildSpecificationListItem

  • moveChildSpecificationListItem(childSpecificationListControlName: string, commandData: MoveListItemCommandData, versionId?: string): Promise<FormData>
  • Moves the child specification at the specified index in a Child Specification List control within this Specification up or down.

    throws

    ArgumentException if childSpecificationListControlName is null or empty.

    throws

    ArgumentException if commandData is null or empty.

    throws

    ArgumentException if the commandData object does not implement the MoveListItemCommandData interface.

    Parameters

    • childSpecificationListControlName: string

      The name of the Child Specification List control.

    • commandData: MoveListItemCommandData

      The MoveListItemCommandData containing the movement direction and row index to perform the command.

    • Optional versionId: string

      The optional unique identifier of a specification form version used to calculate a differenced FormData result.

    Returns Promise<FormData>

    The provided versionId will be used to calculate a differenced FormData result between the supplied and latest version. If no versionId is provided, a complete FormData result will be returned. A version identifier can be retrieved from any FormData object.

moveItemListItem

  • moveItemListItem(itemListControlName: string, commandData: MoveListItemCommandData, versionId?: string): Promise<FormData>
  • Moves the item at the specified index in an Item List Control within this Specification up or down.

    throws

    ArgumentException if itemListControlName is null or empty.

    throws

    ArgumentException if commandData is null or empty.

    throws

    ArgumentException if the commandData object does not implement the MoveListItemCommandData interface.

    Parameters

    • itemListControlName: string

      The name of the Item List control.

    • commandData: MoveListItemCommandData

      The MoveListItemCommandData containing the movement direction and row index to perform the command.

    • Optional versionId: string

      The optional unique identifier of a specification form version used to calculate a differenced FormData result.

    Returns Promise<FormData>

    The provided versionId will be used to calculate a differenced FormData result between the supplied and latest version. If no versionId is provided, a complete FormData result will be returned. A version identifier can be retrieved from any FormData object.

navigate

  • navigate(direction: "backward" | "forward"): Promise<FormData>
  • Navigates this Specification in the chosen direction.

    throws

    ArgumentException if direction is null or empty.

    throws

    ArgumentException if direction contains an invalid value.

    Parameters

    • direction: "backward" | "forward"

      The direction to navigate in - "backward" or "forward".

    Returns Promise<FormData>

navigateHyperlink

  • navigateHyperlink(hyperlinkControlName: string, versionId?: string): Promise<FormData>
  • Navigates to the hyperlink of a Hyperlink control within this Specification.

    throws

    ArgumentException if hyperlinkControlName is null or empty.

    Parameters

    • hyperlinkControlName: string

      The name of the Hyperlink control.

    • Optional versionId: string

      The optional unique identifier of a specification form version used to calculate a differenced FormData result.

    Returns Promise<FormData>

    The provided versionId will be used to calculate a differenced FormData result between the supplied and latest version. If no versionId is provided, a complete FormData result will be returned. A version identifier can be retrieved from any FormData object.

openDialog

  • openDialog(dialogButtonControlName: string, versionId?: string): Promise<FormData>
  • Opens the dialog of a Dialog Button within this Specification.

    throws

    ArgumentException if dialogButtonControlName is null or empty.

    Parameters

    • dialogButtonControlName: string

      The name of the Dialog Button control.

    • Optional versionId: string

      The optional unique identifier of a specification form version used to calculate a differenced FormData result.

    Returns Promise<FormData>

    The provided versionId will be used to calculate a differenced FormData result between the supplied and latest version. If no versionId is provided, a complete FormData result will be returned. A version identifier can be retrieved from any FormData object.

ping

  • ping(): void
  • Sends a signal to the server to restart the session, specification and group timeout timers.

    Returns void

registerCancelButton

  • registerCancelButton(element: HTMLElement, displayStyle?: string | null): void
  • Registers a chosen HTML element that when clicked will cancel the active dialog.

    throws

    ArgumentException if the passed element is null.

    Parameters

    • element: HTMLElement

      The element that will be registered as the cancel button.

    • Default value displayStyle: string | null = window.getComputedStyle(element).display

      The value to set the display property to when making the cancel button visible. By default the current value of the display property will be used.

    Returns void

registerConstantValueChangedDelegate

  • registerConstantValueChangedDelegate(constantValueChangedDelegate: function): void
  • Registers a function to execute when a project constant's value is changed.

    Parameters

    • constantValueChangedDelegate: function

      The function to be executed when a project constant's value is changed.

        • (data: object): void
        • Parameters

          • data: object
            • constantName: string
            • constantValue: string

          Returns void

    Returns void

registerNextButton

  • registerNextButton(element: HTMLElement, displayStyle?: string | null): void
  • Registers a chosen HTML element that when clicked will navigate the specification to the next form.

    throws

    ArgumentException if the passed element is null.

    Parameters

    • element: HTMLElement

      The element that will be registered as the next button.

    • Default value displayStyle: string | null = window.getComputedStyle(element).display

      The value to set the display property to when making the next button visible. By default the current value of the display property will be used.

    Returns void

registerOkButton

  • registerOkButton(element: HTMLElement, displayStyle?: string | null): void
  • Registers a chosen HTML element that when clicked will confirm and close the active dialog.

    throws

    ArgumentException if the passed element is null.

    Parameters

    • element: HTMLElement

      The element that will be registered as the confirmation button.

    • Default value displayStyle: string | null = window.getComputedStyle(element).display

      The value to set the display property to when making the ok button visible. By default the current value of the display property will be used.

    Returns void

registerPreviousButton

  • registerPreviousButton(element: HTMLElement, displayStyle?: string | null): void
  • Registers a chosen HTML element that when clicked will navigate the specification to the previous form.

    throws

    ArgumentException if the passed element is null.

    Parameters

    • element: HTMLElement

      The element that will be registered as the previous button.

    • Default value displayStyle: string | null = window.getComputedStyle(element).display

      The value to set the display property to when making the previous button visible. By default the current value of the display property will be used.

    Returns void

registerSpecificationCancelledDelegate

  • registerSpecificationCancelledDelegate(cancelledDelegate: function): void
  • Registers a function to execute when the specification is cancelled.

    Parameters

    • cancelledDelegate: function

      The function to be executed when the specification is cancelled.

        • (): void
        • Returns void

    Returns void

registerSpecificationClosedDelegate

  • registerSpecificationClosedDelegate(closedDelegate: function): void
  • Registers a function to execute when the specification is closed.

    Parameters

    • closedDelegate: function

      The function to be executed when the specification is closed.

        • (): void
        • Returns void

    Returns void

registerVariableValueChangedDelegate

  • registerVariableValueChangedDelegate(variableValueChangedDelegate: function): void
  • Registers a function to execute when a project variable's value is changed.

    Parameters

    • variableValueChangedDelegate: function

      The function to be executed when a project variable's value is changed.

        • (data: object): void
        • Parameters

          • data: object
            • variableName: string
            • variableValue: string

          Returns void

    Returns void

removeChildSpecificationListItem

  • removeChildSpecificationListItem(childSpecificationListControlName: string, versionId?: string): Promise<FormData>
  • Removes the currently selected child specification from a Child Specification List within this Specification.

    throws

    ArgumentException if childSpecificationListControlName is null or empty.

    Parameters

    • childSpecificationListControlName: string

      The name of the Child Specification List control.

    • Optional versionId: string

      The optional unique identifier of a specification form version used to calculate a differenced FormData result.

    Returns Promise<FormData>

    The provided versionId will be used to calculate a differenced FormData result between the supplied and latest version. If no versionId is provided, a complete FormData result will be returned. A version identifier can be retrieved from any FormData object.

render

  • render(element: HTMLElement): Promise<void>
  • Renders the specification's active form to the supplied HTML element.

    throws

    ArgumentException if the element is null.

    Parameters

    • element: HTMLElement

      The element that you wish to render the specification form to.

    Returns Promise<void>

requestPreview

  • requestPreview(previewControlName: string, versionId?: string): Promise<FormData>
  • Requests a preview from a 3D Preview control within this Specification.

    throws

    ArgumentException if previewControlName is null or empty.

    Parameters

    • previewControlName: string

      The name of the 3D Preview control.

    • Optional versionId: string

      The optional unique identifier of a specification form version used to calculate a differenced FormData result.

    Returns Promise<FormData>

    The provided versionId will be used to calculate a differenced FormData result between the supplied and latest version. If no versionId is provided, a complete FormData result will be returned. A version identifier can be retrieved from any FormData object.

requestScreenshot

runControlMacro

  • runControlMacro(controlName: string, macroData: ControlMacroData, versionId?: string): Promise<FormData>
  • Runs a macro for a control within this Specification and returns the latest FormData.

    throws

    ArgumentException if controlName is null or empty.

    throws

    ArgumentException if macroData is null or empty.

    throws

    ArgumentException if the macroData object does not implement the ControlMacroData interface.

    Parameters

    • controlName: string

      The name of the control to run the macro on.

    • macroData: ControlMacroData

      The ControlMacroData to provide to the macro, including the name of the macro to run.

    • Optional versionId: string

      The optional unique identifier of a specification form version used to calculate a differenced FormData result.

    Returns Promise<FormData>

    The provided versionId will be used to calculate a differenced FormData result between the supplied and latest version. If no versionId is provided, a complete FormData result will be returned. A version identifier can be retrieved from any FormData object.

runMacro

runTouchPointMacro

  • runTouchPointMacro(previewControlName: string, commandData: TouchPointCommandData, versionId?: string): Promise<FormData>
  • Runs a touch point macro within a 3D Preview control in this Specification.

    throws

    ArgumentException if previewControlName is null or empty.

    Parameters

    • previewControlName: string

      The name of the 3D Preview control.

    • commandData: TouchPointCommandData

      The TouchPointCommandData containing data to run the macro with.

    • Optional versionId: string

      The optional unique identifier of a specification form version used to calculate a differenced FormData result.

    Returns Promise<FormData>

    The provided versionId will be used to calculate a differenced FormData result between the supplied and latest version. If no versionId is provided, a complete FormData result will be returned. A version identifier can be retrieved from any FormData object.

setChildSpecificationListSelectedIndex

  • setChildSpecificationListSelectedIndex(childSpecificationListControlName: string, index: number, versionId?: string): Promise<FormData>
  • Sets the selection of a Child Specification List control in this Specification to the item at the provided index.

    throws

    ArgumentException if childSpecificationListControlName is null or empty.

    throws

    ArgumentException if index is null or empty.

    Parameters

    • childSpecificationListControlName: string

      The name of the Child Specification List control.

    • index: number

      The index to set as the selected item of the list control.

    • Optional versionId: string

      The optional unique identifier of a specification form version used to calculate a differenced FormData result.

    Returns Promise<FormData>

    The provided versionId will be used to calculate a differenced FormData result between the supplied and latest version. If no versionId is provided, a complete FormData result will be returned. A version identifier can be retrieved from any FormData object.

setItemListSelectedIndex

  • setItemListSelectedIndex(listControlName: string, rowIndex: number, versionId?: string): Promise<FormData>
  • Sets the selection of an Item List control in this Specification to the item at the provided index.

    throws

    ArgumentException if listControlName is null or empty.

    throws

    ArgumentException if rowIndex is null or empty.

    Parameters

    • listControlName: string
    • rowIndex: number

      The index to set as the selected item of the list control.

    • Optional versionId: string

      The optional unique identifier of a specification form version used to calculate a differenced FormData result.

    Returns Promise<FormData>

    The provided versionId will be used to calculate a differenced FormData result between the supplied and latest version. If no versionId is provided, a complete FormData result will be returned. A version identifier can be retrieved from any FormData object.

updateConstantValue

  • updateConstantValue(constantName: string, constantValue: string): Promise<ConstantData>
  • Updates a constant within this Specification with the provided value.

    throws

    ArgumentException if constantName is null or empty.

    Parameters

    • constantName: string

      The name of the constant to update.

    • constantValue: string

      The value to be applied to the constant.

    Returns Promise<ConstantData>