private static String toProcessVariableString(Property p) { String processVariableName = getProcessVariableName(p); return Optional.ofNullable(p.getItemSubjectRef()) .map(ItemDefinition::getStructureRef) .map(type -> processVariableName + ":" + type) .orElse(processVariableName); }
private static String toCaseFileVariableString(Property p) { String variableName = getCaseFileVariableName(p); String caseFileVariableName = variableName.substring(CaseFileVariables.CASE_FILE_PREFIX.length()); return Optional.ofNullable(p.getItemSubjectRef()) .map(ItemDefinition::getStructureRef) .map(type -> caseFileVariableName + ":" + type) .orElse(caseFileVariableName); }
private Set<DataHolder> getProcessDataHolders( List<Property> processProperties, String path ) { Set<DataHolder> result = new TreeSet<DataHolder>(); String[] colors = dataHolderManager.getHolderColors().keySet().toArray( new String[0] ); int index = 0; for ( Property prop : processProperties ) { String propertyName = prop.getId(); String propertyType = StringUtils.defaultIfEmpty( prop.getItemSubjectRef().getStructureRef(), "java.lang.Object" ); DataHolderBuildConfig config = new DataHolderBuildConfig( propertyName, "", propertyName, colors[index], propertyType ); config.addAttribute( "path", path ); DataHolder dataHolder = createDataHolder( config ); if ( dataHolder != null ) result.add( dataHolder ); if ( index == colors.length - 1 ) index = 0; else index++; } return result; }
private Property getProcessProperty(List<Property> properties, String id, String itemSubjectRef) { for (Property property : properties) { if (id.equals(property.getId())) { if (itemSubjectRef.equals(property.getItemSubjectRef().getId())) { return property; } else { return null; } } } return null; }
@Before public void setup() { properties = new ArrayList<>(); properties.add(property1); properties.add(property2); properties.add(property3); properties.add(property4); when(property1.getName()).thenReturn(CaseFileVariables.CASE_FILE_PREFIX + "CFV1"); when(property1.getId()).thenReturn(CaseFileVariables.CASE_FILE_PREFIX + "CFV1"); when(property1.getItemSubjectRef()).thenReturn(definition); when(property2.getName()).thenReturn(null); when(property2.getId()).thenReturn(CaseFileVariables.CASE_FILE_PREFIX + "CFV2"); when(property2.getItemSubjectRef()).thenReturn(definition); when(definition.getStructureRef()).thenReturn("Boolean"); when(property3.getName()).thenReturn("PV1"); when(property3.getId()).thenReturn("PV1"); when(property4.getName()).thenReturn(null); when(property4.getId()).thenReturn("PV2"); }
private Property getProcessProperty(List<Property> properties, String id, String itemSubjectRef) { for (Property property : properties) { if (id.equals(property.getId()) || id.equals(property.getName())) { if (itemSubjectRef.equals(property.getItemSubjectRef().getId())) { return property; } else { return null; } } } return null; }
String holderClass = StringUtils.defaultIfEmpty( prop.getItemSubjectRef().getStructureRef(), "java.lang.Object" ); DataHolderBuildConfig config = new DataHolderBuildConfig( prop.getId(),
@Override public BusinessProcessFormModel generateProcessFormModel(Definitions source, Path path) { Process process = getProcess(source); if (process != null) { final ClassLoader projectClassLoader = projectClassLoaderHelper.getModuleClassLoader(moduleService.resolveModule(path)); List<ModelProperty> properties = process.getProperties().stream().map(property -> { String varName = property.getId(); String varType = BPMNVariableUtils.getRealTypeForInput(property.getItemSubjectRef().getStructureRef()); Variable variable = new Variable(varName, varType); variable.setInput(true); variable.setOutput(true); return createModelProperty(variable, projectClassLoader); }).filter(modelProperty -> modelProperty != null) .sorted((property1, property2) -> property1.getName().compareToIgnoreCase(property2.getName())).collect(Collectors.toList()); return new BusinessProcessFormModel(process.getId(), process.getName(), properties); } return null; }
propVal += p.getId(); if (p.getItemSubjectRef() != null && p.getItemSubjectRef().getStructureRef() != null) { propVal += ":" + p.getItemSubjectRef().getStructureRef();
propVal += p.getId(); if (p.getItemSubjectRef() != null && p.getItemSubjectRef().getStructureRef() != null) { propVal += ":" + p.getItemSubjectRef().getStructureRef();