var tasks = new Array();
var result = remote.call("/slingshot/dashlets/my-tasks");
var result2 = remote.call("/api/sites/" + page.url.templateArgs.site);
var site = eval('(' + result2 + ')').title;
var sitename = site.split('_')[1].split(' ')[0].replace(/\s+/g, '');
var data = eval('(' + result + ')');
if (data.tasks !== null)
{
for (var i=0,len = data.tasks.length;i<len;i++)
{
if(data.tasks[i].description.replace(/\s+/g, '')==sitename){
tasks.push(data.tasks[i]);
}
}
}
workflow.getDefinitionByName('nom de mon workflow')
Cela ne fonctionne pas ….
var list = new Array();
var name= url.templateArgs.name;
var selectedworkflow;
var tasks = new Array();;
var works = workflow.getDefinitionByName("jbpm$workflowname").getActiveInstances();
for each(single in works)
{
if(single.description == name){
selectedworkflow = single.getPaths();
for each(path in selectedworkflow){
tasks=path.getTasks();
for each(task in tasks){
list.push(task);
}
}
}
}
model.tasklist = list;
model.work = works;
model.name = name;
public Scriptable getAllTasks() {
WorkflowService workflowService = serviceRegistry.getWorkflowService();
WorkflowTaskQuery query = new WorkflowTaskQuery();
query.setActive(active);
query.setTaskState(null);
query.setProcessId(id);
ArrayList<Serializable> completedtasks = new ArrayList<Serializable>();
List<WorkflowTask> tasks = workflowService.queryTasks(query);
for (WorkflowTask task : tasks)
{
completedtasks.add(new JscriptWorkflowTask(task, this.serviceRegistry, this.scope));
}
Scriptable completedTasksScriptable =
(Scriptable)new ValueConverter().convertValueForScript(this.serviceRegistry, this.scope, null, completedtasks);
return completedTasksScriptable;
}
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.