Previous Topic

Book Contents

Book Index

Next Topic

Script Libraries

Script libraries are scripts with functions and/or classes which can be called easily from other scripts without the need to call a subworkflow.

In previous Valuemation versions, if you needed to reuse some Python code and call it from other scripts, the only option was to create a subworkflow with a script node and call this subworkflow from the desired scripts. It became desirable that we could call a function or a class from other scripts directly too, just like it is common in Java.

Note: The Python language has a way of doing it but it requires that the script to be called resides in a *.py file on the disk. Then you just import it calling something like from <package>.<script> import * and then you can call any functions and classes defined in the <script>.py file. But as we know, we store all Python scripts in the DB so that we could share them among all users. If we started using Python scripts in *.py files, we would have to deal with several problems – how to distribute them to other users, how to solve conflicts, how to export them etc.

Since Valuemation version 4.0, it possible to store libraries just as any other Python scripts in Valuemation (i.e. the workflows with script nodes), but it is also possible to cache them to *.py files on the disk in the vmcache\<DB>lib directory so that you could use them easily in other python scripts.

In This Chapter

Installing and Using Standard Libraries

Creating and Using Valuemation Libraries

See Also

Workflows

What is a Workflow

Workflows Usage

Workflow Definitions Catalog

Structure of Workflows

A Workflow at Runtime

Workflow Creation Tool (WCT)

Template Workflows

Workflow Translations

Activities Overview

Workflow Debugging

Calling A WebService Using Workflow