> For the complete documentation index, see [llms.txt](https://docs.eximee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eximee.com/budowanie-aplikacji/logika-biznesowa/scriptcode/zadanie-skryptowe-scripttask/podpinanie-zadania-skryptowego-w-procesie.md).

# Podpinanie zadania skryptowego w procesie

## Podpinanie ScriptCode Handler w procesie <a href="#zadanieskryptowe-podpinaniescriptcodehandlerwprocesie" id="zadanieskryptowe-podpinaniescriptcodehandlerwprocesie"></a>

Aby proces mógł wywołać handler, należy w definicji procesu ustawić ***ServiceTask*** na:

* sekcja ***Implementation***: **Topic = eximeeScriptCodeTask**

<figure><img src="/files/YdlpldPB71QbfudiMuIJ" alt=""><figcaption><p align="center"><em><strong>Ilustracja 1.</strong> Sekcja 'Implementation' w ServiceTask</em></p></figcaption></figure>

* sekcja ***Extension properties***: należy dodać zmienną o nazwie **script** z **nazwą skryptu** jako wartością, który chcemy wywołać:

<figure><img src="/files/LsTWdE2NIwg2mWjMRaEF" alt=""><figcaption><p align="center"><em><strong>Ilustracja 2.</strong> Sekcja 'Extension properties' w ServiceTask</em></p></figcaption></figure>

W sekcji ***Inputs*** mamy możliwość definiowania argumentów do handlera, dla przykładowego skryptu:

<figure><img src="/files/dSyJWO58xhddobnF3ztI" alt=""><figcaption><p align="center"><em><strong>Ilustracja 3.</strong> Sekcja 'Inputs' w ServiceTask</em></p></figcaption></figure>

W powyższym przykładzie dodaliśmy do handler'a zmienną **testVariable** o wartości **10**.

Należy pamiętać, że w skrypcie handler'a mamy dostęp do wszystkich globalnych zmiennych procesu za pomocą metod getVariable() oraz getAllVariables().

## Obsługa cache w process-handler-executor <a href="#zadanieskryptowe-obslugacachewprocess-handler-executor" id="zadanieskryptowe-obslugacachewprocess-handler-executor"></a>

process-handler-executor to aplikacja wchodząca w skład platformy Eximee. Odpowiada ona za wykonywanie zadań skryptowych. Aplikacja ta posiada cache, który pozwala ograniczyć liczbę zapytań po treść artefaktów zadań skryptowych, co skutkuje lepszą wydajnością.

Cache jest konfigurowalny poprzez parametr PROCESS\_HANDLER\_SCRIPT\_CODE\_CACHE\_TTL. Jego wartość powinna być ustawiona w zależności od częstotliwości aktualizacji artefaktów na danym środowisku. W przypadku środowisk deweloperskich, gdzie artefakty są często aktualizowane, zalecana jest niska wartość, przykładowo '1s', dla środowisk produkcyjnych można użyć wartości znacznie wyższej, przykładowo '10m'.

Cache można też czyścić na żądanie, wykonując request:

```
curl --location --request POST '
http://DOCKER_HOST/process-handler-executor/cache/invalidate'

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.eximee.com/budowanie-aplikacji/logika-biznesowa/scriptcode/zadanie-skryptowe-scripttask/podpinanie-zadania-skryptowego-w-procesie.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
