Skip to content

Commit 5b19d8c

Browse files
author
Ahmad-Nouri1
committed
Changes done for v1.1.9.
1 parent dbd3755 commit 5b19d8c

File tree

12 files changed

+136
-53
lines changed

12 files changed

+136
-53
lines changed

Makefile

Lines changed: 0 additions & 40 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,16 +285,16 @@ This toolkit came into existence for a specific need with which a large enterpri
285285
(Value.Status.Event equalsCI 'PATCHING') && ((Value.Status.UserName containsCI 'EWR') || (Value.Status.EntityState equalsCI 'ENGINEERING') || ((Value.Properties.OwnedBy containsCI 'FER') && ((Value.Status.Availability equalsCI 'Up') || ((Value.Status.Availability equalsCI 'Down') && (Value.Status.StatusCategory3 containsCI 'StatusCategory3'))))) && (Value.Status.StatusCategory4 equalsCI 'StatusCategory4')
286286

287287
## Source code
288-
The complete C++ logic for the **eval_predicate** function is available in the [eval_predicate.h](impl/include/eval_predicate.h) file of this repository.
288+
The complete C++ logic for the **eval_predicate** function is available in the [eval_predicate.h](com.ibm.streamsx.eval_predicate/impl/include/eval_predicate.h) file of this repository.
289289

290290
## Example applications
291-
There is a well documented and well tested example application available in the [EvalPredicateExample.spl](com.ibm.streamsx.eval_predicate/EvalPredicateExample.spl) file of this repository. Users can browse that example code, compile and run it to become familiar with the usage of the **eval_predicate** function. There is also [FunctionalTests.spl](com.ibm.streamsx.eval_predicate/FunctionalTests.spl) which is a comprehensive application that tests the major code paths in the **eval_predicate** function.
291+
There is a well documented and well tested example application available in the [EvalPredicateExample.spl](samples/01_eval_predicate_example/com.ibm.streamsx.eval_predicate.test/EvalPredicateExample.spl) file of this repository. Users can browse that example code, compile and run it to become familiar with the usage of the **eval_predicate** function. There is also [FunctionalTests.spl](samples/02_eval_predicate_functional_tests/com.ibm.streamsx.eval_predicate.test/FunctionalTests.spl) which is a comprehensive application that tests the major code paths in the **eval_predicate** function.
292292

293-
At the top-level of this toolkit directory, a *Makefile* can be found. To build the two example applications mentioned above, one can type `make` from a Linux terminal window by being in that top-level directory. Alternatively, the extracted toolkit directory can also be imported into IBM Streams Studio or Microsoft Visual Studio Code. Before importing, it is a must to rename that Makefile in that top-level directory to *Makefile.org*. Only with that renaming of the Makefile, the example applications will build correctly after importing the toolkit into the Studio development environment.
293+
A *Makefile* can be found in each of the example applications mentioned above. One can type `make` from a Linux terminal window by being inside the specific example directory. Alternatively, the extracted toolkit directory and the individual example directories can also be imported into IBM Streams Studio or Microsoft Visual Studio Code. Before importing, it is a must to rename that Makefile in that example directory to *Makefile.org*. Only with that renaming of the Makefile, the example applications will build correctly after importing the toolkit into the Studio development environment.
294294

295295
## Getting an official version of this toolkit
296296
One can clone this repository as needed for making code changes. But, for users who only want to use this toolkit in their applications, it is better to download an official version of this toolkit that has a release tag. In the right hand side column of this web page, you will see the *Releases* section. There, you can click on the *Latest* button and then download the tar.gz file which can be extracted for ready use as a dependency in your IBM Streams application project.
297297

298298
## WHATS NEW
299299

300-
see: [CHANGELOG.md](CHANGELOG.md)
300+
see: [CHANGELOG.md](com.ibm.streamsx.eval_predicate/CHANGELOG.md)

CHANGELOG.md renamed to com.ibm.streamsx.eval_predicate/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changes
22

