BPMN model to JSON using Java

Hello!

Does Camunda have any library to parse bpmn model to JSON using Java? I can’t find anything, so appreciate your help.

So, it was easier than I think :slight_smile:


public class JsonUtil {

    public static String parseXmlToJson(byte[] xmlScheme) {
        try {
            JsonNode node = new XmlMapper().readTree(xmlScheme);
            return new ObjectMapper().writeValueAsString(node);
        } catch (Exception e) {
            throw new JsonException("json.parsing", e);
        }
    }
}
2 Likes