Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[9.102.x-prod] kie-kogito-runtimes-3770: Use the workflow id as the auto-generated value for the name, when the workflow definition has no value in the attribute name #76

Closed
Closed
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 @@ -68,7 +68,6 @@ public class ServerlessWorkflowParser {

public static final String NODE_START_NAME = "Start";
public static final String NODE_END_NAME = "End";
public static final String DEFAULT_NAME = "workflow";
public static final String DEFAULT_PACKAGE = "org.kie.kogito.serverless";
public static final String DEFAULT_VERSION = "1.0";

Expand Down Expand Up @@ -127,7 +126,7 @@ private ServerlessWorkflowParser(Workflow workflow, KogitoBuildContext context)
private GeneratedInfo<KogitoWorkflowProcess> parseProcess() {

RuleFlowProcessFactory factory = RuleFlowProcessFactory.createProcess(workflow.getId(), !workflow.isKeepActive())
.name(workflow.getName() == null ? DEFAULT_NAME : workflow.getName())
.name(workflow.getName() == null ? workflow.getId() : workflow.getName())
.version(workflow.getVersion() == null ? DEFAULT_VERSION : workflow.getVersion())
.packageName(workflow.getMetadata() != null ? workflow.getMetadata().getOrDefault("package",
DEFAULT_PACKAGE) : DEFAULT_PACKAGE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ public void testMinimumWorkflow() {
ServerlessWorkflowParser parser = ServerlessWorkflowParser.of(workflow, JavaKogitoBuildContext.builder().build());
Process process = parser.getProcessInfo().info();
assertThat(parser.getProcessInfo().info()).isSameAs(process);
assertThat(process.getName()).isEqualTo(ServerlessWorkflowParser.DEFAULT_NAME);
assertThat(process.getName()).isEqualTo(workflow.getId());
assertThat(process.getVersion()).isEqualTo(ServerlessWorkflowParser.DEFAULT_VERSION);
assertThat(process.getPackageName()).isEqualTo(ServerlessWorkflowParser.DEFAULT_PACKAGE);
}
Expand Down
Loading