findResourceWorkflow function

Workflow<DataObject>? findResourceWorkflow(
  1. ApertureResource<DataObject> res
)

The workflow of the element type of res, if the application has one.

The element type identifies a workflow, so no configuration is needed.

Implementation

Workflow? findResourceWorkflow(ApertureResource res) {
  final name = res.repository.find().bean.name;
  return Find<Workflow?>((workflow) => workflow?.describe().name == name)
      .find();
}