Search in sources :

Example 6 with ValueConverter

use of org.alfresco.repo.jscript.ValueConverter in project alfresco-repository by Alfresco.

the class JscriptWorkflowInstance method getPaths.

/**
 * Get all paths for the specified workflow instance
 */
public Scriptable getPaths() {
    WorkflowService workflowService = serviceRegistry.getWorkflowService();
    List<WorkflowPath> cmrPaths = workflowService.getWorkflowPaths(this.id);
    ArrayList<Serializable> paths = new ArrayList<Serializable>();
    for (WorkflowPath cmrPath : cmrPaths) {
        paths.add(new JscriptWorkflowPath(cmrPath, this.serviceRegistry, this.scope));
    }
    Scriptable pathsScriptable = (Scriptable) new ValueConverter().convertValueForScript(this.serviceRegistry, this.scope, null, paths);
    return pathsScriptable;
}
Also used : Serializable(java.io.Serializable) WorkflowService(org.alfresco.service.cmr.workflow.WorkflowService) ArrayList(java.util.ArrayList) WorkflowPath(org.alfresco.service.cmr.workflow.WorkflowPath) Scriptable(org.mozilla.javascript.Scriptable) ValueConverter(org.alfresco.repo.jscript.ValueConverter)

Aggregations

Serializable (java.io.Serializable)6 ArrayList (java.util.ArrayList)6 ValueConverter (org.alfresco.repo.jscript.ValueConverter)6 Scriptable (org.mozilla.javascript.Scriptable)6 WorkflowService (org.alfresco.service.cmr.workflow.WorkflowService)3 WorkflowTask (org.alfresco.service.cmr.workflow.WorkflowTask)3 WorkflowDefinition (org.alfresco.service.cmr.workflow.WorkflowDefinition)2 WorkflowPath (org.alfresco.service.cmr.workflow.WorkflowPath)1