public Builder entities(Map<String, String[]> entities) { definition.setAssociatedEntities(entities); return this; }
public Builder entitiesAsCollection(Map<String, Collection<String>> entities) { Map<String, String[]> data = new HashMap<String, String[]>(); for (Map.Entry<String, Collection<String>> entry : entities.entrySet()) { data.put(entry.getKey(), entry.getValue().toArray(new String[entry.getValue().size()])); } definition.setAssociatedEntities(data); return this; }
@Test public void testProcessSummaryMapper_mapProcessSummary() { final ProcessDefinition pd = new ProcessDefinition(); pd.setName("definitionName"); pd.setId("definitionId"); pd.setDynamic(true); pd.setContainerId("containerId"); pd.setVersion("1.0"); pd.setAssociatedEntities(singletonMap("e1", new String[0])); pd.setProcessVariables(singletonMap("initiator", "String")); pd.setReusableSubProcesses(singletonList("processOne")); pd.setServiceTasks(singletonMap("email", "org.jbpm")); pd.setNodes(singletonList(NodeDefinition.builder().id(1l).build())); pd.setTimers(singletonList(TimerDefinition.builder().id(1l).build())); assertProcessSummary(pd, new ProcessSummaryMapper().apply(pd)); }
@Test public void testProcessSummaryMapper_mapProcessSummary() { final ProcessDefinition pd = new ProcessDefinition(); pd.setName("definitionName"); pd.setId("definitionId"); pd.setDynamic(true); pd.setContainerId("containerId"); pd.setVersion("1.0"); pd.setAssociatedEntities(singletonMap("e1", new String[0])); pd.setProcessVariables(singletonMap("initiator", "String")); pd.setReusableSubProcesses(singletonList("processOne")); pd.setServiceTasks(singletonMap("email", "org.jbpm")); pd.setNodes(singletonList(NodeDefinition.builder().id(1l).build())); pd.setTimers(singletonList(TimerDefinition.builder().id(1l).build())); assertProcessSummary(pd, new ProcessSummaryMapper().apply(pd)); }