Package org.jbpm.simulation

Examples of org.jbpm.simulation.PathContext


                            .getErrorRef().getId();
                }

                FlowElement catchEvent = manager.getCatchingEvents().get(key);
                if (catchEvent != null && hasPathToCatchEvent(catchEvent)) {
                    PathContext context = manager.getContextFromStack();
                    boolean canBeFinished = context.isCanBeFinished();
                    context.setCanBeFinishedNoIncrement(false);
                    super.handle(catchEvent, manager);
                    context.setCanBeFinishedNoIncrement(canBeFinished);
                }
            }

        }
        return super.handle(element, manager);
View Full Code Here


            for (SequenceFlow seqFlow : outgoing) {

                FlowElement target = seqFlow.getTargetRef();
                if (!contextAtThisNode.getVisitedSplitPoint().contains(seqFlow)) {
                    PathContext separatePath = manager.cloneGiven(contextAtThisNode);
                    separatePath.addVisitedSplitPoint(seqFlow);
                    manager.addToPath(seqFlow, separatePath);
                    super.handle(target, manager);
                    separatePath.setLocked(true);
                    locked.add(separatePath);
                }
            }
        }
        // unlock
View Full Code Here

            for (SequenceFlow flow : outgoing) {

                // first remove one that we currently processing as that is not
                // a combination
                copy.remove(flow);
                PathContext contextAtThisNode = manager.cloneGivenWithoutPush(manager.getContextFromStack());
                for (SequenceFlow copyFlow : copy) {
                    manager.cloneGiven(contextAtThisNode);


                    andCombination = new ArrayList<SequenceFlow>();
View Full Code Here

        manager.getContextFromStack().setType(currentType);

    }

    protected void handleParallelGateway(List<SequenceFlow> outgoing) {
        PathContext context = manager.getContextFromStack();
        boolean canBeFinished = context.isCanBeFinished();
        context.setCanBeFinished(false);
        manager.addAllToPath(outgoing, context);
        int counter = 0;
        for (SequenceFlow seqFlow : outgoing) {
            counter++;
            FlowElement target = seqFlow.getTargetRef();

            if (counter == outgoing.size()) {
                if (manager.getPaths().size() == 1) {
                    context.setCanBeFinished(canBeFinished);

                } else {
                    Iterator<PathContext> it = manager.getPaths().iterator();

                    while (it.hasNext()) {
                        PathContext pathContext = (PathContext) it.next();
                        if (pathContext.getType() == Type.ACTIVE) {
                            pathContext.setCanBeFinished(canBeFinished);
                        }
                    }
                }
            }
           
View Full Code Here

public class MainElementHandler implements ElementHandler {
   
   

    public boolean handle(FlowElement element, PathContextManager manager) {
        PathContext context = manager.getContextFromStack();
        if (!(element instanceof SubProcess)) {
            manager.addToPath(element, context);
        }
       
        List<SequenceFlow> outgoing = getOutgoing(element);
View Full Code Here

        List<SequenceFlow> outgoing = new ArrayList<SequenceFlow>(getOutgoing(element));
        if (outgoing.size() == 0) {
            return false;
        }
       
        PathContext context = manager.getContextFromStack();
       
        List<BoundaryEvent> bEvents = ((Activity) element).getBoundaryEventRefs();
        if (bEvents != null && bEvents.size() > 0) {
            boolean cancelActivity = false;
            for (BoundaryEvent bEvent : bEvents) {

                if (!context.getPathElements().contains(bEvent)) {
                    manager.addToPath(bEvent, context);
                    List<SequenceFlow> bOut = bEvent.getOutgoing();
                    outgoing.addAll(bOut);
                    cancelActivity = bEvent.isCancelActivity();
View Full Code Here

       
    }

    protected void handleSeparatePaths(List<SequenceFlow> outgoing, PathContextManager manager, BoundaryEvent bEvent) {
        List<PathContext> locked = new ArrayList<PathContext>();
        PathContext context = manager.getContextFromStack();
        for (SequenceFlow seqFlow : outgoing) {

            FlowElement target = seqFlow.getTargetRef();

            PathContext separatePath = manager.cloneGiven(context);
            // replace boundary event with a wrapper if sequence flow does not go out if it
            if (!seqFlow.getSourceRef().equals(bEvent)) {
                separatePath.removePathElement(bEvent);
                separatePath.addPathElement(new WrappedBoundaryEvent(bEvent));
            }
            manager.addToPath(seqFlow, separatePath);
            super.handle(target, manager);
            separatePath.setLocked(true);

            locked.add(separatePath);
        }

        // unlock
View Full Code Here

            ctx.setLocked(false);
        }
    }
   
    protected void handleAllPaths(List<SequenceFlow> outgoing, PathContextManager manager) {
        PathContext context = manager.getContextFromStack();
        context.setCanBeFinished(false);
        int counter = 0;
        for (SequenceFlow seqFlow : outgoing) {
            counter++;
            FlowElement target = seqFlow.getTargetRef();

            if (counter == outgoing.size()) {
                context.setCanBeFinished(true);
            }
            manager.addToPath(seqFlow, context);
            super.handle(target, manager);
        }
    }
View Full Code Here

TOP

Related Classes of org.jbpm.simulation.PathContext

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.