Package org.jahia.services.workflow

Examples of org.jahia.services.workflow.WorkflowDefinition


        Map<PublicationWorkflow, WorkflowDefinition> result = new LinkedHashMap<PublicationWorkflow, WorkflowDefinition>();

        Map<String,WorkflowDefinition> workflows = new HashMap<String,WorkflowDefinition>();
        for (String wf : keys) {
            WorkflowDefinition w = workflowService.getWorkflowDefinition(StringUtils.substringBefore(wf,":"), StringUtils.substringAfter(wf,":"),null);
            workflows.put(wf, w);
        }

        for (Map.Entry<String, List<GWTJahiaPublicationInfo>> entry : infosListByWorflowGroup.entrySet()) {
            result.put(new PublicationWorkflow(entry.getValue()),workflows.get(workflowGroupToKey.get(entry.getKey())));
View Full Code Here


        String workspace = (String) execution.getVariable("workspace");
        String userKey = (String) execution.getVariable("user");

        // try to get some user who did an action on the workflow for the last time
        try {
            WorkflowDefinition def = (WorkflowDefinition) execution.getVariable("workflow");
            List<HistoryWorkflowTask> list = WorkflowService.getInstance().getHistoryWorkflowTasks(((ExecutionImpl) execution).getProcessInstance().getId(), def.getProvider(), Locale.getDefault());
            if (list.size() > 0) {
                userKey = list.get(list.size()-1).getUser();
            }
        } catch (Exception e) {
            logger.error("Cannot get last user on the workflow",e);
View Full Code Here

    public List<User> findUsersById(String... strings) {
        SortedSet<User> emails = new TreeSet<User>();
        try {
            ExecutionImpl execution = ((ExecutionContext)EnvironmentImpl.getCurrent().getContext("execution")).getExecution();
            WorkflowDefinition def = (WorkflowDefinition) execution.getVariable("workflow");
            String id = (String) execution.getVariable("nodeId");
            for (String userId : strings) {
                if (userId.equals("previousTaskAssignable")) {
                    JCRNodeWrapper node = JCRSessionFactory.getInstance().getCurrentUserSession().getNodeByUUID(id);
                    List<JahiaPrincipal> principals = WorkflowService.getInstance().getAssignedRole(node, def,
View Full Code Here

    /**
     * sets the actorId and candidates for the given task.
     */
    public void assign(Assignable assignable, OpenExecution execution) throws Exception {

        WorkflowDefinition def = (WorkflowDefinition) execution.getVariable("workflow");
        String id = (String) execution.getVariable("nodeId");
        JCRNodeWrapper node = JCRSessionFactory.getInstance().getCurrentUserSession().getNodeByUUID(id);
        String name = null;
        if (assignable instanceof TaskImpl) {
            name = ((TaskImpl)assignable).getActivityName();
View Full Code Here

        }
    }

    private SortedSet<String> getAssignables(ExecutionImpl exe, String s) throws RepositoryException {
        SortedSet<String> emails = new TreeSet<String>();
        WorkflowDefinition def = (WorkflowDefinition) exe.getVariable("workflow");
        String id = (String) exe.getVariable("nodeId");
        JCRNodeWrapper node = JCRSessionFactory.getInstance().getCurrentUserSession().getNodeByUUID(id);
        List<JahiaPrincipal> principals = WorkflowService.getInstance().getAssignedRole(node, def,
                exe.getActivity().getDefaultOutgoingTransition().getDestination().getName(), exe.getProcessInstance().getId());
        for (JahiaPrincipal principal : principals) {
View Full Code Here

TOP

Related Classes of org.jahia.services.workflow.WorkflowDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.