Examples of BehaviorLogic


Examples of it.freedomotic.objects.BehaviorLogic

                for (Condition condition : rea.getConditions()) {
                    //System.out.println("DEBUG: check condition " + condition.getTarget());
                    EnvObjectLogic object = EnvObjectPersistence.getObjectByName(condition.getTarget());
                    Statement statement = condition.getStatement();
                    if (object != null) {
                        BehaviorLogic behavior = object.getBehavior(statement.getAttribute());
                        //System.out.println("DEBUG: " + object.getPojo().getName() + " "
                        //+ " behavior: " + behavior.getName() + " " + behavior.getValueAsString());
                        boolean eval = behavior.getValueAsString().equalsIgnoreCase(statement.getValue());
                        if (statement.getLogical().equalsIgnoreCase("AND")) {
                            result = result && eval;
                            //System.out.println("DEBUG: result and: " + result + "(" + eval +")");
                        } else {
                            result = result || eval;
View Full Code Here

Examples of it.freedomotic.objects.BehaviorLogic

        // if the object exists
        if (obj != null) {

            // gets the behavior name in the user level command
            String behaviorName = userLevelCommand.getProperty(Command.PROPERTY_BEHAVIOR);
            BehaviorLogic behavior = obj.getBehavior(behaviorName);

            // if this behavior exists in object obj
            if (behavior != null) {

                LOG.log(Level.CONFIG,
                        "User level command ''{0}'' request changing behavior {1} of object ''{2}'' "
                        + "from value ''{3}'' to value ''{4}''",
                        new Object[]{userLevelCommand.getName(), behavior.getName(), obj.getPojo().getName(), behavior.getValueAsString(), userLevelCommand.getProperties().getProperty("value")});

                // true means a command must be fired
                behavior.filterParams(userLevelCommand.getProperties(), true);

            } else {
                LOG.log(Level.WARNING,
                        "Behavior ''{0}'' is not a valid behavior for object ''{1}''. "
                        + "Please check ''behavior'' parameter spelling in command {2}",
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.