3+
## v1.1.9
4+
* Mar/05/2024
5+
* Rearranged this toolkit's directory to have a top-level directory that in turn contains two subdirectories i.e. com.ibm.streamsx.eval_predicate subdirectory containing the main C++ code for this toolkit and the samples subdirectory containing two comprehensive examples showcasing the eval_predicate features.
6+
* Both the EvalPredicateExample and FunctionalTests applications are now placed in their own subirectories within the samples directory in a new namespace com.ibm.streamsx.eval_predicate.test.
7+
* Other than the above-mentioned directory and file restructuring, there are no functional changes done in this release.
8+
* User applications that want to use this toolkit will have to now have this statement at the top of their SPL file(s): use com.ibm.streamsx.eval_predicate::*;
9+
310
## v1.1.8
411
* Oct/11/2023
512
* Made a fix to correctly evaluate new multi-level nested expression patterns as shown in the test cases A51.22 to A51.24 in FunctionalTests.spl.
File renamed without changes.
File renamed without changes.

info.xml renamed to com.ibm.streamsx.eval_predicate/info.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<info:toolkitInfoModel xmlns:common="http://www.ibm.com/xmlns/prod/streams/spl/common"
33
xmlns:info="http://www.ibm.com/xmlns/prod/streams/spl/toolkitInfo">
44
<info:identity>
5-
<info:name>eval_predicate</info:name>
5+
<info:name>com.ibm.streamsx.eval_predicate</info:name>
66
<info:description>Toolkit for user defined rule (expression) processing</info:description>
7-
<info:version>1.1.8</info:version>
7+
<info:version>1.1.9</info:version>
88
<info:requiredProductVersion>4.2.1.6</info:requiredProductVersion>
99
</info:identity>
1010
<info:dependencies/>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright (C)2020, 2024 International Business Machines Corporation and
2+
# others. All Rights Reserved.
3+
.PHONY: build all distributed clean
4+
5+
# Please point this to your correct eval_predicate toolkit location.
6+
STREAMS_EVAL_PREDICATE_TOOLKIT ?= $(PWD)/../../com.ibm.streamsx.eval_predicate
7+
8+
ifeq ($(STREAMS_STUDIO_BUILDING), 1)
9+
$(info Building from Streams Studio, use env vars set by studio)
10+
SPLC = $(STREAMS_STUDIO_SC_PATH)
11+
DATA_DIR = $(STREAMS_STUDIO_DATA_DIRECTORY)
12+
OUTPUT_DIR = $(STREAMS_STUDIO_OUTPUT_DIRECTORY)
13+
TOOLKIT_PATH = $(STREAMS_STUDIO_SPL_PATH)
14+
else
15+
$(info build use env settings)
16+
ifndef STREAMS_INSTALL
17+
$(error require streams environment STREAMS_INSTALL)
18+
endif
19+
SPLC = $(STREAMS_INSTALL)/bin/sc
20+
DATA_DIR = data
21+
OUTPUT_DIR = output/com.ibm.streamsx.eval_predicate.test.EvalPredicateExample/BuildConfig
22+
TOOLKIT_PATH = $(STREAMS_EVAL_PREDICATE_TOOLKIT)
23+
endif
24+
25+
SPL_MAIN_COMPOSITE = com.ibm.streamsx.eval_predicate.test::EvalPredicateExample
26+
SPLC_FLAGS = -a
27+
SPL_CMD_ARGS ?=
28+
29+
build: distributed
30+
31+
all: clean build
32+
33+
distributed:
34+
$(SPLC) $(SPLC_FLAGS) -M $(SPL_MAIN_COMPOSITE) -t ${TOOLKIT_PATH} --data-dir $(DATA_DIR) --output-dir $(OUTPUT_DIR) $(SPL_CMD_ARGS)
35+
36+
clean:
37+
$(SPLC) $(SPLC_FLAGS) -M $(SPL_MAIN_COMPOSITE) -t ${TOOLKIT_PATH} --data-dir $(DATA_DIR) --output-dir $(OUTPUT_DIR) -C $(SPL_CMD_ARGS)
38+
39+
rm -rf output

com.ibm.streamsx.eval_predicate/EvalPredicateExample.spl renamed to samples/01_eval_predicate_example/com.ibm.streamsx.eval_predicate.test/EvalPredicateExample.spl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/*
22
==============================================
33
# Licensed Materials - Property of IBM
4-
# Copyright IBM Corp. 2021, 2023
4+
# Copyright IBM Corp. 2021, 2024
55
==============================================
66
*/
77

