Job constructor

Job({
  1. required String name,
  2. required List<BaseStep> steps,
  3. Map<String, dynamic> jobParameters = const {},
  4. FutureOr<bool> precondition(
    1. ExecutionContext context
    )?,
  5. dynamic onStarted(
    1. ExecutionContext context
    )?,
  6. dynamic onSucceeded(
    1. ExecutionContext context
    )?,
  7. dynamic onError(
    1. ExecutionContext context,
    2. dynamic error,
    3. StackTrace stackTrace
    )?,
  8. dynamic onCompleted(
    1. ExecutionContext context
    )?,
  9. List<Job> branchesOnSucceeded = const [],
  10. List<Job> branchesOnFailed = const [],
  11. List<Job> branchesOnCompleted = const [],
})

Returns the new instance of Job.

Implementation

Job({
  required String name,
  required this.steps,
  this.jobParameters = const {},
  FutureOr<bool> Function(ExecutionContext context)? precondition,
  Function(ExecutionContext context)? onStarted,
  Function(ExecutionContext context)? onSucceeded,
  Function(ExecutionContext context, dynamic error, StackTrace stackTrace)?
      onError,
  Function(ExecutionContext context)? onCompleted,
  List<Job> branchesOnSucceeded = const [],
  List<Job> branchesOnFailed = const [],
  List<Job> branchesOnCompleted = const [],
}) : super(
        name: name,
        precondition: precondition,
        onStarted: onStarted,
        onError: onError,
        onSucceeded: onSucceeded,
        onCompleted: onCompleted,
        branchesOnSucceeded: branchesOnSucceeded,
        branchesOnFailed: branchesOnFailed,
        branchesOnCompleted: branchesOnCompleted,
      );