Package org.joget.workflow.model

Examples of org.joget.workflow.model.WorkflowAssignment


     * @return
     */
    @Override
    public PackageActivityForm viewAssignmentForm(String appId, String version, String activityId, FormData formData, String formUrl) {
        AppDefinition appDef = getAppDefinition(appId, version);
        WorkflowAssignment assignment = workflowManager.getAssignment(activityId);
        return viewAssignmentForm(appDef, assignment, formData, formUrl);
    }
View Full Code Here


        if (formData == null) {
            formData = new FormData();
        }

        // get assignment
        WorkflowAssignment assignment = workflowManager.getAssignment(activityId);
        String processId = assignment.getProcessId();
        String processDefId = assignment.getProcessDefId();
        String activityDefId = assignment.getActivityDefId();

        // accept assignment if necessary
        if (!assignment.isAccepted()) {
            workflowManager.assignmentAccept(activityId);
        }

        // get and submit mapped form
        PackageActivityForm paf = retrieveMappedForm(appId, version, processDefId, activityDefId);
View Full Code Here

        return "Executes standard Java syntax";
    }

    public Object execute(Map properties) {
        String script = (String) properties.get("script");
        WorkflowAssignment wfAssignment = (WorkflowAssignment) properties.get("workflowAssignment");

        Map<String, String> replaceMap = new HashMap<String, String>();
        replaceMap.put("\n", "\\\\n");

        script = WorkflowUtil.processVariable(script, "", wfAssignment, "", replaceMap);
View Full Code Here

        String temp[] = variableKey.split("\\.");
       
        String tableName = temp[0];
        String columnName = temp[1];
       
        WorkflowAssignment wfAssignment = (WorkflowAssignment) this.getProperty("workflowAssignment");
        if ((primaryKey != null && !primaryKey.isEmpty()) || wfAssignment != null) {
            try {
                if (tableName != null && tableName.length() != 0) {
                    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();
                        }
                    }

                    String cacheKey = tableName + "##" + primaryKey;
                    FormRow row = formDataCache.get(cacheKey);
View Full Code Here

public class WorkflowAssignmentHashVariable extends DefaultHashVariablePlugin {

    @Override
    public String processHashVariable(String variableKey) {
        WorkflowAssignment wfAssignment = (WorkflowAssignment) this.getProperty("workflowAssignment");
        if (wfAssignment != null) {
            char firstChar = variableKey.charAt(0);
            firstChar = Character.toUpperCase(firstChar);
            variableKey = firstChar + variableKey.substring(1, variableKey.length());
View Full Code Here

public class WorkflowVariableHashVariable extends DefaultHashVariablePlugin {

    @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

                props.put("username", username);
                props.put("password", password);
                ds = createDataSource(props);
            }
           
            WorkflowAssignment wfAssignment = (WorkflowAssignment) properties.get("workflowAssignment");

            Map<String, String> replace = new HashMap<String, String>();
            if (driver.equalsIgnoreCase("com.mysql.jdbc.Driver")) {
                replace.put("\\\\", "\\\\");
                replace.put("'", "\\'");
View Full Code Here

public class UserVariableHashVariable extends DefaultHashVariablePlugin {
    private Map<String, User> userCache = new HashMap<String, User>();
   
    @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 class PerformerHashVariable extends DefaultHashVariablePlugin {
    private Map<String, User> userCache = new HashMap<String, User>();
   
    @Override
    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

TOP

Related Classes of org.joget.workflow.model.WorkflowAssignment

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.