public static List<TaskBean> filterTaskCandidateGroup(List<String> processDefinitionKey, List<String> candidateGroups) { return filterTask(processDefinitionKey, Map.of(CANDIDATE_GROUPS, candidateGroups.stream().collect(Collectors.joining(",")))); }
/** * 注册invoker * * @param service * 实现类实例,重复调用时不会覆盖,会一直使用首次注册的实例 * * @param clazz * 服务接口 * */ public synchronized void register(Class<?> clazz, Object service) { register(Map.of(clazz, service)); }
public static List<TaskBean> filterTaskCandidateGroup(List<String> processDefinitionKey, List<String> candidateGroups, Map<String, Object> variablesEquals) { String processVariables = getVariablesPathEquals(variablesEquals); return filterTask(processDefinitionKey, Map.of( // ASSIGNEE, CDI.current().select(UserInformation.class).get().get().getId().toString(), PROCESS_VARIABLES, processVariables, CANDIDATE_GROUP, candidateGroups.stream().collect(Collectors.joining(",")) )); }
public static List<TaskBean> filterTaskCandidateGroup(List<String> processDefinitionKey, List<String> candidateGroups, Map<String, Object> variablesEquals) { String processVariables = getVariablesPathEquals(variablesEquals); return filterTask(processDefinitionKey, Map.of( // ASSIGNEE, CDI.current().select(UserInformation.class).get().get().getId().toString(), PROCESS_VARIABLES, processVariables, CANDIDATE_GROUP, candidateGroups.stream().collect(Collectors.joining(",")) )); }
@Override public Map<String, List<String>> get(URI uri, Map<String, List<String>> requestHeaders) throws IOException { var headers = super.get(uri, requestHeaders); var userList = requestHeaders.getOrDefault(HeaderNames.COOKIE, List.of()); var sessionList = headers.getOrDefault(HeaderNames.COOKIE, List.of()); var cookieValues = Lists.concat(userList, sessionList); if (cookieValues.isEmpty()) { return Map.of(); } return Map.of(HeaderNames.COOKIE, cookieValues); } }
private static CompoundParams getParameters(String generatorMnemonic, String string) { if (string.startsWith(generatorMnemonic + " ")) { var parametersString = string.substring(generatorMnemonic.length() + 1); return new CompoundParams(generatorMnemonic, Map.copyOf(getParameters(parametersString))); } else if (string.equals(generatorMnemonic)) { return new CompoundParams(generatorMnemonic, Map.of()); } else { return null; } }
private static Collection<JoinableMap> getReadableLayers() { Collection<JoinableMap> result = new ArrayList<>(); for(ReadRowsLayerInterface layer : getAll(ReadRowsLayerInterface.class, (L)->true)) { result.add(new JoinableMap(Map.of("name", layer.getImplName()))); } return result; }
public void reportHttpRequest(String clientVersion) { if (clientVersion != null) { try { Point point = versionPointCache.get(clientVersion, () -> new Point(Map.of("client-version", clientVersion))); feedRequests.add(point); } catch (ExecutionException e) { // When Point constructor throws an exception throw new RuntimeException(e); } } else { feedRequests.add(); } }
public static List<TaskBean> filterTaskVariables(String processDefinitionKey, Map<String, Object> variablesEquals) { String processVariables = getVariablesPathEquals(variablesEquals); return filterTask(processDefinitionKey, Map.of(PROCESS_VARIABLES, processVariables)); }
public static List<TaskBean> filterTaskVariables(String processDefinitionKey, Map<String, Object> variablesEquals) { String processVariables = getVariablesPathEquals(variablesEquals); return filterTask(processDefinitionKey, Map.of(PROCESS_VARIABLES, processVariables)); }
public static List<ProcessInstanceBean> filterProcessInstance(List<String> processDefinitionKey, Map<String, Object> variablesEquals) { String processVariables = getVariablesPathEquals(variablesEquals); return filterProcessInstanceBase(processDefinitionKey, Map.of(VARIABLES, processVariables)); }
public static List<TaskBean> filterTaskAssignee(List<String> processDefinitionKey) { return filterTask(processDefinitionKey, Map.of(ASSIGNEE, CDI.current().select(UserInformation.class).get().get().getId().toString())); }
public static List<TaskBean> filterTaskInvolvedUser(List<String> processDefinitionKey) { return filterTask(processDefinitionKey, Map.of(INVOLVED_USER, CDI.current().select(UserInformation.class).get().get().getId().toString())); }
public static List<TaskBean> filterTaskCandidateUser(List<String> processDefinitionKey) { return filterTask(processDefinitionKey, Map.of(CANDIDATE_USER, CDI.current().select(UserInformation.class).get().get().getId().toString())); }
public static List<ProcessInstanceBean> filterProcessInstance(String processDefinitionKey, Map<String, Object> variablesEquals) { String processVariables = getVariablesPathEquals(variablesEquals); return filterProcessInstanceBase(List.of(processDefinitionKey), Map.of(VARIABLES, processVariables)); }
public static List<ProcessInstanceBean> filterProcessInstance(String processDefinitionKey, Map<String, Object> variablesEquals) { String processVariables = getVariablesPathEquals(variablesEquals); return filterProcessInstanceBase(List.of(processDefinitionKey), Map.of(VARIABLES, processVariables)); }
public static TestSpecificationElement booleanNode(String name) { return new TestSpecificationElement(name, SpecificationElementType.EMBEDDED, Set.of("boolean"), List.of(), Set.of(), Map.of(), null); }
public static TestSpecificationElement numericNode(String name) { return new TestSpecificationElement(name, SpecificationElementType.EMBEDDED, Set.of("numeric"), List.of(), Set.of(), Map.of(), null); }
public static TestSpecificationElement arrayNode(String name, TestSpecificationElement items) { TestSpecificationElement arrayNode = new TestSpecificationElement(name, SpecificationElementType.EMBEDDED, Set.of("array"), List.of(), Set.of(), Map.of(), items); items.parent(arrayNode); return arrayNode; }
@Test void serializeTags() { assertSoftly(softly -> { softly.assertThat(serializeTags(Map.of(".**", "foo.bar"))).isEqualTo(toJson(Map.of("___", "foo.bar"))); softly.assertThat(serializeTags(Map.of("foo.bar", "baz"))).isEqualTo(toJson(Map.of("foo_bar", "baz"))); softly.assertThat(serializeTags(Map.of("foo.bar.baz", "qux"))).isEqualTo(toJson(Map.of("foo_bar_baz", "qux"))); softly.assertThat(serializeTags(Map.of("foo*bar*baz", "qux"))).isEqualTo(toJson(Map.of("foo_bar_baz", "qux"))); softly.assertThat(serializeTags(Map.of("foo\"bar\"baz", "qux"))).isEqualTo(toJson(Map.of("foo_bar_baz", "qux"))); final String longRandomString = RandomStringUtils.randomAlphanumeric(1025); final String truncatedLongRandomString = longRandomString.substring(0, 1023) + "…"; softly.assertThat(serializeTags(Map.of(longRandomString, longRandomString))).isEqualTo(toJson(Map.of(truncatedLongRandomString, truncatedLongRandomString))); }); }