Class WorkItem

A WorkItem represents an instance of an automated business process. It also represents a request made by an individual and encompasses all the associated data.

Hierarchy (View Summary)

Constructors

  • Create a new instance of the type WorkItem. This constructor is used by the library's code and should not be used by API users.

    Parameters

    • context: Context

      Context information of the call. In most of the cases you can build the context using the request object.

    Returns WorkItem

Properties

classOid: string = ""
code?: string
context: Context
endDate?: Date
fields: IDictionary
fieldsWithAlias: IDictionary
isNew: boolean = false
lists: IDictionary
number: string = ""
oid: number = 0
processOid: number = 0
requesterOid?: number
startDate?: Date
status?: Status
ClassName: string = "Venki.Process.WorkItem"
ClassOid: string = "7a767398-3c6e-4d81-8c04-369600dcb4a7"
TokenExecutionClassOid: string = "d5a12beb-a524-4b3c-a543-8194e37d9d88"

Metadata key for the TokenExecution type, used to represent the execution of a process task.

Accessors

  • get Code(): string
  • Returns string

    Get the code of the requester

  • set Code(value: string): void
  • Parameters

    • value: string

      The new content for the field Code.

    Returns void

    Set the code of the requester

  • get EndDate(): Date
  • Get the end date and time of the finished or canceled work item

    Returns Date

  • get RequesterOid(): number
  • Get the identifier of the requester

    Returns number

  • set RequesterOid(value: number): void
  • Set the identifier of the requester

    Parameters

    • value: number

      The new content for the field RequesterOid.

    Returns void

  • get StartDate(): Date
  • Get the start date and time of the work item

    Returns Date

Methods

  • Add a comment in the Conversation tab.

    Parameters

    • message: string

      Content of the comment.

    Returns void

  • Add a row to the record list.

    Parameters

    • fieldName: string

      Name of the record list.

    • record: any

      A dictionary containing all the fields of the row.

    Returns Promise<CustomType>

    A promise to retrieve the content of the new object added to the record list.

  • Delete a row in a record list.

    Parameters

    • fieldName: string

      Name of the record list.

    • instanceId: string

      Identifier of the row of the record list.

    Returns Promise<void>

  • Delete a list of rows in a record list.

    Parameters

    • fieldName: string

      Name of the record list.

    • instances: string[]

    Returns Promise<void>

  • Retrieve all rows from a record list field.

    Parameters

    • fieldName: string

      Name of the record list.

    Returns Promise<CustomType[]>

    A promise to retrieve the content record list.

  • Parameters

    • Optionalid: number

    Returns string

  • Parameters

    • className: string
    • fieldName: string
    • key: string | number
    • value: any

    Returns void

  • Write a log of type Error you can list inside the process editor. (click the button 'Log and Execution data' at the right side in the Actions tab)

    Parameters

    • message: string

      Error message.

    • OptionaldetailLink: string

      Link to show more details on the error.

    Returns Promise<void>

  • Write a log of type Information you can list inside the process editor. (click the button 'Log and Execution data' at the right side in the Actions tab)

    Parameters

    • message: string

      Information message.

    Returns Promise<void>

  • Write a log of type Warning you can list inside the process editor. (click the button 'Log and Execution data' at the right side in the Actions tab)

    Parameters

    • message: string

      Warning message.

    Returns Promise<void>

  • Populate the object's fields with data from the record.

    Parameters

    • data: IDictionary

      A dictionary holding the record's data.

    Returns void

  • Save all pending changes of the work item.

    Parameters

    • context: Context

      Context information of the call. In most of the cases you can build the context using the request object.

    Returns Promise<string | number>

    Identifier of the saved record.

  • Save all pending changes of a record list.

    Parameters

    • context: Context

      Context information of the call. In most of the cases you can build the context using the request object.

    • fieldName: string

      Name or alias of the record list. (click the script icon in the edition dialog)

    Returns Promise<void>

  • Set the value of a custom field.

    Parameters

    • fieldName: string

      Name or alias of the field. (click the script icon in the edition dialog)

    • value: any

      Current value of the custom field.

    Returns void

  • Update a row in a record list.

    Parameters

    • fieldName: string

      Name of the record list.

    • instanceId: string

      A list of identifiers for the rows in the record list.

    • record: any

      A dictionary containing all the fields of the row.

    Returns Promise<void>

  • Evaluate a Business Rule on a specific work item.

    Parameters

    • context: Context

      Context information of the call. In most of the cases you can build the context using the request object.

    • oid: number

      Identifier of thw work item.

    • br: string

      Unique code of Business Rule. (check the network of Developer Tools)

    Returns Promise<any>

  • Find a work item by an identifier

    Parameters

    • context: Context

      Context information of the call. In most of the cases you can build the context using the request object.

    • id: number

      Identifier of the instance.

    Returns Promise<WorkItem>

    Promise to get the object instance of the work item.

  • Parameters

    • context: Context

      Context information of the call. In most of the cases you can build the context using the request object.

    • processCode: string

      Unique code of the process. (click the script icon above the field Name inside the process editor and tab Properties)

    • instanceCode: string

      Code of the instance.

    Returns Promise<WorkItem[]>

    Promise to get the array of work items that meet the criteria.

    Find a work item by a native code.

  • Find all work items based on a specific process and a search text on a custom field

    Parameters

    • context: Context

      Context information of the call. In most of the cases you can build the context using the request object.

    • processCode: string

      Unique code of the process. (click the script icon above the field Name inside the process editor and tab Properties)

    • field: string

      Name or alias of the field. (click the script icon in the edition dialog)

    • searchValue: string

      Text criteria to find the instances.

    Returns Promise<WorkItem[]>

    Promise to get the array of work items that meet the criteria.

  • Force the execution of a boundary event on a work item

    Parameters

    • context: Context

      Context information of the call. In most of the cases you can build the context using the request object.

    • oid: number

      Identifier of thw work item.

    • code: string

      Unique code of the boundary event. (click the script icon above the field Text inside the process editor and tab Properties)

    Returns Promise<void>

  • Load the object's content from JSON data.

    Parameters

    • context: Context

      Context information of the call. In most of the cases you can build the context using the request object.

    • data: any[]

      An array of key-value pairs (JSON data).

    Returns WorkItem

    Object instance initialized.

  • Cancel all taks and tokens and restart the instance from the same start event.

    Parameters

    • context: Context

      Context information of the call. In most of the cases you can build the context using the request object.

    • oid: number

      Identifier of thw work item.

    Returns Promise<void>