Process Framework package guide
Read configuration, prepare folders, and write HTML logs with optional desktop captures.
Version 2.17.1. Installed versions can differ. Examples are illustrative and not tested.
Prerequisites
- Use a Windows Device with this package and the Windows Desktop runtime. The account must read the configuration files and write to the folders.
- Screenshots and video need a signed-in, unlocked desktop. Video also writes to the account's local application data folder.
- A logger session lasts one Run. Start it, write messages, and stop it at the end.
- Use full paths, such as
C:\AutomationSamples\config.json. A relative path starts in the Run's working folder. - Log rows show the Device and account names, your message and your values. Do not log passwords or other secrets.
Shared fields
| Input | Type; default; requirement | Use |
|---|---|---|
input | Inputdefault FILEoptional | FILE reads a file. TEXT reads the text in the step. Only the selected source is read. |
charset | Stringdefault UTF-8optional | The file encoding, such as UTF-8 or windows-1252. Blank means UTF-8. An unknown name fails. Not used for TEXT. |
is | Booleandefault falseoptional | true removes spaces at the start and end of each value. Keys do not change. |
session | Stringdefault Loggeroptional | The logger session name. Use Logger, or one custom name such as Invoice, in start, message and stop. |
Actions
Read JSON (configReadJson)
Read JSON into a Dictionary of text. Nested names join with dots (app.name), and list items use numbers from 0 (tags[0]). Empty objects and lists add nothing.
Inputs
| Input | Type; default; requirement | Use |
|---|---|---|
json | Stringdefault emptyrequired for FILE | A .json file, such as C:\Automation. |
json | Stringdefault emptyrequired for TEXT | A JSON object or list. A single value, bad JSON or empty text fails. |
parsing | Jsondefault ALLoptional | ALL reads everything. SPECIFIC reads only the part named in json, with keys that start from that part. A single value gets an empty key. |
json | Listdefault emptyoptional | For SPECIFIC: exact names, such as ["app",. List numbers and dots do not work here. A missing name fails. |
Uses the shared fields: inputMethod, charsetName, isTrimValues.
Outputs
| Output | Type | Meaning |
|---|---|---|
config | Dictionary | Text values. Numbers, Booleans and null become text. Save it in settings, then read $settings.app.name$. |
Example
Set inputMethod=TEXT, jsonText={"app":{"name":"demo","port":8080},"tags":["one","two"]}, parsingMethod=ALL and isTrimValues=false. Save config in the Dictionary settings. To read one part, set parsingMethod=SPECIFIC and jsonPathSegments=["app"].
Expected result
ALL gives app.name="demo", app.port="8080", tags[0]="one" and tags[1]="two". SPECIFIC gives name="demo" and port="8080". Bad JSON, a missing name or an unreadable file fails the step.
Read XML (configReadXml)
Read selected XML elements into a Dictionary of text. An attribute can give repeated elements their own keys.
Inputs
| Input | Type; default; requirement | Use |
|---|---|---|
xml | Stringdefault emptyrequired for FILE | An XML file with any extension, such as C:\Automation. |
xml | Stringdefault emptyrequired for TEXT | Valid XML. XML with a <!DOCTYPE> is refused. |
x | Stringdefault emptyrequired | The XPath to the elements, such as /. Namespace prefixes are not supported. |
dictionary | Xmldefault TAG_optional | TAG_: the element name. TAG_: the attribute named in dictionary. Empty keys are skipped. A repeated key keeps the last value. |
dictionary | Stringdefault emptyrequired for TAG_ | An attribute name without a prefix, such as name. |
dictionary | Xmldefault TAG_optional | TAG_: the element text. TAG_: the attribute named in dictionary. A missing attribute gives empty text. |
dictionary | Stringdefault emptyrequired for TAG_ | An attribute name without a prefix, such as value. |
Uses the shared fields: inputMethod, charsetName, isTrimValues.
Outputs
| Output | Type | Meaning |
|---|---|---|
config | Dictionary | The selected keys with text values. Save it in settings, then read $settings.host$. |
Example
Set inputMethod=TEXT, xmlText=<config><item name="host" value="api.example.com"/><item name="mode" value="test"/></config>, xPathToNodes=/config/item, dictionaryKeys=TAG_ATTRIBUTE, dictionaryKeysAttributeName=name, dictionaryValues=TAG_ATTRIBUTE_VALUE and dictionaryValuesAttributeName=value. Save config in settings.
Expected result
The Dictionary holds host="api.example.com" and mode="test". An XPath that finds nothing gives an empty Dictionary. Bad XML or XPath, a <!DOCTYPE> or a missing attribute name fails the step.
Clean directory (deviceCleanDirectory)
Delete old files and folders inside a folder. Deleted items do not go to the Recycle Bin. A folder that holds a kept item is also kept.
Inputs
| Input | Type; default; requirement | Use |
|---|---|---|
input | Stringdefault emptyrequired | A folder such as C:\Automation. Its contents can be deleted, but the folder stays. |
select | Selectdefault ALLoptional | ALL deletes old files and folders. FILE deletes only old files and keeps the folders. |
recursive | Booleandefault trueoptional | true includes subfolders. false checks only the folder's own files and keeps all subfolders. Folder links are not followed. |
threshold | Numberdefault 30optional | The minimum age, 0 or more. 30 with DAY deletes items 30 days old or older. 0 deletes everything in scope. |
threshold | Thresholddefault DAYoptional | DAY, HOUR, MINUTE or SECOND, counted from the current UTC time. |
threshold | Thresholddefault MODIFICATIONoptional | CREATION time or MODIFICATION (last change) time, checked for each item. |
skip | Stringdefault emptyoptional | A case-sensitive regular expression that must match the full folder path. .*[\\/]archive keeps archive folders and their contents. Blank keeps none. |
skip | Stringdefault emptyoptional | A case-sensitive regular expression that must match the full file path. .*\.txt keeps text files and their folders. A bad pattern, or one that runs longer than five seconds, fails. |
unable | Unabledefault IGNOREoptional | IGNORE skips items it cannot delete. THROW fails. Neither one restores deleted items. |
Outputs
No output variables.
Example
Make a test folder C:\AutomationSamples\cleanup with old.log changed 40 days ago, recent.log changed yesterday and keep.txt changed 40 days ago. Set inputFolderPath to that folder, selectMethod=FILE, recursive=true, thresholdNumber=30, thresholdUnit=DAY, thresholdCriteria=MODIFICATION, skipFilePathPattern=.*\.txt and unableToDeleteBehavior=THROW.
Expected result
old.log is deleted. recent.log, keep.txt and the folder stay. A missing folder, a negative age or a bad pattern fails. With IGNORE, items that cannot be deleted stay and no error shows.
Close applications (deviceCloseApplications)
Close every running copy of the named programs. The step asks them to close, waits up to 30 seconds, then forces the rest and their child processes closed. Unsaved work can be lost.
Inputs
| Input | Type; default; requirement | Use |
|---|---|---|
kill | Listdefault emptyrequired | Program names, such as ["Sample. Case, folder and extension are ignored. |
Outputs
No output variables.
Example
Start a test application named SampleEditor.exe and save its work. Set killTaskList=["SampleEditor.exe"]. Do not name the application that runs the automation.
Expected result
The matching programs close. If none runs, nothing changes. An empty List fails. Access errors are ignored, so a protected program can stay open.
Create folders (deviceCreateFolders)
Create working folders and get their full paths by name. Overwrite empties folders that already exist.
Inputs
| Input | Type; default; requirement | Use |
|---|---|---|
path | Pathdefault RELATIVEoptional | RELATIVE adds each entry to base. ABSOLUTE resolves each entry to a full path. |
base | Stringdefault emptyrequired for RELATIVE | Such as C:\Automation. An entry such as ..\other can still go outside it. |
folder | Listdefault emptyrequired | Folders such as ["input",. Missing parents are created. The output key uses the last folder name, so equal last names share one key. |
overwrite | Booleandefault falseoptional | false keeps the contents. true deletes all contents of each folder that exists. Use test folders. |
prefix | Stringdefault emptyoptional | Text before each output key, such as cfg_. Folder names do not change. |
suffix | Stringdefault _optional | Text after each output key. With _, the folder input gets the key input_. |
Outputs
| Output | Type | Meaning |
|---|---|---|
folders | Dictionary | Full paths, with the key prefix + last folder name + suffix. Save it in paths, then read $paths.cfg_. |
Example
Set pathType=RELATIVE, baseFolderPath=C:\AutomationSamples, folderPaths=["input","work/pending"], overwriteExisting=false, prefix=cfg_ and suffix=_Path. Save folders in paths.
Expected result
Both folders exist. cfg_input_Path is C:\AutomationSamples\input and cfg_pending_Path is C:\AutomationSamples\work\pending. Existing contents stay. A bad path or a denied write fails, and folders made before the failure stay.
Log message (logMessage)
Add a row to an open HTML log. The row can link variable cards, a desktop screenshot and a video clip.
Inputs
| Input | Type; default; requirement | Use |
|---|---|---|
log | Logdefault INFOoptional | INFO, WARN or ERROR. The session settings give each level its file and video rule. |
log | Stringdefault emptyrequired | The message, such as Invoice INV-9 accepted. HTML in it shows as text. |
capture | Booleandefault falseoptional | true saves a PNG of the whole desktop, all screens. |
variables | Dictionarydefault emptyoptional | Values shown as text cards on a linked page, such as {"invoice":"INV-9",. Empty makes no page. Credential values are hidden, but a secret in a plain String shows. |
Uses the shared fields: sessionName.
Outputs
| Output | Type | Meaning |
|---|---|---|
screenshot | String | The PNG path when capture. Otherwise empty, also when the row has a video clip. |
Example
Start InvoiceLog with logsStartSession, logFilePath=C:\AutomationSamples\logs\run.html and no video. Set sessionName=InvoiceLog, logLevel=INFO, logMessage=Invoice INV-9 accepted, captureScreenshot=false and variables={"invoice":"INV-9","attempt":"2"}. Save screenshotPath in shot.
Expected result
An INFO row shows the message and links two variable cards. shot is empty. With captureScreenshot=true, it holds the PNG path. The step fails if the session is not started or the message is empty. A screenshot or write error can also fail it. If a video clip cannot be made, the row has no clip.
Start logger session (logsStartSession)
Open an HTML log, with screenshots, variables and clips folders beside it. An open session with the same name is closed first.
Inputs
| Input | Type; default; requirement | Use |
|---|---|---|
log | Logdefault COMMON_optional | COMMON_: one file, log, for all levels. CONFIGURABLE_: one file per level. Only the selected paths are checked. |
log | Stringdefault emptyrequired for COMMON_ | A writable .html file, such as C:\Automation. Later sessions add rows to it. |
info | Stringdefault emptyrequired for CONFIGURABLE_ | The INFO .html file, such as C:\Automation. The clips folder goes beside it. |
warn | Stringdefault emptyrequired for CONFIGURABLE_ | The WARN .html file. For video, put it in the INFO file's folder so clip links work. |
error | Stringdefault emptyrequired for CONFIGURABLE_ | The ERROR .html file. For video, put it in the INFO file's folder so clip links work. |
max | Numberdefault 1000optional | Rows per file, more than 0, counted across sessions. A full file is renamed 1_ (older ones move to 2_ and on) and a new file starts. Old files are not deleted. |
capture | Screendefault NO_optional | NO_ or VIDEO_. Only VIDEO_ uses video and video. It records the desktop all the time while a video is true. If recording cannot start, logging goes on without video. |
video | Booleandefault falseoptional | true adds a video clip to INFO rows. |
video | Booleandefault falseoptional | true adds a video clip to WARN rows. |
video | Booleandefault trueoptional | true adds a video clip to ERROR rows. |
video | Numberdefault 30optional | Seconds of video before each row, 5 to 90. A clip can be shorter. |
encoding | Encodingdefault FASToptional | Video only. FAST makes clips quickly. COMPACT is slower and makes smaller files. Clips are made in the background. |
Uses the shared fields: sessionName.
Outputs
No output variables.
Example
Set sessionName=InvoiceLog, logLevelsAndFileOption=COMMON_FILE, logFilePath=C:\AutomationSamples\logs\run.html, maxLogEntries=2 and captureScreenRecording=NO_VIDEO. Write three messages in this session, then stop it. For video on a test desktop, choose VIDEO_ENABLED, videoOnError=true, videoBufferSeconds=5 and encodingMode=FAST.
Expected result
The log page and its folders exist. With a new file and three messages, 1_run.html holds rows 1 and 2, and run.html holds row 3. A path that is not .html, a row limit under 1 or a buffer outside 5 to 90 seconds fails. A failed video start does not fail the step.
Stop logger session (logsStopSession)
Close the log pages, wait for video clips, and end the session.
Inputs
Uses the shared fields: sessionName.
Outputs
No output variables.
Example
After you write messages with sessionName=InvoiceLog, run this action with sessionName=InvoiceLog. A second stop with the same name is allowed.
Expected result
The log pages get their footer and the session ends. The step waits up to five minutes for clips, and clips not finished by then can be missing. Later messages need a new start. Stopping a session that is not open does nothing.