use of io.atlasmap.v2.Property in project kie-wb-common by kiegroup.
the class OutputAssignmentReaderTest method testFromAssociationWithPropertyId.
@Test
public void testFromAssociationWithPropertyId() {
Property property = mockProperty(TARGET_ID, null);
DataOutputAssociation outputAssociation = mockDataOutputAssociation(SOURCE_NAME, property);
OutputAssignmentReader outputReader = OutputAssignmentReader.fromAssociation(outputAssociation);
assertNotNull(outputReader);
assertResult(SOURCE_NAME, TARGET_ID, AssociationDeclaration.Type.SourceTarget, outputReader.getAssociationDeclaration());
}
use of io.atlasmap.v2.Property in project kie-wb-common by kiegroup.
the class SubProcessPropertyWriter method setProcessVariables.
public void setProcessVariables(BaseProcessVariables processVariables) {
String value = processVariables.getValue();
DeclarationList declarationList = DeclarationList.fromString(value);
List<Property> properties = process.getProperties();
declarationList.getDeclarations().forEach(decl -> {
VariableScope.Variable variable = variableScope.declare(this.process.getId(), decl.getIdentifier(), decl.getType());
if (!decl.getTags().isEmpty()) {
CustomElement.customTags.of(variable.getTypedIdentifier()).set(decl.getTags());
}
properties.add(variable.getTypedIdentifier());
this.itemDefinitions.add(variable.getTypeDeclaration());
});
}
use of io.atlasmap.v2.Property in project kie-wb-common by kiegroup.
the class MultipleInstanceActivityPropertyWriter method setCollectionOutput.
public void setCollectionOutput(String collectionOutput) {
if (isEmpty(collectionOutput)) {
return;
}
setUpLoopCharacteristics();
String suffix = "OUT_COLLECTION";
String id = Ids.dataOutput(activity.getId(), suffix);
DataOutput dataOutputElement = createDataOutput(id, suffix);
addSafe(ioSpec.getDataOutputs(), dataOutputElement);
Optional<Property> property = findPropertyById(collectionOutput);
Optional<DataObject> dataObject = findDataObjectById(collectionOutput);
if (property.isPresent()) {
processDataOutput(dataOutputElement, property.get());
} else if (dataObject.isPresent()) {
processDataOutput(dataOutputElement, dataObject.get());
}
}
use of io.atlasmap.v2.Property in project kie-wb-common by kiegroup.
the class ProcessPropertyWriter method setCaseFileVariables.
public void setCaseFileVariables(CaseFileVariables caseFileVariables) {
String value = caseFileVariables.getValue();
DeclarationList declarationList = DeclarationList.fromString(value);
List<Property> properties = process.getProperties();
declarationList.getDeclarations().forEach(decl -> {
VariableScope.Variable variable = variableScope.declare(this.process.getId(), CaseFileVariables.CASE_FILE_PREFIX + decl.getIdentifier(), decl.getType());
properties.add(variable.getTypedIdentifier());
this.itemDefinitions.add(variable.getTypeDeclaration());
});
}
use of io.atlasmap.v2.Property in project kie-wb-common by kiegroup.
the class MultipleInstanceActivityPropertyWriterTest method mockProperty.
private Property mockProperty(String name, String itemSubjectRef) {
Property property = mock(Property.class);
when(property.getId()).thenReturn(name);
when(property.getName()).thenReturn(name);
ItemDefinition itemDefinition = mock(ItemDefinition.class);
when(itemDefinition.getId()).thenReturn(itemSubjectRef);
when(property.getItemSubjectRef()).thenReturn(itemDefinition);
return property;
}
Aggregations