59 lines
1.6 KiB
YAML
59 lines
1.6 KiB
YAML
info:
|
|
name: Calcolo ore IN o OUT servizio
|
|
type: http
|
|
seq: 4
|
|
|
|
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: "24829"
|
|
body:
|
|
type: json
|
|
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 (`)
|
|
prepareEftlDocument(String.raw`
|
|
[EFTL][HEADER name="trimDocument" value="true" type="boolean" /]
|
|
[VAR name="tipoAttivita" type="string"][TAG]GETVALUEBYTAG,ATTIVITA_TIPO,REQUEST,IUQOID,UPDATED_LAST[/TAG][/VAR]
|
|
[VAR name="oreAttivita" type="string"][TAG]GETVALUEBYTAG,ATTIVITA_ORE,REQUEST,IUQOID,UPDATED_LAST[/TAG][/VAR]
|
|
|
|
[VAR name="oreOrarioIn" type="string"][% oreOrarioIn = "0"; %][/VAR]
|
|
[VAR name="oreOrarioOut" type="string"][% oreOrarioOut = "0"; %][/VAR]
|
|
|
|
[IF]
|
|
[CONDITION][% tipoAttivita == "in orario di lavoro" %][/CONDITION]
|
|
[THEN][% oreOrarioIn = oreAttivita; %][/THEN]
|
|
[ELSE][% oreOrarioOut = oreAttivita; %][/ELSE]
|
|
[/IF]
|
|
|
|
[%= oreOrarioIn %]
|
|
[%= crlf %]
|
|
[%= oreOrarioOut %]
|
|
[/EFTL]
|
|
`);
|
|
|
|
settings:
|
|
encodeUrl: true
|
|
timeout: 0
|
|
followRedirects: true
|
|
maxRedirects: 5
|