Publishing the workflow as an app¶
You can make your workflow available to other pSeven Enterprise users by
publishing it as a web app in the AppsHub repository. To publish a
workflow, select its folder in the Explorer panel, and then use the
Publish to AppsHub... command from the panel menu. To
open the published app in AppsHub, hover over its thumbnail and click
the icon in the upper right
corner of the thumbnail.
Understanding the app UI¶
Access to the workflow from AppsHub is provided by the web app user interface (app UI). The app UI is a part of the workflow; its implementation files are located in the UI folder in the workflow. Every new workflow contains a stock app UI, which provides for entering parameters, uploading input files, running the app, viewing and downloading the app run log, viewing the results and downloading output files. You can replace the stock app UI with your custom app UI - upload the custom app UI files to the UI folder inside your workflow before you publish it.
The stock app UI is a web page containing several areas:
- Page header - at the top of the page, the page header displays the name of the workflow. An app user can start the workflow by clicking the Calculate button on the right side of the page header.
- App description - below the page header, you can place explanatory text describing the app, as well as instructions on how to use this app.
- Parameters - the Parameters area displays all the workflow input parameters specified in the workflow setup. Each parameter has a field under its name for viewing, entering and editing the parameter value.
- Parameters description - under the Parameters heading, you can place explanatory text describing the parameters and their intended purposes, as well as instructions on how to set the parameters.
- Results - the Results area displays all the workflow results that should be shown according to the workflow setup. Each result has a field under its name for viewing the result value.
- Results description - under the Results heading, you can place explanatory text to help understand the results output by the app workflow.
While preparing to publish a workflow, you can get a preview of its app UI by
opening the index.html
file from the UI folder:
- In the Explorer panel, go to your workflow folder. From there, open the UI folder.
- In the UI folder, double-click the
index.html
file.
Adding descriptions to the stock app UI¶
The web page of the stock app UI can display the app description, the
parameters description, and the results description. These descriptions
are stored in the text file README.md
located in the root of the
workflow folder. To add descriptions:
-
Prepare a text file with your descriptions. The file name must be
README.md
. The file should be saved with the UTF-8 encoding.New workflows contain a default
README.md
file, which you can download and use as a template. -
In the Explorer panel, go to your workflow folder and upload your
README.md
file to that folder.
The text in the README.md
file consists of three parts delimited by
HTML comment labels:
- App description
<!-- APPLICATION DESCRIPTION BEGIN -->
- marks the beginning of the app description.<!-- APPLICATION DESCRIPTION END -->
- marks the end of the app description.
- Parameters description
<!-- PARAMETERS DESCRIPTION BEGIN -->
- marks the beginning of the parameters description.<!-- PARAMETERS DESCRIPTION END -->
- marks the end of the parameters description.
- Results description
<!-- RESULTS DESCRIPTION BEGIN -->
- marks the beginning of the results description.<!-- RESULTS DESCRIPTION END -->
- marks the end of the results description.
Thus, the text in the README.md
file should be organized as follows:
<!-- APPLICATION DESCRIPTION BEGIN -->
Your app description goes here.
<!-- APPLICATION DESCRIPTION END -->
<!-- PARAMETERS DESCRIPTION BEGIN -->
Your parameters description goes here.
<!-- PARAMETERS DESCRIPTION END -->
<!-- RESULTS DESCRIPTION BEGIN -->
Your results description goes here.
<!-- RESULTS DESCRIPTION END -->
If you do not need all the descriptions, remove the unnecessary parts of
the text along with their <!-- ... BEGIN -->
and <!-- ... END -->
labels.
To format your descriptions, use Markdown - a lightweight markup language that allows you to create rich text by adding markup tags to plain text. In this way, you can markup headings, lists and tables, add links and so on. For more information on the version of Markdown used in pSeven Enterprise, visit the CommonMark website.
App URL parameters¶
Each published app has a unique URL: <sign-in URL>/appshub/.app/{app ID}/
,
where <sign-in URL>
is the pSeven Enterprise sign-in URL and {app ID}
is
a unique identifier assigned to an app upon publishing. A user signed in to
AppsHub can open an app directly by its URL.
If you link to an app from another web page or application, you can add a
query string to the app URL. The stock app UI recognizes query string
parameters as app arguments and automatically sets parameter values in the UI.
Parameter names in the query string are app (workflow) parameter names with
the added arg-
prefix. For example, if your app has a numeric parameter
named some value
and a string parameter named some label
, an URL like the
following sets them to 42
and case #N
respectively:
<sign-in URL>/appshub/.app/{app ID}/?arg-some%20value=42&arg-some%20label=case%20%23N
Note that parameter names and values must be URL-encoded as shown in the
example above, and the arg-
prefix is required in each parameter name.
How is the app URL different from the app API URL
The app URL described here is the URL that opens the app page with its end user interface. You can use query string parameters in the app URL to preset parameter values on the app page displayed to the user who follows that URL.
The app API URL referenced in the REST API guide section is the programming interface URL used to run an app and process its results. The app API URL exposes the app REST API endpoints and does not open the app UI.