Skip to content

Commit

Permalink
Merge branch 'master' of github.com:/amplafi/amplafi-flow-core
Browse files Browse the repository at this point in the history
Conflicts:
	src/main/java/org/amplafi/flow/FlowStateJsonRenderer.java
  • Loading branch information
patmoore committed May 15, 2012
2 parents 7ef082a + d1516f9 commit 49b60c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/amplafi/flow/FlowStateJsonRenderer.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@


import org.amplafi.json.IJsonWriter; import org.amplafi.json.IJsonWriter;
import org.amplafi.json.JSONObject; import org.amplafi.json.JSONObject;
import org.amplafi.json.JSONWriter;
import org.amplafi.json.JsonRenderer; import org.amplafi.json.JsonRenderer;


import com.sworddance.util.ApplicationIllegalStateException; import com.sworddance.util.ApplicationIllegalStateException;
Expand Down Expand Up @@ -76,10 +77,9 @@ protected void renderState(IJsonWriter jsonWriter, FlowState flowState) {


protected void renderProperty(IJsonWriter jsonWriter, FlowState flowState, protected void renderProperty(IJsonWriter jsonWriter, FlowState flowState,
FlowPropertyDefinition flowPropertyDefinition) { FlowPropertyDefinition flowPropertyDefinition) {
String propertyName = flowPropertyDefinition.getName(); String propertyName = flowPropertyDefinition.getName();
Object property = flowState.getProperty(propertyName); Object property = flowState.getProperty(propertyName);
jsonWriter.key(propertyName); jsonWriter.keyValueIfNotBlankValue(propertyName, flowPropertyDefinition.serialize(new JSONWriter(), property).toString());
flowPropertyDefinition.serialize(jsonWriter, property);
ApplicationIllegalStateException.checkState(jsonWriter.isInKeyMode(), "Not in value mode after serializing key/value for ", flowPropertyDefinition.getName()); ApplicationIllegalStateException.checkState(jsonWriter.isInKeyMode(), "Not in value mode after serializing key/value for ", flowPropertyDefinition.getName());
} }


Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/amplafi/flow/impl/JsonFlowRenderer.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ protected void renderError(FlowState flowState, String message, Exception except
jsonWriter.object(); jsonWriter.object();
jsonWriter.keyValueIfNotBlankValue(ServicesConstants.ERROR_MESSAGE, message); jsonWriter.keyValueIfNotBlankValue(ServicesConstants.ERROR_MESSAGE, message);
if (flowState != null) { 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 // TODO : probably need to check on PropertyRequired.finish
Map<String, FlowValidationResult> result = flowState.getFlowValidationResults(FlowActivityPhase.advance, FlowStepDirection.forward); Map<String, FlowValidationResult> result = flowState.getFlowValidationResults(FlowActivityPhase.advance, FlowStepDirection.forward);
writeValidationResult(jsonWriter, result); writeValidationResult(jsonWriter, result);
Expand Down

0 comments on commit 49b60c1

Please sign in to comment.