Create a Script Executor from which to run Scripts.
To create a new Script Executor is to build a new Docker container using a supported programming language from which the Script Executor runs Scripts. See a design example.
Follow these steps to create a new Script Executor:
View your Script Executors. The Script Executors page displays.
Click the +Script Executor button. The Add New Script Executor screen displays.
In the Name setting, enter the unique name for the Script Executor. This name displays from Script configuration settings, so enter a descriptive name that Process designers configuring their Scripts understand what customization this Script Executor provides. For example, if specific third-party classes have been appended to the Script Executor that provide access to that third-party's API or SDK, enter a name that Process designers developing their Scripts understand how they can best use this Script Executor.
In the Description setting, enter a description for the Script Executor.
From the Language setting, select one of the following programming languages that the Script Executor uses to run Scripts:
PHP
Lua
JavaScript
C#
Java
Python
R
After selecting a programming language, the default Dockerfile content to run Scripts using that language displays in the Dockerfile setting. The Dockerfile content includes the SDK for that language.
From the Dockerfile setting, append the default Dockerfile content with the Docker commands the Script Executor runs when it builds the Docker container. Consider following best practices for writing Dockerfiles. Do not edit the default Dockerfile content as this is necessary to run Scripts successfully in a Docker container using the selected programming language.
Click Save and Build to build the Docker container from which the Script Executor runs Scripts. The Build Command Output setting displays below the Dockerfile setting as the Script Executor builds the Docker container in real-time. If the Docker container builds successfully, the following message displays: Executor Successfully Built. You can now close this window. If building the Docker container is unsuccessful, the following message displays: Error Building Executor. See Output Above.. The Build Command Output setting displays the Dockerfile error.
Click Close.
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
Edit a Script Executor.
Follow these steps to edit a Script Executor:
View your Script Executors. The Script Executors page displays.
Edit the following information about the Script Executor as necessary:
In the Name setting, edit the unique name for the Script Executor. This name displays from Script configuration settings, so enter a descriptive name that Process designers configuring their Scripts understand what customization this Script Executor provides. For example, if specific third-party classes have been appended to the Script Executor that provide access to that third-party's API or SDK, enter a name that ProcessMaker designers developing their Scripts understand how they can best use this Script Executor.
In the Description setting, edit the description for the Script Executor.
From the Language setting, select one of the following programming languages that the Script Executor uses to run Scripts:
PHP
Lua
JavaScript
C#
Java
Python
R
After selecting a programming language, the default Dockerfile content to run Scripts using that language displays in the Dockerfile setting. The Dockerfile content includes the SDK for that language.
From the Dockerfile setting, append the default Dockerfile content with the Docker commands the Script Executor runs when it builds the Docker container. Consider following best practices for writing Dockerfiles. Do not edit the default Dockerfile content as this is necessary to run Scripts successfully in a Docker container using the selected programming language.
Click Save and Build to build the Docker container from which the Script Executor runs Scripts. The Build Command Output setting displays below the Dockerfile setting as the Script Executor builds the Docker container in real-time. If the Docker container builds successfully, the following message displays: Executor Successfully Built. You can now close this window. If building the Docker container is unsuccessful, the following message displays: Error Building Executor. See Output Above.. The Build Command Output setting displays the Dockerfile error.
Click Close.
Click the Edit iconfor the Script Executor to edit. The Script Executor settings display.
When a Script Executor is deleted, all that run during a Request fail. Process designers that have developed Scripts configured to use a deleted Script Executor are not notified of that Script Executor's deletion. When a Process designer reviews or edits the settings for a Script configured to use a deleted Script Executor, that Script Executor does not display from the Language setting. Therefore, take caution when deleting a Script Executor.
. The Script Executors page displays.
Click the Delete iconfor the Script Executor to delete. The Caution screen displays to confirm the deletion of the Script Executor.
Manage the Script Executors that run Scripts.
In ProcessMaker Platform, a Script Executor is a Docker container for a specifically supported programming language to run Scripts developed in that programming language. See an example.
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 ProcessMaker Platform 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. The Script Executor for each supported programming language contains the ProcessMaker Platform Software Development Kit (SDK) that supports extensibility to provide programmatic interaction with ProcessMaker Platform.
Script Executors not only manage Docker containers to run Scripts. Savvy Administrators may add Docker commands and customized code to new or default Script Executors that adds custom packages that allow Scripts to call sanctioned third-party Application Program Interfaces (APIs) and SDKs. Process designers who develop Scripts may make calls and requests to those APIs and SDKs via customized Script Executors. Since the Administrator must provide the Docker commands and configuration to a customized Script Executor, that Administrator controls access to sanctioned APIs and SDKs to those Process designers to ensure security.
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
ProcessMaker Platform supports the following programming languages in the open-source edition:
PHP
Lua
JavaScript
ProcessMaker Platform Enterprise edition supports the following additional programming languages:
C#
Java
Python
R
ProcessMaker Platform displays all Script Executors in one location. Any Script Executor developed by any Administrator can be used in any Process model. This makes it easy to manage Scripts.
Follow these steps to view all Script Executors in your organization:
Log on to ProcessMaker Platform.
Click the Admin option from the top menu. The Users page displays.
The Script Executors page displays the following information in tabular format about Script Executors:
Language: The Language column displays for which Scripts the Script Executor runs based on its programming language.
Title: The Title column displays the name of the Script Executor.
Modified: The Modified column displays the date and time the Script Executor 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.
ProcessMaker Platform provides the following Script Executors.
C# Executor: This is the default Script Executor to run Scripts developed using C#.
Java Executor: This is the default Script Executor to run Scripts developed using Java.
Node Executor: This is the default Script Executor to run Scripts developed using JavaScript.
LUA Executor: This is the default Script Executor to run Scripts developed using Lua.
Python Executor: This is the default Script Executor to run Scripts developed using Python.
R Executor: This is the default Script Executor to run Scripts developed using R.
Click the Script Executors icon from the left sidebar. The Script Executors page displays all Script Executors.