Package org.joget.workflow.model.service

Examples of org.joget.workflow.model.service.WorkflowManager


                    ApplicationContext appContext = AppUtil.getApplicationContext();
                    FormDataDao formDataDao = (FormDataDao) appContext.getBean("formDataDao");

                    if (primaryKey == null && wfAssignment != null) {

                        WorkflowManager workflowManager = (WorkflowManager) appContext.getBean("workflowManager");
                        WorkflowProcessLink link = workflowManager.getWorkflowProcessLink(wfAssignment.getProcessId());

                        if (link != null) {
                            primaryKey = link.getOriginProcessId();
                        } else if (primaryKey == null) {
                            primaryKey = wfAssignment.getProcessId();
View Full Code Here


    @Override
    public String processHashVariable(String variableKey) {
        WorkflowAssignment wfAssignment = (WorkflowAssignment) this.getProperty("workflowAssignment");
        if (wfAssignment != null) {
            ApplicationContext appContext = AppUtil.getApplicationContext();
            WorkflowManager workflowManager = (WorkflowManager) appContext.getBean("workflowManager");

            String varVal = workflowManager.getProcessVariable(wfAssignment.getProcessId(), variableKey);
            if (varVal != null) {
                return varVal;
            }
        }
        return null;
View Full Code Here

    @Override
    public String processHashVariable(String variableKey) {
        WorkflowAssignment wfAssignment = (WorkflowAssignment) this.getProperty("workflowAssignment");
        if (wfAssignment != null) {
            ApplicationContext appContext = AppUtil.getApplicationContext();
            WorkflowManager workflowManager = (WorkflowManager) appContext.getBean("workflowManager");

            String variable = variableKey.substring(0, variableKey.indexOf("."));
            String varVal = workflowManager.getProcessVariable(wfAssignment.getProcessId(), variable);
            if (varVal != null) {
                String attribute = variableKey.substring(variableKey.indexOf(".") + 1);
                return getUserAttribute(varVal, attribute);
            }
        }
View Full Code Here

            }
        }
        if (json != null && json.trim().length() > 0) {
            if (parentFormData != null && parentFormData.getProcessId() != null && !parentFormData.getProcessId().isEmpty()) {
                formData.setProcessId(parentFormData.getProcessId());
                WorkflowManager wm = (WorkflowManager) AppUtil.getApplicationContext().getBean("workflowManager");
                WorkflowAssignment wfAssignment = wm.getAssignmentByProcess(parentFormData.getProcessId());
                json = AppUtil.processHashVariable(json, wfAssignment, StringUtil.TYPE_JSON, null);
            }
           
            // use the json definition to create the subform
            try {
View Full Code Here

    public String processHashVariable(String variableKey) {
        WorkflowAssignment wfAssignment = (WorkflowAssignment) this.getProperty("workflowAssignment");
        if (wfAssignment != null) {
            try {
                ApplicationContext appContext = AppUtil.getApplicationContext();
                WorkflowManager workflowManager = (WorkflowManager) appContext.getBean("workflowManager");

                String username = workflowManager.getUserByProcessIdAndActivityDefId(wfAssignment.getProcessDefId(), wfAssignment.getProcessId(), variableKey.substring(0, variableKey.indexOf(".")));

                if (username != null && username.trim().length() > 0) {

                    String attribute = variableKey.substring(variableKey.indexOf(".") + 1);
                    String returnResult = getUserAttribute(username, attribute);
View Full Code Here

        ApplicationContext appContext = AppUtil.getApplicationContext();
        PluginManager pluginManager = (PluginManager) appContext.getBean("pluginManager");
        AppDefinition appDef = null;
       
        if (assignment != null) {
            WorkflowManager workflowManager = (WorkflowManager) appContext.getBean("workflowManager");
            PackageDefinitionDao packageDefinitionDao = (PackageDefinitionDao) appContext.getBean("packageDefinitionDao");
           
            String processDefId = assignment.getProcessDefId();
            WorkflowProcess process = workflowManager.getProcess(processDefId);
            if (process != null) {
                String packageId = process.getPackageId();
                Long packageVersion = Long.parseLong(process.getVersion());
                PackageDefinition packageDef = packageDefinitionDao.loadPackageDefinition(packageId, packageVersion);
                if (packageDef != null) {
View Full Code Here

    protected List<String> getParticipantsByRequester(PackageParticipant participant, String processDefId, String processId, String requesterUsername) {
        List<String> resultList = new ArrayList<String>();
        ApplicationContext appContext = AppUtil.getApplicationContext();
        DirectoryManager directoryManager = (DirectoryManager) appContext.getBean("directoryManager");
        if (participant.getValue() != null && participant.getValue().trim().length() > 0) {
            WorkflowManager workflowManager = (WorkflowManager) appContext.getBean("workflowManager");
            String activityDefId = participant.getValue();
            requesterUsername = workflowManager.getUserByProcessIdAndActivityDefId(processDefId, processId, activityDefId);
        }
        if (requesterUsername != null && requesterUsername.trim().length() > 0) {
            User user = directoryManager.getUserByUsername(requesterUsername);
            if (user != null && user.getActive() == User.ACTIVE) {
                resultList.add(user.getUsername());
View Full Code Here

    protected List<String> getParticipantsByRequesterHod(PackageParticipant participant, String processDefId, String processId, String requesterUsername) {
        List<String> resultList = new ArrayList<String>();
        ApplicationContext appContext = AppUtil.getApplicationContext();
        DirectoryManager directoryManager = (DirectoryManager) appContext.getBean("directoryManager");
        if (participant.getValue() != null && participant.getValue().trim().length() > 0) {
            WorkflowManager workflowManager = (WorkflowManager) appContext.getBean("workflowManager");
            requesterUsername = workflowManager.getUserByProcessIdAndActivityDefId(processDefId, processId, participant.getValue());
        }
        Collection<User> users = directoryManager.getUserHod(requesterUsername);
        for (User user : users) {
            if (user != null && user.getActive() == User.ACTIVE) {
                resultList.add(user.getUsername());
View Full Code Here

    protected List<String> getParticipantsByRequesterHodIgnoreReportTo(PackageParticipant participant, String processDefId, String processId, String requesterUsername) {
        List<String> resultList = new ArrayList<String>();
        ApplicationContext appContext = AppUtil.getApplicationContext();
        DirectoryManager directoryManager = (DirectoryManager) appContext.getBean("directoryManager");
        if (participant.getValue() != null && participant.getValue().trim().length() > 0) {
            WorkflowManager workflowManager = (WorkflowManager) appContext.getBean("workflowManager");
            requesterUsername = workflowManager.getUserByProcessIdAndActivityDefId(processDefId, processId, participant.getValue());
        }
       
        User requester = directoryManager.getUserByUsername(requesterUsername);
        if (requester != null && requester.getEmployments() != null && !requester.getEmployments().isEmpty()) {
            Employment employment = (Employment) requester.getEmployments().iterator().next();
View Full Code Here

     */
    protected List<String> getParticipantsByRequesterSubordinates(PackageParticipant participant, String processDefId, String processId, String requesterUsername) {
        List<String> resultList = new ArrayList<String>();
        ApplicationContext appContext = AppUtil.getApplicationContext();
        if (participant.getValue() != null && participant.getValue().trim().length() > 0) {
            WorkflowManager workflowManager = (WorkflowManager) appContext.getBean("workflowManager");
            requesterUsername = workflowManager.getUserByProcessIdAndActivityDefId(processDefId, processId, participant.getValue());
        }
        DirectoryManager directoryManager = (DirectoryManager) appContext.getBean("directoryManager");
        Collection<User> users = directoryManager.getUserSubordinate(requesterUsername);
        for (User user : users) {
            if (user != null && user.getActive() == User.ACTIVE) {
View Full Code Here

TOP

Related Classes of org.joget.workflow.model.service.WorkflowManager

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.