...
Also see this tutorial to learn how to create an app in PIPEFORCE.
App home folder
Typically, all properties (resources) of an app reside in the property store and having a property path with a prefix like this:
...
The path always starts with prefix global/app
, followed by the name of the app <NAME>
, whereas <NAME>
must be a fully qualified, unique name as described below.
This path is called the app home folder.
Qualified app naming
In order to avoid a naming clash with other apps from other users which could probably have the same naming as your app, as best practise, you should give the app always a name which follows the reversed domain name package conventions from the Java package specification, which works like this:
...
Inside of an app path, there is a certain " folder " structure at top app home folder level which defines the main resource types of an app. Depending on in which folders properties are stored inside an app, auto-backend tasks could be fired. The typical folder structure looks like this (the folders could vary, depending on your setup):
...
):
Naming convention
Any resource inside an app should follow this naming convention:
The property name is always in lower case, sections are separated with dashes and the name can start with an optional prefix, followed by a verb (if applicable): <prefix>-<verb>-section1-section2-sectionN
The <prefix>
is optional and is the only part which may contain upper case letters (for example A001
). This can be used to define the order of properties or to link them to workflow tasks.
Examples:
Code Block |
---|
global/app/tld.domain.myapp/pipeline/001-send-invite-email
global/app/tld.domain.myapp/pipeline/add-to-sap
global/app/tld.domain.myapp/pipeline/inform-hr |
/form
This folder contains all form configurations for any form of the app, whereas the name of the property is the name of the form. For example:
Code Block |
---|
global/app/myApptld.domain.myapp/form/createUsercreate-user global/app/myApptld.domain.myapp/form/deleteUserdelete-user |
/function
This folder contains all Python FaaS functions which will be automatically deployed when such a property of this app is stored in the property store in this folder.
...
This folder contains all list configuration properties for any list of the app, whereas the name of the property is the name of the list. For example:
Code Block |
---|
global/app/myApptld.domain.myapp/list/all-users global/app/myApptld.domain.myapp/list/all-employees |
/object
This folder contains any application model (schema) and its instances (if there are any).
...
The schema of an object is stored in a property having this path:
Code Block |
---|
global/app/myApptld.domain.myapp/object/<NAME>/<VERSION>/schema |
...
The schema property typically contains as value a JSON schema, which describes this object. For the person object, the schema could, for example, look like this:
Code Block | ||
---|---|---|
| ||
{ "type": "object", "properties": { "firstName": { "type": "string" }, "lastName": { "type": "string" }, "age": { "type": "number" }, "gender": { "type": "string", "enum": ["male", "female", "neutral"] } } } |
See the JSON schema specification for a description how to define JSON schema documents: https://json-schema.org/
...
section for more details: JSON Schema
/instance
In case there are object instances (JSON documents) based on a schema, they should be typically stored inside this path structure:
Code Block |
---|
global/app/myApptld.domain.myapp/object/<NAME>/<VERSION>/instance/<UUID> |
...
For example:
Code Block |
---|
global/app/myApptld.domain.myapp/object/person/v1/instance/fa471958-fdb7-4bf6-a0a3-c5e8c782893e |
Each instance property will contain as value the data of the object instance which matches the object schema, for example:
Code Block | ||
---|---|---|
| ||
{ "firstName": "Homer", "lastName": "Simpson", "age": 48, "gender": "male" } |
/pipeline
This folder contains all persisted pipeline configurations YAML scripts for the given app. A pipeline can be seen as the business logic or data integration part of an application.Find more about pipelines here
Each property name corresponds with the name of the pipeline and contains as value the pipeline configuration. For exampleYAML script.
Examples:
Code Block |
---|
global/app/myApptld.domain.myapp/pipeline/informHR001-send-invite-email global/app/myApptld.domain.myapp/pipeline/addToSAPadd-to-sap global/app/myApptld.domain.myapp/pipeline/addToActiveDirectoryinform-hr |
Such a pipeline configuration YAML script could look like this:
Code Block | ||
---|---|---|
| ||
pipeline: - mail.send: to: hr@company.de subject: "A new employee was addded!" |
Also see Command and Pipeline for more details how to create persisted pipelines.
/setup
This optional folder can also contain pipelinespipeline YAML scripts. These pipelines will be executed in case the app will be installed using the app.install
command.
This is handy in case you would like to do some preparation on setup phase of an app.Note: .
The pipelines will be executed in their natural naming order. So if you would like to make sure a pipeline gets executed the very first, make sure it is at the very top of the naming order by using prefixes like 001-
, 002-
and so on.
Info |
---|
The pipelines in this folder wont be auto-executed on save of properties in the |
...
portal or on publish using the CLI. Only an |
/script
Inside of the optional script folder, scripts can be placed which can contain more complex business logic if required. By default, such scripts are written in JavaScript. Optionally also Python or Groovy are available (ask support@pipeforce.io if required). For example:
Code Block |
---|
global/app/myApp/script/helloworld |
Such a script could look like this example:
Code Block |
---|
function command() {
pi.message.headers["foo"] = "bar";
pi.message.body = "HELLO WORLD IN THE BODY";
var timestamp = pi.util.timestamp();
pi.log.debug("Command script executed at: " + timestamp);
} |
You can call such a script from a pipeline, like this example shows:
Code Block |
---|
pipeline:
- script.run:
path: "global/app/myApp/script/helloworld" |
...
No longer supported. Use the /function
folder instead in order to write custom Python scripts.
/test
This folder typically contains pipelines for tests only. Whenever necessary, PIPEFORCE automatically executes the test pipelines inside this folder to make sure the app is working as expected. Therefore you have to make sure that these tests can be executed at any time and are fully reentrant (once a test has been finished it can be executed again as often as necessary).
For example:
Code Block |
---|
global/app/myApptld.domain.myapp/test/createUserTestcreate-user |
The property contains the test pipeline as value. Such a test pipeline could look like this:
...
For example:
Code Block |
---|
global/app/myApptld.domain.myapp/workflow/approveNewEmployee |
...
approve-new-employee |
Developing an app
In its simple case you can manage all properties of an app in the property store with the property.*
commands and the CLI using pi pipelinepublish
or using the online workbench.
...
This CLI command scans your local folder and uploads only those resources which have been changed since the last upload or have been created since then. See here how to setup the CLI and how to create a local worskspaceworkspace: Local Low-Code Workspace