Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • predicate: If evaluated to true, a NewFilenamePunctuation will be created.TODO
  • filename: An expression that constructs the new filename. Return value will be interpreted as string.

Example

Code Block
#PARSER PQL
#ADDQUERY

/// Just a trigger, that fire every second
heart = TIMER({PERIOD = 1000, SOURCE = 'source'})
 
/// A counter to simulate   values
prep = MAP({
            	 expressions = [['counter()','count']],
            	 evaluateonpunctuation = true
 	},
 heart
 )       },
          heart
        )
        
prep2 = MAP({
    expressions = ['count',['
 
/// Create a new punctuation each time count is higher than 0 and count MOD 10 is 0
/// Create filename from count-Attribute (important: use full path!)
punc = CreateNewFilenamePunctuation({
 	  filename = '"${WORKSPACEPROJECT}/out/"+toString(count)+".csv"','filename']],
    evaluateonpunctuation = true
  },
  prep
)
        
        
punc = CREATENEWFILENAMEPUNCTUATION({
            filenameattribute = 'filename',
            	  predicate = 'count % 10 = 0',
 && count > 0'
 	},
 prep
 )
 
/// File sink automatically suppressfilenameinoutputreacts =on true
new punctuation and replaces the filename with the   },
          prep2
        )
        
outone
/// generated from CreateNewFilenamePunctuation, a new filename will only be used, if the 
/// filename differs from last filename!
 out = CSVFILESINK({FILENAME = '${WORKSPACEPROJECT}/out/ignore0.csv', SINK = 'sink'}, punc)