Skip to content

Commit

Permalink
checkout kie-kogito-runtimes-3770: Use the workflow id as the auto-ge…
Browse files Browse the repository at this point in the history
…nerated value for the name, when the workflow definition has no value in the attribute name (apache#3771) (#77)

(cherry picked from commit 5876428)
  • Loading branch information
wmedvede authored Nov 13, 2024
1 parent bd17486 commit 6308ea7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
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

0 comments on commit 6308ea7

Please sign in to comment.