Skip to content

Latest commit

 

History

History
44 lines (32 loc) · 2.46 KB

File metadata and controls

44 lines (32 loc) · 2.46 KB

Sample Laserfiche Python Rule script project

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

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

Prerequisites

Build and Test script

This project is using a mono-repo structure with multiple packages. Please refer to the documentation for more details.

  • Clone this GIT repository
  • Install: pip install -r requirements.txt
  • Test: pytest

Configure a remote agent

Remote Agents Documentation

Sample Projects

Deployment

  • Copy the whole repo into the remote agent folder

    • e.g., C:\Program Files\Laserfiche\Server\RemoteAgent\ScriptRunner\Python\lf-sample-python-script-rules
  • Add the destination folder into the PYTHONPATH environment variable

    • if your windows login user is different than the user running the remote agent, you need to add the environment variable to System variables.
    • import os
      os.environ['PYTHONPATH'] = r'C:\Program Files\Laserfiche\Server\RemoteAgent\ScriptRunner\Python\lf-sample-python-script-rules'
  • Install dependencies: pip install -r requirements.txt

    • If your windows login user is different than the user running the remote agent, you need to make pip install to install dependencies for all the user.
    • e.g, pip install --target="C:\Program Files\Python312\Lib\site-packages" -r requirements.txt
    • Please update the --target based on your python installation folder.