Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@

Sample javascript scripts that can be invoked from Laserfiche workflow or business process.

Scripts are invoked by **Laserfiche Remote Agent** which is a aervice installed on a Windows PC for this purpose.

NOTE: nodejs v20+ and npm v9+ are required to build this project.
Scripts are invoked by **Laserfiche Remote Agent** which is a service installed on a Windows PC for this purpose.

## Prerequisites

- [nodejs v20 && npm v9](https://nodejs.org/en)
- [nodejs 16 LTS or later](https://nodejs.org/en)
- [Visual Studio Code v1.80 or later](https://code.visualstudio.com/download)
- [A Laserfiche Cloud Account](https://www.laserfiche.com/signon/)
- [Creating a Node.js Script Dcoumentation](https://doc.laserfiche.com/laserfiche.documentation/en-us/Default.htm#../Subsystems/ProcessAutomation/Content/Resources/Rules/nodejsscript.htm?TocPath=Process%2520Automation%257CRules%257CGetting%2520Started%2520With%2520Scripts%257C_____3)
- [Creating a Node.js Script Documentation](https://doc.laserfiche.com/laserfiche.documentation/en-us/Default.htm#../Subsystems/ProcessAutomation/Content/Resources/Rules/nodejsscript.htm?TocPath=Process%2520Automation%257CRules%257CGetting%2520Started%2520With%2520Scripts%257C_____3)

## Build and Test script

Expand All @@ -33,6 +31,6 @@ This project is using [NPM workspaces](https://docs.npmjs.com/cli/v9/using-npm/w

### Note for bundling

- In all the smaple packages, we are using ***rollup*** to bundle all the code (include internal and external dependencies) into a single file. This is not required, but it makes it easier to deploy the code to the remote agent.
- You can also ***copy the folder*** of source code pacakge into remote agent and mannually install the dependencies using `npm install` command.
- In all the sample packages, we are using ***rollup*** to bundle all the code (include internal and external dependencies) into a single file. This is not required, but it makes it easier to deploy the code to the remote agent.
- You can also ***copy the folder*** of source code package into remote agent and manually install the dependencies using `npm install` command.
- Remote agent only cares the target script file, and it expects the deployment step to ensure the target script is executable during invocation time.
10 changes: 5 additions & 5 deletions doc/distance-between-zipcodes/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

This project is a sample script to show how to import 3rd party npm packages in a Laserfiche Nodejs Rule script project.

## Deply script to your remote agent
## Deploy script to your remote agent

- Copy the content of the bundle output folder `\dist` to your remote agent folder
- Copy the content of the bundle output folder `\dist` to your remote agent folder
- e.g., `C:\Program Files\Laserfiche\Server\RemoteAgent\ScriptRunner\Nodejs\script`

## Configure and test this script rule in your Laserfiche Cloud Account -> Process Automation -> Rules
Expand All @@ -22,12 +22,12 @@ This project is a sample script to show how to import 3rd party npm packages in

## Test the rule

- Providing two zip code inputs, this script would caculate the distance between the two zip codes and return the result in miles under output parameter named "Distance"
- Providing two zip code inputs, this script would calculate the distance between the two zip codes and return the result in miles under output parameter named "Distance"

![Drag Racing](script-test-inputs.png)

## Test script rule in a workflow

- Run the workflow and verify the script calcuate the distance between the two zip codes
- Run the workflow and verify the script calculate the distance between the two zip codes

![Drag Racing](workflow-script-rule-sample.png)
![Drag Racing](workflow-script-rule-sample.png)
2 changes: 1 addition & 1 deletion doc/template/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This project is a template for creating a Laserfiche Nodejs Rule script project. It contains a sample script that can be used as a starting point for creating your own script.

## Deply script to your remote agent
## Deploy script to your remote agent

- Copy the content of the bundle output folder `\dist` to your remote agent folder
- e.g., `C:\Program Files\Laserfiche\Server\RemoteAgent\ScriptRunner\Nodejs\script`
Expand Down
Loading