elixFormsAPI - update syntax and add prepare global function
This commit is contained in:
+3
-2
@@ -39,8 +39,9 @@ runtime:
|
||||
scripts:
|
||||
- type: before-request
|
||||
code: |-
|
||||
const { prepareEftlDocument } = require("./elixFormsJs.js")
|
||||
// Copy-pasta your EFTL document below inside the template literals (`)
|
||||
var eftlDocumentToBeProcessed = bru.setVar("elixBase64EftlDocument", btoa(String.raw`
|
||||
prepareEftlDocument(String.raw`
|
||||
[EFTL][HEADER name="trimDocument" value="true" type="boolean" /]
|
||||
[VAR name="arrayCFdocenti" type="string"][TAG]GETVALUEBYTAG,PARTECIPANTI_QUALIFICA_DOCENTE,REQUEST,IUQOID[/TAG][/VAR]
|
||||
[VAR name="arrayCFaltro" type="string"][TAG]GETVALUEBYTAG,PARTECIPANTI_QUALIFICA_ALTRO,REQUEST,IUQOID[/TAG][/VAR]
|
||||
@@ -71,7 +72,7 @@ runtime:
|
||||
[%= crlf %]
|
||||
[%= importoAltro %]
|
||||
[/EFTL]
|
||||
`));
|
||||
`);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
|
||||
+3
-2
@@ -36,8 +36,9 @@ runtime:
|
||||
scripts:
|
||||
- type: before-request
|
||||
code: |-
|
||||
const { prepareEftlDocument } = require("./elixFormsJs.js")
|
||||
// Copy-pasta your EFTL document below inside the template literals (`)
|
||||
var eftlDocumentToBeProcessed = bru.setVar("elixBase64EftlDocument", btoa(String.raw`
|
||||
prepareEftlDocument(String.raw`
|
||||
[EFTL][HEADER name="trimDocument" value="true" type="boolean" /]
|
||||
|
||||
[VAR name="importo" type="number"][TAG]GETVALUEBYTAG,IMPORTO_RIPARTIZIONE_ASSEGNATA,REQUEST,IUQOID[/TAG][/VAR]
|
||||
@@ -52,7 +53,7 @@ runtime:
|
||||
[%= crlf %]
|
||||
[%= oreEquivalenti %]
|
||||
[/EFTL]
|
||||
`));
|
||||
`);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
|
||||
+3
-2
@@ -39,8 +39,9 @@ runtime:
|
||||
scripts:
|
||||
- type: before-request
|
||||
code: |-
|
||||
const { prepareEftlDocument } = require("./elixFormsJs.js")
|
||||
// Copy-pasta your EFTL document below inside the template literals (`)
|
||||
var eftlDocumentToBeProcessed = bru.setVar("elixBase64EftlDocument", btoa(String.raw`
|
||||
prepareEftlDocument(String.raw`
|
||||
[EFTL][HEADER name="trimDocument" value="true" type="boolean" /]
|
||||
[VAR name="arrayCFdocenti" type="string"][TAG]GETVALUEBYTAG,PARTECIPANTI_QUALIFICA_DOCENTE,REQUEST,IUQOID[/TAG][/VAR]
|
||||
[VAR name="arrayCFaltro" type="string"][TAG]GETVALUEBYTAG,PARTECIPANTI_QUALIFICA_ALTRO,REQUEST,IUQOID[/TAG][/VAR]
|
||||
@@ -92,7 +93,7 @@ runtime:
|
||||
[TAG]GETVALUEBYTAG,PARTECIPANTE,REQUEST,IUQOID,UPDATED_LAST[/TAG]: [TAG]GETVALUEBYTAG,IMPORTO_RIPARTIZIONE,REQUEST,IUQOID,UPDATED_LAST[/TAG]
|
||||
--]
|
||||
[/EFTL]
|
||||
`));
|
||||
`);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
|
||||
+44
-94
@@ -15,111 +15,61 @@ http:
|
||||
value: "21306"
|
||||
body:
|
||||
type: json
|
||||
data: "{\r
|
||||
|
||||
\ \"userDocument\": \"{{elixBase64EftlDocument}}\", // see the pre-request script\r
|
||||
|
||||
\ \"userContext\": {\r
|
||||
|
||||
\ \"lang\": \"IT\",\r
|
||||
|
||||
\ \"crlf\": \"\\r\\n\",\r
|
||||
|
||||
\ \"codiciFiscaliAmmessi\": \";XMMPPL74T17E463A;;\"\r
|
||||
|
||||
\ }\r
|
||||
|
||||
}"
|
||||
data: |-
|
||||
{
|
||||
"userDocument": "{{elixBase64EftlDocument}}", // see the pre-request script
|
||||
"userContext": {
|
||||
"lang": "IT",
|
||||
"crlf": "\r\n",
|
||||
"codiciFiscaliAmmessi": ";XMMPPL74T17E463A;;"
|
||||
}
|
||||
}
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: before-request
|
||||
code: "// Copy-pasta your EFTL document below inside the template literals (`)\r
|
||||
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 eftlDocumentToBeProcessed = String.raw`\r
|
||||
[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]
|
||||
|
||||
[EFTL][HEADER name=\"trimDocument\" value=\"true\" type=\"boolean\" /]\r
|
||||
|
||||
[VAR name=\"checkUtentePartecipante\" type=\"string\"][% utentePartecipante = \"Utente non ammesso alla compilazione perché non partecipante al contratto!\"; %][/VAR]\r
|
||||
[!-- Hack for the CONTAIN below... --]
|
||||
[VAR name="richiedenteCFcontain" type="string"][% richiedenteCFcontain = ", CF: " + richiedenteCF + ", Qualifica: "; %][/VAR]
|
||||
|
||||
[VAR name=\"richiedenteCF\" type=\"string\"][TAG]GETVALUEBYTAG,RICHIEDENTE_CODFIS,REQUEST,IUQOID[/TAG][/VAR]\r
|
||||
[!-- 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) --]
|
||||
|
||||
\r
|
||||
[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]
|
||||
|
||||
[VAR name=\"rsProponenteCF\" type=\"string\"][TAG]GETVALUEBYTAG,RSP_CODFIS,REQUEST,IUQOID[/TAG][/VAR]\r
|
||||
|
||||
[VAR name=\"responsabili\" type=\"string\"][TAG]GETVALUEBYTAG,CONTRATTO_RESPONSABILI,REQUEST,IUQOID[/TAG][/VAR]\r
|
||||
|
||||
[VAR name=\"partecipanti\" type=\"string\"][TAG]GETVALUEBYTAG,CONTRATTO_PARTECIPANTI,REQUEST,IUQOID[/TAG][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
\r
|
||||
|
||||
[!-- Hack for the CONTAIN below... --]\r
|
||||
|
||||
[VAR name=\"richiedenteCFcontain\" type=\"string\"][% richiedenteCFcontain = \", CF: \" + richiedenteCF + \", Qualifica: \"; %][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
[!-- Il richiedente non deve essere il RS proponente --]\r
|
||||
|
||||
[!-- Il richiedente deve comparire fra i responsabili --]\r
|
||||
|
||||
[!-- Il richiedente deve comparire fra i partecipanti --]\r
|
||||
|
||||
[!-- Il richiedente deve comparire fra i nominativi ammessi (DEBUG) --]\r
|
||||
|
||||
\r
|
||||
|
||||
[IF]\r
|
||||
|
||||
\ [CONDITION][% richiedenteCF == rsProponenteCF %][/CONDITION]\r
|
||||
|
||||
\ [THEN][% checkUtentePartecipante = \"Il Responsabile Scientifico proponente non deve compilare la DSAN\"; %][/THEN]\r
|
||||
|
||||
\ [ELSE IF]\r
|
||||
|
||||
\ [CONDITION][CONTAINS varname=\"responsabili\"][VALUE_OF varname=\"richiedenteCFcontain\" /][/CONTAINS][/CONDITION]\r
|
||||
|
||||
\ [THEN][% checkUtentePartecipante = \"1\"; %][/THEN]\r
|
||||
|
||||
\ [/ELSE IF]\r
|
||||
|
||||
\ [ELSE IF]\r
|
||||
|
||||
\ [CONDITION][CONTAINS varname=\"partecipanti\"][VALUE_OF varname=\"richiedenteCFcontain\" /][/CONTAINS][/CONDITION]\r
|
||||
|
||||
\ [THEN][% checkUtentePartecipante = \"2\"; %][/THEN]\r
|
||||
|
||||
\ [/ELSE IF]\r
|
||||
|
||||
\ [ELSE IF]\r
|
||||
|
||||
\ [CONDITION][CONTAINS varname=\"codiciFiscaliAmmessi\"][VALUE_OF varname=\"richiedenteCF\" /][/CONTAINS][/CONDITION]\r
|
||||
|
||||
\ [THEN][% checkUtentePartecipante = \"\"; %][/THEN]\r
|
||||
|
||||
\ [/ELSE IF]\r
|
||||
|
||||
[/IF]\r
|
||||
|
||||
\r
|
||||
|
||||
[%= checkUtentePartecipante %]\r
|
||||
|
||||
[/EFTL]\r
|
||||
|
||||
`;\r
|
||||
|
||||
\r
|
||||
|
||||
var base64EncodedDocument = btoa(eftlDocumentToBeProcessed);\r
|
||||
|
||||
\r
|
||||
|
||||
bru.setVar(\"elixBase64EftlDocument\", base64EncodedDocument);"
|
||||
[%= checkUtentePartecipante %]
|
||||
[/EFTL]
|
||||
`);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
|
||||
+46
-98
@@ -15,115 +15,63 @@ http:
|
||||
value: "21223"
|
||||
body:
|
||||
type: json
|
||||
data: "{\r
|
||||
|
||||
\ \"userDocument\": \"{{elixBase64EftlDocument}}\", // see the pre-request script\r
|
||||
|
||||
\ \"userContext\": {\r
|
||||
|
||||
\ \"lang\": \"IT\",\r
|
||||
|
||||
\ \"crlf\": \"\\r\\n\",\r
|
||||
|
||||
\ \"nominativiAmmessi\": \";MAMMI Pier Paolo;;\"\r
|
||||
|
||||
\ }\r
|
||||
|
||||
}"
|
||||
data: |-
|
||||
{
|
||||
"userDocument": "{{elixBase64EftlDocument}}", // see the pre-request script
|
||||
"userContext": {
|
||||
"lang": "IT",
|
||||
"crlf": "\r\n",
|
||||
"nominativiAmmessi": ";MAMMI Pier Paolo;;"
|
||||
}
|
||||
}
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: before-request
|
||||
code: "// Copy-pasta your EFTL document below inside the template literals (`)\r
|
||||
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 eftlDocumentToBeProcessed = String.raw`\r
|
||||
[VAR name="rsProponenteCognome" type="string"][TAG]GETVALUEBYTAG,RSP_COGNOME,REQUEST,IUQOID[/TAG][/VAR]
|
||||
[VAR name="rsProponenteNome" type="string"][TAG]GETVALUEBYTAG,RSP_COGNOME,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]
|
||||
|
||||
[EFTL][HEADER name=\"trimDocument\" value=\"true\" type=\"boolean\" /]\r
|
||||
[!-- [VAR name="nominativoUtentePlain" type="string"][TAG]GETVALUEBYTAG,RICHIEDENTE_NOMINATIVO,REQUEST,IUQOID[/TAG][/VAR] --]
|
||||
[VAR name="nominativoUtentePlain" type="string"][% nominativoUtentePlain = "mammi Pier Paolo"; %][/VAR]
|
||||
|
||||
[VAR name=\"checkUtentePartecipante\" type=\"string\"][% utentePartecipante = \"Utente non ammesso alla compilazione perché non partecipante al contratto!\"; %][/VAR]\r
|
||||
[!-- Hack for the CONTAIN below... --]
|
||||
[VAR name="nominativoUtente" type="string"][% nominativoUtente = " " + nominativoUtentePlain + ", CF: "; %][/VAR]
|
||||
|
||||
\r
|
||||
[!-- 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) --]
|
||||
|
||||
[VAR name=\"rsProponenteCognome\" type=\"string\"][TAG]GETVALUEBYTAG,RSP_COGNOME,REQUEST,IUQOID[/TAG][/VAR]\r
|
||||
[IF]
|
||||
[CONDITION][% nominativoUtentePlain == rsProponenteCognome + " " + rsProponenteNome %][/CONDITION]
|
||||
[THEN][% checkUtentePartecipante = "Il Responsabile Scientifico proponente non deve compilare la DSAN"; %][/THEN]
|
||||
[ELSE IF]
|
||||
[CONDITION][CONTAINS varname="responsabili"][VALUE_OF varname="nominativoUtente" /][/CONTAINS][/CONDITION]
|
||||
[THEN][% checkUtentePartecipante = ""; %][/THEN]
|
||||
[/ELSE IF]
|
||||
[ELSE IF]
|
||||
[CONDITION][CONTAINS varname="partecipanti"][VALUE_OF varname="nominativoUtente" /][/CONTAINS][/CONDITION]
|
||||
[THEN][% checkUtentePartecipante = ""; %][/THEN]
|
||||
[/ELSE IF]
|
||||
[ELSE IF]
|
||||
[CONDITION][CONTAINS varname="nominativiAmmessi"][VALUE_OF varname="nominativoUtentePlain" /][/CONTAINS][/CONDITION]
|
||||
[THEN][% checkUtentePartecipante = ""; %][/THEN]
|
||||
[/ELSE IF]
|
||||
[/IF]
|
||||
|
||||
[VAR name=\"rsProponenteNome\" type=\"string\"][TAG]GETVALUEBYTAG,RSP_COGNOME,REQUEST,IUQOID[/TAG][/VAR]\r
|
||||
|
||||
[VAR name=\"responsabili\" type=\"string\"][TAG]GETVALUEBYTAG,CONTRATTO_RESPONSABILI,REQUEST,IUQOID[/TAG][/VAR]\r
|
||||
|
||||
[VAR name=\"partecipanti\" type=\"string\"][TAG]GETVALUEBYTAG,CONTRATTO_PARTECIPANTI,REQUEST,IUQOID[/TAG][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
[!-- [VAR name=\"nominativoUtentePlain\" type=\"string\"][TAG]GETVALUEBYTAG,RICHIEDENTE_NOMINATIVO,REQUEST,IUQOID[/TAG][/VAR] --]\r
|
||||
|
||||
[VAR name=\"nominativoUtentePlain\" type=\"string\"][% nominativoUtentePlain = \"mammi Pier Paolo\"; %][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
[!-- Hack for the CONTAIN below... --]\r
|
||||
|
||||
[VAR name=\"nominativoUtente\" type=\"string\"][% nominativoUtente = \" \" + nominativoUtentePlain + \", CF: \"; %][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
[!-- Il richiedente non deve essere il RS proponente --]\r
|
||||
|
||||
[!-- Il richiedente deve comparire fra i responsabili --]\r
|
||||
|
||||
[!-- Il richiedente deve comparire fra i partecipanti --]\r
|
||||
|
||||
[!-- Il richiedente deve comparire fra i nominativi ammessi (DEBUG) --]\r
|
||||
|
||||
\r
|
||||
|
||||
[IF]\r
|
||||
|
||||
\ [CONDITION][% nominativoUtentePlain == rsProponenteCognome + \" \" + rsProponenteNome %][/CONDITION]\r
|
||||
|
||||
\ [THEN][% checkUtentePartecipante = \"Il Responsabile Scientifico proponente non deve compilare la DSAN\"; %][/THEN]\r
|
||||
|
||||
\ [ELSE IF]\r
|
||||
|
||||
\ [CONDITION][CONTAINS varname=\"responsabili\"][VALUE_OF varname=\"nominativoUtente\" /][/CONTAINS][/CONDITION]\r
|
||||
|
||||
\ [THEN][% checkUtentePartecipante = \"\"; %][/THEN]\r
|
||||
|
||||
\ [/ELSE IF]\r
|
||||
|
||||
\ [ELSE IF]\r
|
||||
|
||||
\ [CONDITION][CONTAINS varname=\"partecipanti\"][VALUE_OF varname=\"nominativoUtente\" /][/CONTAINS][/CONDITION]\r
|
||||
|
||||
\ [THEN][% checkUtentePartecipante = \"\"; %][/THEN]\r
|
||||
|
||||
\ [/ELSE IF]\r
|
||||
|
||||
\ [ELSE IF]\r
|
||||
|
||||
\ [CONDITION][CONTAINS varname=\"nominativiAmmessi\"][VALUE_OF varname=\"nominativoUtentePlain\" /][/CONTAINS][/CONDITION]\r
|
||||
|
||||
\ [THEN][% checkUtentePartecipante = \"\"; %][/THEN]\r
|
||||
|
||||
\ [/ELSE IF]\r
|
||||
|
||||
[/IF]\r
|
||||
|
||||
\r
|
||||
|
||||
[%= checkUtentePartecipante %]\r
|
||||
|
||||
[/EFTL]\r
|
||||
|
||||
`;\r
|
||||
|
||||
\r
|
||||
|
||||
var base64EncodedDocument = btoa(eftlDocumentToBeProcessed);\r
|
||||
|
||||
\r
|
||||
|
||||
bru.setVar(\"elixBase64EftlDocument\", base64EncodedDocument);"
|
||||
[%= checkUtentePartecipante %]
|
||||
[/EFTL]
|
||||
`);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
|
||||
+3
-6
@@ -29,8 +29,9 @@ runtime:
|
||||
scripts:
|
||||
- type: before-request
|
||||
code: |-
|
||||
const { prepareEftlDocument } = require("./elixFormsJs.js")
|
||||
// Copy-pasta your EFTL document below inside the template literals (`)
|
||||
var eftlDocumentToBeProcessed = String.raw`
|
||||
prepareEftlDocument(String.raw`
|
||||
[EFTL][HEADER name="trimDocument" value="true" type="boolean" /]
|
||||
[VAR name="isRichiedenteInRS" type="string"][% isRichiedenteInRS = "Utente non ammesso alla compilazione perché non RS del contratto!"; %][/VAR]
|
||||
[VAR name="responsabiliScientifici" type="string"][TAG]GETVALUEBYTAG,CONTRATTO_RESPONSABILI,REQUEST,IUQOID[/TAG][/VAR]
|
||||
@@ -51,11 +52,7 @@ runtime:
|
||||
|
||||
[%= isRichiedenteInRS %]
|
||||
[/EFTL]
|
||||
`;
|
||||
|
||||
var base64EncodedDocument = btoa(eftlDocumentToBeProcessed);
|
||||
|
||||
bru.setVar("elixBase64EftlDocument", base64EncodedDocument);
|
||||
`);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
|
||||
+38
-80
@@ -21,95 +21,53 @@ http:
|
||||
value: "21344"
|
||||
body:
|
||||
type: json
|
||||
data: "{\r
|
||||
|
||||
\ \"userDocument\": \"{{elixBase64EftlDocument}}\", // see the pre-request script\r
|
||||
|
||||
\ \"userContext\": {\r
|
||||
|
||||
\ \"lang\": \"IT\",\r
|
||||
|
||||
\ \"crlf\": \"\\r\\n\",\r
|
||||
|
||||
\ \"codiciFiscaliAmmessi\": \";MMMPPL74T17E463A;;\"\r
|
||||
|
||||
\ }\r
|
||||
|
||||
}"
|
||||
data: |-
|
||||
{
|
||||
"userDocument": "{{elixBase64EftlDocument}}", // see the pre-request script
|
||||
"userContext": {
|
||||
"lang": "IT",
|
||||
"crlf": "\r\n",
|
||||
"codiciFiscaliAmmessi": ";MMMPPL74T17E463A;;"
|
||||
}
|
||||
}
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: before-request
|
||||
code: "// Copy-pasta your EFTL document below inside the template literals (`)\r
|
||||
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 eftlDocumentToBeProcessed = String.raw`\r
|
||||
[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]
|
||||
|
||||
[EFTL][HEADER name=\"trimDocument\" value=\"true\" type=\"boolean\" /]\r
|
||||
[!-- 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) --]
|
||||
|
||||
[VAR name=\"checkUtentePartecipante\" type=\"string\"][% utentePartecipante = \"Il richiedente non è ammesso alla compilazione perché non rientra tra le ripartizioni proposte\"; %][/VAR]\r
|
||||
[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]
|
||||
|
||||
\r
|
||||
|
||||
[VAR name=\"ripartizioniDaProposta\" type=\"string\"][TAG]GETVALUEBYTAG,RIPARTIZIONI,REQUEST,IUQOID[/TAG][/VAR]\r
|
||||
|
||||
[VAR name=\"rsProponenteCF\" type=\"string\"][TAG]GETVALUEBYTAG,RSP_CODFIS,REQUEST,IUQOID[/TAG][/VAR]\r
|
||||
|
||||
[VAR name=\"richiedenteCF\" type=\"string\"][TAG]GETVALUEBYTAG,RICHIEDENTE_CODFIS,REQUEST,IUQOID[/TAG][/VAR]\r
|
||||
|
||||
[VAR name=\"richiedenteCFregex\" type=\"string\"][% richiedenteCFregex = \" (CF: \" + richiedenteCF + \")\"; %][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
[!-- Il richiedente non deve essere il RS proponente --]\r
|
||||
|
||||
[!-- Il richiedente deve comparire fra i responsabili --]\r
|
||||
|
||||
[!-- Il richiedente deve comparire fra i partecipanti --]\r
|
||||
|
||||
[!-- Il richiedente deve comparire fra i nominativi ammessi (DEBUG) --]\r
|
||||
|
||||
\r
|
||||
|
||||
[IF]\r
|
||||
|
||||
\ [CONDITION][% richiedenteCF == rsProponenteCF %][/CONDITION]\r
|
||||
|
||||
\ [THEN][% checkUtentePartecipante = \"Il Responsabile Scientifico proponente non deve compilare la DSAN\"; %][/THEN]\r
|
||||
|
||||
\ [ELSE IF]\r
|
||||
|
||||
\ [CONDITION][CONTAINS varname=\"ripartizioniDaProposta\"][VALUE_OF varname=\"richiedenteCFregex\" /][/CONTAINS][/CONDITION]\r
|
||||
|
||||
\ [THEN][% checkUtentePartecipante = \"\"; %][/THEN]\r
|
||||
|
||||
\ [/ELSE IF]\r
|
||||
|
||||
\ [ELSE IF]\r
|
||||
|
||||
\ [CONDITION][CONTAINS varname=\"codiciFiscaliAmmessi\"][VALUE_OF varname=\"richiedenteCF\" /][/CONTAINS][/CONDITION]\r
|
||||
|
||||
\ [THEN][% checkUtentePartecipante = \"\"; %][/THEN]\r
|
||||
|
||||
\ [/ELSE IF]\r
|
||||
|
||||
[/IF]\r
|
||||
|
||||
\r
|
||||
|
||||
[%= checkUtentePartecipante %]\r
|
||||
|
||||
[/EFTL]\r
|
||||
|
||||
`;\r
|
||||
|
||||
\r
|
||||
|
||||
var base64EncodedDocument = btoa(eftlDocumentToBeProcessed);\r
|
||||
|
||||
\r
|
||||
|
||||
bru.setVar(\"elixBase64EftlDocument\", base64EncodedDocument);"
|
||||
[%= checkUtentePartecipante %]
|
||||
[/EFTL]
|
||||
`);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
|
||||
+45
-97
@@ -18,115 +18,63 @@ http:
|
||||
value: "21334"
|
||||
body:
|
||||
type: json
|
||||
data: "{\r
|
||||
|
||||
\ \"userDocument\": \"{{elixBase64EftlDocument}}\", // see the pre-request script\r
|
||||
|
||||
\ \"userContext\": {\r
|
||||
|
||||
\ \"lang\": \"IT\",\r
|
||||
|
||||
\ \"crlf\": \"\\r\\n\"\r
|
||||
|
||||
\ }\r
|
||||
|
||||
}"
|
||||
data: |-
|
||||
{
|
||||
"userDocument": "{{elixBase64EftlDocument}}", // see the pre-request script
|
||||
"userContext": {
|
||||
"lang": "IT",
|
||||
"crlf": "\r\n"
|
||||
}
|
||||
}
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: before-request
|
||||
code: "// Copy-pasta your EFTL document below inside the template literals (`)\r
|
||||
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="ripartizioniIterableWithSep" type="iterable"][SPLIT regex="#"][TAG]GETVALUEBYTAG,PARTECIPANTE,REQUEST,IUQOID,CONCAT,#[/TAG][/SPLIT][/VAR]
|
||||
[VAR name="ripartizioniCount" type="string"][SIZE_OF varname="ripartizioniIterableWithSep" /][/VAR]
|
||||
|
||||
var eftlDocumentToBeProcessed = String.raw`\r
|
||||
[VAR name="ripartizioniJoin" type="string"][% ripartizioniJoin = ""; %][/VAR]
|
||||
|
||||
[EFTL][HEADER name=\"trimDocument\" value=\"true\" type=\"boolean\" /]\r
|
||||
[IF][CONDITION][% ripartizioniCount > 0 %][/CONDITION][THEN]
|
||||
[VAR name="ripartizioneIdx" type="string"][% ripartizioneIdx = 0; %][/VAR]
|
||||
[VAR name="firstItem" type="number"][% firstItem = 0; %][/VAR]
|
||||
[VAR name="secondItem" type="number"][% secondItem = 1; %][/VAR]
|
||||
|
||||
[VAR name=\"ripartizioniIterableWithSep\" type=\"iterable\"][SPLIT regex=\"#\"][TAG]GETVALUEBYTAG,PARTECIPANTE,REQUEST,IUQOID,CONCAT,#[/TAG][/SPLIT][/VAR]\r
|
||||
[WHILE threshold="99"]
|
||||
[CONDITION][% ripartizioneIdx < ripartizioniCount %][/CONDITION]
|
||||
[DO]
|
||||
[VAR name="ripartizioneFull" type="string"][VALUE_OF varname="ripartizioniIterableWithSep" index="ripartizioneIdx" /][/VAR]
|
||||
[VAR name="ripartizioneFullIterable" type="iterable"][SPLIT regex=" \(CF: "][TRIM][VALUE_OF varname="ripartizioneFull" /][/TRIM][/SPLIT][/VAR]
|
||||
[VAR name="ripartizioneCFIterable" type="iterable"][SPLIT regex="\)"][VALUE_OF varname="ripartizioneFullIterable" index="secondItem" /][/SPLIT][/VAR]
|
||||
[VAR name="ripartizioneCF" type="string"][VALUE_OF varname="ripartizioneCFIterable" index="firstItem" /][/VAR]
|
||||
[% ripartizioniJoin = ripartizioniJoin + ripartizioneCF; %]
|
||||
|
||||
[VAR name=\"ripartizioniCount\" type=\"string\"][SIZE_OF varname=\"ripartizioniIterableWithSep\" /][/VAR]\r
|
||||
[% ripartizioneIdx = ripartizioneIdx + 1; %]
|
||||
|
||||
\r
|
||||
[IF][CONDITION][% ripartizioneIdx < ripartizioniCount %][/CONDITION][THEN]
|
||||
[% ripartizioniJoin = ripartizioniJoin + "#"; %]
|
||||
[/THEN][/IF]
|
||||
[/DO]
|
||||
[/WHILE]
|
||||
[/THEN][/IF]
|
||||
|
||||
[VAR name=\"ripartizioniJoin\" type=\"string\"][% ripartizioniJoin = \"\"; %][/VAR]\r
|
||||
[!--
|
||||
[%= ripartizioniCount %]
|
||||
[%= crlf %]
|
||||
[%= ripartizioneIdx %]
|
||||
[%= crlf %]
|
||||
[%= "JOIN: " ripartizioniJoin %]
|
||||
--]
|
||||
|
||||
\r
|
||||
|
||||
[IF][CONDITION][% ripartizioniCount > 0 %][/CONDITION][THEN]\r
|
||||
|
||||
\ [VAR name=\"ripartizioneIdx\" type=\"string\"][% ripartizioneIdx = 0; %][/VAR]\r
|
||||
|
||||
\ [VAR name=\"firstItem\" type=\"number\"][% firstItem = 0; %][/VAR]\r
|
||||
|
||||
\ [VAR name=\"secondItem\" type=\"number\"][% secondItem = 1; %][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
\ [WHILE threshold=\"99\"]\r
|
||||
|
||||
\ [CONDITION][% ripartizioneIdx < ripartizioniCount %][/CONDITION]\r
|
||||
|
||||
\ [DO]\r
|
||||
|
||||
\ [VAR name=\"ripartizioneFull\" type=\"string\"][VALUE_OF varname=\"ripartizioniIterableWithSep\" index=\"ripartizioneIdx\" /][/VAR]\r
|
||||
|
||||
\ [VAR name=\"ripartizioneFullIterable\" type=\"iterable\"][SPLIT regex=\" \\(CF: \"][TRIM][VALUE_OF varname=\"ripartizioneFull\" /][/TRIM][/SPLIT][/VAR]\r
|
||||
|
||||
\ [VAR name=\"ripartizioneCFIterable\" type=\"iterable\"][SPLIT regex=\"\\)\"][VALUE_OF varname=\"ripartizioneFullIterable\" index=\"secondItem\" /][/SPLIT][/VAR]\r
|
||||
|
||||
\ [VAR name=\"ripartizioneCF\" type=\"string\"][VALUE_OF varname=\"ripartizioneCFIterable\" index=\"firstItem\" /][/VAR]\r
|
||||
|
||||
\ [% ripartizioniJoin = ripartizioniJoin + ripartizioneCF; %]\r
|
||||
|
||||
\r
|
||||
|
||||
\ [% ripartizioneIdx = ripartizioneIdx + 1; %]\r
|
||||
|
||||
\r
|
||||
|
||||
\ [IF][CONDITION][% ripartizioneIdx < ripartizioniCount %][/CONDITION][THEN]\r
|
||||
|
||||
\ [% ripartizioniJoin = ripartizioniJoin + \"#\"; %]\r
|
||||
|
||||
\ [/THEN][/IF]\r
|
||||
|
||||
\ [/DO]\r
|
||||
|
||||
\ [/WHILE]\r
|
||||
|
||||
[/THEN][/IF]\r
|
||||
|
||||
\r
|
||||
|
||||
[!--\r
|
||||
|
||||
[%= ripartizioniCount %]\r
|
||||
|
||||
[%= crlf %]\r
|
||||
|
||||
[%= ripartizioneIdx %]\r
|
||||
|
||||
[%= crlf %]\r
|
||||
|
||||
[%= \"JOIN: \" ripartizioniJoin %]\r
|
||||
|
||||
--]\r
|
||||
|
||||
\r
|
||||
|
||||
[%= ripartizioniJoin %]\r
|
||||
|
||||
[/EFTL]\r
|
||||
|
||||
`;\r
|
||||
|
||||
\r
|
||||
|
||||
var base64EncodedDocument = btoa(eftlDocumentToBeProcessed);\r
|
||||
|
||||
\r
|
||||
|
||||
bru.setVar(\"elixBase64EftlDocument\", base64EncodedDocument);"
|
||||
[%= ripartizioniJoin %]
|
||||
[/EFTL]
|
||||
`);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
|
||||
+99
-204
@@ -15,221 +15,116 @@ http:
|
||||
value: "8760"
|
||||
body:
|
||||
type: json
|
||||
data: "{\r
|
||||
|
||||
\ \"userDocument\": \"{{elixBase64EftlDocument}}\", // see the pre-request script\r
|
||||
|
||||
\ \"userContext\": {\r
|
||||
|
||||
\ \"lang\": \"IT\",\r
|
||||
|
||||
\ \"docs\": [\r
|
||||
|
||||
\ {\r
|
||||
|
||||
\ \"name\": \"doc1\",\r
|
||||
|
||||
\ \"quantity\": 3,\r
|
||||
|
||||
\ \"price\": 123.3\r
|
||||
|
||||
\ },\r
|
||||
|
||||
\ {\r
|
||||
|
||||
\ \"name\": \"doc2\",\r
|
||||
|
||||
\ \"quantity\": 5,\r
|
||||
|
||||
\ \"price\": 213.3\r
|
||||
|
||||
\ },\r
|
||||
|
||||
\ {\r
|
||||
|
||||
\ \"name\": \"doc3\",\r
|
||||
|
||||
\ \"quantity\": 10,\r
|
||||
|
||||
\ \"price\": 321.3\r
|
||||
|
||||
\ }\r
|
||||
|
||||
\ ],\r
|
||||
|
||||
\ \"docsAsEntities\": [\r
|
||||
|
||||
\ {\r
|
||||
|
||||
\ \"eftlEntityType\": \"com.anthesi.elixforms.api.eftl.model.mock.EftlDoc\",\r
|
||||
|
||||
\ \"eftlEntity\": {\r
|
||||
|
||||
\ \"name\": \"doc1\",\r
|
||||
|
||||
\ \"quantity\": 3,\r
|
||||
|
||||
\ \"price\": 123.3\r
|
||||
|
||||
\ }\r
|
||||
|
||||
\ },\r
|
||||
|
||||
\ {\r
|
||||
|
||||
\ \"eftlEntityType\": \"com.anthesi.elixforms.api.eftl.model.mock.EftlDoc\",\r
|
||||
|
||||
\ \"eftlEntity\": {\r
|
||||
|
||||
\ \"name\": \"doc2\",\r
|
||||
|
||||
\ \"quantity\": 5,\r
|
||||
|
||||
\ \"price\": 213.3\r
|
||||
|
||||
\ }\r
|
||||
|
||||
\ },\r
|
||||
|
||||
\ {\r
|
||||
|
||||
\ \"eftlEntityType\": \"com.anthesi.elixforms.api.eftl.model.mock.EftlDoc\",\r
|
||||
|
||||
\ \"eftlEntity\": {\r
|
||||
|
||||
\ \"name\": \"doc3\",\r
|
||||
|
||||
\ \"quantity\": 10,\r
|
||||
|
||||
\ \"price\": 321.3\r
|
||||
|
||||
\ }\r
|
||||
|
||||
\ }\r
|
||||
|
||||
\ ],\r
|
||||
|
||||
\ \"singleEntity\": {\r
|
||||
|
||||
\ \"eftlEntityType\": \"com.anthesi.elixforms.api.eftl.model.mock.EftlDoc\",\r
|
||||
|
||||
\ \"eftlEntity\": {\r
|
||||
|
||||
\ \"name\": \"doc1\",\r
|
||||
|
||||
\ \"quantity\": 3,\r
|
||||
|
||||
\ \"price\": 123.3\r
|
||||
|
||||
\ }\r
|
||||
|
||||
\ },\r
|
||||
|
||||
\ \"simpleList\": [\r
|
||||
|
||||
\ \"s1\",\r
|
||||
|
||||
\ \"s2\",\r
|
||||
|
||||
\ \"s3\"\r
|
||||
|
||||
\ ],\r
|
||||
|
||||
\ \"docsSize\": 3\r
|
||||
|
||||
\ }\r
|
||||
|
||||
}"
|
||||
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: "// Copy-pasta your EFTL document below inside the template literals (`)\r
|
||||
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="idxNome" type="number"][% idxNome = 0; %][/VAR]
|
||||
[VAR name="idxCfPIva" type="number"][% idxCfPIva = 1; %][/VAR]
|
||||
[VAR name="idxSede" type="number"][% idxSede = 2; %][/VAR]
|
||||
|
||||
var eftlDocumentToBeProcessed = `\r
|
||||
[VAR name="elencoContraentiCompleto" type="string"][% elencoContraentiCompleto = ""; %][/VAR]
|
||||
|
||||
[EFTL][HEADER name=\"trimDocument\" value=\"true\" type=\"boolean\" /]\r
|
||||
[VAR name="contraenti" type="iterable"][SPLIT regex="\n"][TAG]SCHEMAID,341,COL0004,IUQOID, , [/TAG][/SPLIT][/VAR]
|
||||
[VAR name="countContraenti" type="number"][SIZE_OF varname="contraenti" /][/VAR]
|
||||
[VAR name="idxContraente" type="number"][% idxContraente = 0; %][/VAR]
|
||||
|
||||
[VAR name=\"idxNome\" type=\"number\"][% idxNome = 0; %][/VAR]\r
|
||||
[!-- Estraggo i dati del primo contraente (ce ne sarà sempre almeno uno) --]
|
||||
[VAR name="currContraente" type="string"][VALUE_OF varname="contraenti" index="idxContraente" /][/VAR]
|
||||
[VAR name="currContraenteSplit" type="iterable"][SPLIT regex=", (.*?):"][TRIM][VALUE_OF varname="currContraente" /][/TRIM][/SPLIT][/VAR]
|
||||
[VAR name="currContraenteNome" type="string"][TRIM][VALUE_OF varname="currContraenteSplit" index="idxNome" /][/TRIM][/VAR]
|
||||
[VAR name="currContraenteCfPIva" type="string"][TRIM][VALUE_OF varname="currContraenteSplit" index="idxCfPIva" /][/TRIM][/VAR]
|
||||
[VAR name="currContraenteSede" type="string"][TRIM][VALUE_OF varname="currContraenteSplit" index="idxSede" /][/TRIM][/VAR]
|
||||
[% elencoContraentiCompleto = currContraenteNome + " (CF/PIVA: " + currContraenteCfPIva + ") con sede legale in " + currContraenteSede; %]
|
||||
|
||||
[VAR name=\"idxCfPIva\" type=\"number\"][% idxCfPIva = 1; %][/VAR]\r
|
||||
[!-- Se c'è più di un contraente, ciclo su tutti i rimanenti (tutto questo per non avere una ", " in fondo alla stringa finale...) --]
|
||||
[WHILE]
|
||||
[CONDITION][% idxContraente < countContraenti - 1 %][/CONDITION]
|
||||
[DO]
|
||||
[% idxContraente = idxContraente + 1; %]
|
||||
|
||||
[VAR name=\"idxSede\" type=\"number\"][% idxSede = 2; %][/VAR]\r
|
||||
[VAR name="currContraente" type="string"][VALUE_OF varname="contraenti" index="idxContraente" /][/VAR]
|
||||
[VAR name="currContraenteSplit" type="iterable"][SPLIT regex=", (.*?):"][TRIM][VALUE_OF varname="currContraente" /][/TRIM][/SPLIT][/VAR]
|
||||
[VAR name="currContraenteNome" type="string"][VALUE_OF varname="currContraenteSplit" index="idxNome" /][/VAR]
|
||||
[VAR name="currContraenteCfPIva" type="string"][VALUE_OF varname="currContraenteSplit" index="idxCfPIva" /][/VAR]
|
||||
[VAR name="currContraenteSede" type="string"][VALUE_OF varname="currContraenteSplit" index="idxSede" /][/VAR]
|
||||
[% elencoContraentiCompleto = elencoContraentiCompleto + ", " + currContraenteNome + " (CF/PIVA: " + currContraenteCfPIva + ") con sede legale in " + currContraenteSede; %]
|
||||
[/DO]
|
||||
[/WHILE]
|
||||
|
||||
\r
|
||||
|
||||
[VAR name=\"elencoContraentiCompleto\" type=\"string\"][% elencoContraentiCompleto = \"\"; %][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
[VAR name=\"contraenti\" type=\"iterable\"][SPLIT regex=\"\\n\"][TAG]SCHEMAID,341,COL0004,IUQOID, , [/TAG][/SPLIT][/VAR]\r
|
||||
|
||||
[VAR name=\"countContraenti\" type=\"number\"][SIZE_OF varname=\"contraenti\" /][/VAR]\r
|
||||
|
||||
[VAR name=\"idxContraente\" type=\"number\"][% idxContraente = 0; %][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
[!-- Estraggo i dati del primo contraente (ce ne sarà sempre almeno uno) --]\r
|
||||
|
||||
[VAR name=\"currContraente\" type=\"string\"][VALUE_OF varname=\"contraenti\" index=\"idxContraente\" /][/VAR]\r
|
||||
|
||||
[VAR name=\"currContraenteSplit\" type=\"iterable\"][SPLIT regex=\", (.*?):\"][TRIM][VALUE_OF varname=\"currContraente\" /][/TRIM][/SPLIT][/VAR]\r
|
||||
|
||||
[VAR name=\"currContraenteNome\" type=\"string\"][TRIM][VALUE_OF varname=\"currContraenteSplit\" index=\"idxNome\" /][/TRIM][/VAR]\r
|
||||
|
||||
[VAR name=\"currContraenteCfPIva\" type=\"string\"][TRIM][VALUE_OF varname=\"currContraenteSplit\" index=\"idxCfPIva\" /][/TRIM][/VAR]\r
|
||||
|
||||
[VAR name=\"currContraenteSede\" type=\"string\"][TRIM][VALUE_OF varname=\"currContraenteSplit\" index=\"idxSede\" /][/TRIM][/VAR]\r
|
||||
|
||||
[% elencoContraentiCompleto = currContraenteNome + \" (CF/PIVA: \" + currContraenteCfPIva + \") con sede legale in \" + currContraenteSede; %]\r
|
||||
|
||||
\r
|
||||
|
||||
[!-- Se c'è più di un contraente, ciclo su tutti i rimanenti (tutto questo per non avere una \", \" in fondo alla stringa finale...) --]\r
|
||||
|
||||
[WHILE]\r
|
||||
|
||||
\ [CONDITION][% idxContraente < countContraenti - 1 %][/CONDITION]\r
|
||||
|
||||
\ [DO]\r
|
||||
|
||||
\ [% idxContraente = idxContraente + 1; %]\r
|
||||
|
||||
\r
|
||||
|
||||
\ [VAR name=\"currContraente\" type=\"string\"][VALUE_OF varname=\"contraenti\" index=\"idxContraente\" /][/VAR]\r
|
||||
|
||||
\ [VAR name=\"currContraenteSplit\" type=\"iterable\"][SPLIT regex=\", (.*?):\"][TRIM][VALUE_OF varname=\"currContraente\" /][/TRIM][/SPLIT][/VAR]\r
|
||||
|
||||
\ [VAR name=\"currContraenteNome\" type=\"string\"][VALUE_OF varname=\"currContraenteSplit\" index=\"idxNome\" /][/VAR]\r
|
||||
|
||||
\ [VAR name=\"currContraenteCfPIva\" type=\"string\"][VALUE_OF varname=\"currContraenteSplit\" index=\"idxCfPIva\" /][/VAR]\r
|
||||
|
||||
\ [VAR name=\"currContraenteSede\" type=\"string\"][VALUE_OF varname=\"currContraenteSplit\" index=\"idxSede\" /][/VAR]\r
|
||||
|
||||
\ [% elencoContraentiCompleto = elencoContraentiCompleto + \", \" + currContraenteNome + \" (CF/PIVA: \" + currContraenteCfPIva + \") con sede legale in \" + currContraenteSede; %]\r
|
||||
|
||||
\ [/DO]\r
|
||||
|
||||
[/WHILE]\r
|
||||
|
||||
\r
|
||||
|
||||
[%= elencoContraentiCompleto %]\r
|
||||
|
||||
[/EFTL]\r
|
||||
|
||||
`;\r
|
||||
|
||||
\r
|
||||
|
||||
var base64EncodedDocument = btoa(eftlDocumentToBeProcessed);\r
|
||||
|
||||
\r
|
||||
|
||||
bru.setVar(\"elixBase64EftlDocument\", base64EncodedDocument);"
|
||||
[%= elencoContraentiCompleto %]
|
||||
[/EFTL]
|
||||
`);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
|
||||
+109
-218
@@ -15,229 +15,120 @@ http:
|
||||
value: "21223"
|
||||
body:
|
||||
type: json
|
||||
data: "{\r
|
||||
|
||||
\ \"userDocument\": \"{{elixBase64EftlDocument}}\", // see the pre-request script\r
|
||||
|
||||
\ \"userContext\": {\r
|
||||
|
||||
\ \"lang\": \"IT\",\r
|
||||
|
||||
\ \"crlf\": \"\\r\\n\"\r
|
||||
|
||||
\ }\r
|
||||
|
||||
}"
|
||||
data: |-
|
||||
{
|
||||
"userDocument": "{{elixBase64EftlDocument}}", // see the pre-request script
|
||||
"userContext": {
|
||||
"lang": "IT",
|
||||
"crlf": "\r\n"
|
||||
}
|
||||
}
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: before-request
|
||||
code: "// Copy-pasta your EFTL document below inside the template literals (`)\r
|
||||
|
||||
var eftlDocumentToBeProcessed = String.raw`\r
|
||||
|
||||
[EFTL][HEADER name=\"trimDocument\" value=\"true\" type=\"boolean\" /]\r
|
||||
|
||||
[VAR name=\"newLine\" type=\"string\"][VALUE_OF varname=\"crlf\" /][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
[VAR name=\"responsabili\" type=\"string\"][TRIM][TAG]GETVALUEBYTAG,CONTRATTO_RESPONSABILI,REQUEST,IUQOID[/TAG][/TRIM][/VAR]\r
|
||||
|
||||
[VAR name=\"partecipanti\" type=\"string\"][TRIM][TAG]GETVALUEBYTAG,CONTRATTO_PARTECIPANTI,REQUEST,IUQOID[/TAG][/TRIM][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
[!-- Aggiungi primo elemento \"nullo\" --]\r
|
||||
|
||||
[VAR name=\"ripartizioniElenco\" type=\"string\"][% ripartizioniElenco = \"[0] ---\" + newLine; %][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
[VAR name=\"responsabiliIterable\" type=\"iterable\"][SPLIT regex=\"\\n\"][VALUE_OF varname=\"responsabili\" /][/SPLIT][/VAR]\r
|
||||
|
||||
[VAR name=\"partecipantiIterable\" type=\"iterable\"][SPLIT regex=\"\\n\"][VALUE_OF varname=\"partecipanti\" /][/SPLIT][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
[VAR name=\"responsabiliCount\" type=\"number\"][SIZE_OF varname=\"responsabiliIterable\" /][/VAR]\r
|
||||
|
||||
[VAR name=\"partecipantiCount\" type=\"number\"][SIZE_OF varname=\"partecipantiIterable\" /][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
[VAR name=\"personaIdx\" type=\"string\"][% personaIdx = 0; %][/VAR]\r
|
||||
|
||||
[VAR name=\"dropdownIdx\" type=\"string\"][% dropdownIdx = 0; %][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
[VAR name=\"firstItem\" type=\"number\"][% firstItem = 0; %][/VAR]\r
|
||||
|
||||
[VAR name=\"secondItem\" type=\"number\"][% secondItem = 1; %][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
[WHILE threshold=\"99\"]\r
|
||||
|
||||
\ [CONDITION][% personaIdx < responsabiliCount %][/CONDITION]\r
|
||||
|
||||
\ [DO]\r
|
||||
|
||||
\ [VAR name=\"responsabileFull\" type=\"string\"][VALUE_OF varname=\"responsabiliIterable\" index=\"personaIdx\" /][/VAR]\r
|
||||
|
||||
\ [VAR name=\"responsabileIterable\" type=\"iterable\"][SPLIT regex=\", CF: \"][TRIM][VALUE_OF varname=\"responsabileFull\" /][/TRIM][/SPLIT][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
\ [!-- Recupera il nominativo --]\r
|
||||
|
||||
\ [VAR name=\"responsabileNominativo\" type=\"string\"][VALUE_OF varname=\"responsabileIterable\" index=\"firstItem\" /][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
\ [!-- Recupera il codice fiscale --]\r
|
||||
|
||||
\ [VAR name=\"responsabileResto\" type=\"string\"][VALUE_OF varname=\"responsabileIterable\" index=\"secondItem\" /][/VAR]\r
|
||||
|
||||
\ [VAR name=\"responsabileRestoIterable\" type=\"iterable\"][SPLIT regex=\", Qualifica: \"][VALUE_OF varname=\"responsabileResto\" /][/SPLIT][/VAR]\r
|
||||
|
||||
\ [VAR name=\"responsabileCodiceFiscale\" type=\"string\"][VALUE_OF varname=\"responsabileRestoIterable\" index=\"firstItem\" /][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
\ [% personaIdx = personaIdx + 1; %]\r
|
||||
|
||||
\ [% dropdownIdx = dropdownIdx + 1; %]\r
|
||||
|
||||
\r
|
||||
|
||||
\ [!-- HACK ignobile per recuperare il numero che altrimenti verrebbe emesso come \"1.0\", etc... --]\r
|
||||
|
||||
\ [VAR name=\"responsabileKeyIterable\" type=\"iterable\"][SPLIT regex=\"\\.\"][% dropdownIdx + \"\" %][/SPLIT][/VAR]\r
|
||||
|
||||
\ [VAR name=\"responsabileKey\" type=\"string\"][VALUE_OF varname=\"responsabileKeyIterable\" index=\"firstItem\" /][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
\ [% ripartizioniElenco = ripartizioniElenco + \"[\" + responsabileKey + \"] \" + responsabileNominativo + \" (CF: \" + responsabileCodiceFiscale + \")\"; %]\r
|
||||
|
||||
\r
|
||||
|
||||
\ [IF]\r
|
||||
|
||||
\ [CONDITION][% personaIdx < responsabiliCount %][/CONDITION]\r
|
||||
|
||||
\ [THEN]\r
|
||||
|
||||
\ [% ripartizioniElenco = ripartizioniElenco + newLine; %]\r
|
||||
|
||||
\ [/THEN]\r
|
||||
|
||||
\ [ELSE IF]\r
|
||||
|
||||
\ [CONDITION][IS_NOT_EMPTY varname=\"partecipanti\" /][/CONDITION]\r
|
||||
|
||||
\ [THEN]\r
|
||||
|
||||
\ [% ripartizioniElenco = ripartizioniElenco + newLine; %]\r
|
||||
|
||||
\ [/THEN]\r
|
||||
|
||||
\ [/ELSE IF]\r
|
||||
|
||||
\ [/IF]\r
|
||||
|
||||
\ [/DO]\r
|
||||
|
||||
[/WHILE]\r
|
||||
|
||||
\r
|
||||
|
||||
[IF][CONDITION][IS_NOT_EMPTY varname=\"partecipanti\" /][/CONDITION][THEN]\r
|
||||
|
||||
\ [% personaIdx = 0; %]\r
|
||||
|
||||
\ [WHILE threshold=\"99\"]\r
|
||||
|
||||
\ [CONDITION][% personaIdx < partecipantiCount %][/CONDITION]\r
|
||||
|
||||
\ [DO]\r
|
||||
|
||||
\ [VAR name=\"partecipanteFull\" type=\"string\"][VALUE_OF varname=\"partecipantiIterable\" index=\"personaIdx\" /][/VAR]\r
|
||||
|
||||
\ [VAR name=\"partecipanteIterable\" type=\"iterable\"][SPLIT regex=\", CF: \"][TRIM][VALUE_OF varname=\"partecipanteFull\" /][/TRIM][/SPLIT][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
\ [!-- Recupera il nominativo --]\r
|
||||
|
||||
\ [VAR name=\"partecipanteNominativo\" type=\"string\"][VALUE_OF varname=\"partecipanteIterable\" index=\"firstItem\" /][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
\ [!-- Recupera il codice fiscale --]\r
|
||||
|
||||
\ [VAR name=\"partecipanteResto\" type=\"string\"][VALUE_OF varname=\"partecipanteIterable\" index=\"secondItem\" /][/VAR]\r
|
||||
|
||||
\ [VAR name=\"partecipanteRestoIterable\" type=\"iterable\"][SPLIT regex=\", Qualifica: \"][VALUE_OF varname=\"partecipanteResto\" /][/SPLIT][/VAR]\r
|
||||
|
||||
\ [VAR name=\"partecipanteCodiceFiscale\" type=\"string\"][VALUE_OF varname=\"partecipanteRestoIterable\" index=\"firstItem\" /][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
\ [% personaIdx = personaIdx + 1; %]\r
|
||||
|
||||
\ [% dropdownIdx = dropdownIdx + 1; %]\r
|
||||
|
||||
\r
|
||||
|
||||
\ [!-- HACK ignobile per recuperare il numero che altrimenti verrebbe emesso come \"1.0\", etc... --]\r
|
||||
|
||||
\ [VAR name=\"partecipanteKeyIterable\" type=\"iterable\"][SPLIT regex=\"\\.\"][% dropdownIdx + \"\" %][/SPLIT][/VAR]\r
|
||||
|
||||
\ [VAR name=\"partecipanteKey\" type=\"string\"][VALUE_OF varname=\"partecipanteKeyIterable\" index=\"firstItem\" /][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
\ [% ripartizioniElenco = ripartizioniElenco + \"[\" + partecipanteKey + \"] \" + partecipanteNominativo + \" (CF: \" + partecipanteCodiceFiscale + \")\"; %]\r
|
||||
|
||||
\r
|
||||
|
||||
\ [IF]\r
|
||||
|
||||
\ [CONDITION][% personaIdx < partecipantiCount %][/CONDITION]\r
|
||||
|
||||
\ [THEN]\r
|
||||
|
||||
\ [% ripartizioniElenco = ripartizioniElenco + newLine; %]\r
|
||||
|
||||
\ [/THEN]\r
|
||||
|
||||
\ [/IF]\r
|
||||
|
||||
\ [/DO]\r
|
||||
|
||||
\ [/WHILE]\r
|
||||
|
||||
[/THEN][/IF]\r
|
||||
|
||||
\r
|
||||
|
||||
[%= ripartizioniElenco %]\r
|
||||
|
||||
[/EFTL]\r
|
||||
|
||||
`;\r
|
||||
|
||||
\r
|
||||
|
||||
var base64EncodedDocument = btoa(eftlDocumentToBeProcessed);\r
|
||||
|
||||
\r
|
||||
|
||||
bru.setVar(\"elixBase64EftlDocument\", base64EncodedDocument);"
|
||||
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="newLine" type="string"][VALUE_OF varname="crlf" /][/VAR]
|
||||
|
||||
[VAR name="responsabili" type="string"][TRIM][TAG]GETVALUEBYTAG,CONTRATTO_RESPONSABILI,REQUEST,IUQOID[/TAG][/TRIM][/VAR]
|
||||
[VAR name="partecipanti" type="string"][TRIM][TAG]GETVALUEBYTAG,CONTRATTO_PARTECIPANTI,REQUEST,IUQOID[/TAG][/TRIM][/VAR]
|
||||
|
||||
[!-- Aggiungi primo elemento "nullo" --]
|
||||
[VAR name="ripartizioniElenco" type="string"][% ripartizioniElenco = "[0] ---" + newLine; %][/VAR]
|
||||
|
||||
[VAR name="responsabiliIterable" type="iterable"][SPLIT regex="\n"][VALUE_OF varname="responsabili" /][/SPLIT][/VAR]
|
||||
[VAR name="partecipantiIterable" type="iterable"][SPLIT regex="\n"][VALUE_OF varname="partecipanti" /][/SPLIT][/VAR]
|
||||
|
||||
[VAR name="responsabiliCount" type="number"][SIZE_OF varname="responsabiliIterable" /][/VAR]
|
||||
[VAR name="partecipantiCount" type="number"][SIZE_OF varname="partecipantiIterable" /][/VAR]
|
||||
|
||||
[VAR name="personaIdx" type="string"][% personaIdx = 0; %][/VAR]
|
||||
[VAR name="dropdownIdx" type="string"][% dropdownIdx = 0; %][/VAR]
|
||||
|
||||
[VAR name="firstItem" type="number"][% firstItem = 0; %][/VAR]
|
||||
[VAR name="secondItem" type="number"][% secondItem = 1; %][/VAR]
|
||||
|
||||
[WHILE threshold="99"]
|
||||
[CONDITION][% personaIdx < responsabiliCount %][/CONDITION]
|
||||
[DO]
|
||||
[VAR name="responsabileFull" type="string"][VALUE_OF varname="responsabiliIterable" index="personaIdx" /][/VAR]
|
||||
[VAR name="responsabileIterable" type="iterable"][SPLIT regex=", CF: "][TRIM][VALUE_OF varname="responsabileFull" /][/TRIM][/SPLIT][/VAR]
|
||||
|
||||
[!-- Recupera il nominativo --]
|
||||
[VAR name="responsabileNominativo" type="string"][VALUE_OF varname="responsabileIterable" index="firstItem" /][/VAR]
|
||||
|
||||
[!-- Recupera il codice fiscale --]
|
||||
[VAR name="responsabileResto" type="string"][VALUE_OF varname="responsabileIterable" index="secondItem" /][/VAR]
|
||||
[VAR name="responsabileRestoIterable" type="iterable"][SPLIT regex=", Qualifica: "][VALUE_OF varname="responsabileResto" /][/SPLIT][/VAR]
|
||||
[VAR name="responsabileCodiceFiscale" type="string"][VALUE_OF varname="responsabileRestoIterable" index="firstItem" /][/VAR]
|
||||
|
||||
[% personaIdx = personaIdx + 1; %]
|
||||
[% dropdownIdx = dropdownIdx + 1; %]
|
||||
|
||||
[!-- HACK ignobile per recuperare il numero che altrimenti verrebbe emesso come "1.0", etc... --]
|
||||
[VAR name="responsabileKeyIterable" type="iterable"][SPLIT regex="\."][% dropdownIdx + "" %][/SPLIT][/VAR]
|
||||
[VAR name="responsabileKey" type="string"][VALUE_OF varname="responsabileKeyIterable" index="firstItem" /][/VAR]
|
||||
|
||||
[% ripartizioniElenco = ripartizioniElenco + "[" + responsabileKey + "] " + responsabileNominativo + " (CF: " + responsabileCodiceFiscale + ")"; %]
|
||||
|
||||
[IF]
|
||||
[CONDITION][% personaIdx < responsabiliCount %][/CONDITION]
|
||||
[THEN]
|
||||
[% ripartizioniElenco = ripartizioniElenco + newLine; %]
|
||||
[/THEN]
|
||||
[ELSE IF]
|
||||
[CONDITION][IS_NOT_EMPTY varname="partecipanti" /][/CONDITION]
|
||||
[THEN]
|
||||
[% ripartizioniElenco = ripartizioniElenco + newLine; %]
|
||||
[/THEN]
|
||||
[/ELSE IF]
|
||||
[/IF]
|
||||
[/DO]
|
||||
[/WHILE]
|
||||
|
||||
[IF][CONDITION][IS_NOT_EMPTY varname="partecipanti" /][/CONDITION][THEN]
|
||||
[% personaIdx = 0; %]
|
||||
[WHILE threshold="99"]
|
||||
[CONDITION][% personaIdx < partecipantiCount %][/CONDITION]
|
||||
[DO]
|
||||
[VAR name="partecipanteFull" type="string"][VALUE_OF varname="partecipantiIterable" index="personaIdx" /][/VAR]
|
||||
[VAR name="partecipanteIterable" type="iterable"][SPLIT regex=", CF: "][TRIM][VALUE_OF varname="partecipanteFull" /][/TRIM][/SPLIT][/VAR]
|
||||
|
||||
[!-- Recupera il nominativo --]
|
||||
[VAR name="partecipanteNominativo" type="string"][VALUE_OF varname="partecipanteIterable" index="firstItem" /][/VAR]
|
||||
|
||||
[!-- Recupera il codice fiscale --]
|
||||
[VAR name="partecipanteResto" type="string"][VALUE_OF varname="partecipanteIterable" index="secondItem" /][/VAR]
|
||||
[VAR name="partecipanteRestoIterable" type="iterable"][SPLIT regex=", Qualifica: "][VALUE_OF varname="partecipanteResto" /][/SPLIT][/VAR]
|
||||
[VAR name="partecipanteCodiceFiscale" type="string"][VALUE_OF varname="partecipanteRestoIterable" index="firstItem" /][/VAR]
|
||||
|
||||
[% personaIdx = personaIdx + 1; %]
|
||||
[% dropdownIdx = dropdownIdx + 1; %]
|
||||
|
||||
[!-- HACK ignobile per recuperare il numero che altrimenti verrebbe emesso come "1.0", etc... --]
|
||||
[VAR name="partecipanteKeyIterable" type="iterable"][SPLIT regex="\."][% dropdownIdx + "" %][/SPLIT][/VAR]
|
||||
[VAR name="partecipanteKey" type="string"][VALUE_OF varname="partecipanteKeyIterable" index="firstItem" /][/VAR]
|
||||
|
||||
[% ripartizioniElenco = ripartizioniElenco + "[" + partecipanteKey + "] " + partecipanteNominativo + " (CF: " + partecipanteCodiceFiscale + ")"; %]
|
||||
|
||||
[IF]
|
||||
[CONDITION][% personaIdx < partecipantiCount %][/CONDITION]
|
||||
[THEN]
|
||||
[% ripartizioniElenco = ripartizioniElenco + newLine; %]
|
||||
[/THEN]
|
||||
[/IF]
|
||||
[/DO]
|
||||
[/WHILE]
|
||||
[/THEN][/IF]
|
||||
|
||||
[%= ripartizioniElenco %]
|
||||
[/EFTL]
|
||||
`);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
|
||||
+54
-111
@@ -15,125 +15,68 @@ http:
|
||||
value: "19758"
|
||||
body:
|
||||
type: json
|
||||
data: "{\r
|
||||
|
||||
\ \"userDocument\": \"{{elixBase64EftlDocument}}\", // see the pre-request script\r
|
||||
|
||||
\ \"userContext\": {\r
|
||||
|
||||
\ \"lang\": \"IT\",\r
|
||||
|
||||
\ \"crlf\": \"\\r\\n\"\r
|
||||
|
||||
\ }\r
|
||||
|
||||
}"
|
||||
data: |-
|
||||
{
|
||||
"userDocument": "{{elixBase64EftlDocument}}", // see the pre-request script
|
||||
"userContext": {
|
||||
"lang": "IT",
|
||||
"crlf": "\r\n"
|
||||
}
|
||||
}
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: before-request
|
||||
code: "// Copy-pasta your EFTL document below inside the template literals (`)\r
|
||||
code: |-
|
||||
const { prepareEftlDocument } = require("./elixFormsJs.js")
|
||||
// Copy-pasta your EFTL document below inside the template literals (`)
|
||||
prepareEftlDocument(String.raw`
|
||||
[EFTL]
|
||||
[VAR name="newLine" type="string"][VALUE_OF varname="crlf" /][/VAR]
|
||||
[VAR name="ripartizioniNominativiWithSep" type="string"][TAG]SCHEMAID,538,COL0005,ID_OBJECT,,#[/TAG][/VAR]
|
||||
[VAR name="ripartizioniImportiWithSep" type="string"][TAG]SCHEMAID,538,COL0002,ID_OBJECT,,#[/TAG][/VAR]
|
||||
<table>
|
||||
<tr><th>Partecipante</th><th>Importo (EUR)</th></tr>
|
||||
[IF][CONDITION][IS_NOT_EMPTY varname="ripartizioniNominativiWithSep" /][/CONDITION][THEN]
|
||||
[VAR name="ripartizioniNominativiIterable" type="iterable"][SPLIT regex="#"][VALUE_OF varname="ripartizioniNominativiWithSep" /][/SPLIT][/VAR]
|
||||
[VAR name="ripartizioniImportiIterable" type="iterable"][SPLIT regex="#"][VALUE_OF varname="ripartizioniImportiWithSep" /][/SPLIT][/VAR]
|
||||
[VAR name="ripartizioniCount" type="number"][SIZE_OF varname="ripartizioniNominativiIterable" /][/VAR]
|
||||
[VAR name="ripartizioneIdx" type="string"][% ripartizioneIdx = 0; %][/VAR]
|
||||
[VAR name="firstItem" type="number"][% firstItem = 0; %][/VAR]
|
||||
[VAR name="secondItem" type="number"][% secondItem = 1; %][/VAR]
|
||||
|
||||
var eftlDocumentToBeProcessed = String.raw`\r
|
||||
|
||||
[EFTL]\r
|
||||
[FOR varName="ripartizione" iterable="ripartizioniNominativiIterable"]
|
||||
[VAR name="ripartizioneNominativoFull" type="string"][VALUE_OF varname="ripartizioniNominativiIterable" index="ripartizioneIdx" /][/VAR]
|
||||
[VAR name="ripartizioneImporto" type="string"][VALUE_OF varname="ripartizioniImportiIterable" index="ripartizioneIdx" /][/VAR]
|
||||
[VAR name="ripartizioneNominativoIterable" type="iterable"][SPLIT regex="] "][TRIM][VALUE_OF varname="ripartizioneNominativoFull" /][/TRIM][/SPLIT][/VAR]
|
||||
[VAR name="ripartizioneNominativo" type="string"][VALUE_OF varname="ripartizioneNominativoIterable" index="secondItem" /][/VAR]
|
||||
[% ripartizioneIdx = ripartizioneIdx + 1; %]
|
||||
[VAR name="ripartizioneKeyIterable" type="iterable"][SPLIT regex="\."][% ripartizioneIdx + "" %][/SPLIT][/VAR]
|
||||
[VAR name="ripartizioneKey" type="string"][VALUE_OF varname="ripartizioneKeyIterable" index="firstItem" /][/VAR]
|
||||
<tr><td>[VALUE_OF varname="ripartizioneNominativo" /]</td><td>[VALUE_OF varname="ripartizioneImporto" /]</td></tr>
|
||||
[/FOR]
|
||||
|
||||
[VAR name=\"newLine\" type=\"string\"][VALUE_OF varname=\"crlf\" /][/VAR]\r
|
||||
|
||||
[VAR name=\"ripartizioniNominativiWithSep\" type=\"string\"][TAG]SCHEMAID,538,COL0005,ID_OBJECT,,#[/TAG][/VAR]\r
|
||||
|
||||
[VAR name=\"ripartizioniImportiWithSep\" type=\"string\"][TAG]SCHEMAID,538,COL0002,ID_OBJECT,,#[/TAG][/VAR]\r
|
||||
|
||||
<table>\r
|
||||
|
||||
<tr><th>Partecipante</th><th>Importo (EUR)</th></tr>\r
|
||||
|
||||
[IF][CONDITION][IS_NOT_EMPTY varname=\"ripartizioniNominativiWithSep\" /][/CONDITION][THEN]\r
|
||||
|
||||
\ [VAR name=\"ripartizioniNominativiIterable\" type=\"iterable\"][SPLIT regex=\"#\"][VALUE_OF varname=\"ripartizioniNominativiWithSep\" /][/SPLIT][/VAR]\r
|
||||
|
||||
\ [VAR name=\"ripartizioniImportiIterable\" type=\"iterable\"][SPLIT regex=\"#\"][VALUE_OF varname=\"ripartizioniImportiWithSep\" /][/SPLIT][/VAR]\r
|
||||
|
||||
\ [VAR name=\"ripartizioniCount\" type=\"number\"][SIZE_OF varname=\"ripartizioniNominativiIterable\" /][/VAR]\r
|
||||
|
||||
\ [VAR name=\"ripartizioneIdx\" type=\"string\"][% ripartizioneIdx = 0; %][/VAR]\r
|
||||
|
||||
\ [VAR name=\"firstItem\" type=\"number\"][% firstItem = 0; %][/VAR]\r
|
||||
|
||||
\ [VAR name=\"secondItem\" type=\"number\"][% secondItem = 1; %][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
\r
|
||||
|
||||
\ [FOR varName=\"ripartizione\" iterable=\"ripartizioniNominativiIterable\"]\r
|
||||
|
||||
\ [VAR name=\"ripartizioneNominativoFull\" type=\"string\"][VALUE_OF varname=\"ripartizioniNominativiIterable\" index=\"ripartizioneIdx\" /][/VAR]\r
|
||||
|
||||
\ [VAR name=\"ripartizioneImporto\" type=\"string\"][VALUE_OF varname=\"ripartizioniImportiIterable\" index=\"ripartizioneIdx\" /][/VAR]\r
|
||||
|
||||
\ [VAR name=\"ripartizioneNominativoIterable\" type=\"iterable\"][SPLIT regex=\"] \"][TRIM][VALUE_OF varname=\"ripartizioneNominativoFull\" /][/TRIM][/SPLIT][/VAR]\r
|
||||
|
||||
\ [VAR name=\"ripartizioneNominativo\" type=\"string\"][VALUE_OF varname=\"ripartizioneNominativoIterable\" index=\"secondItem\" /][/VAR]\r
|
||||
|
||||
\ [% ripartizioneIdx = ripartizioneIdx + 1; %]\r
|
||||
|
||||
\ [VAR name=\"ripartizioneKeyIterable\" type=\"iterable\"][SPLIT regex=\"\\.\"][% ripartizioneIdx + \"\" %][/SPLIT][/VAR]\r
|
||||
|
||||
\ [VAR name=\"ripartizioneKey\" type=\"string\"][VALUE_OF varname=\"ripartizioneKeyIterable\" index=\"firstItem\" /][/VAR]\r
|
||||
|
||||
\ <tr><td>[VALUE_OF varname=\"ripartizioneNominativo\" /]</td><td>[VALUE_OF varname=\"ripartizioneImporto\" /]</td></tr>\r
|
||||
|
||||
\ [/FOR]\r
|
||||
|
||||
\r
|
||||
|
||||
\ [!--\r
|
||||
|
||||
\ [WHILE threshold=\"99\"]\r
|
||||
|
||||
\ [CONDITION][% ripartizioneIdx < ripartizioniCount %][/CONDITION]\r
|
||||
|
||||
\ [DO]\r
|
||||
|
||||
\ [VAR name=\"ripartizioneNominativoFull\" type=\"string\"][VALUE_OF varname=\"ripartizioniNominativiIterable\" index=\"ripartizioneIdx\" /][/VAR]\r
|
||||
|
||||
\ [VAR name=\"ripartizioneImporto\" type=\"string\"][VALUE_OF varname=\"ripartizioniImportiIterable\" index=\"ripartizioneIdx\" /][/VAR]\r
|
||||
|
||||
\ [VAR name=\"ripartizioneNominativoIterable\" type=\"iterable\"][SPLIT regex=\"] \"][TRIM][VALUE_OF varname=\"ripartizioneNominativoFull\" /][/TRIM][/SPLIT][/VAR]\r
|
||||
|
||||
\ [VAR name=\"ripartizioneNominativo\" type=\"string\"][VALUE_OF varname=\"ripartizioneNominativoIterable\" index=\"secondItem\" /][/VAR]\r
|
||||
|
||||
\ [% ripartizioneIdx = ripartizioneIdx + 1; %]\r
|
||||
|
||||
\ [VAR name=\"ripartizioneKeyIterable\" type=\"iterable\"][SPLIT regex=\"\\.\"][% ripartizioneIdx + \"\" %][/SPLIT][/VAR]\r
|
||||
|
||||
\ [VAR name=\"ripartizioneKey\" type=\"string\"][VALUE_OF varname=\"ripartizioneKeyIterable\" index=\"firstItem\" /][/VAR]\r
|
||||
|
||||
<tr><td>[VALUE_OF varname=\"ripartizioneNominativo\" /]</td><td>[VALUE_OF varname=\"ripartizioneImporto\" /]</td></tr>\r
|
||||
|
||||
\ [/DO]\r
|
||||
|
||||
\ [/WHILE]\r
|
||||
|
||||
\ --]\r
|
||||
|
||||
[/THEN][/IF]\r
|
||||
|
||||
</table>\r
|
||||
|
||||
[/EFTL]\r
|
||||
|
||||
`;\r
|
||||
|
||||
\r
|
||||
|
||||
var base64EncodedDocument = btoa(eftlDocumentToBeProcessed);\r
|
||||
|
||||
\r
|
||||
|
||||
bru.setVar(\"elixBase64EftlDocument\", base64EncodedDocument);"
|
||||
[!--
|
||||
[WHILE threshold="99"]
|
||||
[CONDITION][% ripartizioneIdx < ripartizioniCount %][/CONDITION]
|
||||
[DO]
|
||||
[VAR name="ripartizioneNominativoFull" type="string"][VALUE_OF varname="ripartizioniNominativiIterable" index="ripartizioneIdx" /][/VAR]
|
||||
[VAR name="ripartizioneImporto" type="string"][VALUE_OF varname="ripartizioniImportiIterable" index="ripartizioneIdx" /][/VAR]
|
||||
[VAR name="ripartizioneNominativoIterable" type="iterable"][SPLIT regex="] "][TRIM][VALUE_OF varname="ripartizioneNominativoFull" /][/TRIM][/SPLIT][/VAR]
|
||||
[VAR name="ripartizioneNominativo" type="string"][VALUE_OF varname="ripartizioneNominativoIterable" index="secondItem" /][/VAR]
|
||||
[% ripartizioneIdx = ripartizioneIdx + 1; %]
|
||||
[VAR name="ripartizioneKeyIterable" type="iterable"][SPLIT regex="\."][% ripartizioneIdx + "" %][/SPLIT][/VAR]
|
||||
[VAR name="ripartizioneKey" type="string"][VALUE_OF varname="ripartizioneKeyIterable" index="firstItem" /][/VAR]
|
||||
<tr><td>[VALUE_OF varname="ripartizioneNominativo" /]</td><td>[VALUE_OF varname="ripartizioneImporto" /]</td></tr>
|
||||
[/DO]
|
||||
[/WHILE]
|
||||
--]
|
||||
[/THEN][/IF]
|
||||
</table>
|
||||
[/EFTL]
|
||||
`);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
|
||||
+11
-19
@@ -18,27 +18,23 @@ http:
|
||||
value: "23629"
|
||||
body:
|
||||
type: json
|
||||
data: "{\r
|
||||
|
||||
\ \"userDocument\": \"{{elixBase64EftlDocument}}\", // see the pre-request script\r
|
||||
|
||||
\ \"userContext\": {\r
|
||||
|
||||
\ \"lang\": \"IT\",\r
|
||||
|
||||
\ \"crlf\": \"\\r\\n\"\r
|
||||
|
||||
\ }\r
|
||||
|
||||
}"
|
||||
data: |-
|
||||
{
|
||||
"userDocument": "{{elixBase64EftlDocument}}", // see the pre-request script
|
||||
"userContext": {
|
||||
"lang": "IT",
|
||||
"crlf": "\r\n"
|
||||
}
|
||||
}
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: before-request
|
||||
code: |-
|
||||
const { prepareEftlDocument } = require("./elixFormsJs.js")
|
||||
// Copy-pasta your EFTL document below inside the template literals (`)
|
||||
var eftlDocumentToBeProcessed = String.raw`
|
||||
prepareEftlDocument(String.raw`
|
||||
[EFTL]
|
||||
[HEADER name="trimDocument" value="true" type="boolean" /]
|
||||
[VAR name="ripartizioniNominativiWithSep" type="string"][TAG]SCHEMAID,538,COL0005,ID_OBJECT,,#[/TAG][/VAR]
|
||||
@@ -77,11 +73,7 @@ runtime:
|
||||
|
||||
[%= "</table>" %]
|
||||
[/EFTL]
|
||||
`;
|
||||
|
||||
var base64EncodedDocument = btoa(eftlDocumentToBeProcessed);
|
||||
|
||||
bru.setVar("elixBase64EftlDocument", base64EncodedDocument);
|
||||
`);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
|
||||
+38
-76
@@ -15,87 +15,49 @@ http:
|
||||
value: "19375"
|
||||
body:
|
||||
type: json
|
||||
data: "{\r
|
||||
|
||||
\ \"userDocument\": \"{{elixBase64EftlDocument}}\", // see the pre-request script\r
|
||||
|
||||
\ \"userContext\": {\r
|
||||
|
||||
\ \"lang\": \"IT\",\r
|
||||
|
||||
\ \"crlf\": \"\\r\\n\"\r
|
||||
|
||||
\ }\r
|
||||
|
||||
}"
|
||||
data: |-
|
||||
{
|
||||
"userDocument": "{{elixBase64EftlDocument}}", // see the pre-request script
|
||||
"userContext": {
|
||||
"lang": "IT",
|
||||
"crlf": "\r\n"
|
||||
}
|
||||
}
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: before-request
|
||||
code: "// Copy-pasta your EFTL document below inside the template literals (`)\r
|
||||
|
||||
var eftlDocumentToBeProcessed = String.raw`\r
|
||||
|
||||
[EFTL][HEADER name=\"trimDocument\" value=\"true\" type=\"boolean\" /]\r
|
||||
|
||||
[VAR name=\"elencoPartecipantiDebug\" type=\"string\"][% elencoPartecipantiDebug = \"\"; %][/VAR]\r
|
||||
|
||||
[VAR name=\"elencoPartecipantiCompleto\" type=\"string\"][% elencoContraentiCompleto = \"\"; %][/VAR]\r
|
||||
|
||||
[VAR name=\"partecipanti\" type=\"string\"][TRIM][TAG]SCHEMAID,542,COL0018,IUQOID, , [/TAG][/TRIM][/VAR]\r
|
||||
|
||||
[%= \"\" %]\r
|
||||
|
||||
[IF][CONDITION][IS_NOT_EMPTY varname=\"partecipanti\" /][/CONDITION][THEN]\r
|
||||
|
||||
[VAR name=\"partecipantiSplit\" type=\"iterable\"][SPLIT regex=\"\\n\"][VALUE_OF varname=\"partecipanti\" /][/SPLIT][/VAR]\r
|
||||
|
||||
[VAR name=\"partecipantiCount\" type=\"number\"][SIZE_OF varname=\"partecipantiSplit\" /][/VAR]\r
|
||||
|
||||
[VAR name=\"partecipanteIdx\" type=\"number\"][% partecipanteIdx = 0; %][/VAR]\r
|
||||
|
||||
[VAR name=\"partecipanteNominativoIdx\" type=\"number\"][% partecipanteNominativoIdx = 0; %][/VAR]\r
|
||||
|
||||
[VAR name=\"partecipanteRestoIdx\" type=\"number\"][% partecipanteRestoIdx = 1; %][/VAR]\r
|
||||
|
||||
[WHILE threshold=\"99\"][CONDITION][% partecipanteIdx < partecipantiCount %][/CONDITION][DO]\r
|
||||
|
||||
[VAR name=\"partecipanteFull\" type=\"string\"][VALUE_OF varname=\"partecipantiSplit\" index=\"partecipanteIdx\" /][/VAR]\r
|
||||
|
||||
[VAR name=\"partecipanteSplit\" type=\"iterable\"][SPLIT regex=\", CF: \"][TRIM][VALUE_OF varname=\"partecipanteFull\" /][/TRIM][/SPLIT][/VAR]\r
|
||||
|
||||
[!-- Recupera il nominativo --]\r
|
||||
|
||||
[VAR name=\"partecipanteNominativo\" type=\"string\"][VALUE_OF varname=\"partecipanteSplit\" index=\"partecipanteNominativoIdx\" /][/VAR]\r
|
||||
|
||||
[!-- Recupera il codice fiscale --]\r
|
||||
|
||||
[VAR name=\"partecipanteResto\" type=\"string\"][VALUE_OF varname=\"partecipanteSplit\" index=\"partecipanteRestoIdx\" /][/VAR]\r
|
||||
|
||||
[VAR name=\"partecipanteRestoSplit\" type=\"iterable\"][SPLIT regex=\", Qualifica: \"][VALUE_OF varname=\"partecipanteResto\" /][/SPLIT][/VAR]\r
|
||||
|
||||
[VAR name=\"partecipanteCodiceFiscale\" type=\"string\"][VALUE_OF varname=\"partecipanteRestoSplit\" index=\"partecipanteNominativoIdx\" /][/VAR]\r
|
||||
|
||||
[%= \"[\" %][FORMAT type=\"number\" pattern=\"integer\"][% partecipanteIdx + 1 %][/FORMAT][%= \"] \" + partecipanteNominativo + \" (CF: \" + partecipanteCodiceFiscale + \")\" %]\r
|
||||
|
||||
[% partecipanteIdx = partecipanteIdx + 1; %]\r
|
||||
|
||||
[/DO][/WHILE]\r
|
||||
|
||||
[/THEN][/IF]\r
|
||||
|
||||
[/EFTL]\r
|
||||
|
||||
`;\r
|
||||
|
||||
\r
|
||||
|
||||
var base64EncodedDocument = btoa(eftlDocumentToBeProcessed);\r
|
||||
|
||||
\r
|
||||
|
||||
bru.setVar(\"elixBase64EftlDocument\", base64EncodedDocument);"
|
||||
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="elencoPartecipantiDebug" type="string"][% elencoPartecipantiDebug = ""; %][/VAR]
|
||||
[VAR name="elencoPartecipantiCompleto" type="string"][% elencoContraentiCompleto = ""; %][/VAR]
|
||||
[VAR name="partecipanti" type="string"][TRIM][TAG]SCHEMAID,542,COL0018,IUQOID, , [/TAG][/TRIM][/VAR]
|
||||
[%= "" %]
|
||||
[IF][CONDITION][IS_NOT_EMPTY varname="partecipanti" /][/CONDITION][THEN]
|
||||
[VAR name="partecipantiSplit" type="iterable"][SPLIT regex="\n"][VALUE_OF varname="partecipanti" /][/SPLIT][/VAR]
|
||||
[VAR name="partecipantiCount" type="number"][SIZE_OF varname="partecipantiSplit" /][/VAR]
|
||||
[VAR name="partecipanteIdx" type="number"][% partecipanteIdx = 0; %][/VAR]
|
||||
[VAR name="partecipanteNominativoIdx" type="number"][% partecipanteNominativoIdx = 0; %][/VAR]
|
||||
[VAR name="partecipanteRestoIdx" type="number"][% partecipanteRestoIdx = 1; %][/VAR]
|
||||
[WHILE threshold="99"][CONDITION][% partecipanteIdx < partecipantiCount %][/CONDITION][DO]
|
||||
[VAR name="partecipanteFull" type="string"][VALUE_OF varname="partecipantiSplit" index="partecipanteIdx" /][/VAR]
|
||||
[VAR name="partecipanteSplit" type="iterable"][SPLIT regex=", CF: "][TRIM][VALUE_OF varname="partecipanteFull" /][/TRIM][/SPLIT][/VAR]
|
||||
[!-- Recupera il nominativo --]
|
||||
[VAR name="partecipanteNominativo" type="string"][VALUE_OF varname="partecipanteSplit" index="partecipanteNominativoIdx" /][/VAR]
|
||||
[!-- Recupera il codice fiscale --]
|
||||
[VAR name="partecipanteResto" type="string"][VALUE_OF varname="partecipanteSplit" index="partecipanteRestoIdx" /][/VAR]
|
||||
[VAR name="partecipanteRestoSplit" type="iterable"][SPLIT regex=", Qualifica: "][VALUE_OF varname="partecipanteResto" /][/SPLIT][/VAR]
|
||||
[VAR name="partecipanteCodiceFiscale" type="string"][VALUE_OF varname="partecipanteRestoSplit" index="partecipanteNominativoIdx" /][/VAR]
|
||||
[%= "[" %][FORMAT type="number" pattern="integer"][% partecipanteIdx + 1 %][/FORMAT][%= "] " + partecipanteNominativo + " (CF: " + partecipanteCodiceFiscale + ")" %]
|
||||
[% partecipanteIdx = partecipanteIdx + 1; %]
|
||||
[/DO][/WHILE]
|
||||
[/THEN][/IF]
|
||||
[/EFTL]
|
||||
`);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
|
||||
+3
-6
@@ -32,8 +32,9 @@ runtime:
|
||||
scripts:
|
||||
- type: before-request
|
||||
code: |-
|
||||
const { prepareEftlDocument } = require("./elixFormsJs.js")
|
||||
// Copy-pasta your EFTL document below inside the template literals (`)
|
||||
var eftlDocumentToBeProcessed = String.raw`
|
||||
prepareEftlDocument(String.raw`
|
||||
[EFTL][HEADER name="trimDocument" value="true" type="boolean" /]
|
||||
[VAR name="newline"][% newline = ""; %][/VAR]
|
||||
[VAR name="codiceFiscaleProponente"][TAG]GETVALUEBYTAG,RICHIEDENTE_CODFIS,REQUEST,IUQOID[/TAG][/VAR]
|
||||
@@ -54,11 +55,7 @@ runtime:
|
||||
[%= newline %]
|
||||
[%= ripartizioniCount %]
|
||||
[/EFTL]
|
||||
`;
|
||||
|
||||
var base64EncodedDocument = btoa(eftlDocumentToBeProcessed);
|
||||
|
||||
bru.setVar("elixBase64EftlDocument", base64EncodedDocument);
|
||||
`);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
|
||||
+18
-37
@@ -15,49 +15,30 @@ http:
|
||||
value: "19758"
|
||||
body:
|
||||
type: json
|
||||
data: "{\r
|
||||
|
||||
\ \"userDocument\": \"{{elixBase64EftlDocument}}\", // see the pre-request script\r
|
||||
|
||||
\ \"userContext\": {\r
|
||||
|
||||
\ \"lang\": \"IT\",\r
|
||||
|
||||
\ \"crlf\": \"\\r\\n\"\r
|
||||
|
||||
\ }\r
|
||||
|
||||
}"
|
||||
data: |-
|
||||
{
|
||||
"userDocument": "{{elixBase64EftlDocument}}", // see the pre-request script
|
||||
"userContext": {
|
||||
"lang": "IT",
|
||||
"crlf": "\r\n"
|
||||
}
|
||||
}
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: before-request
|
||||
code: "// Copy-pasta your EFTL document below inside the template literals (`)\r
|
||||
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="ripartizioniIterable" type="iterable"][SPLIT regex="#"][TAG]SCHEMAID,538,COL0005,ID_OBJECT,,#[/TAG][/SPLIT][/VAR]
|
||||
[VAR name="ripartizioniCount" type="string"][SIZE_OF varname="ripartizioniIterable" /][/VAR]
|
||||
|
||||
var eftlDocumentToBeProcessed = String.raw`\r
|
||||
|
||||
[EFTL][HEADER name=\"trimDocument\" value=\"true\" type=\"boolean\" /]\r
|
||||
|
||||
[VAR name=\"ripartizioniIterable\" type=\"iterable\"][SPLIT regex=\"#\"][TAG]SCHEMAID,538,COL0005,ID_OBJECT,,#[/TAG][/SPLIT][/VAR]\r
|
||||
|
||||
[VAR name=\"ripartizioniCount\" type=\"string\"][SIZE_OF varname=\"ripartizioniIterable\" /][/VAR]\r
|
||||
|
||||
\r
|
||||
|
||||
[%= ripartizioniCount %]\r
|
||||
|
||||
[/EFTL]\r
|
||||
|
||||
`;\r
|
||||
|
||||
\r
|
||||
|
||||
var base64EncodedDocument = btoa(eftlDocumentToBeProcessed);\r
|
||||
|
||||
\r
|
||||
|
||||
bru.setVar(\"elixBase64EftlDocument\", base64EncodedDocument);"
|
||||
[%= ripartizioniCount %]
|
||||
[/EFTL]
|
||||
`);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
|
||||
+3
-6
@@ -30,8 +30,9 @@ runtime:
|
||||
scripts:
|
||||
- type: before-request
|
||||
code: |-
|
||||
const { prepareEftlDocument } = require("./elixFormsJs.js")
|
||||
// Copy-pasta your EFTL document below inside the template literals (`)
|
||||
var eftlDocumentToBeProcessed = String.raw`
|
||||
prepareEftlDocument(String.raw`
|
||||
[EFTL][HEADER name="trimDocument" value="true" type="boolean" /]
|
||||
[!-- Must be defined in EftlSolver attribute! --]
|
||||
[VAR name="newLine" type="string"][VALUE_OF varname="crlf" /][/VAR]
|
||||
@@ -75,11 +76,7 @@ runtime:
|
||||
[%= newLine %]
|
||||
[%= responsabiliScientifici + newLine + partecipanti %]
|
||||
[/EFTL]
|
||||
`;
|
||||
|
||||
var base64EncodedDocument = btoa(eftlDocumentToBeProcessed);
|
||||
|
||||
bru.setVar("elixBase64EftlDocument", base64EncodedDocument);
|
||||
`);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
|
||||
+19
-38
@@ -15,49 +15,30 @@ http:
|
||||
value: "19758"
|
||||
body:
|
||||
type: json
|
||||
data: "{\r
|
||||
|
||||
\ \"userDocument\": \"{{elixBase64EftlDocument}}\", // see the pre-request script\r
|
||||
|
||||
\ \"userContext\": {\r
|
||||
|
||||
\ \"lang\": \"IT\",\r
|
||||
|
||||
\ \"crlf\": \"\\r\\n\"\r
|
||||
|
||||
\ }\r
|
||||
|
||||
}"
|
||||
data: |-
|
||||
{
|
||||
"userDocument": "{{elixBase64EftlDocument}}", // see the pre-request script
|
||||
"userContext": {
|
||||
"lang": "IT",
|
||||
"crlf": "\r\n"
|
||||
}
|
||||
}
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: before-request
|
||||
code: "// Copy-pasta your EFTL document below inside the template literals (`)\r
|
||||
|
||||
var eftlDocumentToBeProcessed = String.raw`\r
|
||||
|
||||
[EFTL][HEADER name=\"trimDocument\" value=\"true\" type=\"boolean\" /]\r
|
||||
|
||||
[VAR name=\"rspTitolo\" type=\"string\"][TAG]GETVALUEBYTAG,RSP_TITOLO,REQUEST,IUQOID[/TAG][/VAR]\r
|
||||
|
||||
[VAR name=\"rspCognome\" type=\"string\"][TAG]GETVALUEBYTAG,RSP_COGNOME,REQUEST,IUQOID[/TAG][/VAR]\r
|
||||
|
||||
[VAR name=\"rspNome\" type=\"string\"][TAG]GETVALUEBYTAG,RSP_NOME,REQUEST,IUQOID[/TAG][/VAR]\r
|
||||
|
||||
[%= rspTitolo + \" \" + rspCognome + \" \" rspNome %]\r
|
||||
|
||||
[/EFTL]\r
|
||||
|
||||
`;\r
|
||||
|
||||
\r
|
||||
|
||||
var base64EncodedDocument = btoa(eftlDocumentToBeProcessed);\r
|
||||
|
||||
\r
|
||||
|
||||
bru.setVar(\"elixBase64EftlDocument\", base64EncodedDocument);"
|
||||
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="rspTitolo" type="string"][TAG]GETVALUEBYTAG,RSP_TITOLO,REQUEST,IUQOID[/TAG][/VAR]
|
||||
[VAR name="rspCognome" type="string"][TAG]GETVALUEBYTAG,RSP_COGNOME,REQUEST,IUQOID[/TAG][/VAR]
|
||||
[VAR name="rspNome" type="string"][TAG]GETVALUEBYTAG,RSP_NOME,REQUEST,IUQOID[/TAG][/VAR]
|
||||
[%= rspTitolo + " " + rspCognome + " " rspNome %]
|
||||
[/EFTL]
|
||||
`);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
|
||||
+6
-2
@@ -19,6 +19,9 @@ http:
|
||||
disabled: true
|
||||
- name: x-ef-request-id
|
||||
value: "23663"
|
||||
disabled: true
|
||||
- name: x-ef-request-id
|
||||
value: "23698"
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
@@ -36,8 +39,9 @@ runtime:
|
||||
scripts:
|
||||
- type: before-request
|
||||
code: |-
|
||||
const { prepareEftlDocument } = require("./elixFormsJs.js")
|
||||
// Copy-pasta your EFTL document below inside the template literals (`)
|
||||
var eftlDocumentToBeProcessed = bru.setVar("elixBase64EftlDocument", btoa(String.raw`
|
||||
prepareEftlDocument(String.raw`
|
||||
[EFTL][HEADER name="trimDocument" value="true" type="boolean" /]
|
||||
|
||||
[VAR name="codiceFiscaleRichiedente" type="string"][TAG]GETVALUEBYTAG,RICHIEDENTE_CODFIS,REQUEST,IUQOID[/TAG][/VAR]
|
||||
@@ -60,7 +64,7 @@ runtime:
|
||||
|
||||
[%= importoRichiedente %]
|
||||
[/EFTL]
|
||||
`));
|
||||
`);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
|
||||
+3
-2
@@ -35,8 +35,9 @@ runtime:
|
||||
scripts:
|
||||
- type: before-request
|
||||
code: |-
|
||||
const { prepareEftlDocument } = require("./elixFormsJs.js")
|
||||
// Copy-pasta your EFTL document below inside the template literals (`)
|
||||
var eftlDocumentToBeProcessed = bru.setVar("elixBase64EftlDocument", btoa(String.raw`
|
||||
prepareEftlDocument(String.raw`
|
||||
[EFTL][HEADER name="trimDocument" value="true" type="boolean" /]
|
||||
|
||||
[VAR name="lastUpdatedNominativo" type="string"][TAG]GETVALUEBYTAG,PARTECIPANTE,REQUEST,IUQOID,UPDATED_LAST[/TAG][/VAR]
|
||||
@@ -51,7 +52,7 @@ runtime:
|
||||
|
||||
[%= lastUpdatedNominativoCF + ":" + lastUpdatedImporto %]
|
||||
[/EFTL]
|
||||
`));
|
||||
`);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
|
||||
Reference in New Issue
Block a user