# Reference: processes
# Block type ask
Allows you to request additional information during submission that is common for all files. The submit code can get this information like this:
const shared_state = await window.imshost.getProcessSharedState();
const vals = shared_state[bname] // bname - the name of the block that requested information
// vals - object with entered values
Options:
properties
- array of requested properties (see section Reference: form generation)rememberLast
- whether to remember the last entered values
Exits:
next
- data was enteredcancel
- user canceled input
# Block type attempt
Allows you to repeat the specified actions no more than N times.
Options:
num
- number of attemptsfailMessage
- error text if all attempts were used
Exits:
next
- attempts are not over yetfail
- attempts are already over
# Block type batch
Waits for other files until their number reaches the specified number
Options:
num
- the number of files to accumulate. If not set, expects all files
Exits:
next
- files accumulated
# Block type browserAuth
Allows you to authorize on the microstock website. First, an attempt is made to open the target page (targetPage
). If the page opens, then the block let files go through. If target page is not opened, login page will be opended (loginPage
) and browser window will become visible to the user to enter his data. After filling out the form, when user reaches target page (targetPage
) or his address matches the mask (targetPageMask
), the files are passed on
Options:
destination
- service name of the microstock to which the login form belongstargePage
- target page addresstargetPageMask
- target page address mask. A gap in the mask is marked with*
loginPage
- address of the login pageforceLogin
- iftrue
, then the browser will immediately open on the login page without trying to open the target
Exits:
next
- authorization successedcancel
- cancelled by user
# Block type browserSubmit
Activating the block opens the targetPage
target page in a hidden browser and calls the submitCode
code.
Options:
targePage
- target page addresssubmitCode
- code to be executed on the target pagedestination
- service name of the microstock within which the submission is madeconnection
- service name of the FTP connection used when uploading filesdictionaries
- a dictionary that is passed to thesubmitCode
codemarker
- status added after successful completion. Ifnull
no status will be added
Exits:
next
- submit completedunauthorized
- the user is not authorizednotfound
- file is not found on microstockfail
- file processing error
# Block type confirm
Allows to ask the user if he is sure want to do some action
Options:
message
- text of questionyesCaption
- change the text of the "Yes" buttonnoCaption
- change the text of the "No" buttonwithCancel
- show "Cancel" buttoncancelCaption
- change the text of the "Cancel" buttondanger
- flag that the action is potentially dangerous (the "Yes" button will be red)
Exits:
yes
- "Yes" is selectedno
- "No" is selectedcancel
- "Cancel" is selected
# Block type delay
Delay before executing the next block
Options:
delay
- delay in secondsrange
- delay spread in seconds (for different files there will be different delay times within +-range
)
Exits:
next
- delay time is elapsed
# Block type metadataFilter
Condition block. Allows you to perform different actions depending on the conditions specified by the filters
Options:
filter
- filter condition. Either string (single condition) or arrayfailMessage
- if set, then if the check fails, the specified error text will be assigned to the file. Either one line (general error for all conditions), or an array - different errors for different conditions (the first condition is the first error text, the second condition is the second error text, etc.)
Exits:
next
- the file matches all conditionsfail
- the file does not match at least one condition
# Block type runCommand
Allows to run specified IMS Studio command under files came to the block
Options:
command
- command namecommandParameter
- additional command parameter
Exits:
next
- command completedfail
- an error occurred while executing the command
# Block type upload
Upload files using the specified FTP connection.
Options:
connection
- FTP connection service nameskipAlreadyUploaded
- skip already uploaded (checking is by file status)
Exits:
next
- file uploaded successfullyfail
- an error occurred during uploadingreject
- the file does not meet the requirements of the FTP connectioncancel
- user canceled upload during login stage
# Block type uploadCheck
Checking if files have been uploaded to a given microstock. Checking is by file status
Options:
destination
- microstock service name
Exits:
next
- the file has not been uploaded yetskip
- the file is already uploaded