Java Code Examples for org.camunda.bpm.engine.ProcessEngine#getFilterService()

The following examples show how to use org.camunda.bpm.engine.ProcessEngine#getFilterService() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TaskFilterPropertiesScenario.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
@DescribesScenario("initTaskFilterProperties")
public static ScenarioSetup initTaskFilterProperties() {
  return new ScenarioSetup() {
    public void execute(ProcessEngine engine, String scenarioName) {
      FilterService filterService = engine.getFilterService();

      Filter filterOne = filterService
        .newTaskFilter("taskFilterOne");

      Map<String, Object> primitivesMap = new HashMap<>();
      primitivesMap.put("string", "aStringValue");
      primitivesMap.put("int", 47);
      primitivesMap.put("intOutOfRange", Integer.MAX_VALUE + 1L);
      primitivesMap.put("long", Long.MAX_VALUE);
      primitivesMap.put("double", 3.14159265359D);
      primitivesMap.put("boolean", true);
      primitivesMap.put("null", null);

      filterOne.setProperties(Collections.<String, Object>singletonMap("foo", Collections.singletonList(primitivesMap)));
      filterService.saveFilter(filterOne);

      Filter filterTwo = engine.getFilterService()
        .newTaskFilter("taskFilterTwo");

      List<Object> primitivesList = new ArrayList<>();
      primitivesList.add("aStringValue");
      primitivesList.add(47);
      primitivesList.add(Integer.MAX_VALUE + 1L);
      primitivesList.add(Long.MAX_VALUE);
      primitivesList.add(3.14159265359D);
      primitivesList.add(true);
      primitivesList.add(null);

      filterTwo.setProperties(Collections.<String, Object>singletonMap("foo", Collections.singletonMap("bar", primitivesList)));
      filterService.saveFilter(filterTwo);
    }
  };
}