# Attaching a script task in the process

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

In order for the process to be able 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***: you need to add a variable named **script** with **the name of the script** as the value that 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 have the ability to 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 example above, 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 frequently updated, 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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
