Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public CompletableFuture<WorkflowModel> apply(
WorkflowContext workflowContext, TaskContext taskContext, WorkflowModel input) {
WorkflowModelFactory modelFactory = workflowContext.definition().application().modelFactory();
return CompletableFuture.completedFuture(
modelFactory.fromAny(function.apply(JavaFuncUtils.convertT(input, inputClass))));
modelFactory.fromAny(input, function.apply(JavaFuncUtils.convertT(input, inputClass))));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public CompletableFuture<WorkflowModel> apply(
WorkflowModelFactory modelFactory = workflowContext.definition().application().modelFactory();
return CompletableFuture.completedFuture(
modelFactory.fromAny(
input,
function.apply(
input.asJavaObject(), safeObject(taskContext.variables().get(varName)))));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public CompletableFuture<WorkflowModel> apply(

return CompletableFuture.completedFuture(
modelFactory.fromAny(
input,
function.apply(
input.asJavaObject(),
safeObject(taskContext.variables().get(varName)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public ObjectExpression buildExpression(ExpressionDescriptor descriptor) {
} else if (value instanceof TypedFunction func) {
return (w, t, n) -> func.function().apply(n.as(func.argClass()).orElseThrow());
} else {
return (w, t, n) -> modelFactory.fromAny(value);
return (w, t, n) -> value;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public void init(
(request, w, context, node) ->
converter.toModel(
application.modelFactory(),
node,
request.post(
converter.toEntity(bodyFilter.apply(w, context, node)),
node.objectClass()));
Expand All @@ -118,7 +119,7 @@ public void init(
default:
this.requestFunction =
(request, w, t, n) ->
converter.toModel(application.modelFactory(), request.get(n.objectClass()));
converter.toModel(application.modelFactory(), n, request.get(n.objectClass()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

public interface HttpModelConverter {

default WorkflowModel toModel(WorkflowModelFactory factory, Object entity) {
return factory.fromAny(entity);
default WorkflowModel toModel(WorkflowModelFactory factory, WorkflowModel model, Object entity) {
return factory.fromAny(model, entity);
}

default Entity toEntity(Map<String, Object> model) {
Expand Down
Loading