Scripts

In ProcessMaker Platform, Scripts allow Process designers and developers to write self-contained programmatic actions that can be called from any Process at runtime. This enables the reuse of the same Script across multiple Process models. In other words, "write once, use anywhere."

See an example in the following video showing how ProcessMaker Platform integrates with third-party services Amazon Textract and UiPath Robotic Process Automation (RPA) so a loan application workflow scans, analyzes, and intelligently routes a Request and provision a bot accordingly.

  • Intended audience: Process designers and business analysts

  • Viewing time: 11 minutes; contains narration

Supported Programming Languages

ProcessMaker Platform supports the following programming languages:

  • PHP

  • Lua

  • JavaScript

  • C#

  • Java

  • Python

  • R

Use ProcessMaker's AI Assistant to Code, Clean, Document, and Explain  Your Script's Functionality

More efficiently produce your Scripts with ProcessMaker's AI assistant, Cornea AI. Use Cornea AI's no-coding option in the following ways to more efficiently produce Script assets:

  • Generate a Script using a natural language description of its function

  • Clean a Script to improve its code

  • Document a Script

  • Explain a Script

Note that Cornea AI features are only available when using Scripts in JavaScript or PHP programming languages.

Scripts Run in Short-Lived Docker Containers for Security

Scripts run securely and in isolation from within Docker containers called Script Executors. The Script Executor for each supported programming language contains the Software Development Kit (SDK) that supports extensibility to provide programmatic interaction with ProcessMaker Platform. When the ProcessMaker Platform instance calls a Script to run, the Script Executor for that programming language creates a Docker container corresponding with that programming language, runs the Script, and then destroys the Docker container. This ensures that any malicious script that anyone in your organization might inadvertently introduce to ProcessMaker Platform does not affect the instance or its hosting environment: Docker containers cannot access them. Furthermore, Docker containers cannot listen for inbound connections; therefore, a Docker container cannot be accessed externally.

When the Script Executor creates a Docker container to run a Script, required libraries are already built in that Docker container. Furthermore, all default Script Executors that run ProcessMaker Platform-supported programming languages also contain the Software Development Kits (SDKs) for those languages.

See an example in the following video how to use a Script Executor that includes a Docker RUN command to package the Google Client class provided by Google into that Script Executor, thereby allowing Scripts using that Script Executor to successfully call the Google API.

  • Intended audience: Administrators, software developers, and coding engineers

  • Viewing time: 3 minutes; contains narration

Design and Test Scripts in One Environment

Scripts are designed and tested in the Script Editor. While designing a Script, test it before you deploy it. Scripts are tested within the authoring environment to ensure they function as intended. While testing, do the following:

  • Use the JSON data model that you can preview from your Screens to ensure that variables designed from a Screen function as intended in your Script.

  • Incorporate other JSON-formatted data, such as API keys, to ensure your Script uses them correctly during your testing.

View All Scripts

Permissions

Your user account or group membership must have the "Scripts: View Scripts" permission to view the list of Scripts unless your user account has the Make this user a Super Admin setting selected.

See the Scripts permissions or ask your Administrator for assistance.

Follow these steps to view all Scripts in your organization:

  1. Log on to ProcessMaker Platform.

  2. Click the Designer option from the top menu. The Designer Welcome Screen displays.

  3. Do one of the following:

    • From the Assets pane in the Designer Welcome Screen, mouse-hover over the Scripts icon, and then select View All Scripts.

    • Click the Scripts icon from the left sidebar. The Scripts tab displays all Scripts in the Scripts page.

      "Scripts" tab display all Scripts in your organization

The Scripts tab displays the following information in tabular format about Scripts:

  • Name: The Name column displays the name of the Script. Click the name to edit the Script in Scripts Editor.

  • Description: The Description column displays the description of the Script. See Edit Script Configuration for more information.

  • Category: The Category column displays to which Script Category the Script is assigned.

  • Language: The Language column displays the programming language with which the Script was written.

  • Modified: The Modified column displays the date and time the Script was last modified. The time zone setting to display the time is according to the ProcessMaker Platform instance unless your user profile's Time zone setting is specified.

  • Created: The Created column displays the date and time the Script was created. The time zone setting to display the time is according to the ProcessMaker Platform instance unless your user profile's Time zone setting is specified.

Create a Script
Click the +Script button. See Create a New Script.

The Script Editor

Create and Edit Scripts in the Script Editor.

Copy a Script
Click the menu, and then click the Copy option. See Copy a Script

Configure a Script
Click the menu, and then click the Configure option. See Edit Script Configuration

Add a Script to a Project
Click the menu, and then select the Add to Project option. See Add a Script to a Project.

Edit Script
Click the menu, and then  select the Edit Script option or click the Script name. See Edit a Script.

Delete a Script
Click the menu, and then select the Delete option. See Delete a Script.