Esempio n. 1
0
def _complete_task(task_ex, task_spec, state):
    # Ignore if task already completed.
    if states.is_completed(task_ex.state):
        return []

    _set_task_state(task_ex, state)

    data_flow.publish_variables(task_ex, task_spec)

    if not task_spec.get_keep_result():
        data_flow.destroy_task_result(task_ex)
Esempio n. 2
0
def _complete_task(task_ex, task_spec, state):
    # Ignore if task already completed.
    if states.is_completed(task_ex.state):
        return []

    _set_task_state(task_ex, state)

    data_flow.publish_variables(
        task_ex,
        task_spec
    )

    if not task_spec.get_keep_result():
        data_flow.destroy_task_result(task_ex)
Esempio n. 3
0
def _complete_task(task_ex, task_spec, state):
    # Ignore if task already completed.
    if states.is_completed(task_ex.state):
        return []

    _set_task_state(task_ex, state)

    try:
        data_flow.publish_variables(
            task_ex,
            task_spec
        )
    except Exception as e:
        _set_task_state(task_ex, states.ERROR, state_info=str(e))

    if not task_spec.get_keep_result():
        data_flow.destroy_task_result(task_ex)
Esempio n. 4
0
def _complete_task(task_ex, task_spec, state, state_info=None):
    # Ignore if task already completed.
    if states.is_completed(task_ex.state):
        return []

    set_task_state(task_ex, state, state_info)

    try:
        data_flow.publish_variables(
            task_ex,
            task_spec
        )
    except Exception as e:
        set_task_state(task_ex, states.ERROR, str(e))

    if not task_spec.get_keep_result():
        data_flow.destroy_task_result(task_ex)
Esempio n. 5
0
def _complete_task(task_ex, task_spec, state, state_info=None):
    # Ignore if task already completed.
    if states.is_completed(task_ex.state):
        return []

    set_task_state(task_ex, state, state_info)

    try:
        data_flow.publish_variables(task_ex, task_spec)
    except exc.MistralException as e:
        LOG.error(
            'An error while publishing task variables'
            ' [task_execution_id=%s]: %s', task_ex.id, str(e))

        set_task_state(task_ex, states.ERROR, str(e))

    if not task_spec.get_keep_result():
        data_flow.destroy_task_result(task_ex)
Esempio n. 6
0
def _complete_task(task_ex, task_spec, state, state_info=None):
    # Ignore if task already completed.
    if states.is_completed(task_ex.state):
        return []

    set_task_state(task_ex, state, state_info)

    try:
        data_flow.publish_variables(task_ex, task_spec)
    except exc.MistralException as e:
        LOG.error(
            'An error while publishing task variables'
            ' [task_execution_id=%s]: %s',
            task_ex.id, str(e)
        )

        set_task_state(task_ex, states.ERROR, str(e))

    if not task_spec.get_keep_result():
        data_flow.destroy_task_result(task_ex)