# 2412 - Service Change of State

> MSS documentation · https://doc.sysdevmobile.com/mss/extensibility/functions-mss-to-kalipso/services/2412-services-service-change-of-state
>
> Eventos EXT_2412 na mudança de estado de um serviço, com o estado anterior e o novo; o Replace substitui, valida ou aborta com outRunMSSCode.

2412 - Service Change of State

| Event | Extension action set | Description |
| --- | --- | --- |
| [Before ](https://doc.sysdevmobile.com/mss/extensibility/functions-mss-to-kalipso/services/2412-services-service-change-of-state.md#before) | EXT_2412_1_Before | Will be executed before MSS changes the state of the service; |
| [Replace](https://doc.sysdevmobile.com/mss/extensibility/functions-mss-to-kalipso/services/2412-services-service-change-of-state.md#replace) | EXT_2412_2_Replace | Will replace MSS change state code, can be used also to create validations before MSS changes the state of the service using the output parameter **outRunMSSCode**; |
| [After](https://doc.sysdevmobile.com/mss/extensibility/functions-mss-to-kalipso/services/2412-services-service-change-of-state.md#after) | EXT_2412_3_After | Will be executed after MSS changes the state of the service; |

### Before

_Input Parameters_

* inServiceExercise – Exercise of the service (SRVEXR);
* inServiceSeries – Serie of the service (SRVSER);
* inServiceNumber – Number of the service (SRVNDC);
* inPreviousState – Code of the current State (SRVSTS);
* inNewState – Code of the new State (SRVSTS);

### Replace

_Input Parameters_

* inServiceExercise – Exercise of the service (SRVEXR);
* inServiceSeries – Serie of the service (SRVSER);
* inServiceNumber – Number of the service (SRVNDC);
* inPreviousState – Code of the current State (SRVSTS);
* inNewState – Code of the new State (SRVSTS);

_Output Parameters_

* outRunMSSCode – when replacing MSS module must return 0(zero), if working as validations can return 1 so MSS changes the state of the service, 0 to ignore MSS code or -1 to abort the operation;

### After

_Input Parameters_

* inServiceExercise – Exercise of the service (SRVEXR);
* inServiceSeries – Serie of the service (SRVSER);
* inServiceNumber – Number of the service (SRVNDC);
* inPreviousState – Code of the previous State (SRVSTS);
* inNewState – Code of the current State (SRVSTS);
