# 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 entered
  • cancel - user canceled input

# Block type attempt

Allows you to repeat the specified actions no more than N times.

Options:

  • num - number of attempts
  • failMessage - error text if all attempts were used

Exits:

  • next - attempts are not over yet
  • fail - 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 belongs
  • targePage - target page address
  • targetPageMask - target page address mask. A gap in the mask is marked with *
  • loginPage - address of the login page
  • forceLogin - if true, then the browser will immediately open on the login page without trying to open the target

Exits:

  • next - authorization successed
  • cancel - 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 address
  • submitCode - code to be executed on the target page
  • destination - service name of the microstock within which the submission is made
  • connection - service name of the FTP connection used when uploading files
  • dictionaries - a dictionary that is passed to the submitCode code
  • marker - status added after successful completion. If null no status will be added

Exits:

  • next - submit completed
  • unauthorized - the user is not authorized
  • notfound - file is not found on microstock
  • fail - file processing error

# Block type confirm

Allows to ask the user if he is sure want to do some action

Options:

  • message - text of question
  • yesCaption - change the text of the "Yes" button
  • noCaption - change the text of the "No" button
  • withCancel - show "Cancel" button
  • cancelCaption - change the text of the "Cancel" button
  • danger - flag that the action is potentially dangerous (the "Yes" button will be red)

Exits:

  • yes - "Yes" is selected
  • no - "No" is selected
  • cancel - "Cancel" is selected

# Block type delay

Delay before executing the next block

Options:

  • delay - delay in seconds
  • range - 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 array
  • failMessage - 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 conditions
  • fail - 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 name
  • commandParameter - additional command parameter

Exits:

  • next - command completed
  • fail - an error occurred while executing the command

# Block type upload

Upload files using the specified FTP connection.

Options:

  • connection - FTP connection service name
  • skipAlreadyUploaded - skip already uploaded (checking is by file status)

Exits:

  • next - file uploaded successfully
  • fail - an error occurred during uploading
  • reject - the file does not meet the requirements of the FTP connection
  • cancel - 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 yet
  • skip - the file is already uploaded