use of org.eclipse.smarthome.binding.mqtt.generic.internal.convention.homie300.Property in project kie-wb-common by kiegroup.
the class MultipleInstanceActivityPropertyWriter method setCollectionInput.
public void setCollectionInput(String collectionInput) {
if (isEmpty(collectionInput)) {
return;
}
setUpLoopCharacteristics();
String suffix = "IN_COLLECTION";
String id = Ids.dataInput(activity.getId(), suffix);
DataInput dataInputElement = createDataInput(id, suffix);
ioSpec.getDataInputs().add(dataInputElement);
// check whether this exist
Optional<Property> property = findPropertyById(collectionInput);
Optional<DataObject> dataObject = findDataObjectById(collectionInput);
if (property.isPresent()) {
processDataInput(dataInputElement, property.get());
} else if (dataObject.isPresent()) {
processDataInput(dataInputElement, dataObject.get());
}
}
use of org.eclipse.smarthome.binding.mqtt.generic.internal.convention.homie300.Property in project kie-wb-common by kiegroup.
the class ProcessPropertyWriter 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(), decl.getTags());
if (!decl.getTags().isEmpty()) {
CustomElement.customTags.of(variable.getTypedIdentifier()).set(decl.getTags());
}
properties.add(variable.getTypedIdentifier());
this.itemDefinitions.add(variable.getTypeDeclaration());
});
}
use of org.eclipse.smarthome.binding.mqtt.generic.internal.convention.homie300.Property in project kie-wb-common by kiegroup.
the class ActivityPropertyReaderTest method mockProperty.
public static Property mockProperty(String id) {
Property property = mock(Property.class);
when(property.getId()).thenReturn(id);
return property;
}
use of org.eclipse.smarthome.binding.mqtt.generic.internal.convention.homie300.Property in project kie-wb-common by kiegroup.
the class OutputAssignmentReaderTest method testFromAssociationWithPropertyName.
@Test
public void testFromAssociationWithPropertyName() {
Property property = mockProperty(TARGET_ID, TARGET_NAME);
DataOutputAssociation outputAssociation = mockDataOutputAssociation(SOURCE_NAME, property);
OutputAssignmentReader outputReader = OutputAssignmentReader.fromAssociation(outputAssociation);
assertNotNull(outputReader);
assertResult(SOURCE_NAME, TARGET_NAME, AssociationDeclaration.Type.SourceTarget, outputReader.getAssociationDeclaration());
}
use of org.eclipse.smarthome.binding.mqtt.generic.internal.convention.homie300.Property in project kie-wb-common by kiegroup.
the class SubProcessConverterTest method assertVariables.
private static void assertVariables(List<Pair<String, String>> expectedVariables, List<Property> properties) {
assertEquals(expectedVariables.size(), properties.size());
Pair<String, String> expectedVariable;
Property property;
for (int i = 0; i < expectedVariables.size(); i++) {
expectedVariable = expectedVariables.get(i);
property = properties.get(i);
assertEquals(expectedVariable.getK1(), property.getId());
assertEquals(expectedVariable.getK1(), property.getName());
assertEquals(String.format("_%sItem", expectedVariable.getK1()), property.getItemSubjectRef().getId());
assertEquals(expectedVariable.getK2(), property.getItemSubjectRef().getStructureRef());
}
}
Aggregations