/** * 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)); } } }
workflowInstance.workAsync = readWork(dbWorkflowInstance, WORK_ASYNC, workflowInstance); workflowInstance.properties = readObjectMap(dbWorkflowInstance, PROPERTIES); workflowInstance.setProperty(ORGANIZATION_ID, readObject(dbWorkflowInstance, ORGANIZATION_ID));
workflowInstance.workAsync = readWork(dbWorkflowInstance, WORK_ASYNC, workflowInstance); workflowInstance.properties = readObjectMap(dbWorkflowInstance, PROPERTIES); workflowInstance.setProperty(ORGANIZATION_ID, readObject(dbWorkflowInstance, ORGANIZATION_ID));