Embedded Case Management with CMMN in camunda BPM

In our latest alpha release we include a preview of the upcoming support for CMMN (Case Management Model and Notation) in camunda BPM. Time to have a look at CMMN and the way it is implemented in camunda BPM.

 

What is CMMN?

CMMN is an emerging OMG standard for (Adaptive) Case Management. Version 1.0 is freshly released and vendor adoption starts to take off. Trisotech already provides a Web-based Modeler for CMMN and we at camunda have the ambition to provide the first embedded, Open Source Runtime Engine for CMMN.

CMMN allows modeling Cases. A case allows humans to do work in a more or less structured way in order to achieve something. Classic examples where case management is applied are Credit Application, Customer Support Management, Document Management, and so on.

The following is a simple Example of a Credit Application Case modeled in CMMN:

Example of a Credit Application Case modeled in CMMN

The Picture above shows the graphical representation of the CMMN Model. The model also has an executable XML representation which looks like this:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>

<definitions id="_81291489-586f-4b00-b7c4-1ef8f7523c29"
                  targetNamespace="Examples"
                  xmlns="http://www.omg.org/spec/CMMN/20131201/MODEL"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <case id="loanApplication" name="Loan Application Case">

    <casePlanModel name="Loan Application" id="CasePlanModel_1">

      <planItem definitionRef="Stage_1" id="PI_Stage_1"/>
      <planItem definitionRef="HumanTask_6" id="PI_HumanTask_6"/>

      <humanTask name="Capture Applicant Data" id="HumanTask_1"/>
      <humanTask name="Obtain Schufa-Information" id="HumanTask_2"/>
      <humanTask name="Obtain Credit-worthiness" id="HumanTask_3"/>
      <humanTask name="Review Documents" id="HumanTask_4"/>
      <humanTask name="Request Missing Documents" id="HumanTask_5"/>
      <humanTask name="Decide About Loan Application" id="HumanTask_6"/>

      <stage name="Obtain Customer Data" id="Stage_1">
        <planItem definitionRef="HumanTask_1" id="PI_HumanTask_1"/>
        <planItem definitionRef="HumanTask_2" id="PI_HumanTask_2"/>
        <planItem definitionRef="HumanTask_3" id="PI_HumanTask_3"/>
        <planItem definitionRef="HumanTask_4" id="PI_HumanTask_4"/>
        <planItem definitionRef="HumanTask_5" id="PI_HumanTask_5"/>
      </stage>

    </casePlanModel>

  </case>
</definitions>

New Features in 7.2.0-alpha3

In camunda BPM 7.2.0-alpha3 we implemented the basic Case Instance and Plan Item Instance lifecycle. On top of this, the following task types are available:

  • Stage
  • Human Task
  • Process Task
  • Case Task

Using API you can now start and complete cases and perform the lifecycle on the plan items:

  // deploy the case definition
    repositoryService.createDeployment()
      .addClasspathResource("org/camunda/bpm/engine/test/examples/cmmn/loan-application.cmmn")
      .deploy();

    // create a new case instance
    CaseInstance caseInstance = caseService
      .withCaseDefinitionByKey("loanApplication")
      .setVariable("applicantId", "some id ...")
      .create();
    // as a result, the stage and the tasks are enabled.

    // Query for the stage execution
    CaseExecution stageExecution = caseService.createCaseExecutionQuery()
      .caseInstanceId(caseInstance.getId())
      .activityId("PI_Stage_1")
      .singleResult();

    // start the stage
    caseService.withCaseExecution(stageExecution.getId())
      .manualStart();

    // now the "Review Documents" task is enabled:
    CaseExecution reviewDocumentsExecution = caseService.createCaseExecutionQuery()
      .activityId("PI_HumanTask_4")
      .enabled()
      .singleResult();

    // start the review documents task:
    caseService.withCaseExecution(reviewDocumentsExecution.getId())
      .manualStart();

    // complete the review documents task:
    caseService.withCaseExecution(reviewDocumentsExecution.getId())
      .setVariable("allDocumentsObtained", true)
      .complete();

    // ...

Read the Docs

There is some documentation on the CMMN implementation available.

Update!
We have published a getting started guide for CMMN.

  • Monitoring Camunda Platform 7 with Prometheus

    Monitoring is an essential facet of running applications in a production system. Through this process, organizations collect and analyze data, and determine if a program is performing as expected within set boundaries. When combined with alerting, monitoring allows for detecting unexpected system behavior to mitigate exceptional situations as fast as possible. Furthermore, tracking the performance of a system enables organizations to improve those aspects that have the biggest impact with higher priority. One essential aspect of monitoring is the list of key metrics you want to observe. There are different categories of statistics that can be of interest here. To observe the defined metrics, there are plenty of application monitoring tools on the market today. They differ in many aspects...

    Read more
  • Securing Camunda 8 self-managed cluster and applications...

    Directory services are an effective way to manage an organization’s users, groups, printers, devices, and more. Most organizations accomplish this using Active Directory, Apache Directory, Oracle Internet Directory, or other similar tools. Recently I worked with a customer who wanted to see how he could secure the Camunda 8 Platform and process applications with such a directory. Their requirements consisted of: Allowing Directory users to access Camunda applications (Tasklist, Operate, Optimize) Accessing secured Tasklist & Operate APIs from our custom project Securing the custom project In this article, I’ll briefly explain the 3 easy steps taken to fulfill their requirements which include: Federate users from the Directory service into Keycloak Declare an application in Identity to access Camunda APIs Configure...

    Read more
  • Accelerate Connectivity with Camunda Platform 8.1

    We’re thrilled to announce Camunda Platform 8.1, the latest release of our process orchestration solution. This new version introduces features that accelerate connectivity to the many different systems and technologies that are required for true digital transformation, including: Create custom Connectors with our Integration Framework to accelerate connectivity New out-of-the-box Connectors for popular services Enhancements to Camunda Modeler that improve productivity Hot backups and official support for Amazon EKS and Red Hat OpenShift Plus, several upgrades requested by Camunda Platform 7 customers Organizations across all industries rely on complex technology stacks to adapt and enhance their operations in response to market dynamics, new disruptive companies, and increasing consumer expectations. Your technology stack likely includes everything from cutting-edge technologies to legacy...

    Read more

Ready to get started?

Still have questions?