Bonjour,J'ai créé un Workflow dans lequel je peux séléctionner des utilisateurs. Comment puis-je récupérer cette liste pour l'exploiter dans un programme Java. J'ai essayé d'analyser la class ForEachFork qui récupère déjà ce type d'information grâce aux balises suivantes : <foreach> et </foreach> et la variable #{lwf_reviewAssignees}<action class="org.alfresco.repo.workflow.jbpm.ForEachFork">
<foreach>#{lwf_reviewAssignees}</foreach>
<var>reviewer</var>
</action>mais au final j'obtiens ceci[Node Type: {http://www.alfresco.org/model/content/1.0}person, Node Aspects: [{http://www.alfresco.org/model/system/1.0}referenceable, {http://www.alfresco.org/model/application/1.0}configurable, {http://www.alfresco.org/model/content/1.0}ownable]]grâce au code suivant : if (foreach != null) {
List forEachColl = null;
String forEachCollStr = foreach.getTextTrim();
System.out.println("DEBUG FOREACH COLLSTR : " + forEachCollStr);
if (forEachCollStr != null)
{
if (forEachCollStr.startsWith("#{"))
{
String expression = forEachCollStr.substring(2, forEachCollStr.length() -1);
Object eval = AlfrescoJavaScript.executeScript(executionContext, services, expression, null);
System.out.println("DEBUG EVAL : " + eval);
if (eval == null)
{
throw new WorkflowException("forEach expression '" + forEachCollStr + "' evaluates to null");
}
// expression evaluates to string
if (eval instanceof String)
{
String[] forEachStrs = ((String)eval).trim().split(",");
System.out.println("DEBUG FOREACH STR : " + forEachStrs);
forEachColl = new ArrayList(forEachStrs.length);
for (String forEachStr : forEachStrs)
{
forEachColl.add(forEachStr);
System.out.println("DEBUG FOREACH : " + forEachStr);
}
}
// expression evaluates to Node array
else if (eval instanceof Serializable[])
{
Serializable[] nodes = (Serializable[])eval;
System.out.println("DEBUG NODES : " + nodes);
forEachColl = new ArrayList(nodes.length);
for (Serializable node : nodes)
{
System.out.println("DEBUG NODE : " + node);
if (node instanceof NodeRef)
{
forEachColl.add(new JBPMNode((NodeRef)node, services));
}
}
}
// expression evaluates to collection
else if (eval instanceof Collection)
{
forEachColl = (List)eval;
System.out.println("DEBUG forEachColl : " + forEachColl);
}
}
}
else
{
forEachColl = (List)FieldInstantiator.getValue(List.class, foreach);
System.out.println("DEBUG FOREACHCOLL : " + forEachColl);
}Comment puis-je utiliser ce résultat, pour pouvoir positionner les permissions de lecture en fonction du résultat retourné par cette liste.