Workflow Engine v0.1.0 WE.StorageAdapter behaviour View Source

A behaviour for storage adapters. This adapter is responsible for storing the engine's history and the documents into a storage solution. By default the WE.Adapter.Local is loaded and used. It is recommended to only use this in memory adapter in dev and test becasue a restart will purge all its data.

Link to this section Summary

Types

The name of the document given as parameter in WE.Document.document/1 during workflow construction.

The unique identifier of a history record. This id is equal to the business_id.

t()

Callbacks

Find a document by the document's name.

Store a document.

Store a history record.

Update a document.

Link to this section Types

Link to this type

document_name()

View Source (since 0.1.0)
document_name() :: String.t()

The name of the document given as parameter in WE.Document.document/1 during workflow construction.

Link to this type

history_id()

View Source (since 0.1.0)
history_id() :: String.t()

The unique identifier of a history record. This id is equal to the business_id.

Link to this section Callbacks

Link to this callback

find_all_history_records(history_id)

View Source (since 0.1.0)
find_all_history_records(history_id()) :: [WE.HistoryRecord.t()]

Find a document by history_id/0

Link to this callback

find_document(document_name)

View Source (since 0.1.0)
find_document(document_name()) :: WE.Document.t() | {:error, String.t()}

Find a document by the document's name.

Link to this callback

store_document(arg1)

View Source (since 0.1.0)
store_document(WE.Document.t()) :: {:ok, WE.Document.t()} | {:error, String.t()}

Store a document.

Link to this callback

store_history_record(history_id, arg2)

View Source (since 0.1.0)
store_history_record(history_id(), WE.HistoryRecord.t()) ::
  {:ok, WE.HistoryRecord} | {:error, String.t()}

Store a history record.

Link to this callback

update_document(arg1)

View Source (since 0.1.0)
update_document(WE.Document.t()) ::
  {:ok, WE.Document.t()} | {:error, String.t()}

Update a document.