@ply-ct/ply
Version:
REST API Automated Testing
30 lines • 1.13 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.StopExec = void 0;
const exec_1 = require("./exec");
const log_1 = require("../log");
class StopExec extends exec_1.StepExec {
async run(context) {
if (!context.subflow) {
let name = context.flowInstance.flowPath;
const lastSlash = name.lastIndexOf('/');
if (lastSlash > 0 && lastSlash < name.length - 1)
name = name.substring(lastSlash + 1);
const runId = context.logger.level === log_1.LogLevel.debug
? ` (${context.stepInstance.flowInstanceId})`
: '';
context.logger.info(`Finished flow: ${name}${runId}`);
}
// result simply driven by instance status
if (context.stepInstance.status === 'In Progress') {
// not overwritten by step execution
context.stepInstance.status = 'Completed';
}
return this.mapToExecResult(context.stepInstance);
}
isTrustRequired() {
return false;
}
}
exports.StopExec = StopExec;
//# sourceMappingURL=stop.js.map