public static ColorAction create(ActionContext actionContext) throws OgnlException { Thing self = (Thing) actionContext.get("self"); ColorAction action = Actions.action(ColorAction.class); Color startColor = (Color) self.getObject("startColor", actionContext); if (startColor != null) { action.setColor(startColor); } Color endColor = (Color) self.getObject("endColor", actionContext); if (endColor != null) { action.setEndColor(endColor); } TemporalActionActions.init(self, action, actionContext); actionContext.getScope(0).put(self.getMetadata().getName(), action); return action; }