Permalink
Browse files

Merge branch 'master' of github.com:/amplafi/amplafi-flow-core

Conflicts:
	src/main/java/org/amplafi/flow/FlowStateJsonRenderer.java
  • Loading branch information...
2 parents 7ef082a + d1516f9 commit 49b60c18c2b1a6d8402163af24147e368c98cecc @patmoore patmoore committed May 15, 2012
@@ -19,6 +19,7 @@
import org.amplafi.json.IJsonWriter;
import org.amplafi.json.JSONObject;
+import org.amplafi.json.JSONWriter;
import org.amplafi.json.JsonRenderer;
import com.sworddance.util.ApplicationIllegalStateException;
@@ -76,10 +77,9 @@ protected void renderState(IJsonWriter jsonWriter, FlowState flowState) {
protected void renderProperty(IJsonWriter jsonWriter, FlowState flowState,
FlowPropertyDefinition flowPropertyDefinition) {
- String propertyName = flowPropertyDefinition.getName();
+ String propertyName = flowPropertyDefinition.getName();
Object property = flowState.getProperty(propertyName);
- jsonWriter.key(propertyName);
- flowPropertyDefinition.serialize(jsonWriter, property);
+ jsonWriter.keyValueIfNotBlankValue(propertyName, flowPropertyDefinition.serialize(new JSONWriter(), property).toString());
ApplicationIllegalStateException.checkState(jsonWriter.isInKeyMode(), "Not in value mode after serializing key/value for ", flowPropertyDefinition.getName());
}
@@ -85,7 +85,7 @@ protected void renderError(FlowState flowState, String message, Exception except
jsonWriter.object();
jsonWriter.keyValueIfNotBlankValue(ServicesConstants.ERROR_MESSAGE, message);
if (flowState != null) {
- jsonWriter.key(FLOW_STATE_JSON_KEY).value(flowState);
+ jsonWriter.keyValueIfNotNullValue(FLOW_STATE_JSON_KEY, flowState);
// TODO : probably need to check on PropertyRequired.finish
Map<String, FlowValidationResult> result = flowState.getFlowValidationResults(FlowActivityPhase.advance, FlowStepDirection.forward);
writeValidationResult(jsonWriter, result);

0 comments on commit 49b60c1

Please sign in to comment.