bossenti commented on a change in pull request #38:
URL: 
https://github.com/apache/incubator-streampipes-extensions/pull/38#discussion_r603050196



##########
File path: 
streampipes-processors-transformation-jvm/src/main/java/org/apache/streampipes/processors/transformation/jvm/processor/booloperator/logical/BooleanOperatorProcessor.java
##########
@@ -0,0 +1,99 @@
+package 
org.apache.streampipes.processors.transformation.jvm.processor.booloperator.logical;
+
+import org.apache.streampipes.commons.exceptions.SpRuntimeException;
+import org.apache.streampipes.model.DataProcessorType;
+import org.apache.streampipes.model.graph.DataProcessorDescription;
+import org.apache.streampipes.model.runtime.Event;
+import 
org.apache.streampipes.processors.transformation.jvm.processor.booloperator.logical.enums.BooleanOperatorType;
+import 
org.apache.streampipes.processors.transformation.jvm.processor.booloperator.logical.operations.IBoolOperation;
+import 
org.apache.streampipes.processors.transformation.jvm.processor.booloperator.logical.operations.factory.BoolOperationFactory;
+import org.apache.streampipes.sdk.builder.PrimitivePropertyBuilder;
+import org.apache.streampipes.sdk.builder.ProcessingElementBuilder;
+import org.apache.streampipes.sdk.builder.StreamRequirementsBuilder;
+import org.apache.streampipes.sdk.helpers.EpRequirements;
+import org.apache.streampipes.sdk.helpers.Labels;
+import org.apache.streampipes.sdk.helpers.Locales;
+import org.apache.streampipes.sdk.helpers.OutputStrategies;
+import org.apache.streampipes.sdk.utils.Assets;
+import org.apache.streampipes.sdk.utils.Datatypes;
+import org.apache.streampipes.wrapper.context.EventProcessorRuntimeContext;
+import org.apache.streampipes.wrapper.routing.SpOutputCollector;
+import org.apache.streampipes.wrapper.standalone.ProcessorParams;
+import org.apache.streampipes.wrapper.standalone.StreamPipesDataProcessor;
+
+import java.util.List;
+
+import static 
org.apache.streampipes.processors.transformation.jvm.processor.booloperator.logical.enums.BooleanOperatorType.NOT;
+
+public class BooleanOperatorProcessor extends StreamPipesDataProcessor {
+
+    private static final String BOOLEAN_PROCESSOR_INPUT_KEY = 
"boolean-processor-configs";
+    private static final String BOOLEAN_PROCESSOR_OUT_KEY = 
"boolean-operations-result";
+    private BooleanOperationInputConfigs configs;
+
+    @Override
+    public DataProcessorDescription declareModel() {
+        return 
ProcessingElementBuilder.create("org.apache.streampipes.processors.transformation.jvm.processor.booloperator.logical")
+                .withAssets(Assets.DOCUMENTATION, Assets.ICON)
+                .withLocales(Locales.EN)
+                .category(DataProcessorType.ENRICH)
+                .requiredStream(
+                        StreamRequirementsBuilder
+                                .create()
+                                .requiredProperty(EpRequirements.anyProperty())
+                                .build())
+                
.requiredTextParameter(Labels.withId(BOOLEAN_PROCESSOR_INPUT_KEY))
+                .outputStrategy(OutputStrategies.append(
+                        PrimitivePropertyBuilder.create(
+                                Datatypes.String, BOOLEAN_PROCESSOR_OUT_KEY)
+                                .build()))
+                .build();
+    }
+
+    @Override
+    public void onInvocation(ProcessorParams processorParams, 
SpOutputCollector spOutputCollector, EventProcessorRuntimeContext 
eventProcessorRuntimeContext) throws SpRuntimeException {
+        BooleanOperationInputConfigs configs = 
processorParams.extractor().singleValueParameter(BOOLEAN_PROCESSOR_INPUT_KEY, 
BooleanOperationInputConfigs.class);

Review comment:
       Maybe I am missing something here, but where do the `properties `for the 
`BooleanOperationInputConfigs` come from?
   Are they supposed to be selected by the user? If so, we would need an 
additional UI element and would have to extract the values separately.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to