Skip to content

Instantly share code, notes, and snippets.

@hlucasfranca
Created July 25, 2022 10:29
Show Gist options
  • Save hlucasfranca/db648cd37f4bcf009ef8d5ec20b953b2 to your computer and use it in GitHub Desktop.
Save hlucasfranca/db648cd37f4bcf009ef8d5ec20b953b2 to your computer and use it in GitHub Desktop.
from bs4 import BeautifulSoup
attributes = [
"camunda:class",
"camunda:topic",
"camunda:type"
]
with open('process.bpmn', 'r') as f:
contents = f.read()
soup = BeautifulSoup(contents, features='xml')
print(";".join(attributes))
for ob in soup.find_all("bpmn:serviceTask"):
props = []
for attribute in attributes:
if(ob.has_attr(attribute)):
props.append(ob[attribute])
else:
props.append("")
print(";".join(props))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment