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."
Supported Programming Languages
ProcessMaker Platform supports the following programming languages:
PHP (µService)
C#
Java
Lua
JavaScript
JavaScript SSR
PHP
Python
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:
Log on to ProcessMaker Platform.
Click the Designer option from the top menu. The Designer Welcome Screen displays.
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.
Columns in the Scripts list
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.
To efficiently manage scripts you can perform several actions, such as searching, editing, copying, or deleting scripts.
Create a Script: Click the +Script button. See Create a New Script.
Edit Script: Click the ellipsis menu, and then select the Edit Script option or click the script name to modify it.
Configure a Script: Click the ellipsis menu, and then click the Configure option. See Configure a Script.
Add a Script to a Project: Click the ellipsis menu, and then select the Add to Project option.
Copy a Script: Click the ellipsis menu, and then click the Copy option.
Delete a Script: Click the ellipsis menu, and then select the Delete option.
The Script Editor: Use the Script Editor to write your scripts.
Scripting AI Assistant
Easily create scripts using ProcessMaker's AI assistant. Leverage no-code options to efficiently generate scripts, enhancing productivity and reducing complexity in process design. The scripting AI assistance offers the following functionality:
Generate a Script using a natural language description of its function.
Clean a Script to enhance its code quality.
Document a Script for better clarity and maintainability.
Explain a Script to understand its functionality.
Explore how to use the scripting AI assistant with the following product tour. For more information, see Generate Scripts using the AI Assistant.
Create a New Script
Permissions
Your user account or group membership must have the following permissions to create a Script unless your user account has the Make this user a Super Admin setting selected:
Scripts: Create Scripts
Scripts: View Scripts
See the Scripts permissions or ask your Administrator for assistance.
Follow these steps to create a new Script:
View your Scripts. The Scripts page displays.
Click the +Script button. The Create Script screen displays.
From the Choose an Executor section, select a programming language to use for creating your script. Your Administrator may have created custom Script Executors using ProcessMaker Platform-supported languages to run sanctioned custom third-party code and/or Docker commands that allow Scripts to successfully call third-party Application Program Interfaces (APIs) and Software Development Kits (SDKs). To know more about the available executors, see What is a Script Executor?. This setting is required.
In the Name setting, enter the name of the Script. Script names must be unique and can only use apostrophe characters (
'
) and spaces. This is a required setting.In the Description setting, enter the description of the Script. This is a required setting.
From the Project drop-down menu, optionally select the Project(s) for this script. This setting only displays Projects of which you are a member. To remove a Project that is currently selected, click the icon for that selection or press
Enter
when the drop-down is visible.From the Category drop-down menu, select one or more Script Categories to associate with this Script. In doing so, Script Categories may be sorted from the Scripts page. To remove a Script Category that is currently selected, click the icon for that selection or press
Enter
when the drop-down is visible. This is a required setting.At the bottom right, click the Advanced Options link. Advanced options display.
Click the Less Options link to hide advanced options.
From the Run Script As drop-down menu, select which user's API client token to use with our REST API. Ensure that the selected user's account has the appropriate API permissions to access our REST API. By default Administrator user is selected. This is a required setting.
In the Timeout setting, enter how many seconds the Script is allowed to run before it times out. Use
0
to indicate that the Script never times out. The default timeout is 60 seconds. This setting requires an integer.In the Retry Attempts setting, configure how many times to re-run the Script if the Script fails. Enter
0
for no retry attempts.In the Retry Wait Time setting, configure how many seconds to wait before attempting a retry . Enter
0
for no wait time.Click Save and continuing editing the script in the Script Editor.
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.