88
/*
99
==================================================================
1010
First created on: Mar/05/2021
11-
Last modified on: Sep/20/2023
11+
Last modified on: Mar/05/2024
1212

1313
This is an example application that shows how to use the
1414
eval_predicate function to evaluate an SPL expression a.k.a
@@ -142,7 +142,11 @@ importing the toolkit into the Studio development environment.
142142
==================================================================
143143
*/
144144
// eval_predicate function is available from this namespace.
145-
namespace com.ibm.streamsx.eval_predicate;
145+
namespace com.ibm.streamsx.eval_predicate.test;
146+
147+
// We have to declare the use of this namespace from where we will get the
148+
// eval_predicate native functions that are called from this application.
149+
use com.ibm.streamsx.eval_predicate::*;
146150

147151
// This is the main composite for this application.
148152
composite EvalPredicateExample {
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<info:toolkitInfoModel xmlns:common="http://www.ibm.com/xmlns/prod/streams/spl/common" xmlns:info="http://www.ibm.com/xmlns/prod/streams/spl/toolkitInfo">
3+
<info:identity>
4+
<info:name>01_eval_predicate_example</info:name>
5+
<info:description>Simple example that showcases the major eval_predicate features.</info:description>
6+
<info:version>1.1.9</info:version>
7+
<info:requiredProductVersion>4.2.0.0</info:requiredProductVersion>
8+
</info:identity>
9+
<info:dependencies>
10+
<info:toolkit>
11+
<common:name>com.ibm.streamsx.eval_predicate</common:name>
12+
<common:version>[1.1.9,9.0.0)</common:version>
13+
</info:toolkit>
14+
</info:dependencies>
15+
</info:toolkitInfoModel>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright (C)2020, 2024 International Business Machines Corporation and
2+
# others. All Rights Reserved.
3+
.PHONY: build all distributed clean
4+
5+
# Please point this to your correct eval_predicate toolkit location.
6+
STREAMS_EVAL_PREDICATE_TOOLKIT ?= $(PWD)/../../com.ibm.streamsx.eval_predicate
7+
8+
ifeq ($(STREAMS_STUDIO_BUILDING), 1)
9+
$(info Building from Streams Studio, use env vars set by studio)
10+
SPLC = $(STREAMS_STUDIO_SC_PATH)
11+
DATA_DIR = $(STREAMS_STUDIO_DATA_DIRECTORY)
12+
OUTPUT_DIR = $(STREAMS_STUDIO_OUTPUT_DIRECTORY)
13+
TOOLKIT_PATH = $(STREAMS_STUDIO_SPL_PATH)
14+
else
15+
$(info build use env settings)
16+
ifndef STREAMS_INSTALL
17+
$(error require streams environment STREAMS_INSTALL)
18+
endif
19+
SPLC = $(STREAMS_INSTALL)/bin/sc
20+
DATA_DIR = data
21+
OUTPUT_DIR = output/com.ibm.streamsx.eval_predicate.test.FunctionalTests/BuildConfig
22+
TOOLKIT_PATH = $(STREAMS_EVAL_PREDICATE_TOOLKIT)
23+
endif
24+
25+
SPL_MAIN_COMPOSITE = com.ibm.streamsx.eval_predicate.test::FunctionalTests
26+
SPLC_FLAGS = -a
27+
SPL_CMD_ARGS ?=
28+
29+
build: distributed
30+
31+
all: clean build
32+
33+
distributed:
34+
$(SPLC) $(SPLC_FLAGS) -M $(SPL_MAIN_COMPOSITE) -t ${TOOLKIT_PATH} --data-dir $(DATA_DIR) --output-dir $(OUTPUT_DIR) $(SPL_CMD_ARGS)
35+
36+
clean:
37+
$(SPLC) $(SPLC_FLAGS) -M $(SPL_MAIN_COMPOSITE) -t ${TOOLKIT_PATH} --data-dir $(DATA_DIR) --output-dir $(OUTPUT_DIR) -C $(SPL_CMD_ARGS)
38+
39+
rm -rf output

0 commit comments

Comments
 (0)