info: name: Check richiedente in partecipanti by CodFis type: http seq: 6 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: "21306" body: type: json data: |- { "userDocument": "{{elixBase64EftlDocument}}", // see the pre-request script "userContext": { "lang": "IT", "crlf": "\r\n", "codiciFiscaliAmmessi": ";XMMPPL74T17E463A;;" } } 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 = "Utente non ammesso alla compilazione perché non partecipante al contratto!"; %][/VAR] [VAR name="richiedenteCF" type="string"][TAG]GETVALUEBYTAG,RICHIEDENTE_CODFIS,REQUEST,IUQOID[/TAG][/VAR] [VAR name="rsProponenteCF" type="string"][TAG]GETVALUEBYTAG,RSP_CODFIS,REQUEST,IUQOID[/TAG][/VAR] [VAR name="responsabili" type="string"][TAG]GETVALUEBYTAG,CONTRATTO_RESPONSABILI,REQUEST,IUQOID[/TAG][/VAR] [VAR name="partecipanti" type="string"][TAG]GETVALUEBYTAG,CONTRATTO_PARTECIPANTI,REQUEST,IUQOID[/TAG][/VAR] [!-- Hack for the CONTAIN below... --] [VAR name="richiedenteCFcontain" type="string"][% richiedenteCFcontain = ", CF: " + richiedenteCF + ", Qualifica: "; %][/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="responsabili"][VALUE_OF varname="richiedenteCFcontain" /][/CONTAINS][/CONDITION] [THEN][% checkUtentePartecipante = "1"; %][/THEN] [/ELSE IF] [ELSE IF] [CONDITION][CONTAINS varname="partecipanti"][VALUE_OF varname="richiedenteCFcontain" /][/CONTAINS][/CONDITION] [THEN][% checkUtentePartecipante = "2"; %][/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