A method for restoring a status of a third apparatus controlled by multiple commands in a system, the system including a first apparatus, a second apparatus connected to the first apparatus, and the third apparatus connected to the second apparatus, the method comprising:
- causing the first apparatus to:
- store first apparatus-status information indicating a status of the third apparatus that is updated by the first apparatus,
- provide the second apparatus with a first control command for controlling the third apparatus, and
- update the apparatus-status information when information indicating a normal finish of the first control command is received from the second apparatus;
- causing the second apparatus to:
- convert the first control command received from the first apparatus to a plurality of second control commands compatible with the third apparatus,
- provide the third apparatus with a request to perform the plurality of second control commands, and
- transmit information indicating a normal finish of the first control command to the first apparatus when all of the plurality of second control commands finish normally;
- and
- causing the third apparatus to:
- store second apparatus-status information indicating a status of the third apparatus that is updated by the third apparatus, and a reverse command for restoring a result of executing each second control command to a result prior to executing the each second control command,
- execute the plurality of second control commands, based on a request from the second apparatus, and update the second apparatus-status information in connection with finish of each second control command,
- transmit a normal-finish notification indicating a normal finish of the plurality of second control commands to the second apparatus,
- generate a reverse command in connection with execution of each second control command, and store the generated reverse commands, and
- in a case where all of the plurality of second control commands have not been executed, cause the second apparatus-status information to be restored to information indicating a status prior to execution of the plurality of second control commands by executing control based on the reverse commands stored in the third apparatus.