Package com.mossle.api.user

Examples of com.mossle.api.user.UserConnector


        }
    }

    public void processArrival(DelegateTask delegateTask,
            BpmConfNotice bpmConfNotice) {
        UserConnector userConnector = ApplicationContextHelper
                .getBean(UserConnector.class);

        TaskEntity taskEntity = new TaskEntity();
        taskEntity.setId(delegateTask.getId());
        taskEntity.setName(delegateTask.getName());
        taskEntity.setAssigneeWithoutCascade(userConnector.findById(
                delegateTask.getAssignee()).getDisplayName());
        taskEntity.setVariableLocal("initiator",
                getInitiator(userConnector, delegateTask));
        logger.debug("initiator : {}", delegateTask.getVariable("initator"));
        logger.debug("variables : {}", delegateTask.getVariables());

        String receiver = bpmConfNotice.getReceiver();
        BpmMailTemplate bpmMailTemplate = bpmConfNotice.getBpmMailTemplate();
        ExpressionManager expressionManager = Context
                .getProcessEngineConfiguration().getExpressionManager();
        UserDTO userDto = null;
        String subject = expressionManager
                .createExpression(bpmMailTemplate.getSubject())
                .getValue(taskEntity).toString();

        String content = expressionManager
                .createExpression(bpmMailTemplate.getContent())
                .getValue(taskEntity).toString();

        if ("任务接收人".equals(receiver)) {
            userDto = userConnector.findById(delegateTask.getAssignee());
        } else if ("流程发起人".equals(receiver)) {
            userDto = userConnector.findById((String) delegateTask
                    .getVariables().get("initiator"));
        } else {
            HistoricProcessInstanceEntity historicProcessInstanceEntity = Context
                    .getCommandContext()
                    .getHistoricProcessInstanceEntityManager()
                    .findHistoricProcessInstance(
                            delegateTask.getProcessInstanceId());
            userDto = userConnector.findById(historicProcessInstanceEntity
                    .getStartUserId());
        }

        this.sendMail(userDto, subject, content);
        this.sendSiteMessage(userDto, subject, content);
View Full Code Here


            Date noticeDate = calendar.getTime();
            Date now = new Date();

            if ((now.getTime() < noticeDate.getTime())
                    && ((noticeDate.getTime() - now.getTime()) < (60 * 1000))) {
                UserConnector userConnector = ApplicationContextHelper
                        .getBean(UserConnector.class);
                MailFacade mailFacade = ApplicationContextHelper
                        .getBean(MailFacade.class);
                TaskEntity taskEntity = new TaskEntity();
                taskEntity.setId(delegateTask.getId());
                taskEntity.setName(delegateTask.getName());
                taskEntity.setAssigneeWithoutCascade(userConnector.findById(
                        delegateTask.getAssignee()).getDisplayName());
                taskEntity.setVariableLocal("initiator",
                        getInitiator(userConnector, delegateTask));

                String receiver = bpmConfNotice.getReceiver();
                BpmMailTemplate bpmMailTemplate = bpmConfNotice
                        .getBpmMailTemplate();
                ExpressionManager expressionManager = Context
                        .getProcessEngineConfiguration().getExpressionManager();

                UserDTO userDto = null;

                if ("任务接收人".equals(receiver)) {
                    userDto = userConnector
                            .findById(delegateTask.getAssignee());
                } else if ("流程发起人".equals(receiver)) {
                    userDto = userConnector.findById((String) delegateTask
                            .getVariables().get("initiator"));
                } else {
                    HistoricProcessInstanceEntity historicProcessInstanceEntity = Context
                            .getCommandContext()
                            .getHistoricProcessInstanceEntityManager()
                            .findHistoricProcessInstance(
                                    delegateTask.getProcessInstanceId());
                    userDto = userConnector
                            .findById(historicProcessInstanceEntity
                                    .getStartUserId());
                }

                String subject = expressionManager
View Full Code Here

        }
    }

    public void processComplete(DelegateTask delegateTask,
            BpmConfNotice bpmConfNotice) {
        UserConnector userConnector = ApplicationContextHelper
                .getBean(UserConnector.class);
        MailFacade mailFacade = ApplicationContextHelper
                .getBean(MailFacade.class);
        TaskEntity taskEntity = new TaskEntity();
        taskEntity.setId(delegateTask.getId());
        taskEntity.setName(delegateTask.getName());
        taskEntity.setAssigneeWithoutCascade(userConnector.findById(
                delegateTask.getAssignee()).getDisplayName());
        taskEntity.setVariableLocal("initiator",
                getInitiator(userConnector, delegateTask));

        String receiver = bpmConfNotice.getReceiver();
        BpmMailTemplate bpmMailTemplate = bpmConfNotice.getBpmMailTemplate();
        ExpressionManager expressionManager = Context
                .getProcessEngineConfiguration().getExpressionManager();
        UserDTO userDto = null;

        if ("任务接收人".equals(receiver)) {
            userDto = userConnector.findById(delegateTask.getAssignee());
        } else if ("流程发起人".equals(receiver)) {
            userDto = userConnector.findById((String) delegateTask
                    .getVariables().get("initiator"));
        } else {
            HistoricProcessInstanceEntity historicProcessInstanceEntity = Context
                    .getCommandContext()
                    .getHistoricProcessInstanceEntityManager()
                    .findHistoricProcessInstance(
                            delegateTask.getProcessInstanceId());
            userDto = userConnector.findById(historicProcessInstanceEntity
                    .getStartUserId());
        }

        String subject = expressionManager
                .createExpression(bpmMailTemplate.getSubject())
View Full Code Here

        logger.debug("taskDefinitionKey : {}", taskDefinitionKey);
        logger.debug("processDefinitionId : {}", processDefinitionId);
        logger.debug("processInstanceId : {}", processInstanceId);
        logger.debug("bpmConfRules : {}", bpmConfRules);

        UserConnector userConnector = ApplicationContextHelper
                .getBean(UserConnector.class);
        OrgConnector orgConnector = (OrgConnector) ApplicationContextHelper
                .getBean(OrgConnector.class);
        ExpressionManager expressionManager = Context
                .getProcessEngineConfiguration().getExpressionManager();
        MapVariableScope mapVariableScope = new MapVariableScope();
        String initiator = historicProcessInstanceEntity.getStartUserId();
        mapVariableScope.setVariable("initiator",
                userConnector.findById(initiator));

        for (BpmConfRule bpmConfRule : bpmConfRules) {
            String value = bpmConfRule.getValue();

            if ("职位".equals(value)) {
View Full Code Here

TOP

Related Classes of com.mossle.api.user.UserConnector

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.