09-10-2012 12:48 PM
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 😞
09-11-2012 06:05 AM
So if you are on 5.4.2, you have 2 solutions :
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);
}
}
}
09-11-2012 03:52 AM
Did you try the run for each operation with a sub operation.
09-11-2012 04:37 AM
unforunately, i'm running a 5.4.2 project and the the "run for each " operation seems to be 5.5
09-11-2012 06:05 AM
So if you are on 5.4.2, you have 2 solutions :
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);
}
}
}
09-11-2012 06:42 AM
That's what i was about to do.
09-11-2012 07:33 AM
Backporting new feature is bad...
09-11-2012 07:36 AM
Feel free to contribute an addon on github for missing operations
09-12-2012 07:16 AM
Create a new Question please...
Attention: Blogs & Forums are in READ-ONLY mode from Oct 9-19 as we transition to our new platform. Learn more.
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.