operation chains in Nuxeo IDE
i was wandering if there is a mechanism like operation chains that can be used directly in java.
What i would like to do is not to call an existing operation chain from java but rather call a series of operations, like in a chain, directly in java.
This would give me the possibility to have various operations defined in java and assemble chains in java in a dynamic way, based on various conditions.
This code enables you to run un single operation.
CoreSession session = getCoreSession(); Map<String, Object> params = getParams(); AutomationService as = Framework.getLocalService(AutomationService.class); OperationContext ctx = new OperationContext(session); service.run(ctx, "anOperationId" , params);
thanks for your answer Damien two quick questions
- what if I am expecting an output from the operation call, can i get it through service.run?
- where dose the service.run come from? Is is from AutomationService?
if you know what type you operation sends in result you can do for instance DocumentModel doc = (DocumentModel) as.run(….)
yes, it's a bad copy/paste. Replace service with "as" in this code