You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by bo...@apache.org on 2021/05/12 07:48:24 UTC

[incubator-streampipes-extensions] 02/04: [STREAMPIPES-350] add label values as valueSpecification

This is an automated email from the ASF dual-hosted git repository.

bossenti pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes-extensions.git

commit 6fdfa136ff4c797a033f1879b7e3f36c4961342e
Author: bossenti <bo...@posteo.de>
AuthorDate: Fri Apr 30 08:26:53 2021 +0200

    [STREAMPIPES-350] add label values as valueSpecification
---
 .../transformation/jvm/processor/state/labeler/LabelerUtils.java       | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/streampipes-processors-transformation-jvm/src/main/java/org/apache/streampipes/processors/transformation/jvm/processor/state/labeler/LabelerUtils.java b/streampipes-processors-transformation-jvm/src/main/java/org/apache/streampipes/processors/transformation/jvm/processor/state/labeler/LabelerUtils.java
index 31db2f2..eba8d13 100644
--- a/streampipes-processors-transformation-jvm/src/main/java/org/apache/streampipes/processors/transformation/jvm/processor/state/labeler/LabelerUtils.java
+++ b/streampipes-processors-transformation-jvm/src/main/java/org/apache/streampipes/processors/transformation/jvm/processor/state/labeler/LabelerUtils.java
@@ -14,7 +14,7 @@ import java.util.List;
 
 public class LabelerUtils {
 
-    public static EventSchema resolveOutputStrategy(DataProcessorInvocation processingElement, String labelName) throws SpRuntimeException {
+    public static EventSchema resolveOutputStrategy(DataProcessorInvocation processingElement, String labelName, List<String> labelStrings) throws SpRuntimeException {
 
         List<EventProperty> properties = processingElement
                 .getInputStreams()
@@ -24,6 +24,7 @@ public class LabelerUtils {
 
         properties.add(PrimitivePropertyBuilder
                 .create(Datatypes.String, labelName)
+                .valueSpecification(labelName, "possible label values", labelStrings)
                 .domainProperty(SPSensor.STATE)
                 .scope(PropertyScope.DIMENSION_PROPERTY)
                 .build());