info: name: Contratto IS economico type: http seq: 1 http: method: POST url: "{{elixFormsApiUrl}}/eftl/process/v1" headers: - name: x-requested-with value: XMLHttpRequest - name: x-api-key value: "{{elixFormsWsAuthenticationToken}}" - name: x-ef-request-id value: "8463" body: type: json data: |- { "userDocument": "{{elixBase64EftlDocument}}", // see the pre-request script "userContext": { "lang": "IT", "docs": [ { "name": "doc1", "quantity": 3, "price": 123.3 }, { "name": "doc2", "quantity": 5, "price": 213.3 }, { "name": "doc3", "quantity": 10, "price": 321.3 } ], "docsAsEntities": [ { "eftlEntityType": "com.anthesi.elixforms.api.eftl.model.mock.EftlDoc", "eftlEntity": { "name": "doc1", "quantity": 3, "price": 123.3 } }, { "eftlEntityType": "com.anthesi.elixforms.api.eftl.model.mock.EftlDoc", "eftlEntity": { "name": "doc2", "quantity": 5, "price": 213.3 } }, { "eftlEntityType": "com.anthesi.elixforms.api.eftl.model.mock.EftlDoc", "eftlEntity": { "name": "doc3", "quantity": 10, "price": 321.3 } } ], "singleEntity": { "eftlEntityType": "com.anthesi.elixforms.api.eftl.model.mock.EftlDoc", "eftlEntity": { "name": "doc1", "quantity": 3, "price": 123.3 } }, "simpleList": [ "s1", "s2", "s3" ], "docsSize": 3 } } auth: inherit runtime: scripts: - type: before-request code: |- const { prepareEftlDocument } = require("./elixFormsJs.js") // Copy-pasta your EFTL document below inside the template literals (`) prepareEftlDocument(String.raw` [EFTL][HEADER name="trimDocument" value="true" type="boolean" /] [VAR name="tipologiaCodice" type="string"][TAG]GETVALUEBYTAG,TIPOLOGIA_CODICE,REQUEST,IUQOID[/TAG][/VAR] [VAR name="isEconomico" type="boolean"][% isEconomico = true; %][/VAR] [VAR name="tipologieNonEconomico" type="iterable"][SPLIT regex=";"][TAG]GETVALUEBYTAG,TIPOLOGIE_NON_ECONOMICO,REQUEST,IUQOID[/TAG][/SPLIT][/VAR] [IF] [CONDITION] [CONTAINS varname="tipologieNonEconomico"][VALUE_OF varname="tipologiaCodice" /][/CONTAINS] [/CONDITION] [THEN][% isEconomico = false; %][/THEN] [/IF] [%= isEconomico %] [/EFTL] `); settings: encodeUrl: true timeout: 0 followRedirects: true maxRedirects: 5