Package org.jbpm.ui.jpdl2.model

Examples of org.jbpm.ui.jpdl2.model.ActionImpl


        String targetName = getAttribute(node, TO_ATTR);
        TRANSION_TARGETS.put(transition, targetName);
    }

    private void parseAction(Node node, GraphElement parent) {
        ActionImpl action = create(node, parent);
        action.setEventType(getAttribute(node, EVENT_TYPE_ATTR));
    }
View Full Code Here


        String targetName = getAttribute(node, TO_ATTR);
        TRANSITION_TARGETS.put(transition, targetName);
    }

    private void parseAction(Node node, GraphElement parent, String eventType) {
        ActionImpl action = JpdlVersionRegistry.getElementTypeDefinition(jpdlVersion, ACTION_NODE).createElement();
        action.setDelegationClassName(getAttribute(node, CLASS_ATTR));
        action.setDelegationConfiguration(getTextContent(node));
        parent.addAction(action, -1);
        action.setEventType(eventType);
    }
View Full Code Here

        List<ActionNode> actionNodeNodes = definition.getChildren(ActionNode.class);
        for (ActionNode actionNode : actionNodeNodes) {
            Element actionNodeElement = writeNode(document, root, actionNode, null);
            for (Action action : actionNode.getActions()) {
                ActionImpl actionImpl = (ActionImpl) action;
                if (!Event.NODE_ACTION.equals(actionImpl.getEventType())) {
                    writeEvent(document, actionNodeElement, new Event(actionImpl.getEventType()), actionImpl);
                }
            }
        }

        List<Decision> decisions = definition.getChildren(Decision.class);
        for (Decision decision : decisions) {
            writeNode(document, root, decision, HANDLER_NODE);
        }

        List<TaskState> states = definition.getChildren(TaskState.class);
        for (TaskState state : states) {
            Element stateElement = writeTaskState(document, root, state);
            if (state.timerExist()) {
                Element timerElement = document.createElement(TIMER_NODE);
                setAttribute(timerElement, DUEDATE_ATTR, state.getDuration().getDuration());
                if (!state.hasTimeoutTransition() && state.getTimerAction() != null) {
                    if (state.getTimerAction().getRepeat().hasDuration()) {
                        setAttribute(timerElement, REPEAT_ATTR, state.getTimerAction().getRepeat().getDuration());
                    }
                    writeDelegation(document, timerElement, ACTION_NODE, state.getTimerAction());
                } else {
                    setAttribute(timerElement, TRANSITION_NODE, PluginConstants.TIMER_TRANSITION_NAME);
                }
                stateElement.appendChild(timerElement);
            }
            writeTransitions(document, stateElement, state);
        }

        List<WaitState> waitStates = definition.getChildren(WaitState.class);
        for (WaitState waitState : waitStates) {
            Element stateElement = writeWaitState(document, root, waitState);
            writeTransitions(document, stateElement, waitState);
        }

        List<MailNode> mailNodes = definition.getChildren(MailNode.class);
        for (MailNode mailNode : mailNodes) {
            Element nodeElement = writeNode(document, root, mailNode, null);
            setAttribute(nodeElement, "to", mailNode.getRecipient());
            writeTransitions(document, nodeElement, mailNode);
            Element subject = document.createElement("subject");
            setNodeValue(subject, mailNode.getSubject());
            nodeElement.appendChild(subject);
            Element body = document.createElement("body");
            setNodeValue(body, mailNode.getMailBody());
            nodeElement.appendChild(body);
        }

        List<Fork> forks = definition.getChildren(Fork.class);
        for (org.jbpm.ui.common.model.Node node : forks) {
            writeNode(document, root, node, null);
        }

        List<Join> joins = definition.getChildren(Join.class);
        for (org.jbpm.ui.common.model.Node node : joins) {
            writeNode(document, root, node, null);
        }

        List<Subprocess> subprocesses = definition.getChildren(Subprocess.class);
        boolean addSubprocessPermissionHandler = false;
        for (Subprocess subprocess : subprocesses) {
            addSubprocessPermissionHandler = true;
            Element processStateElement = writeNode(document, root, subprocess, null);
            Element subProcessElement = document.createElement(SUB_PROCESS_NODE);
            setAttribute(subProcessElement, NAME_ATTR, subprocess.getSubProcessName());
            setAttribute(subProcessElement, "binding", "late");
            processStateElement.appendChild(subProcessElement);
            for (VariableMapping variable : subprocess.getVariablesList()) {
                Element variableElement = document.createElement(VARIABLE_NODE);
                setAttribute(variableElement, NAME_ATTR, variable.getProcessVariable());
                setAttribute(variableElement, MAPPED_NAME_ATTR, variable.getSubprocessVariable());
                setAttribute(variableElement, ACCESS_ATTR, variable.getUsage());
                processStateElement.appendChild(variableElement);
            }
        }

        /*
        List<MultiInstance> multiInstances = definition.getChildren(MultiInstance.class);
        for (MultiInstance multiInstance : multiInstances) {
            addSubprocessPermissionHandler = true;
            Element processStateElement = writeNode(document, root, multiInstance, null);
            Element subProcessElement = document.createElement(SUB_PROCESS_NODE);
            setAttribute(subProcessElement, NAME_ATTR, multiInstance.getSubProcessName());
            setAttribute(subProcessElement, "binding", "late");
            processStateElement.appendChild(subProcessElement);
            for (VariableMapping variable : multiInstance.getVariablesList()) {
                Element variableElement = document.createElement(VARIABLE_NODE);
                setAttribute(variableElement, NAME_ATTR, variable.getProcessVariable());
                setAttribute(variableElement, MAPPED_NAME_ATTR, variable.getSubprocessVariable());
                setAttribute(variableElement, ACCESS_ATTR, variable.getAccess());
                processStateElement.appendChild(variableElement);
            }
        }
        */

        if (addSubprocessPermissionHandler) {
            // TODO add XML comment and move to own method (after event support will be added)
            ActionImpl action = new ActionImpl();
            action.setDelegationClassName("ru.runa.wf.jbpm.delegation.action.SetSubProcessPermissionsActionHandler");
            writeEvent(document, root, new Event(Event.SUBPROCESS_CREATED), action);
        }

        EndState endState = definition.getFirstChild(EndState.class);
        if (endState != null) {
View Full Code Here

        setAttribute(taskElement, SWIMLANE_NODE, state.getSwimlaneName());
        if (state instanceof State && ((State) state).isReassignmentEnabled()) {
            setAttribute(taskElement, REASSIGN_ATTR, "true");
        }
        for (Action action : state.getActions()) {
            ActionImpl actionImpl = (ActionImpl) action;
            writeEvent(document, taskElement, new Event(actionImpl.getEventType()), actionImpl);
        }
        nodeElement.appendChild(taskElement);
        if (state instanceof ITimed && ((ITimed) state).timerExist()) {
            setAttribute(nodeElement, END_TASKS_ATTR, "true");
        }
View Full Code Here

TOP

Related Classes of org.jbpm.ui.jpdl2.model.ActionImpl

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.