Documentation ¶
Overview ¶
Package workflow contains an experimental workflow for Archivemica transfers.
It's not generalized since it contains client-specific activities. However, the long-term goal is to build a system where workflows and activities are dynamically set up based on user input.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AsyncCompletionActivityName = "async-completion-activity"
var ErrAsyncCompletionAbandoned = errors.New("user abandoned")
Functions ¶
This section is empty.
Types ¶
type AsyncCompletionActivity ¶ added in v0.22.0
type AsyncCompletionActivity struct {
// contains filtered or unexported fields
}
func NewAsyncCompletionActivity ¶ added in v0.22.0
func NewAsyncCompletionActivity(m *manager.Manager) *AsyncCompletionActivity
type ProcessingWorkflow ¶
type ProcessingWorkflow struct {
// contains filtered or unexported fields
}
func NewProcessingWorkflow ¶
func NewProcessingWorkflow(m *manager.Manager) *ProcessingWorkflow
func (*ProcessingWorkflow) Execute ¶
func (w *ProcessingWorkflow) Execute(ctx workflow.Context, req *collection.ProcessingWorkflowRequest) error
ProcessingWorkflow orchestrates all the activities related to the processing of a SIP in Archivematica, including is retrieval, creation of transfer, etc...
Retrying this workflow would result in a new Archivematica transfer. We do not have a retry policy in place. The user could trigger a new instance via the API.
func (*ProcessingWorkflow) SessionHandler ¶
func (w *ProcessingWorkflow) SessionHandler(sessCtx workflow.Context, attempt int, tinfo *TransferInfo, nameInfo nha.NameInfo) error
SessionHandler runs activities that belong to the same session.
type TransferInfo ¶
type TransferInfo struct { // TempFile is the temporary location where the blob is downloaded. // // It is populated by the workflow with the result of DownloadActivity. TempFile string // TransferID given by Archivematica. // // It is populated by TransferActivity. TransferID string // SIPID given by Archivematica. // // It is populated by PollTransferActivity. SIPID string // Enduro internal collection ID. // // It is populated via the workflow request or createPackageLocalActivity. CollectionID uint // Original watcher event. // // It is populated via the workflow request. Event *watcher.BlobEvent // StoredAt is the time when the AIP is stored. // // It is populated by PollIngestActivity as long as Ingest completes. StoredAt time.Time // PipelineConfig is the configuration of the pipeline that this workflow // uses to provide access to its activities. // // It is populated by loadConfigLocalActivity. PipelineConfig *pipeline.Config // PipelineID is the UUID of the Archivematica pipeline. Extracted from // the API response header when the transfer is submitted. // // It is populated by transferActivity. PipelineID string // Hooks is the hook config store. // // It is populated by loadConfigLocalActivity. Hooks map[string]map[string]interface{} // Information about the bundle (transfer) that we submit to Archivematica. // Full path, relative path... // // It is populated by BundleActivity. Bundle activities.BundleActivityResult }
TransferInfo is shared state that is passed down to activities. It can be useful for hooks that may require quick access to processing state. TODO: clean this up, e.g.: it can embed a collection.Collection.