> For the complete documentation index, see [llms.txt](https://boomi.markusschmidt.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://boomi.markusschmidt.pro/boomi-scriptease/examples/1-debug-an-existing-process-script.md).

# 1 - Debug an existing process script

We are creating a new, empty script file in our project. Then we copy and paste the code of an existing process script into the file. We create a Test to host the script, and we debug the existing script with IntelliJ.

Right click on *training* and select ***New -> Package***, aka: new folder.

<figure><img src="/files/TA0l97iBmwocaWyZa26L" alt=""><figcaption><p>create a new package</p></figcaption></figure>

Call the package: `training.example01` . Right click on `example01`\`  and add a new, blank Groovy Script. Call it `psgNull` - null: it does nothing, no functionality!

<figure><img src="/files/cJP42oWTt9qjT4SrIbrZ" alt=""><figcaption></figcaption></figure>

Goto to **Boomi Integration** and create a new Process Script, call it `psgNull`

<figure><img src="/files/XGbPMU6jYlTh8AVHBGNK" alt=""><figcaption><p>Boomi Integration - Process Script with <em>Null</em> functionality</p></figcaption></figure>

```groovy
import java.util.Properties;
import java.io.InputStream;

for( int i = 0; i < dataContext.getDataCount(); i++ ) {
    InputStream is = dataContext.getStream(i);
    Properties props = dataContext.getProperties(i);

    dataContext.storeStream(is, props);
}
```

Copy the code and paste it into the `psgNull.groovy` file.

<figure><img src="/files/OhoRDuXg7MdsTSgcVwtz" alt=""><figcaption><p>psgNull pasted into IntelliJ, with warnings</p></figcaption></figure>

{% hint style="info" %}
IntelliJ gives us some warnings (yellow bars to the right): *Unused Imports* and *Unnecessary Semicolon* - fix it, or leave it. Just to mention here that you eventually want to read and recognize what IntelliJ tells you.
{% endhint %}

Set a breakpoint on line 8, we want to stop there:

<figure><img src="/files/LST7YyeVrMfs7NrBSNAN" alt=""><figcaption><p>Null script with breakpoint</p></figcaption></figure>

Now, we want to debug that script, and we **need a Test as a host** to run the process script locally.&#x20;

### Create Test class from template

Right click on the `example01` folder select ***New -> Boomi Process Script Test*** and provide the Map-Script name (from above: *psgNull*) without *psg*:

<figure><img src="/files/b1OftKsX8dEd1MYCNXIh" alt=""><figcaption><p>Create a test from a template: the test needs the name of the script.</p></figcaption></figure>

{% hint style="info" %}
**Tip!**

The *MyScripts* IntelliJ project comes with [four pre-configured templates](/boomi-scriptease/knowlede-base/process-script-templates.md), to create new Tests and Scripts. If you have&#x20;

> ***Project Files** Bar -> Options (three dots)* \
> &#x20; *-> Appearance -> View Excluded Files* &#x20;

enabled, you will see the files in the project directory under `.idea\fileTemplates`. \
More information on that topic in the [IntelliJ Help](https://www.jetbrains.com/help/idea/settings-file-and-code-templates.html).
{% endhint %}

Open  the created `Test_Null`, click the green arrow and *Debug* method ***test01()**.*

<figure><img src="/files/hrI0yx3ENBTaDT203gja" alt=""><figcaption></figcaption></figure>

The code execution is going to halt in the debugger in our Boomi Script `psgNull.groovy`on line 8.

<figure><img src="/files/zo7nzOtz4DcDyIn0fzwv" alt=""><figcaption><p>Haltet script</p></figcaption></figure>

Select `dataContext.getDataCount()`, right click and *Evaluate Expression...* to see the data: `value = 1`.

Big question: A value of 1 means, the script has got *one* document! The question is, where did it come from?


---

# 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:

```
GET https://boomi.markusschmidt.pro/boomi-scriptease/examples/1-debug-an-existing-process-script.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.
