Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 4 additions & 1 deletion src/subworkflows/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ function createSubworkflow({
}

const { functions = {}, attributes = {}, ...cfg } = config;
let subworkflow = subworkflowCls.fromArguments(application, model, method, name, units, cfg);
let subworkflow = subworkflowCls.fromArguments(application, model, method, name, units, {
...cfg,
attributes,
});
subworkflow = applyConfig({ obj: subworkflow, config: { functions, attributes } });
if (setSearchText) subworkflow.model.method.setSearchText(setSearchText);
return subworkflow;
Expand Down
4 changes: 3 additions & 1 deletion src/subworkflows/subworkflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,11 @@ export class Subworkflow extends BaseSubworkflow {
config = {},
Cls = Subworkflow,
) {
const idName = config.attributes?.name || name;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nameForIdGeneration


return new Cls({
...config,
_id: Cls.generateSubworkflowId(name),
_id: Cls.generateSubworkflowId(idName),
name,
application: application.toJSON(),
properties: lodash.sortedUniq(
Expand Down