<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def modify_origin(self, from_state, from_outcome):
 """Set both from_state and from_outcome at the same time to modify transition origin :param str from_state: State id of the origin state :param int from_outcome: Outcome id of the origin port :raises exceptions.ValueError: If parameters have wrong types or the new transition is not valid """

        if not (from_state is None and from_outcome is None):
            if not isinstance(from_state, string_types):
                raise ValueError("Invalid transition origin port: from_state must be a string")
            if not isinstance(from_outcome, int):
                raise ValueError("Invalid transition origin port: from_outcome must be of type int")

        old_from_state = self.from_state
        old_from_outcome = self.from_outcome
        self._from_state = from_state
        self._from_outcome = from_outcome

        valid, message = self._check_validity()
        if not valid:
            self._from_state = old_from_state
            self._from_outcome = old_from_outcome
            raise ValueError("The transition origin could not be changed: {0}".format(message))