150 lines
3.1 KiB
JSON
150 lines
3.1 KiB
JSON
{
|
|
"schemaVersion": 1,
|
|
"flowKey": "DOCUMENT_DEMO",
|
|
"version": 1,
|
|
"initialState": "LICENCIA_PENDIENTE",
|
|
"dataSchema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"documentos": {
|
|
"type": "object"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"initialDataSchema": {
|
|
"type": "object",
|
|
"additionalProperties": false
|
|
},
|
|
"states": [
|
|
{
|
|
"key": "LICENCIA_PENDIENTE",
|
|
"terminal": false
|
|
},
|
|
{
|
|
"key": "COMPLETA",
|
|
"terminal": true
|
|
}
|
|
],
|
|
"events": [
|
|
{
|
|
"key": "REGISTRAR_LICENCIA",
|
|
"inputSchema": {
|
|
"type": "object",
|
|
"required": [
|
|
"documentId"
|
|
],
|
|
"properties": {
|
|
"documentId": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|
|
}
|
|
],
|
|
"transitions": [
|
|
{
|
|
"id": "licencia",
|
|
"from": "LICENCIA_PENDIENTE",
|
|
"event": "REGISTRAR_LICENCIA",
|
|
"allowedRoles": [
|
|
"ANALISTA"
|
|
],
|
|
"actions": [
|
|
{
|
|
"id": "registrar",
|
|
"type": "REGISTER_DOCUMENT",
|
|
"documentType": "LICENCIA_CONDUCIR",
|
|
"inputs": {
|
|
"documentId": {
|
|
"path": "/event/data/documentId"
|
|
}
|
|
},
|
|
"resultKey": "documento"
|
|
},
|
|
{
|
|
"id": "validar",
|
|
"type": "INVOKE_INTEGRATION",
|
|
"integrationKey": "DOCUMENTO_VALIDA",
|
|
"contractVersion": "1",
|
|
"profile": "LICENCIA_CONDUCIR",
|
|
"profileVersion": "1",
|
|
"inputs": {
|
|
"documentId": {
|
|
"path": "/results/documento/documentId"
|
|
}
|
|
},
|
|
"resultKey": "validacion"
|
|
}
|
|
],
|
|
"decision": "DOCUMENTO_VALIDO",
|
|
"destinations": {
|
|
"VALID": "COMPLETA",
|
|
"INVALID": "LICENCIA_PENDIENTE"
|
|
},
|
|
"updates": [
|
|
{
|
|
"target": "/documentos/licencia",
|
|
"value": {
|
|
"path": "/results/validacion"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"decisions": [
|
|
{
|
|
"id": "DOCUMENTO_VALIDO",
|
|
"hitPolicy": "UNIQUE",
|
|
"rules": [
|
|
{
|
|
"id": "valida",
|
|
"when": {
|
|
"op": "EQ",
|
|
"left": {
|
|
"path": "/results/validacion/status"
|
|
},
|
|
"right": {
|
|
"literal": "VALID"
|
|
}
|
|
},
|
|
"output": "VALID"
|
|
}
|
|
],
|
|
"defaultOutput": "INVALID"
|
|
}
|
|
],
|
|
"tasks": [
|
|
{
|
|
"state": "LICENCIA_PENDIENTE",
|
|
"event": "REGISTRAR_LICENCIA",
|
|
"inputSchema": {
|
|
"type": "object",
|
|
"required": [
|
|
"documentId"
|
|
],
|
|
"properties": {
|
|
"documentId": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"ui": {
|
|
"component": "DOCUMENT_UPLOAD",
|
|
"title": "Sube tu licencia",
|
|
"documentType": "LICENCIA_CONDUCIR",
|
|
"acceptedMimeTypes": [
|
|
"application/pdf",
|
|
"image/jpeg",
|
|
"image/png"
|
|
],
|
|
"maxBytes": 10485760
|
|
}
|
|
}
|
|
]
|
|
}
|