How to use a field using the user suggestion widget ?
I have a field called reviewers (multi valued string) it is populated thanks to the user suggestion widget i d like to use its content for a setACE operation in a chain but i get a casting error :
No type adapter found for input: class [Ljava.lang.String; and output class java.lang.String
I already made it, but can't remember how :-(
So if you are on 5.4.2, you have 2 solutions :
- Upgrade your Nuxeo to 5.6 :D
- Or if you have some development skills create your operation with Nuxeo IDE.
With Nuxeo IDE it will be really quick to do that :
I let you look the Nuxeo IDE installation documentation : http://doc.nuxeo.com/x/ZYKE
Then you create a new Nuxeo Plugin Project (click on the yellow button > new Nuxeo Plugin name it > next > next )
Create a new Operation (click on the yellow button > new Operation > name it > Next > Next )
And finally you fill the operation :
@Operation(id = YourOpertion.ID, category = Constants.CAT_SUBCHAIN_EXECUTION, label = “Run For Each”, description = ““) public class YourOpertion {
public static final String ID = "YourOpertion"; @Context protected OperationContext ctx; @Context protected AutomationService service; @Param(name = "id") protected String chainId; @Param(name = "list") protected String listName; @Param(name = "item", required = false, values = "item") protected String itemName = "item"; @Param(name = "isolate", required = false, values = "true") protected boolean isolate = true; @OperationMethod public void run() throws Exception { Map<String, Object> vars = isolate ? new HashMap<String, Object>( ctx.getVars()) : ctx.getVars(); OperationContext subctx = new OperationContext(ctx.getCoreSession(), vars); subctx.setInput(ctx.getInput()); for (Object value : (Collection<?>) ctx.get(listName)) { subctx.put(itemName, value); service.run(subctx, chainId); } }
}