Optional sequence<NameValue> parameters?

Hi,

in a custom block to invoke an HTTP endpoint, we want to give users to option to provide additional headers for the request using a sequence parameter. This should be optional but when activating a model, we get an error about a mandatory parameter missing.

We tried using optional< sequence > but in that case we only get a single text field instead of an extensible list of name-value fields.

My understanding from the documentation is that “optional” should work in this case as well:

Is that a misunderstanding?

Hi Herald,
Yes, this should work.

I have tested with Range Lookup block by adding one more parameter
optional<sequence<eventWithPairOfFeilds>> testRanges .
I can see it is taking as list.

output of block with new param
test ranges are present [apama.as.NV(“5.0”,any(string,“bla”)),apama.as.NV(“15”,any(string,“blabla”))]

Thanks,
Sudha Jallu

1 Like

ok, let us retest that again.

1 Like

Hi,
I tried it again

I configured the headers parameter like this

	/**
	* Headers.
	*
	* Additional Headers to add.
	* @$displayType List of Header Key and Header Value
	* @$displayHeaderName Header Key
	* @$displayHeaderValue Header Value
	* @$minNumEntries 0
	*
	*/
	optional<sequence<NameValue>> headers;

But the block looks like this:

It looks like an usual text field and not like a sequence for Name Values.

Let me try from UI too.

Hi,

Yes you are right, It is not allowing from the UI.
I will create defect and also see if there is any workaround for this.

Thanks,
Sudha Jallu.

Hi,

I’m afraid there is no workaround available.

We will get back to you as we investigate further.

Could you share the platform details you are using ?

Thanks,
Sudha Jallu.

Hi Harald,
The issue has been fixed, and the fix is now available in the public block-sdk Git repository ( Cumulocity-IoT/apama-analytics-builder-block-sdk: Apama Analytics Builder Block SDK) as part of version 26.48.0.

Thanks & Regards,
Vinod

1 Like

Hi

I also tried it and it is looking fine now.
Thank you for your help.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.