/** throws RuntimeException if a property is set with an invalid key. * All the known fieldnames are invalid values because the properties are * serialized inside the containing object json. * @param value * @see Extensible */ private void checkProperty(String key, Object value) { Set<String> invalidPropertyKeys = getInvalidPropertyKeys(getClass()); if (key==null || invalidPropertyKeys.contains(key)) { throw new RuntimeException("Invalid property '"+key+"'"); } // TODO checkValue(key, value); // checkValue still fails on the bpmn tests }
/** throws RuntimeException if a property is set with an invalid key. * All the known fieldnames are invalid values because the properties are * serialized inside the containing object json. * @param value * @see Extensible */ private void checkProperty(String key, Object value) { Set<String> invalidPropertyKeys = getInvalidPropertyKeys(getClass()); if (key==null || invalidPropertyKeys.contains(key)) { throw new RuntimeException("Invalid property '"+key+"'"); } // TODO checkValue(key, value); // checkValue still fails on the bpmn tests }
/** * Reads database fields (that do not have Java fields) and copies them to workflow instance properties. * This makes it possible to write non-standard fields to the database and read them from properties. */ private void copyProperties(BasicDBObject dbWorkflowInstance, WorkflowInstanceImpl workflowInstance) { if (dbWorkflowInstance == null || workflowInstance == null) { return; } Set<String> invalidPropertyKeys = Extensible.getInvalidPropertyKeys(WorkflowInstance.class); // Map<String,?> mappedBeanFields = mongoMapper.write(workflowInstance.toWorkflowInstance()); for (String fieldName : dbWorkflowInstance.keySet()) { boolean property = !invalidPropertyKeys.contains(fieldName); if (property) { workflowInstance.setProperty(fieldName, dbWorkflowInstance.get(fieldName)); } } }
/** * Reads database fields (that do not have Java fields) and copies them to workflow instance properties. * This makes it possible to write non-standard fields to the database and read them from properties. */ private void copyProperties(BasicDBObject dbWorkflowInstance, WorkflowInstanceImpl workflowInstance) { if (dbWorkflowInstance == null || workflowInstance == null) { return; } Set<String> invalidPropertyKeys = Extensible.getInvalidPropertyKeys(WorkflowInstance.class); // Map<String,?> mappedBeanFields = mongoMapper.write(workflowInstance.toWorkflowInstance()); for (String fieldName : dbWorkflowInstance.keySet()) { boolean property = !invalidPropertyKeys.contains(fieldName); if (property) { workflowInstance.setProperty(fieldName, dbWorkflowInstance.get(fieldName)); } } }