Interface WorkflowPolicyBuilder<C>
interface WorkflowPolicyBuilder<C extends WorkflowPolicyClass> {
onWorkflowFailure<K extends string | symbol>(
key: K,
...requests: Tokens<
ParametersOf<InstanceType<C>, K>,
Place<InstanceType<C>, K>,
>,
): this;
onWorkflowSuccess<K extends string | symbol>(
key: K,
...requests: Tokens<
ParametersOf<InstanceType<C>, K>,
Place<InstanceType<C>, K>,
>,
): this;
}
onWorkflowFailure<K extends string | symbol>(
key: K,
...requests: Tokens<
ParametersOf<InstanceType<C>, K>,
Place<InstanceType<C>, K>,
>,
): this;
onWorkflowSuccess<K extends string | symbol>(
key: K,
...requests: Tokens<
ParametersOf<InstanceType<C>, K>,
Place<InstanceType<C>, K>,
>,
): this;
}
Type Parameters
- C extends WorkflowPolicyClass
The class of the policy.
Methods
on Workflow Failure
-
onWorkflowFailure<K extends string | symbol>(
key: K,
...requests: Tokens<
ParametersOf<InstanceType<C>, K>,
Place<InstanceType<C>, K>,
>,
): thisMakes the method
keythe policy'son workflow failure, its parameters makingrequests, in order.Type Parameters
- K extends string | symbol
Returns this
Throws
Error, at once, as StepPolicyBuilder.onStepFailure does.
on Workflow Success
-
onWorkflowSuccess<K extends string | symbol>(
key: K,
...requests: Tokens<
ParametersOf<InstanceType<C>, K>,
Place<InstanceType<C>, K>,
>,
): thisMakes the method
keythe policy'son workflow success, its parameters makingrequests, in order.Type Parameters
- K extends string | symbol
Returns this
Throws
Error, at once, as StepPolicyBuilder.onStepFailure does.
Puts a workflow policy of the class
Ctogether for a workflow's builder, which takes it in itspolicy: started by the policy class's staticbuilder(name), for a class declared without decorators. Each method names the method of the class that implements a hook, and gives the requests of its parameters by position.