# Scripting and Script Tasks

In Primeur Data Mover, Script Tasks are used to execute scripts in a JSR-223 compatible scripting language, for instance, **JavaScript** or **Groovy**.

Scripts Tasks are mainly used to perform simple calculations or operations.

Here below you can find some snippets of an example used when developing Script Tasks to clarify the usage of some basic scripting operations and their syntax.

**Example: DataType Conversion**

`testMe` is a Process Variable inside a running instance, its type is int but we need to convert it to a String because we need to place it into a `Map<String,String>`.

This is the result according to the content of a Log Info Service Task containing:

```
TESTVARIABLE: ${testMe} - TOSTRING: ${execution.getVariable("testMe").concat("")} 
-  APPENDSTR: ${execution.getVariable("testMe").concat("example")} 
-  ADDNUMBER: ${execution.getVariable("testMe") +5}
```

The resulting log, once set testMe as an int variable assigned with 2 as value will be:

```
2018-07-30 16:18:00,264 
INFO  [com.primeur.ghibli.workflow.bpm.boundary.services.log.BpmLogInfoService] (pool-13-thread-1247) 
TESTVARIABLE: 2 - TOSTRING: 2 - APPENDSTR: 2example  - ADDNUMBER: 7
```


---

# 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.primeur.com/data-mover-1.21/workflow-templates/service-tasks/scripting-and-script-tasks.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.
