Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to add property conditionEditor in the TDI dataset

39 views
Skip to first unread message

Yangyang Feng

unread,
Aug 4, 2022, 3:40:08 AM8/4/22
to
Hi,

We have a request from customers that they want to add "conditionEditor" : "shown" into the return of TDI datasets, could you guide us on how to achieve that in TDI?
For example, query with "/ibm/tivoli/rest/providers/TDI/datasources/DASH_ITMCollector/datasets/DS_KS3_SPACE?optimize=true", the return is as following:
{
"datasetImplementation": "simple",
"datasourceId": "DASH_ITMCollector",
"eventsEnabled": false,
"id": "DS_KS3_SPACE",
"itemCount": 0,
"label": "KS3_SPACE",
"linkCount": 0,
"providerId": "TDI",
"relationshipCount": 0,
"remote": false,
"remoteHost": "smud90",
"status": [
{......}
],
"type": "",
"viewType": "table"
}

We need to add "conditionEditor" : "shown" in the return of the query, it could be like:
{
"conditionEditor" : "shown",
"datasetImplementation": "simple",
"datasourceId": "DASH_ITMCollector",
"eventsEnabled": false,
"id": "DS_KS3_SPACE",
"itemCount": 0,
"label": "KS3_SPACE",
"linkCount": 0,
"providerId": "TDI",
"relationshipCount": 0,
"remote": false,
"remoteHost": "smud90",
"status": [
{......}
],
"type": "",
"viewType": "table"
}

Thanks
Yangyang

Eddie Hartman

unread,
Sep 15, 2022, 5:17:14 AM9/15/22
to
If this is a json payload then it's pretty simple. First you turn the json into a js object:

jsobj = fromJson(jsonStringValueInYourPost);

To create a property named 'conditionEditor' you only have to assign it a value:

jsobj.conditionEditor = "shown";

Then to convert back to a json string:

// f.ex. write it to the log
task.logmsg("JSON:\n" + jsobj.toJson());

Hope this helps!

/Eddie

P.S. Just learned that my blog is going offline tomorrow. http://tdiingoutloud.com. Grab what you can.
0 new messages