jgoldhammer/alfresco-jscript-extensions

Batch: Simpler method signature?

flox1an opened this issue · 2 comments

I think it would be good to be able to run simply:

batch.runForNodes(nodes, processorFunction) or
batch.runForQuery(query, processorFunction) 

and having batchName, numberOfThreads, numberOfProcessedItems using defaults.

Is it possible to have a syntax like this?:

batch.runForNodes({
  batchName : "someName",
  numberOfThreads : 4,
  numberOfProcessedItems : 10,
  nodes : someNodesArray, 
  processorFunction : function() {...}, 
  runAsSystem : true
});

For the syntactic sugar version, I recommend https://github.com/ciber/alfresco-js-batch-executer. I will ask him to join my project here to publish it as one extension instead of two...

I have integrated the project into this project.