Package org.camunda.bpm.engine.impl.util.json

Examples of org.camunda.bpm.engine.impl.util.json.JSONObject


  @Test
  @SuppressWarnings("unchecked")
  public void testJsonObjectToMap() {
    assertNull(jsonObjectAsMap(null));

    JSONObject jsonObject = new JSONObject();

    Map<String, Object> map = jsonObjectAsMap(jsonObject);
    assertTrue(map.isEmpty());

    jsonObject.put("boolean", true);
    jsonObject.put("int", 12);
    jsonObject.put("double", 11.1);
    jsonObject.put("long", 13l);
    jsonObject.put("string", "test");
    jsonObject.put("list", Collections.singletonList("test"));
    jsonObject.put("map", Collections.singletonMap("test", "test"));
    jsonObject.put("date", new Date(0));

    map = jsonObjectAsMap(jsonObject);
    assertEquals(8, map.size());

    assertEquals(true, map.get("boolean"));
View Full Code Here


  public String getType() {
    return TYPE;
  }

  public void execute(String configuration, ExecutionEntity execution, CommandContext commandContext) {
    JSONObject config = new JSONObject(configuration);

    boolean activateJobs = getIncludeJobs(config);

    ActivateJobDefinitionCmd cmd = null;
View Full Code Here

  protected static final String JOB_HANDLER_CFG_PROCESS_DEFINITION_KEY = "processDefinitionKey";

  protected static final String JOB_HANDLER_CFG_INCLUDE_JOBS = "includeJobs";

  public static String createJobHandlerConfigurationByJobDefinitionId(String jobDefinitionId, boolean includeJobs) {
    JSONObject json = new JSONObject();

    json.put(JOB_HANDLER_CFG_BY, JOB_HANDLER_CFG_JOB_DEFINITION_ID);
    json.put(JOB_HANDLER_CFG_JOB_DEFINITION_ID, jobDefinitionId);
    json.put(JOB_HANDLER_CFG_INCLUDE_JOBS, includeJobs);

    return json.toString();
  }
View Full Code Here

    return json.toString();
  }

  public static String createJobHandlerConfigurationByProcessDefinitionId(String processDefinitionId, boolean includeJobs) {
    JSONObject json = new JSONObject();

    json.put(JOB_HANDLER_CFG_BY, JOB_HANDLER_CFG_PROCESS_DEFINITION_ID);
    json.put(JOB_HANDLER_CFG_PROCESS_DEFINITION_ID, processDefinitionId);
    json.put(JOB_HANDLER_CFG_INCLUDE_JOBS, includeJobs);

    return json.toString();
  }
View Full Code Here

    return json.toString();
  }

  public static String createJobHandlerConfigurationByProcessDefinitionKey(String processDefinitionKey, boolean includeJobs) {
    JSONObject json = new JSONObject();

    json.put(JOB_HANDLER_CFG_BY, JOB_HANDLER_CFG_PROCESS_DEFINITION_KEY);
    json.put(JOB_HANDLER_CFG_PROCESS_DEFINITION_KEY, processDefinitionKey);
    json.put(JOB_HANDLER_CFG_INCLUDE_JOBS, includeJobs);

    return json.toString();
  }
View Full Code Here

  protected static final String JOB_HANDLER_CFG_PROCESS_DEFINITION_KEY = "processDefinitionKey";

  private static final String JOB_HANDLER_CFG_INCLUDE_PROCESS_INSTANCES = "includeProcessInstances";

  public static String createJobHandlerConfigurationByProcessDefinitionId(String processDefinitionId, boolean includeProcessInstances) {
    JSONObject json = new JSONObject();

    json.put(JOB_HANDLER_CFG_BY, JOB_HANDLER_CFG_PROCESS_DEFINITION_ID);
    json.put(JOB_HANDLER_CFG_PROCESS_DEFINITION_ID, processDefinitionId);
    json.put(JOB_HANDLER_CFG_INCLUDE_PROCESS_INSTANCES, includeProcessInstances);

    return json.toString();
  }
View Full Code Here

  }

  public void setQueryInternal(String query) {
    ensureNotNull(NotValidException.class, "query", query);
    JsonObjectConverter<Object> converter = getConverter();
    this.query = (AbstractQuery<?, ?>) converter.toObject(new JSONObject(query));
  }
View Full Code Here

    this.query = (AbstractQuery<?, ?>) converter.toObject(new JSONObject(query));
  }

  public Map<String, Object> getProperties() {
    if (properties != null) {
      return JsonUtil.jsonObjectAsMap(new JSONObject(properties));
    }
    else {
      return null;
    }
  }
View Full Code Here

      return null;
    }
  }

  public String getPropertiesInternal() {
    return new JSONObject(properties).toString();
  }
View Full Code Here

    return this;
  }

  public void setPropertiesInternal(String properties) {
    if (properties != null) {
      JSONObject jsonObject = new JSONObject(properties);
      this.properties = JsonUtil.jsonObjectAsMap(jsonObject);
    }
    else {
      this.properties = null;
    }
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.impl.util.json.JSONObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.