本文整理汇总了TypeScript中simple-swf/build/src/tasks.DecisionTask.getWorkflowInfo方法的典型用法代码示例。如果您正苦于以下问题:TypeScript DecisionTask.getWorkflowInfo方法的具体用法?TypeScript DecisionTask.getWorkflowInfo怎么用?TypeScript DecisionTask.getWorkflowInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类simple-swf/build/src/tasks.DecisionTask
的用法示例。
在下文中一共展示了DecisionTask.getWorkflowInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: buildTaskMeta
buildTaskMeta(task: DecisionTask, meta?: Object): Object {
let wfMeta = task.getWorkflowInfo() as WorkflowWithParent
let parentWf = task.getParentWorkflowInfo()
if (parentWf) {
wfMeta.parentWorkflowId = parentWf.workflowId
}
let taskMeta = {
task: { type: 'taskGraph', id: task.id },
workflow: wfMeta
}
return _.defaults(taskMeta || {}, meta || {})
}
示例2: onDecisionMade
onDecisionMade(task: DecisionTask) {
const finishTime = this.decisionTimers[task.id]
delete this.decisionTimers[task.id]
this.ftlConfig.metricReporter.decrement('decider.running')
this.ftlConfig.metricReporter.increment('decider.completed')
this.ftlConfig.metricReporter.timing('decider.timer', finishTime)
this.logInfo('responded to decision task', this.buildTaskMeta(task, { results: task.getDecisionInfo() }))
const failedWorkflows = task.decisions.filter((d) => d.decision.decisionType === 'FailWorkflowExecution')
// there should only really be one failedWorkflow
if (failedWorkflows.length) {
const wf = failedWorkflows[0]
this.ftlConfig.notifier.sendError('workflowFailed', {
workflow: task.getWorkflowInfo(),
control: task.getWorkflowTaskInput().control,
parentWf: task.getParentWorkflowInfo(),
originWorkflow: task.getOriginWorkflow(),
details: wf.decision.failWorkflowExecutionDecisionAttributes!.details,
reason: wf.decision.failWorkflowExecutionDecisionAttributes!.reason
})
}
this.emit('decisionCompleted', task.decisions.map((d) => d.decision ))
}