-
Story
-
Resolution: Done
-
Undefined
-
None
-
None
-
None
-
False
-
-
False
-
-
At this moment, task parameters are defined in each task definition as
TaskParameters, and it's rendered like this:
```
{
"id": "6977217b-89b3-49cb-a652-b32cc13177f7",
"name": "certWorkFlowTask",
"workType": "TASK",
"parameters": [
,
{ "description": "The user id", "optional": false, "type": "TEXT", "key": "user-id" }],
"outputs": [
"OTHER"
]
},
```
These parameters are not great, mainly because are hard to understand from the
frontend teams, and hard to implement custom validations. My proposal is to use
jsonschema to define the task parameters, so the params can be defined in a
good way. so the params will looks like this:
```
{
"id": "6977217b-89b3-49cb-a652-b32cc13177f7",
"name": "certWorkFlowTask",
"workType": "TASK",
"parameters": {
"api-server":
,
"user-id":
}
"outputs": [
"OTHER"
]
},
```
The good thing is that users can define custom validations in there, like:
```
"user-id":
```
For workflows will be looks like this:
```
WorkFlowTaskParameter
.builder()
.key("api-server")
.description("The api server")
.type(WorkFlowTaskParameterType.URL)
.optional(false).
.extraParams(HashMap<String, String>put("minimum", "18"))
.build(),
```
Where the extraParams are the tools that the user wants to implement. On the
workload definition is kinda easy to match
On the frontend side, can be consumed by any library, but I had great success
with react-jsonschema