siddhi-io / siddhi-execution-string

Extension that provides basic string handling capabilities
https://wso2-extensions.github.io/siddhi-execution-string/
Apache License 2.0
4 stars 37 forks source link

Add support for fillTemplate to use a map along using a set of keys #62

Closed BuddhiWathsala closed 5 years ago

BuddhiWathsala commented 5 years ago

Purpose

Resolve #61.

Goals

Support key-value map template replacement in this extension.

Approach

User stories

User can use this as follow.

Input

str:fillTemplate("{{prize}} > 100 && {{salary}} < 10000",  map:create('prize', 300, 'salary', 10000)))

Output

300 > 100 && 10000 < 10000

Release note

Support str:fillTemplate(STRING, MAP) along with str:fillTemplate(STRING, STRING, ...)

Automation tests

Test environment

Java version "1.8.0_201" Java(TM) SE Runtime Environment (build 1.8.0_201-b09)

suhothayan commented 5 years ago

The release should be Support key value-based str:fillTemplate(STRING, MAP) along with index based str:fillTemplate(STRING, STRING, ...)