The MSPro Boomi Collection
About
ScriptEase For Boomi
ScriptEase For Boomi
  • ScriptEase
    • ScriptEase Development Environment
    • What AI says!
      • The limits of AI ...
  • Software Installation
    • Install a local Atom
  • Project Setup
    • IntelliJ Configuration
    • Verify Project Setup
  • Concepts
    • Use Test Data
  • Examples
    • 1 - Debug an existing process script
    • 9 - Aggregate Prices Example
  • Test Contexts
    • The Process Call Chain
  • Download
  • 💤Appendix
    • Script Templates
    • Java thoughts and recommendations
      • Chose newer JVM for local development
    • Boomi documentation and links
    • Initialize IntelliJ Templates
    • Script Contexts
  • Troubleshoot
    • Java the weed
    • ClassNotFoundException - GroovyStarter
    • Invalid VCS root mapping
    • An illegal reflective access operation has occurred
    • UnauthorizedAccess Error
  • Licensing
    • License Activation
    • Privacy Policy
Powered by GitBook
On this page
  • Create a new Test Context
  • Run the Test
  1. Appendix

Script Templates

Last updated 6 months ago

Script Templates are used to easily create a new scripts together with test contexts. Right click on any script folder where you want to create a New -> Boomi Process Script.

  • Give the script a meaningful name.

    • DO use characters, numbers and underline only.

    • DO NOT use spaces or special characters: -/&(){},[] etc.

    • DO use eitherCamelCase, camelCase or lower_case notation.

  • Write one line about the purpose of the script.

  • and you your shortcut as the author

The script filename starts with psg<BoomiScriptName> as the naming convention for Process Script Groovy: psgMyFirstScript.groovy.

The Script file psgMyFirstScript.groovy is created with the following content:

final String SCRIPT_NAME = "MyFirstScript"

/* **************************************************************************
    This is my first script.
        
    IN : [Describe inbound arguments]
    OUT: [Describe outbound arguments]
    ------------------------------------------------
    12.05.2024  mspro -   Created
    Template v0.2.1
************************************************************************** */

final _logger = ExecutionUtil.getBaseLogger()
_logger.info('>>> Script start ' + SCRIPT_NAME)
...
for (int docNo = 0; docNo < docCount; docNo++) {
	final String textDoc = _getTextDocument( docNo)
	final Properties props = dataContext.getProperties(docNo)
	// *********** Document related functionality ************
	
	// Your document related code here ...
	
	// ******** end of Document related functionality ********
	_setTextDocument( textDoc, props)
}
...

Create a new Test Context

To run a Boomi Script we need a Test Context.

When you create a New -> Boomi Process Script Test, provide the script's name that you used when creating the script: final String SCRIPT_NAME = "MyFirstScript"

@TypeChecked
class Test_psgCalcTotal {
	final String SCRIPT_NAME = "psgCalcTotal"

	@SourceURI
	URI _sourceUri
	final ProcessScript _testScript 
	  = new ProcessScript("psg" + SCRIPT_NAME + ".groovy", _sourceUri)

	/** A short description what this test is supposed to do. */
	@Test
	void test01() { ... }
}

Run the Test

You can run or debug the Test right from there:

💤
Use IntelliJ Templates
Create a new Boomi Process Script based on a template
Create a new Test Class for MyFirstScript
Run or debug script