You can develop custom Pro-Code forms from scratch in a PAS Form Library to use these forms as Low-Code forms or sub-forms in the Designer.
The xUML Library Development Kit (xlib) helps you with this task. It can be used to build these libraries, and run them for testing purposes.
Prerequisites
Developing custom form libraries for the Scheer PAS platform assumes a basic knowledge of HTML, CSS, JavaScript/TypeScript and the Angular framework.
If you want to install the PAS xUML Library Development Kit, please contact our Support team.
You need to have the following installed:
-
the Angular CLI (version 19.2.x)
-
the PAS xUML Library Development Kit
You can install the xUML Library Development Kit using the following command:
npm install @pas/xuml-library-devkit
Expert Advice
For detailed information about multi-project workspaces, visit the Angular documentation.
Working with the xUML Library Development Kit (xlib)
After you have installed the @pas/xuml-library-devkit, you can switch to your project folder and execute the following commands to build a new multiple-projects workspace with a new library project in it.
Creating Workspace and Library
The following table displays an overview on the main features of xlib to use with developing your own form libraries.
|
Command |
Description |
Example |
|---|---|---|
|
|
This command builds a new multiple-projects workspace with a new library project in it. The development kit automatically generates a test form and application. |
|
|
You will get the multiple-projects workspace Generated workspace files: Bash
|
|
|
|
The library project is generated at path <library name/projects/library name>. Projects Folder: Bash
Forms: Bash
|
|
Creating a Form
Your workspace project is created with an automatically generated PAS form from the @pas/xuml-library-devkit under the name my-form. To create your own form, switch to <library name>/projects/<library name>/src/lib> in your workspace project. You can now use the @pas/xuml-library-devkit to create a new PAS form using the following command:
|
Command |
Description |
Example |
|---|---|---|
|
|
The Development Kit creates a new folder that contains all the files needed for a new PAS form. Projects Folder: Bash
|
|
Use the @PasForm decorator in the my-form.component.ts file to set the name of the form in your Designer project and to define the events that can be used to trigger an execution in the BPMN process.
@PASForm Decorator:
@PasForm({
name: 'MyForm',
events: [
'submit'
]
})
The Development Kit uses the my-form.interface.ts file to build the PAS Designer types for you, so use this file to define the types for this form.
Building the Library
Make sure you generate the build folder before you build the library for the first time.
|
Command |
Description |
|---|---|
|
|
Creates an xlib folder and builds the <library name>-library.xlib package in the root folder. Refer to Administrating Libraries for detailed information on how to upload libraries. The usage of libraries is explained in detail on Adding Libraries and in chapter Developing and Using Libraries. |
Testing and Developing Your Form Component
To test your project you can use Storybook for Angular. From the root folder of your workspace, run
npm run ng -- run <library name>:storybook
e.g. npm run ng -- run my-lib:storybook
This will automatically open Storybook on port 9009, and then redirect to http://localhost:9009/?path=/docs/<form name>--docs.
Using External Libraries
If you want to use external libraries in your Pro-Code forms, you need to add the external library to your own library project.
|
Path |
Step |
Description |
Example Code |
|---|---|---|---|
|
my-lib/projects/my-lib |
(1) |
Go to my-lib/projects/my-lib and execute the install command for the external library. |
Bash
|
|
(2) |
Adjust the ng-package.json in the library folder to make the external library available for your applications. |
TypeScript
|
Related Content
Related Pages:
Related Documentation:
Downloads:
Download an archived (empty) test project if you want to use it as a starting point for a new Pro-Code project.
-
The project has been created by an xlib new command.
-
Just perform an npm install to install the dependencies.