Package org.smartcomps.twister.engine.exception

Examples of org.smartcomps.twister.engine.exception.ProcessStructuralException


    public void addMessageEvent(MessageEvent event, Activity activity) {
        int actPos = getActivities().indexOf(activity);

        if (actPos < 0)
            throw new ProcessStructuralException("Activity has not been attributed to " +
                    "this Pick container at creation time.");
        if (actPos != messageEvents.size())
            throw new ProcessStructuralException("MessageEvent must be" +
                    "added in the same order as activities have been created and therefore assigned to this" +
                    "Pick container, please check the ActivityFactory.createActivity method.");

        getMessageEvents().add(event);
    }
View Full Code Here


        for (int m = 0; m < getMessageEvents().size(); m++) {
            try {
                Activity activity = (Activity) getActivities().get(m);

                if (messageEvents.get(m) == null) {
                    throw new ProcessStructuralException("An activity in this Pick container is not associated with " +
                            "any MessageEvent, please check that all activities created in this " +
                            "container is properly associated with an event.");
                }
                result.put(activity, messageEvents.get(m));
            } catch (IndexOutOfBoundsException iobe) {
                throw new ProcessStructuralException("There are more Activity objects in this Pick container " +
                        "than MessageEvent, activities and container have been wrongly created or associated", iobe);
            }
        }
        return result;
    }
View Full Code Here

    public MessageEvent getMessageEvent(Activity activity) {
        int actPos = getActivities().indexOf(activity);

        if (actPos < 0)
            throw new ProcessStructuralException("Activity has not been attributed to " +
                    "this Pick container at creation time.");

        return (MessageEvent) messageEvents.get(actPos);
    }
View Full Code Here

    public void addAlarmEvent(AlarmEvent event, Activity activity) {
        int actPos = getActivities().indexOf(activity);

        if (actPos < 0)
            throw new ProcessStructuralException("Activity has not been attributed to " +
                    "this Pick container at creation time.");
        if (actPos != (alarmEvents.size() + messageEvents.size()))
            throw new ProcessStructuralException("AlarmEvent must be" +
                    "added in the same order as activities have been created and therefore assigned to this" +
                    "Pick container, please check the ActivityFactory.createActivity method.");

        getAlarmEvents().add(event);
    }
View Full Code Here

        for (int m = 0; m < alarmEvents.size(); m++) {
            try {
                Activity activity = (Activity) getActivities().get(m + messageEvents.size());

                if (alarmEvents.get(m) == null) {
                    throw new ProcessStructuralException("An activity in this Pick container is not associated " +
                            "with any AlarmEvent, please check that all activities created in this container " +
                            "is properly associated with an event.");
                }
                result.put(activity, alarmEvents.get(m));
            } catch (IndexOutOfBoundsException iobe) {
                throw new ProcessStructuralException("There are more Activity objects in this Pick container " +
                        "than AlarmEvent, activities and container have been wrongly created or associated", iobe);
            }
        }
        return result;
    }
View Full Code Here

    public AlarmEvent getAlarmEvent(Activity activity) {
        int actPos = getActivities().indexOf(activity);

        if (actPos < 0)
            throw new ProcessStructuralException("Activity has not been attributed to " +
                    "this Pick container at creation time.");
        if (actPos - messageEvents.size() < 0)
            throw new ProcessStructuralException("There are more " +
                    "message events than activities in this Pick container.");

        return (AlarmEvent) alarmEvents.get(actPos - messageEvents.size());
    }
View Full Code Here


  public void addCondition(String condition, Activity activity) {
    int actPos = getActivities().indexOf(activity);

    if (actPos < 0) throw new ProcessStructuralException("Activity has not been attributed to " +
        "this Pick container at creation time.");
    if (actPos != conditions.size()) throw new ProcessStructuralException("Conditions must be " +
        "added in the same order as activities have been added in this container when they " +
        "have been created, please check the ActivityFactory.createActivity method.");

    conditions.add(condition);
  }
View Full Code Here

  }

    public void setOtherwise(Activity activity) {
        Activity last = (Activity) getActivities().get(getActivities().size() - 1);
        if (!last.equals(activity)) {
            throw new ProcessStructuralException("The otherwise activity must have been created and " +
                    "included in this container in the last position.");
        }
    }
View Full Code Here

TOP

Related Classes of org.smartcomps.twister.engine.exception.ProcessStructuralException

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.