Skip to content

fetchObjectHistory ​

Overview ​

Fetches the recorded workflow states of one object and caches them in objectHistories.

A cached history resolves at once, and a cached error rejects at once. A request already in flight for the same object is shared. A transition that executeTransition runs on the object drops its cached history, so the next call fetches it again. A request that was already in flight when the transition ran still resolves for its callers, and its history is not cached.

Signature ​

fetchObjectHistory(app, model, objectPk)

Parameters ​

NameTypeRequiredDescription
appstringyesDjango app label.
modelstringyesModel name.
objectPkstringyesThe object's primary key.

Returns ​

Promise

A promise for the object's history, oldest first. It resolves to an empty array when workflow is off or the model does not enable it. It rejects with WorkflowError when the request fails. The server answers with a 404 for an object that has no workflow state, so the history of that object also rejects with WorkflowError.

Source ​

client/lib/stores/storeWorkflow.js:430