Classify By Tokens

 

<< Click to Display Table of Contents >>

Navigation:  Nodes > Tasks > Classifiers >

Classify By Tokens

 

 

Purpose

 

Given input files and a separator character to split the file name into meaningful tokens,  this node will classify the input files based on one of these methods:

 

- The number of tokens found in the filename.

 

- The token name, by comparing each token found with a list of possible tokens given in the outputList property..

 

Examples are given in the properties below.

 

Inputs

 

files: To connect a files to be classified. You can connect a Folder or a Watcher node, for example.

 

Outputs

 

Output List: A definable list. as per the properties below,

 

other: Input media files not matching any value from the Output List

 

 

Standard properties

 

Object Name

Color

Lock

 

Python standard properties

 

Code

NOTE: An introduction to all the Python tools in Mistika Workflows is available in the Python scripting tools section.

 

 

Node specific properties

 

separator: Character used to separate filename tokens.

 

 

outputList: Comma separated list of possible values to be used as classify outputs.

 

clasiffyMode:

 

Number of tokens:  Classify by the number of tokens found in the file name.  Example:  

 

Using the separator  "_" , an input file like TheWall_Berlin_025.mp4  will go trough the connector 3, because the filename has 3 tokens separated by that character (TheWall, Berlin, 025). Note that the .mp4 extension has its own token and it is not counted.  

 

In the same example, if the "3" value is not appearing in the outputList property then the file will be sent trough the other connector.

 

Token name:  Send each file trough the first output connector that is named  like one of the tokens found. The list of comparison values is defined in the outputList property as usual.

 

In the above example (an input file named TheWall_Berlin_025.mp4), if the outputList is Madrid, Berlin, Paris  then it will send the file trough the Berlin connector.

 

If the input file matches more than one token then it will be sent trough the first matching found (each file can only be sent trough one connector).

 

 

Error mode:  When no matching is found, this property defines what kind of error message will be sent to the error log (None, Info, Warning, Critical). This is mainly to facilitate user scripts parsing render log files later (or human monitoring). But note that this is just a log message, the case Critical will not stop the workflow execution because this node provides its own error control branches via the other connector (when the output connectors do not cover all the possible outcomes).

 

Developer reference (Python - ClassifyByTokens.[Property ID], API Rest - node/ClassifyByTokens/property/[Property ID])

 

Property Label

Property ID

Separator

separator

Output List

outputList

Classify Mode

classifyMode

Error Mode

errorMode