ProcessMaker API Documentation
ProcessMaker Examples

Configure a Script

Edit the configuration for a Script.

Permissions Required

Your user account or group membership must have the following permissions to configure a Script unless your user account has the Make this user a Super Admin setting selected:

  • Scripts: Edit Scripts

  • Scripts: View Scripts

See the Scripts permissions or ask your Administrator for assistance.

Configure a Script

Follow these steps to configure basic settings for a Script:

Configure General Settings

Follow these steps to configure general settings for a Script:

  1. View your Scripts. The Scripts page displays.

  2. Click the Configure iconfor your Script. The Edit Configuration page displays.

  3. Edit the following information about the Script as necessary:

    • In the Name setting, edit the unique name of the Script. This is a required setting.

    • 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.

    • 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. This is a required setting.

    • From the Script Executor drop-down menu, select which Script Executor to run this Script. This setting only displays Script Executors that this Script has been developed using. Your Administrator may have created custom Script Executors using ProcessMaker-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). Below are the Script Executors ProcessMaker provides, though some require packages to be installed:

      • csharp - C# Executor: This is the default Script Executor to run Scripts developed using C#. Note that if the C# package is not installed, this Script Executor is not available.

      • java - Java Executor: This is the default Script Executor to run Scripts developed using Java. Note that if the Java package is not installed, this Script Executor is not available.

      • javascript - Node Executor: This is the default Script Executor to run Scripts developed using JavaScript.

      • lua - LUA Executor: This is the default Script Executor to run Scripts developed using Lua.

      • python - Python Executor: This is the default Script Executor to run Scripts developed using Python. Note that if the Python package is not installed, this Script Executor is not available.

      • r - R Executor: This is the default Script Executor to run Scripts developed using R. Note that if the R package is not installed, this Script Executor is not available.

      This is a required setting.

    • In the Description setting, edit the description of the Script. This is a required setting.

    • In the Timeout setting, use the slider control or 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.

  4. Click Save.

Configure Version History

Package and Permissions Required

The Versioning package must be installed to view or edit the version history for a Script.

Furthermore, your user account or group membership must have the following permissions unless your user account has the Make this user a Super Admin setting selected:

  • Scripts: Edit Scripts

  • Scripts: View Scripts

  • Version History: Edit Version History

  • Version History: View Version History

See the Scripts and Version History permissions or ask your Administrator for assistance.

A version is a set of changes made to a Script at a particular time by a Process Designer. Versioning maintains a record of all named and unnamed changes to that Script. Any of these versions may be viewed or retrieved, if needed. The Version History page displays all saved versions of the Script in a tabular format from where they can be edited and/or marked as the Current Version according to your business needs. The current version of the Script is used in all new Requests and in-progress Requests in which that Script is run from Script Task elements or Watchers. See the Versioning package for more information.

Follow these steps to view or edit the version history of your Script:

  1. View your Scripts. The Scripts page displays.

  2. Click the Configure iconfor your Script. The Configuration tab of the Edit Configuration page displays.

  3. Click on the Version History tab. The Version History page displays. The Version History page organizes versions in a monthly format and displays the following information:

    • Date: The date and time of when a Process Designer saved this version in the Script Editor.

    • Current Version: The most recent version of the Script is displayed at the top and is marked as the Current Version. This version is used in all in-progress and new Requests.

    • Name: The name of this version as entered by a Process Designer when saving the Script in the Script Editor.

    • Description: A description of the changes in this version as entered by a Process Designer when saving the Script in the Script Editor.

    • Saved by: The name of the Process Designer who saved this version.

  4. Toggle the Only show named versions toggle key to show only the versions with a name assigned to them.

  5. Click the Change Version Details iconto edit version details for this version. The Change Version Details screen displays.

  6. Optionally, edit any of the following existing details about this named version:

    1. In the Version Name setting, edit the name to this named version. If saving this named version with no name, this version does not display in the Version History page if the Only show named versions toggle key is enabled.

    2. In the Additional Details (optional) setting, edit the details about this version. For example, describe the changes in this version for auditing, historical, or maintenance purposes.

    3. Click Confirm and Save to save your changes. Otherwise, click Cancel.

  7. Click the Copy to Latest iconto set a version as the current version. The Copy to Latest screen displays. The screen displays the warning This version will become the active version for this asset, indicating that this action will set this version as the current version.

  8. Click Confirm and Save to set this version as the current version. Otherwise, click Cancel.

Related Topics