'Take runtime state from persisted invocation and convert it
into a DefaultToolState object for use during workflow invocation.'

def decode_runtime_state(self, runtime_state):

    if self.tool:
        state = super(ToolModule, self).decode_runtime_state(runtime_state)
        if (RUNTIME_STEP_META_STATE_KEY in runtime_state):
            self.__restore_step_meta_runtime_state(loads(runtime_state[RUNTIME_STEP_META_STATE_KEY]))
        return state
    else:
        raise ToolMissingException(('Tool    %s    missing.    Cannot    recover    runtime    state.' % self.tool_id))
