예제 #1
0
    def _create_execution(self, input_dict, desc, params):
        self.wf_ex = db_api.create_workflow_execution({
            'name': self.wf_def.name,
            'description': desc,
            'workflow_name': self.wf_def.name,
            'workflow_id': self.wf_def.id,
            'spec': self.wf_spec.to_dict(),
            'state': states.IDLE,
            'output': {},
            'task_execution_id': params.get('task_execution_id'),
            'runtime_context': {
                'index': params.get('index', 0)
            },
        })

        self.wf_ex.input = input_dict or {}
        self.wf_ex.context = copy.deepcopy(input_dict) or {}

        env = _get_environment(params)

        if env:
            params['env'] = env

        self.wf_ex.params = params

        data_flow.add_openstack_data_to_context(self.wf_ex)
        data_flow.add_execution_to_context(self.wf_ex)
        data_flow.add_environment_to_context(self.wf_ex)
        data_flow.add_workflow_variables_to_context(self.wf_ex, self.wf_spec)
예제 #2
0
def _create_workflow_execution(wf_def, wf_spec, wf_input, desc, params):
    wf_ex = db_api.create_workflow_execution({
        'name':
        wf_def.name,
        'description':
        desc,
        'workflow_name':
        wf_def.name,
        'workflow_id':
        wf_def.id,
        'spec':
        wf_spec.to_dict(),
        'params':
        params or {},
        'state':
        states.IDLE,
        'input':
        wf_input or {},
        'output': {},
        'context':
        copy.deepcopy(wf_input) or {},
        'task_execution_id':
        params.get('task_execution_id'),
        'runtime_context': {
            'with_items_index': params.get('with_items_index', 0)
        },
    })

    data_flow.add_openstack_data_to_context(wf_ex)
    data_flow.add_execution_to_context(wf_ex)
    data_flow.add_environment_to_context(wf_ex)
    data_flow.add_workflow_variables_to_context(wf_ex, wf_spec)

    return wf_ex
예제 #3
0
    def _create_execution(self, wf_def, wf_ex_id, input_dict, desc, params):
        self.wf_ex = db_api.create_workflow_execution({
            'id': wf_ex_id,
            'name': wf_def.name,
            'description': desc,
            'workflow_name': wf_def.name,
            'workflow_namespace': wf_def.namespace,
            'workflow_id': wf_def.id,
            'spec': self.wf_spec.to_dict(),
            'state': states.IDLE,
            'output': {},
            'task_execution_id': params.get('task_execution_id'),
            'root_execution_id': params.get('root_execution_id'),
            'runtime_context': {
                'index': params.get('index', 0)
            },
        })

        self.wf_ex.input = input_dict or {}

        params['env'] = _get_environment(params)

        self.wf_ex.params = params

        data_flow.add_openstack_data_to_context(self.wf_ex)
        data_flow.add_execution_to_context(self.wf_ex)
        data_flow.add_workflow_variables_to_context(self.wf_ex, self.wf_spec)

        spec_parser.cache_workflow_spec_by_execution_id(
            self.wf_ex.id,
            self.wf_spec
        )
예제 #4
0
    def _create_execution(self, wf_def, wf_ex_id, input_dict, desc, params):
        self.wf_ex = db_api.create_workflow_execution({
            'id': wf_ex_id,
            'name': wf_def.name,
            'description': desc,
            'workflow_name': wf_def.name,
            'workflow_namespace': wf_def.namespace,
            'workflow_id': wf_def.id,
            'spec': self.wf_spec.to_dict(),
            'state': states.IDLE,
            'output': {},
            'task_execution_id': params.get('task_execution_id'),
            'root_execution_id': params.get('root_execution_id'),
            'runtime_context': {
                'index': params.get('index', 0)
            },
        })

        self.wf_ex.input = input_dict or {}

        params['env'] = _get_environment(params)

        self.wf_ex.params = params

        data_flow.add_openstack_data_to_context(self.wf_ex)
        data_flow.add_execution_to_context(self.wf_ex)
        data_flow.add_workflow_variables_to_context(self.wf_ex, self.wf_spec)

        spec_parser.cache_workflow_spec_by_execution_id(
            self.wf_ex.id,
            self.wf_spec
        )
예제 #5
0
    def _create_execution(self, input_dict, desc, params):
        self.wf_ex = db_api.create_workflow_execution({
            'name': self.wf_def.name,
            'description': desc,
            'workflow_name': self.wf_def.name,
            'workflow_id': self.wf_def.id,
            'spec': self.wf_spec.to_dict(),
            'state': states.IDLE,
            'output': {},
            'task_execution_id': params.get('task_execution_id'),
            'runtime_context': {
                'index': params.get('index', 0)
            },
        })

        self.wf_ex.input = input_dict or {}
        self.wf_ex.context = copy.deepcopy(input_dict) or {}

        env = _get_environment(params)

        if env:
            params['env'] = env

        self.wf_ex.params = params

        data_flow.add_openstack_data_to_context(self.wf_ex)
        data_flow.add_execution_to_context(self.wf_ex)
        data_flow.add_environment_to_context(self.wf_ex)
        data_flow.add_workflow_variables_to_context(self.wf_ex, self.wf_spec)
예제 #6
0
def _create_workflow_execution(wf_def, wf_spec, wf_input, desc, params):
    wf_ex = db_api.create_workflow_execution({
        'name': wf_def.name,
        'description': desc,
        'workflow_name': wf_def.name,
        'workflow_id': wf_def.id,
        'spec': wf_spec.to_dict(),
        'params': params or {},
        'state': states.IDLE,
        'input': wf_input or {},
        'output': {},
        'context': copy.deepcopy(wf_input) or {},
        'task_execution_id': params.get('task_execution_id'),
        'runtime_context': {
            'with_items_index': params.get('with_items_index', 0)
        },
    })

    data_flow.add_openstack_data_to_context(wf_ex)
    data_flow.add_execution_to_context(wf_ex)
    data_flow.add_environment_to_context(wf_ex)
    data_flow.add_workflow_variables_to_context(wf_ex, wf_spec)

    return wf_ex