pub fn initiate_resuming_service(
        &mut self,
        instance_id: InstanceId,
        artifact: ArtifactId,
        params: impl BinaryValue,
    ) -> Result<(), ExecutionError> {
        let state = DispatcherSchema::new(&*self.0.fork)
            .get_instance(instance_id)
            .ok_or(CoreError::IncorrectInstanceId)?;

        if state.status != Some(InstanceStatus::Stopped) {
            return Err(CoreError::ServiceNotStopped.into());
        }

        let mut spec = state.spec;
        spec.artifact = artifact;

        let runtime = self
            .0
            .dispatcher
            .runtime_by_id(spec.artifact.runtime_id)
            .ok_or(CoreError::IncorrectRuntime)?;

        runtime
            .initiate_resuming_service(
                self.0.child_context("", spec.as_descriptor(), false),
                &spec.artifact,
                params.into_bytes(),
            )
            .map_err(|mut err| {
                self.0.should_rollback();
                err.set_runtime_id(spec.artifact.runtime_id)
                    .set_call_site(|| CallSite::new(instance_id, CallType::Resume));
                err
            })?;

        DispatcherSchema::new(&*self.0.fork)
            .initiate_resuming_service(instance_id, spec.artifact)
            .map_err(From::from)
    }
/// Initiates resuming previously stopped service instance in the blockchain.
///
/// Provided artifact will be used in attempt to resume service. Artifact name should be equal to
/// the artifact name of the previously stopped instance.
/// Artifact version should be same as the `data_version` stored in the stopped service
/// instance.
///
/// This method can be used to resume modified service after successful migration.
///
/// The service is not immediately activated; it activates when the block containing
/// the activation transaction is committed.
Initiates resuming previously stopped service instance in the blockchain.
Provided artifact will be used in attempt to resume service. Artifact name should be equal to
the artifact name of the previously stopped instance.
Artifact version should be same as the `data_version` stored in the stopped service
instance.

This method can be used to resume modified service after successful migration.

The service is not immediately activated; it activates when the block containing
the activation transaction is committed.
Initiates resuming previously stopped service instance in the blockchain . Provided artifact will be used in attempt to resume service . Artifact name should be equal to the artifact name of the previously stopped instance . Artifact version should be same as the ` data_version ` stored in the stopped service instance . This method can be used to resume modified service after successful migration . The service is not immediately activated ; it activates when the block containing the activation transaction is committed .
pub fn initiate_resuming_service(
        &mut self,
        instance_id: InstanceId,
        artifact: ArtifactId,
        params: impl BinaryValue,
    ) -> Result<(), ExecutionError> {
        let state = DispatcherSchema::new(&*self.0.fork)
            .get_instance(instance_id)
            .ok_or(CoreError::IncorrectInstanceId)?;
        if state.status != Some(InstanceStatus::Stopped) {
            return Err(CoreError::ServiceNotStopped.into());
        }
        let mut spec = state.spec;
        spec.artifact = artifact;
        let runtime = self
            .0
            .dispatcher
            .runtime_by_id(spec.artifact.runtime_id)
            .ok_or(CoreError::IncorrectRuntime)?;
        runtime
            .initiate_resuming_service(
                self.0.child_context("", spec.as_descriptor(), false),
                &spec.artifact,
                params.into_bytes(),
            )
            .map_err(|mut err| {
                self.0.should_rollback();
                err.set_runtime_id(spec.artifact.runtime_id)
                    .set_call_site(|| CallSite::new(instance_id, CallType::Resume));
                err
            })?;
        DispatcherSchema::new(&*self.0.fork)
            .initiate_resuming_service(instance_id, spec.artifact)
            .map_err(From::from)
    }
pub fn initiate_resuming_service ( & mut self , instance_id : InstanceId , artifact : ArtifactId , params : impl BinaryValue , ) -> Result < ( ) , ExecutionError > { let state = DispatcherSchema :: new ( & * self . 0 . fork ) . get_instance ( instance_id ) . ok_or ( CoreError :: IncorrectInstanceId ) ? ; if state . status != Some ( InstanceStatus :: Stopped ) { return Err ( CoreError :: ServiceNotStopped . into ( ) ) ; } let mut spec = state . spec ; spec . artifact = artifact ; let runtime = self . 0 . dispatcher . runtime_by_id ( spec . artifact . runtime_id ) . ok_or ( CoreError :: IncorrectRuntime ) ? ; runtime . initiate_resuming_service ( self . 0 . child_context ( " " , spec . as_descriptor ( ) , false ) , & spec . artifact , params . into_bytes ( ) , ) . map_err ( | mut err | { self . 0 . should_rollback ( ) ; err . set_runtime_id ( spec . artifact . runtime_id ) . set_call_site ( | | CallSite :: new ( instance_id , CallType :: Resume ) ) ; err } ) ? ; DispatcherSchema :: new ( & * self . 0 . fork ) . initiate_resuming_service ( instance_id , spec . artifact ) . map_err ( From :: from ) }
Initiates resuming previously stopped service instance in the blockchain.
Initiates resuming previously stopped service instance in the blockchain .
&mut self
instance_id
InstanceId
artifact
ArtifactId
params
impl BinaryValue
&mut self
instance_id
InstanceId
artifact
ArtifactId
params
impl BinaryValue