Skip to end of banner
Go to start of banner

API/WorkflowInstance/SetAttributeValues [DRAFT]

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

Version 1 Next »

Directly sets Attribute values, bypassing the Workflow Engine.

To perform Actions and Behaviors as well, API/WorkflowInstance/PerformStep

This page is protected from public access. This API is intended for internal use only at this time. There are too many limitations and risk factors for this to be used by external callers without our guidance.

Overview

This is a utility API for updating Workflow Attribute values without going through the Workflow Engine. It was designed so that integrations can update data in LearningBuilder over an HTTP call.

This approach has some trade-offs:

(plus) Highly performant

(plus) Supports bulk updates in a single API call

(minus) Does not enforce Validation Rules

(minus) Can not perform Actions or Behaviors

(minus) Only supports data types that store a simple value in the ITEM_ATTRIBUTE_VALUE table

(minus) Only supports Extrinsic Attributes at this time

(warning) Can update a Workflow Instance regardless of which Step it is on. (This can be a double-edged sword)

Business rules

Which entities can be updated depends on the Workflow type:

Workflow Type

Rules

Create Activity

The Workflow Instance must be Incomplete.

Complete Activity

Complete Learning Plan

Grant Role / Edit Role

The status of the Workflow Instance does not matter. Member Role Attributes can always be updated by this API.

Using the API

Calling this API requires an API Key with sufficient permissions.

HTTP Request

Payload is a JSON document submitted via HTTP Post.

This payload can contain multiple Attribute values to update.

[
  {
    "entityType": "LearningPlanInstance",
    "workflowInstanceId": 42,
    "reason": "updating status from Nursys",
    "attrValues": [
      { "attrDefId": 123, "value": "some new value" },
      { "attrDefId": 456, "value": "another value" },
    ]
  },
  {
    "entityType": "MemberRole",
    "workflowInstanceId": 48,
    "reason": "updating status from Nursys",
    "attrValues": [
      { "attrDefId": 555, "value": "some new value" },
      { "attrDefId": 543, "value": "another value" },
    ]
  }
]

Field

Description

entityType

ActivityInstance, LearningPlanInstance, or MemberRole

workflowInstanceId

The ID of the Workflow instance.

  • ActivityInstance - must point to an Incomplete Complete Activity WFI

  • LearningPlanInstance - must point to an Incomplete Complete LP WFI

  • MemberRole - can point to any Grant Role or Edit Role WFI, regardless of status

reason

(optional) text string describing the update

attrValues

An array of attribute values to set.

attrValues[i].attrDefId

Attribute Definition Id of the attribute to set. Must be a valid Attribute defined for the specified entity type.

attrValues[i].value

Value to set.

No validation or processing is performed on this value.

Take care when using this with data types that handle structured data, as you are responsible for correctly formatting the value in the API call.

HTTP Response

The HTTP response is… (TODO)

  • No labels