Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A first example to show the possibilities with the simple batch processing extension for alfresco javascript execution. It has the only limitation that the processorfunction must have the name process
var batchName ='MyProcessor';
var numberOfThreads = 4;
var numberOfProcessedItems = 10;
var runAsSystem = true;
var processorFunction = function process(node){
var beforeProcessFunction = function beforeProcess(){
var afterProcessFunction = function afterProcess(){
// run for a lucene search query
var nodes = search.luceneSearch("TEXT: alfresco");
batch.runForNodes(batchName,numberOfThreads,numberOfProcessedItems,nodes, processorFunction, runAsSystem, beforeProcessFunction, afterProcessFunction);
// run for a lucene query
var luceneQuery = 'TEXT:alfresco';
batch.runForQuery(batchName,numberOfThreads,numberOfProcessedItems,luceneQuery, processorFunction, runAsSystem, null, null);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment