collectReferences method

  1. @override
Future<List<ModelReference>> collectReferences({
  1. String? appId,
})
override

Implementation

@override
Future<List<ModelReference>> collectReferences({String? appId}) async {
  List<ModelReference> referencesCollector = [];
  if (workflow != null) {
    referencesCollector.add(ModelReference(
        WorkflowModel.packageName, WorkflowModel.id, workflow!));
  }
  if (task != null) {
    referencesCollector.addAll(await task!.collectReferences(appId: appId));
  }
  if (workflow != null) {
    referencesCollector
        .addAll(await workflow!.collectReferences(appId: appId));
  }
  if (resultsCurrent != null) {
    for (var item in resultsCurrent!) {
      referencesCollector.addAll(await item.collectReferences(appId: appId));
    }
  }
  if (resultsPrevious != null) {
    for (var item in resultsPrevious!) {
      referencesCollector.addAll(await item.collectReferences(appId: appId));
    }
  }
  if (confirmMessage != null) {
    referencesCollector
        .addAll(await confirmMessage!.collectReferences(appId: appId));
  }
  if (rejectMessage != null) {
    referencesCollector
        .addAll(await rejectMessage!.collectReferences(appId: appId));
  }
  return referencesCollector;
}