> 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/documentation/documentation-en/budowanie-aplikacji/logika-biznesowa/scriptcode/zadanie-skryptowe-scripttask/podpinanie-zadania-skryptowego-w-procesie.md).

# Hooking up a script task in the process

## Attaching the ScriptCode Handler in a process <a href="#zadanieskryptowe-podpinaniescriptcodehandlerwprocesie" id="zadanieskryptowe-podpinaniescriptcodehandlerwprocesie"></a>

For the process to invoke the handler, you need to set in the process definition ***ServiceTask*** to:

* section ***Implementation***: **Topic = eximeeScriptCodeTask**

<figure><img src="/files/186bb0903d5956469e5b634503964d1476806890" alt=""><figcaption><p align="center"><em><strong>Figure 1.</strong> The 'Implementation' section in ServiceTask</em></p></figcaption></figure>

* section ***Extension properties***: add a variable named **script** of **the name of the script** as the value of the script we want to invoke:

<figure><img src="/files/081144c496a387a6a6cdcccacfa7a3b111199b6a" alt=""><figcaption><p align="center"><em><strong>Figure 2.</strong> The 'Extension properties' section in ServiceTask</em></p></figcaption></figure>

In the section ***Inputs*** we can define arguments for the handler, for the example script:

<figure><img src="/files/7a3f78c658c1fe025cb21c7bd324f2bb162016d4" alt=""><figcaption><p align="center"><em><strong>Figure 3.</strong> The 'Inputs' section in ServiceTask</em></p></figcaption></figure>

In the above example, we added to the handler the variable **testVariable** with the value **10**.

Remember that in the handler script, we have access to all global process variables using the getVariable() and getAllVariables() methods.

## Cache handling in process-handler-executor <a href="#zadanieskryptowe-obslugacachewprocess-handler-executor" id="zadanieskryptowe-obslugacachewprocess-handler-executor"></a>

process-handler-executor is an application that is part of the Eximee platform. It is responsible for executing script tasks. This application has a cache that helps reduce the number of requests for the contents of script task artifacts, resulting in better performance.

The cache is configurable via the PROCESS\_HANDLER\_SCRIPT\_CODE\_CACHE\_TTL parameter. Its value should be set depending on how often artifacts are updated in a given environment. In development environments, where artifacts are updated frequently, a low value is recommended, for example '1s'; for production environments, a much higher value can be used, for example '10m'.

The cache can also be cleared on demand by making a 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/documentation/documentation-en/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.
