{"id":16119550,"url":"https://github.com/stephenott/vertx-bpmn-model-doc-generator","last_synced_at":"2025-03-18T10:31:34.549Z","repository":{"id":148176669,"uuid":"126062039","full_name":"StephenOTT/vertx-bpmn-model-doc-generator","owner":"StephenOTT","description":"Generate rendered FreeMarker templates based on Camunda BPM Model API usage of BPMN files.  Great for generating business process documentation based on a .bpmn file","archived":false,"fork":false,"pushed_at":"2018-03-20T22:23:09.000Z","size":122,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-28T09:11:43.451Z","etag":null,"topics":["bpmn","camunda","vertx","vertx-lang-js"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StephenOTT.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-20T18:08:23.000Z","updated_at":"2021-09-21T22:11:37.000Z","dependencies_parsed_at":"2023-05-19T09:00:23.169Z","dependency_job_id":null,"html_url":"https://github.com/StephenOTT/vertx-bpmn-model-doc-generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephenOTT%2Fvertx-bpmn-model-doc-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephenOTT%2Fvertx-bpmn-model-doc-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephenOTT%2Fvertx-bpmn-model-doc-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephenOTT%2Fvertx-bpmn-model-doc-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StephenOTT","download_url":"https://codeload.github.com/StephenOTT/vertx-bpmn-model-doc-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243922138,"owners_count":20369357,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bpmn","camunda","vertx","vertx-lang-js"],"created_at":"2024-10-09T20:54:26.057Z","updated_at":"2025-03-18T10:31:34.543Z","avatar_url":"https://github.com/StephenOTT.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Camunda BPMN Model API to Freemarker Template\n\nThis is a use case example of using the CamundaBPM (Camunda.org) Model API with Vertx.\nAllows you to provide a BPMN file which will be read and parsed by Camunda's Java Model API and then rendered through a provided FreeMarker template.\n\n## Still not sure what this does...\n\nThis lets you provide a FreeMarker template and a BPMN file; the output is a rendered template.  The purpose is to allow someone to navigate the Camunda BPMN model API directly in the FreeMarker template in order to easily generate documentation for BPMN files.\n\n# Setup\n\nInstall NPM Dependencies: `./gradlew clean npmInstall`\n\nRun Gradle Build: `./gradlew clean run`\n\n# References\n\n1. https://docs.camunda.org/javadoc/camunda-bpm-platform/7.8/?org/camunda/bpm/model/bpmn/instance/package-summary.html\n1. User Tasks Model Element: https://docs.camunda.org/javadoc/camunda-bpm-platform/7.8/org/camunda/bpm/model/bpmn/instance/UserTask.html\n\n\n# BPMN\n\n![bpmn image](./app/bpmn/myProcess.png)\n![extension configuration](./app/bpmn/extension_config.png)\n\n\n## BPMN File XML Snippet\n\n```xml\n...\n    \u003cbpmn:userTask id=\"Task_0w364uq\" name=\"Step 3\" camunda:assignee=\"chris\"\u003e\n      \u003cbpmn:extensionElements\u003e\n        \u003ccamunda:properties\u003e\n          \u003ccamunda:property name=\"order\" value=\"My Order\" /\u003e\n          \u003ccamunda:property name=\"title\" value=\"My Title\" /\u003e\n          \u003ccamunda:property name=\"failure\" value=\"My Failure\" /\u003e\n          \u003ccamunda:property name=\"resolution\" value=\"My Resolution\" /\u003e\n        \u003c/camunda:properties\u003e\n      \u003c/bpmn:extensionElements\u003e\n      \u003cbpmn:incoming\u003eSequenceFlow_0adri7o\u003c/bpmn:incoming\u003e\n      \u003cbpmn:outgoing\u003eSequenceFlow_15kfmnc\u003c/bpmn:outgoing\u003e\n    \u003c/bpmn:userTask\u003e\n...\n```\n\n\n# FreeMarker Template\n\ntemplate is loaded from `app/templates/myTemplate.ftl`\n\nExample:\n\n```freemarker\n\u003c#list tasks_\u003e\nElements:\n  \u003c#items as task\u003e\n  Task Type:\n  ${task.getElementType().getTypeName()}\n\n  Task Name:\n  ${task.getName()}\n\n  Custom Attributes:\n  \u003c#list task.getExtensionElements().getElementsQuery().filterByType(extensionElements_).singleResult().getCamundaProperties()\u003e\n    \u003c#items as extensionElement\u003e\n      Attribute:\n      Key: ${extensionElement.getCamundaName()}\n      Value: ${extensionElement.getCamundaValue()}\n\n    \u003c/#items\u003e\n  \u003c/#list\u003e\n--------------------\n\n  \u003c/#items\u003e\n\u003c/#list\u003e\n```\n\n# Config File\n\nThe template_inputs property is inserted into freemarker.  Any property with a underscore `_` at the end of the property name will go through `eval()`.\n\nConfig is loaded from `app/template_config.json`\n\n```js\n...\n{\n  \"template_inputs\": {\n    \"extensionElements_\": \"instanceClass('camunda.CamundaProperties')\",\n    \"tasks_\": \"modelInstance.getModelElementsByType(instanceClass('Task'))\"\n  },\n  \"template_path\": \"myTemplate.ftl\"\n}\n...\n```\n\nThe `extensionElements_` property is a special property that provides the CamundaProperties Class for use in the FreeMarker template such as:\n\n```freemarker\n\u003c#list task.getExtensionElements().getElementsQuery().filterByType(extensionElements_).singleResult().getCamundaProperties()\u003e\n```\n\n\n# Console Output\n\n```console\nElements:\n  Task Type:\n  userTask\n\n  Task Name:\n  Step 1\n\n  Custom Attributes:\n      Attribute:\n      Key: order\n      Value: some order value\n\n      Attribute:\n      Key: title\n      Value: some title value\n\n      Attribute:\n      Key: failure\n      Value: some fail\n\n      Attribute:\n      Key: resolution\n      Value: some resolution\n\n--------------------\n\n  Task Type:\n  userTask\n\n  Task Name:\n  Step 2\n\n  Custom Attributes:\n      Attribute:\n      Key: order\n      Value: order123\n\n      Attribute:\n      Key: title\n      Value: title321\n\n      Attribute:\n      Key: failure\n      Value: fail000\n\n      Attribute:\n      Key: resolution\n      Value: resABC\n\n--------------------\n\n  Task Type:\n  userTask\n\n  Task Name:\n  Step 3\n\n  Custom Attributes:\n      Attribute:\n      Key: order\n      Value: My Order\n\n      Attribute:\n      Key: title\n      Value: My Title\n\n      Attribute:\n      Key: failure\n      Value: My Failure\n\n      Attribute:\n      Key: resolution\n      Value: My Resolution\n\n--------------------\n```\n\n# TODO / Enhancements:\n\n1. \u003cs\u003eProvide external / injectable `input` object as a json file.\u003c/s\u003e\n1. \u003cs\u003eConfig/Input defines the Template\u003c/s\u003e\n1. Provide a File Writer\n1. Add more generation get Elements call so that all elements are gotten and the FreeMarker template will sub-navigate the tree of elements. (Removes the current need to setup \"Per Element Type\" properties in the `inputs` object)\n1. Provide a HTTP endpoint to get the rendered template as different content types such as JSON and HTML\n1. Provide a HTTP Endpoint to inject Config and FTL templates so the parser can live as a \"microservice\"\n1. Generate Image of BPMN file\n1. Generate Zoomed in Image of BPMN Element in context of overall file\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephenott%2Fvertx-bpmn-model-doc-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephenott%2Fvertx-bpmn-model-doc-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephenott%2Fvertx-bpmn-model-doc-generator/lists"}