info: name: Codici fiscali ripartizioni Simple-minded type: http seq: 9 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: "21223" disabled: true - name: x-ef-request-id value: "21334" disabled: true - name: x-ef-request-id value: "21344" body: type: json data: |- { "userDocument": "{{elixBase64EftlDocument}}", // see the pre-request script "userContext": { "lang": "IT", "crlf": "\r\n", "codiciFiscaliAmmessi": ";MMMPPL74T17E463A;;" } } 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="checkUtentePartecipante" type="string"][% utentePartecipante = "Il richiedente non è ammesso alla compilazione perché non rientra tra le ripartizioni proposte"; %][/VAR] [VAR name="ripartizioniDaProposta" type="string"][TAG]GETVALUEBYTAG,RIPARTIZIONI,REQUEST,IUQOID[/TAG][/VAR] [VAR name="rsProponenteCF" type="string"][TAG]GETVALUEBYTAG,RSP_CODFIS,REQUEST,IUQOID[/TAG][/VAR] [VAR name="richiedenteCF" type="string"][TAG]GETVALUEBYTAG,RICHIEDENTE_CODFIS,REQUEST,IUQOID[/TAG][/VAR] [VAR name="richiedenteCFregex" type="string"][% richiedenteCFregex = " (CF: " + richiedenteCF + ")"; %][/VAR] [!-- Il richiedente non deve essere il RS proponente --] [!-- Il richiedente deve comparire fra i responsabili --] [!-- Il richiedente deve comparire fra i partecipanti --] [!-- Il richiedente deve comparire fra i nominativi ammessi (DEBUG) --] [IF] [CONDITION][% richiedenteCF == rsProponenteCF %][/CONDITION] [THEN][% checkUtentePartecipante = "Il Responsabile Scientifico proponente non deve compilare la DSAN"; %][/THEN] [ELSE IF] [CONDITION][CONTAINS varname="ripartizioniDaProposta"][VALUE_OF varname="richiedenteCFregex" /][/CONTAINS][/CONDITION] [THEN][% checkUtentePartecipante = ""; %][/THEN] [/ELSE IF] [ELSE IF] [CONDITION][CONTAINS varname="codiciFiscaliAmmessi"][VALUE_OF varname="richiedenteCF" /][/CONTAINS][/CONDITION] [THEN][% checkUtentePartecipante = ""; %][/THEN] [/ELSE IF] [/IF] [%= checkUtentePartecipante %] [/EFTL] `); settings: encodeUrl: true timeout: 0 followRedirects: true maxRedirects: 5