Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
elguardian committed Aug 30, 2024
1 parent 759c036 commit afa4f91
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,13 @@ protected Collection<GeneratedFile> internalGenerate() {
ConstructorDeclaration declaration = clazzDeclaration.findFirst(ConstructorDeclaration.class).get();
declaration.setName(className);

String taskNodeName = (String) info.getParameter(TASK_NAME);
Expression taskNameExpression = taskNodeName != null ? new StringLiteralExpr(taskNodeName) : new NullLiteralExpr();

BlockStmt block = declaration.getBody();
NodeList<Expression> arguments = new NodeList<>();
arguments.add(new StringLiteralExpr((String) info.getParameter("id")));
arguments.add(new StringLiteralExpr((String) info.getParameter(TASK_NAME)));
arguments.add(taskNameExpression);
arguments.add(new NullLiteralExpr());
block.addStatement(new ExplicitConstructorInvocationStmt().setThis(false).setArguments(arguments));
block.addStatement(new MethodCallExpr(new ThisExpr(), "setPotentialUsers", NodeList.nodeList(toStringExpression(info.getParameter(ACTOR_ID)))));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static String processId(Work descriptor) {
}

public static String className(Work descriptor) {
return processId(descriptor) + "_" + ConversionUtils.sanitizeClassName((String) descriptor.getParameter("TaskName"));
return processId(descriptor) + "_" + ConversionUtils.sanitizeClassName((String) descriptor.getParameter("id"));
}

public static String packageName(Work descriptor) {
Expand Down

0 comments on commit afa4f91

Please sign in to comment.