コード例 #1
0
    function Workflow(props) {
        _classCallCheck(this, Workflow);

        var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Workflow).call(this, props));

        var subject = new _rxjs.Subject(),
            properties = {
            name: props.name,
            subject: subject,
            stream$: subject.share(),
            logger: _cycleLogger.Loggers.get('log.wf.' + props.name),
            steps$: _cyclePlugins.Plugins.get({
                filter: props.name,
                targetType: Workflow,
                baseType: WorkflowStep
            })
        };
        data.set(_this, properties);
        properties.steps$ = properties.steps$.subscribe(function (steps) {
            properties.steps = steps.toDAG();
            _this.emit(Workflow.Events.WF_STEPS_CHANGED, _this, steps);
        });
        return _this;
    }