Package org.joget.workflow.model

Examples of org.joget.workflow.model.WorkflowActivity


            processId = result.getProcess().getInstanceId();
            Collection<WorkflowActivity> activityList = result.getActivities();
            assertTrue(activityList != null && activityList.size() == 1);

            // get first activity form
            WorkflowActivity firstActivity = activityList.iterator().next();
            String firstActivityId = firstActivity.getId();
            PackageActivityForm firstForm = appService.viewAssignmentForm(TEST_APP_ID, TEST_APP_VERSION.toString(), firstActivityId, null, null);
            assertTrue(TEST_FORM_ID_1.equals(firstForm.getFormId()));

            // complete first task
            FormData formResult = appService.completeAssignmentForm(TEST_APP_ID, TEST_APP_VERSION.toString(), firstActivityId, null, null);
View Full Code Here


                            List<String> userList = new ArrayList<String>();
                            String activityInstanceId = auditTrail.getMessage();
                           
                            int maxAttempt = 5;
                            int numOfAttempt = 0;
                            WorkflowActivity wfActivity = null;
                            while (userList != null && userList.isEmpty() && numOfAttempt < maxAttempt) {
                                //LogUtil.info(getClass().getName(), "Attempting to get resource ids....");
                                Thread.sleep(4000);
                                wfActivity = workflowManager.getActivityById(activityInstanceId);
                                userList = workflowManager.getAssignmentResourceIds(wfActivity.getProcessDefId(), wfActivity.getProcessId(), activityInstanceId);
                                numOfAttempt++;
                            }

                            Collection<String> exclusionIds = new ArrayList<String>();
                            if (exclusion != null && !exclusion.isEmpty()) {
                                exclusionIds.addAll(Arrays.asList(exclusion.split(";")));
                            }
                           
                            if (!exclusionIds.contains(WorkflowUtil.getProcessDefIdWithoutVersion(wfActivity.getProcessDefId()) + "-" + wfActivity.getActivityDefId())) {
                                LogUtil.info(UserNotificationAuditTrail.class.getName(), "Users to notify: " + userList);
                                if (userList != null) {
                                    for (String username : userList) {
                                        workflowUserManager.setCurrentThreadUser(username);
                                        WorkflowAssignment wfAssignment = workflowManager.getAssignment(activityInstanceId);
View Full Code Here

            if (validation(auditTrail)) {
                WorkflowManager workflowManager = (WorkflowManager) AppUtil.getApplicationContext().getBean("workflowManager");
                WorkflowProcess process = null;
                WorkflowProcess trackProcess = null;
                WorkflowActivity activity = null;
                WorkflowActivity trackActivity = null;

                if (auditTrail.getMethod().startsWith("process")) {
                    process = workflowManager.getRunningProcessById(auditTrail.getMessage());
                    trackProcess = workflowManager.getRunningProcessInfo(auditTrail.getMessage());
                } else {
                    activity = workflowManager.getActivityById(auditTrail.getMessage());
                    trackActivity = workflowManager.getRunningActivityInfo(auditTrail.getMessage());
                    process = workflowManager.getRunningProcessById(activity.getProcessId());
                    trackProcess = workflowManager.getRunningProcessInfo(activity.getProcessId());
                }

                final WorkflowProcess wfProcess = process;
                final WorkflowProcess wfTrackProcess = trackProcess;
                final WorkflowActivity wfActivity = activity;
                final WorkflowActivity wfTrackActivity = trackActivity;

                new Thread(new Runnable() {

                    public void run() {
                        String method = auditTrail.getMethod();
View Full Code Here

     */
    @Override
    public AppDefinition getAppDefinitionForWorkflowActivity(String activityId) {
        AppDefinition appDef = null;

        WorkflowActivity activity = workflowManager.getActivityById(activityId);
        if (activity != null) {
            String processDefId = activity.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);
View Full Code Here

        try {
            AppDefinition appDef = AppUtil.getCurrentAppDefinition();
            ParticipantPlugin plugin = (ParticipantPlugin) pluginManager.getPlugin(participant.getValue());
            Map propertyMap = AppPluginUtil.getDefaultProperties((Plugin)plugin, properties, appDef);
            propertyMap.put("pluginManager", pluginManager);
            WorkflowActivity activity = workflowManager.getActivityById(activityId);
            propertyMap.put("workflowActivity", activity);
           
            Collection<String> pluginResult = plugin.getActivityAssignments(propertyMap);
            if (pluginResult != null && pluginResult.size() > 0) {
                resultList.addAll(pluginResult);
View Full Code Here

            if (result != null) {
                setAlertMessage(getPropertyString("messageShowAfterComplete"));
                // Show next activity if available
                Collection<WorkflowActivity> activities = result.getActivities();
                if (activities != null && !activities.isEmpty()) {
                    WorkflowActivity nextActivity = activities.iterator().next();
                    if (nextActivity != null) {
                        setProperty("view", "redirect");
                        setProperty("messageShowAfterComplete", "");
                        String redirectUrl = getUrl() + "?_action=assignmentView&activityId=" + nextActivity.getId();
                        setAlertMessage("");
                        setRedirectUrl(redirectUrl);
                    }
                    return;
                } else {
View Full Code Here

            model.addAttribute("process", process);

            // redirect to next activity if available
            Collection<WorkflowActivity> activities = result.getActivities();
            if (activities != null && !activities.isEmpty()) {
                WorkflowActivity nextActivity = activities.iterator().next();
                String assignmentUrl = "/web/client/app/" + appId + "/" + appDef.getVersion() + "/assignment/" + nextActivity.getId() + "?" + request.getQueryString();
                return "redirect:" + assignmentUrl;
            }
        }

        return "client/app/processStarted";
View Full Code Here

        writeJson(writer, jsonObject, callback);
    }

    @RequestMapping("/json/monitoring/activity/view/(*:activityId)")
    public void activityView(Writer writer, @RequestParam(value = "callback", required = false) String callback, @RequestParam("activityId") String activityId) throws JSONException, IOException {
        WorkflowActivity activity = workflowManager.getActivityById(activityId);
        if (activity == null) {
            return;
        }
        WorkflowActivity activityInfo = workflowManager.getRunningActivityInfo(activityId);
        JSONObject jsonObject = new JSONObject();
        jsonObject.accumulate("activityId", activity.getId());
        jsonObject.accumulate("activityDefId", activity.getActivityDefId());
        jsonObject.accumulate("processId", activity.getProcessId());
        jsonObject.accumulate("processDefId", activity.getProcessDefId());
        jsonObject.accumulate("processVersion", activity.getProcessVersion());
        jsonObject.accumulate("processName", activity.getProcessName());
        jsonObject.accumulate("activityName", activity.getName());
        jsonObject.accumulate("description", activity.getDescription());
        jsonObject.accumulate("participant", activityInfo.getPerformer());
        jsonObject.accumulate("acceptedUser", activityInfo.getNameOfAcceptedUser());
        String[] assignmentUsers = activityInfo.getAssignmentUsers();
        for (String user : assignmentUsers) {
            jsonObject.accumulate("assignee", user);
        }
        Collection<WorkflowVariable> variableList = workflowManager.getActivityVariableList(activityId);
        for (WorkflowVariable variable : variableList) {
View Full Code Here

        //get activity list
        Collection<WorkflowActivity> activityList = workflowManager.getProcessActivityDefinitionList(processDefId);

        //add 'Run Process' activity to activityList
        WorkflowActivity runProcessActivity = new WorkflowActivity();
        runProcessActivity.setId(WorkflowUtil.ACTIVITY_DEF_ID_RUN_PROCESS);
        runProcessActivity.setName("Run Process");
        runProcessActivity.setType("normal");
        activityList.add(runProcessActivity);

        //remove route
        Iterator iterator = activityList.iterator();
        while (iterator.hasNext()) {
            WorkflowActivity activity = (WorkflowActivity) iterator.next();
            if (activity.getType().equals(WorkflowActivity.TYPE_ROUTE)) {
                iterator.remove();
            }
        }

        //get activity plugin mapping
View Full Code Here

        if (activityDefId != null && activityDefId.trim().length() > 0) {
            if (WorkflowUtil.ACTIVITY_DEF_ID_RUN_PROCESS.equals(activityDefId)) {
                activity = "Run Process";
            } else {
                WorkflowActivity wa = workflowManager.getProcessActivityDefinition(processDefId, activityDefId);
                if (wa != null) {
                    activity = wa.getName();
                }
            }
        }

        return activity;
View Full Code Here

TOP

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

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.