use of org.camunda.bpm.engine.impl.util.json.JSONObject in project camunda-bpm-platform by camunda.
the class HistoryCleanupJobHandlerConfiguration method toCanonicalString.
@Override
public String toCanonicalString() {
JSONObject json = new JSONObject();
json.put(JOB_CONFIG_COUNT_EMPTY_RUNS, countEmptyRuns);
json.put(JOB_CONFIG_EXECUTE_AT_ONCE, immediatelyDue);
return json.toString();
}
use of org.camunda.bpm.engine.impl.util.json.JSONObject in project camunda-bpm-platform by camunda.
the class JsonQueryOrderingPropertyConverter method toJsonObject.
public JSONObject toJsonObject(QueryOrderingProperty property) {
JSONObject jsonObject = new JSONObject();
JsonUtil.addField(jsonObject, RELATION, property.getRelation());
QueryProperty queryProperty = property.getQueryProperty();
if (queryProperty != null) {
JsonUtil.addField(jsonObject, QUERY_PROPERTY, queryProperty.getName());
JsonUtil.addField(jsonObject, QUERY_PROPERTY_FUNCTION, queryProperty.getFunction());
}
Direction direction = property.getDirection();
if (direction != null) {
JsonUtil.addField(jsonObject, DIRECTION, direction.getName());
}
if (property.hasRelationConditions()) {
JSONArray relationConditionsJson = JsonQueryFilteringPropertyConverter.ARRAY_CONVERTER.toJsonArray(property.getRelationConditions());
JsonUtil.addField(jsonObject, RELATION_CONDITIONS, relationConditionsJson);
}
return jsonObject;
}
use of org.camunda.bpm.engine.impl.util.json.JSONObject in project camunda-bpm-platform by camunda.
the class JsonTaskQueryVariableValueConverter method toObject.
public TaskQueryVariableValue toObject(JSONObject json) {
String name = json.getString("name");
Object value = json.get("value");
QueryOperator operator = QueryOperator.valueOf(json.getString("operator"));
boolean isTaskVariable = json.getBoolean("taskVariable");
boolean isProcessVariable = json.getBoolean("processVariable");
return new TaskQueryVariableValue(name, value, operator, isTaskVariable, isProcessVariable);
}
use of org.camunda.bpm.engine.impl.util.json.JSONObject in project camunda-bpm-platform by camunda.
the class MigrationInstructionJsonConverter method toJsonObject.
public JSONObject toJsonObject(MigrationInstruction instruction) {
JSONObject json = new JSONObject();
JsonUtil.addArrayField(json, SOURCE_ACTIVITY_IDS, new String[] { instruction.getSourceActivityId() });
JsonUtil.addArrayField(json, TARGET_ACTIVITY_IDS, new String[] { instruction.getTargetActivityId() });
JsonUtil.addField(json, UPDATE_EVENT_TRIGGER, instruction.isUpdateEventTrigger());
return json;
}
use of org.camunda.bpm.engine.impl.util.json.JSONObject in project camunda-bpm-platform by camunda.
the class JsonUtilTest method testJsonObjectNullRetained.
@Test
public void testJsonObjectNullRetained() {
String json = "{\"key\":null}";
JSONObject object = new JSONObject(json);
assertTrue(object.has("key"));
Map<String, Object> map = jsonObjectAsMap(object);
assertTrue(map.containsKey("key"));
assertNull(map.get("key"));
}
Aggregations