Skip to content

Commit ba081d0

Browse files
committed
1674 - Update Condition definition, add OBJECT_BUILDER as ControlType in task dispatchers
1 parent 3839b30 commit ba081d0

File tree

5 files changed

+29
-22
lines changed

5 files changed

+29
-22
lines changed

server/libs/modules/task-dispatchers/condition/src/main/java/com/bytechef/task/dispatcher/condition/ConditionTaskDispatcherDefinitionFactory.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,22 +61,23 @@ public class ConditionTaskDispatcherDefinitionFactory implements TaskDispatcherD
6161
.description("Set condition as raw expression or list of conditions.")
6262
.defaultValue(false),
6363
array(CONDITIONS)
64-
.label("Conditions")
65-
.placeholder("Or Condition")
64+
.label("OR Conditions")
65+
.placeholder("Add OR Condition")
6666
.description("The type of values to compare.")
6767
.expressionEnabled(false)
6868
.displayCondition("%s == false".formatted(RAW_EXPRESSION))
6969
.items(
7070
array()
71-
.label("And conditions")
71+
.label("AND condition")
72+
.placeholder("Add AND Condition")
7273
.expressionEnabled(false)
7374
.items(
7475
object()
7576
.label("Boolean Expression")
7677
.expressionEnabled(false)
7778
.properties(
7879
object(BOOLEAN)
79-
.label("Boolean Expression")
80+
.label("Boolean")
8081
.expressionEnabled(false)
8182
.properties(
8283
bool(VALUE_1)
@@ -102,7 +103,7 @@ public class ConditionTaskDispatcherDefinitionFactory implements TaskDispatcherD
102103
.expressionEnabled(false)
103104
.properties(
104105
object(DATE_TIME)
105-
.label("Date & Time Expression")
106+
.label("Date & Time")
106107
.expressionEnabled(false)
107108
.properties(
108109
dateTime(VALUE_1)
@@ -128,7 +129,7 @@ public class ConditionTaskDispatcherDefinitionFactory implements TaskDispatcherD
128129
.expressionEnabled(false)
129130
.properties(
130131
object(NUMBER)
131-
.label("Number Expression")
132+
.label("Number")
132133
.expressionEnabled(false)
133134
.properties(
134135
number(VALUE_1)
@@ -165,7 +166,7 @@ public class ConditionTaskDispatcherDefinitionFactory implements TaskDispatcherD
165166
.expressionEnabled(false)
166167
.properties(
167168
object(STRING)
168-
.label("String Expression")
169+
.label("String")
169170
.expressionEnabled(false)
170171
.properties(
171172
string(VALUE_1)

server/libs/modules/task-dispatchers/condition/src/test/resources/definition/condition_v1.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"defaultValue" : null,
8686
"description" : null,
8787
"exampleValue" : null,
88-
"label" : "Boolean Expression",
88+
"label" : "Boolean",
8989
"placeholder" : null,
9090
"options" : null,
9191
"additionalProperties" : null,
@@ -165,9 +165,9 @@
165165
} ],
166166
"controlType" : "SELECT"
167167
} ],
168-
"controlType" : "SELECT"
168+
"controlType" : "OBJECT_BUILDER"
169169
} ],
170-
"controlType" : "SELECT"
170+
"controlType" : "OBJECT_BUILDER"
171171
}, {
172172
"advancedOption" : null,
173173
"displayCondition" : null,
@@ -197,7 +197,7 @@
197197
"defaultValue" : null,
198198
"description" : null,
199199
"exampleValue" : null,
200-
"label" : "Date & Time Expression",
200+
"label" : "Date & Time",
201201
"placeholder" : null,
202202
"options" : null,
203203
"additionalProperties" : null,
@@ -261,9 +261,9 @@
261261
"options" : null,
262262
"controlType" : "DATE_TIME"
263263
} ],
264-
"controlType" : "SELECT"
264+
"controlType" : "OBJECT_BUILDER"
265265
} ],
266-
"controlType" : "SELECT"
266+
"controlType" : "OBJECT_BUILDER"
267267
}, {
268268
"advancedOption" : null,
269269
"displayCondition" : null,
@@ -293,7 +293,7 @@
293293
"defaultValue" : null,
294294
"description" : null,
295295
"exampleValue" : null,
296-
"label" : "Number Expression",
296+
"label" : "Number",
297297
"placeholder" : null,
298298
"options" : null,
299299
"additionalProperties" : null,
@@ -387,9 +387,9 @@
387387
"numberPrecision" : null,
388388
"controlType" : "NUMBER"
389389
} ],
390-
"controlType" : "SELECT"
390+
"controlType" : "OBJECT_BUILDER"
391391
} ],
392-
"controlType" : "SELECT"
392+
"controlType" : "OBJECT_BUILDER"
393393
}, {
394394
"advancedOption" : null,
395395
"displayCondition" : null,
@@ -419,7 +419,7 @@
419419
"defaultValue" : null,
420420
"description" : null,
421421
"exampleValue" : null,
422-
"label" : "String Expression",
422+
"label" : "String",
423423
"placeholder" : null,
424424
"options" : null,
425425
"additionalProperties" : null,
@@ -529,9 +529,9 @@
529529
"maxLength" : null,
530530
"minLength" : null
531531
} ],
532-
"controlType" : "SELECT"
532+
"controlType" : "OBJECT_BUILDER"
533533
} ],
534-
"controlType" : "SELECT"
534+
"controlType" : "OBJECT_BUILDER"
535535
} ],
536536
"maxItems" : null,
537537
"minItems" : null,

server/libs/platform/platform-configuration/platform-configuration-rest/platform-configuration-rest-api/src/main/java/com/bytechef/platform/configuration/web/rest/mapper/PropertyMapper.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,9 @@ public interface TaskDispatcherPropertyMapper
171171
com.bytechef.platform.workflow.task.dispatcher.registry.domain.Property.PropertyVisitor {
172172

173173
@Override
174-
default PropertyModel
175-
convert(com.bytechef.platform.workflow.task.dispatcher.registry.domain.Property property) {
174+
default PropertyModel convert(
175+
com.bytechef.platform.workflow.task.dispatcher.registry.domain.Property property) {
176+
176177
return (PropertyModel) property.accept(this);
177178
}
178179

server/libs/platform/platform-workflow/platform-workflow-task-dispatcher/platform-workflow-task-dispatcher-api/src/main/java/com/bytechef/platform/workflow/task/dispatcher/definition/Property.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ enum ControlType implements BaseControlType {
4444
INTEGER,
4545
MULTI_SELECT,
4646
NUMBER,
47+
OBJECT_BUILDER,
4748
PASSWORD,
4849
PHONE,
4950
SELECT,

server/libs/platform/platform-workflow/platform-workflow-task-dispatcher/platform-workflow-task-dispatcher-api/src/main/java/com/bytechef/platform/workflow/task/dispatcher/definition/TaskDispatcherDsl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,11 @@ public Optional<List<? extends Property>> getAdditionalProperties() {
914914

915915
@Override
916916
public ControlType getControlType() {
917-
return ControlType.SELECT;
917+
if (options == null) {
918+
return ControlType.OBJECT_BUILDER;
919+
} else {
920+
return ControlType.SELECT;
921+
}
918922
}
919923

920924
public Optional<Boolean> getMultipleValues() {

0 commit comments

Comments
 (0)