Skip to content

Commit

Permalink
Adjusted names of elements in templates.
Browse files Browse the repository at this point in the history
  • Loading branch information
pme123 committed Jan 7, 2025
1 parent 2ba0206 commit 24c348a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion 03-api/src/main/scala/camundala/api/ApiCreator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ trait ApiCreator extends PostmanApiCreator, TapirApiCreator, App:
def document(apis: CApi*): Unit =
val apiDoc = ApiDoc(apis.toList)
apiConfig.init // pulls all dependencies.
ModelerTemplGenerator(version, apiConfig.modelerTemplateConfig, Some(projectName)).generate(
ModelerTemplGenerator(version, apiConfig.modelerTemplateConfig, projectName, apiProjectConfig.companyName).generate(
collectApis(apiDoc)
)
ModelerTemplUpdater(apiConfig, apiProjectConfig).update()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import camundala.domain.*
final case class ModelerTemplGenerator(
apiVersion: String,
config: ModelerTemplateConfig,
projectName: Option[String]
projectName: String,
companyName: String
) extends App:

lazy val version = apiVersion.split("\\.").head.toInt
Expand Down Expand Up @@ -42,14 +43,15 @@ final case class ModelerTemplGenerator(
if elementType == ElementType.callActivity then PropType.`camunda:out`
else PropType.`camunda:outputParameter`
)
val niceName = inOut.niceName.replace(s"${companyName.head.toUpper}${companyName.tail} ", "")
val templ = MTemplate(
inOut.id,
inOut.id,
inOut.descr.getOrElse("").split("---").head,
version,
appliesTo,
elementType,
mapProps ++ properties :+ TemplProp.name(inOut.niceName),
mapProps ++ properties :+ TemplProp.name(niceName),
config.schema
)
os.write.over(
Expand Down

0 comments on commit 24c348a

Please sign in to comment.