public boolean inDevelopment() { return getAttributes().getBoolean("development", false); }
/** * Create a new flow with the given id and attributes. * @param id the flow id * @param attributes the attributes * @return the flow */ public static Flow create(String id, AttributeMap<?> attributes) { Flow flow = new Flow(id); flow.getAttributes().putAll(attributes); return flow; }
public boolean inDevelopment() { return getAttributes().getBoolean("development", false); }
public boolean inDevelopment() { return getAttributes().getBoolean("development", Boolean.FALSE).booleanValue(); }
/** * Create a new flow with the given id and attributes. * @param id the flow id * @param attributes the attributes * @return the flow */ public static Flow create(String id, AttributeMap<?> attributes) { Flow flow = new Flow(id); flow.getAttributes().putAll(attributes); return flow; }
/** * Create a new flow with the given id and attributes. * @param id the flow id * @param attributes the attributes * @return the flow */ public static Flow create(String id, AttributeMap attributes) { Flow flow = new Flow(id); flow.getAttributes().putAll(attributes); return flow; }
public void testPersistenceContextFlow() { model.setPersistenceContext(new PersistenceContextModel()); model.setStates(asList(new EndStateModel("end"))); Flow flow = getFlow(model); assertNotNull(flow.getAttributes().get("persistenceContext")); assertTrue((Boolean) flow.getAttributes().get("persistenceContext")); }
public void testCustomFlowAttribute() { AttributeModel attribute1 = new AttributeModel("foo", "bar"); AttributeModel attribute2 = new AttributeModel("number", "1"); attribute2.setType("integer"); model.setAttributes(asList(attribute1, attribute2)); model.setStates(asList(new EndStateModel("end"))); Flow flow = getFlow(model); assertEquals("bar", flow.getAttributes().get("foo")); assertEquals(1, flow.getAttributes().get("number")); }
public void testFlowSecured() { model.setSecured(new SecuredModel("ROLE_USER")); model.setStates(asList(new EndStateModel("end"))); Flow flow = getFlow(model); SecurityRule rule = (SecurityRule) flow.getAttributes().get(SecurityRule.SECURITY_ATTRIBUTE_NAME); assertNotNull(rule); assertEquals(SecurityRule.COMPARISON_ANY, rule.getComparisonType()); assertEquals(1, rule.getAttributes().size()); assertTrue(rule.getAttributes().contains("ROLE_USER")); }
public void testSessionCreatingWithSecurity() { SecurityFlowExecutionListener listener = new SecurityFlowExecutionListener(); RequestContext context = new MockRequestContext(); Flow flow = new Flow("flow"); SecurityRule rule = getSecurityRuleAnyAuthorized(); flow.getAttributes().put(SecurityRule.SECURITY_ATTRIBUTE_NAME, rule); configureSecurityContext(); listener.sessionCreating(context, flow); }