State Machine Service
State Machine Config

Update state-machine configuration of an entity type

1min
PUT
https://{tenantSubDomain}.fxtrt.io/core/api/v1/state-machine/config/{entityCode}

This API is for updating state-machine configuration (states, sub-states and state transition rules) of an entity type e.g. users,bags,boxes,vehicles etc. specified by entityType.

Important:

  • The state machine cannot be partially updated.
  • Updation/Addition of main states names defined for an entity type is not allowed.Tenant can only add/update substates. Addition/updation of rest all configurations, except names of main states, is allowed.
ParameterDescriptionTypeValidation
states*List of main states with its substates and transitions.minItems: 1
ㅤ↳name*Name of the state.stringminLength: 3 maxLength: 32 pattern: Name can have alphabets and must be 3 to 16 characters long.
ㅤ↳defaultSubState*Represents default substate for this state.stringminLength: 3 maxLength: 32 pattern: Name can have alphabets and must be 3 to 16 characters long.
ㅤ↳subStates*minItems: 1
ㅤ↳name*Name of the sub-state.stringminLength: 3 maxLength: 32 pattern: Name can have alphabets and must be 3 to 16 characters long.
ㅤㅤ↳transitions*Represents an array of transition rules for this substate. Contains events and the destination state.
ㅤㅤㅤ↳eventCode*Represents code of the event for state transition.string
ㅤㅤㅤ↳reasonCode*Represents code of the reason for state transition.string
ㅤㅤㅤ↳destination*Name of the main state and its substate.minLength: 3 maxLength: 64
ㅤㅤ
ㅤㅤ↳callbackRepresents callback url, which can be called to get any info about state transition of an instance or its terminal ttl expiry or to notify status of API request.stringpattern: A valid URL.
ㅤ↳terminalStatesRepresents terminal state list for this state. Only the last main state should have terminal states.minLength: 3 maxLength: 32 pattern: Name can have alphabets and must be 3 to 16 characters long.
terminalTTL*Represents time to live of an instance in a transactional database after it has reached a terminal state.stringTime string in days, hours, minutes and seconds. minLength: 2 Example- 30m, 1d 12h, 1d 12h 30m 45s etc.
callbackRepresents callback url, which can be called to get any info about state transition of an instance or its terminal ttl expiry or to notify status of API request.stringpattern: A valid URL.

*This is required.

HTTP Status Code Summary

CodeDescription
200 - OKEverything worked as expected.
| **400 - Bad Request** | The request was unacceptable, often due to missing a required parameter. |
| **401 - Unauthorized** | No valid API key provided. |
| **503 - Server Errors** | Something went wrong on our end. (These are rare.) |
Path Parameters
entityCode
*
Header Parameters
X-COREOS-REQUEST-ID
*
X-COREOS-TID
*
X-COREOS-ACCESS
*
X-COREOS-USERINFO
Body Parameters
body
*
Description
State-machine configuration for the entity type
All Of
StateMachineConfig +
states
*
terminalTTL
*
callback
Responses
200
OK
All Of
ErrorResponse +
error
*
request
*
data
400
Bad request - The server is unable to process the request due to something that is perceived to be a client error.
error
*
request
*
401
Unauthorized - The client's identity is unknown to the server. Verify that you are accessing the correct tenant and that your client ID and client secret are valid on that Tenant.
error
*
request
*
503
Server error - The server is not ready to handle the request. This could be due to maintenance downtime or system resource constraints.
error
*
request
*
Curl
JS
Ruby
Python
Responses
200
400
401
503