Richard Allen 7 minute read

How we’re using GenAI in Flows for APEX to help model business processes.

Flows for APEX uses the industry standard process modelling notation, BPMN 2.0, to graphically model business processes. Steps in those processes that require user input or processing can then be rapidly developed using Oracle APEX, and Flows for APEX will then execute and manage instances of those processes. So how can GenAI help us with that?

Business Process Model and Notation (BPMN) representations of a business process appear to the user as a process diagram, showing tasks, events, and gateways that control the process direction. Optionally these diagrams can contain swim lanes showing who (person or organisation) is responsible for each process step, and can show how a process interacts with other processes and/or other organizations.

Under the covers, these BPMN diagrams are stored as an XML document, containing two main sections - one defining the process logic, and a second defining the diagram layout.

Current Gen AI models are good at understanding XML documents, have been trained on material including the BPMN standard, the many books written about BPMN, and the countless number of conference papers written by business consultants over the last two decades. The good news is that you don’t have to stay awake reading all of them - Gen AI has already read them and can help us!

What can Gen AI do with a BPMN Diagram?

  1. Explaining Diagrams

    The first thing that GenAI can do is to explain the diagram to us in business English. Or any other language, but I’ll come back to that later!

    The AI models are good at converting the structure and text contained in the BPMN model to a good, well-structured explanation of the process in a diagram. They seem to be good at inferring background purpose and concepts in a model, and describing them - at a high level, or in as much detail as you want.

    Let’s take an example. I have a contrived business process built for a demo that conducts annual employment verification checks for staff. The process is started by HR, and then carried out by HR and line managers. Here’s the top level diagram …

    Employee Check Process - Top level

    This diagram uses a subprocess for the ‘review department’ task. If I click on the blue arrow icon underneath ‘review department’, I can see the detail of this subprocess…

    Employee Check Process - Second level

    And so I can see that the process for each department is to identify staff needing a review, that conduct that review — the details of which are contained in a sub process, which again I can see by clicking on the blue arrow below ‘review staff’.

    Employee Check Process - Third level

    Now I can see that the process conducts a government employability check and then a salary review by the line manager.

    What can AI do? If I click the ‘Ask Flo’ button, we send a subset of the diagram to the AI service, ask ask for a brief summary of the business process. Here’s the response.

    Summary of the business process generated by GenAI

    This looks like a good summary of the process. For those who aren’t familiar with the intricacies of BPMN, whether APEX developers new to BPMN or business managers new to process modelling, this should be useful.

    The AI service is able to answer more detailed questions about the business process or the mechanics of the BPMN diagram. Here is an arbitrary example where we’ve asked for more details on the staff review part of the process using a free text question from the user…

    Detailed explanation of the staff review sub process

  2. Suggesting Process Model Improvements

    The next capability that AI can help us with is suggesting improvements to our model, whether these are technical / process modelling improvements or actual business process improvements.

    suggestions for improvement to our model

    Our experience is that the suggestions provided by AI also range from the simple / trivial to more complex, less obvious ideas. It’s not always easy to get relevant suggestions from simplified demo processes like our staff review process — but you can see that some of the ideas are good and generally helpful.

  3. Model Error Checking

    The next capability is to detect and explain model errors. In the Flows for APEX Process Modeler, we have already included a BPMN linting capability that detects various syntactic errors in your model. Additionally, the AI engine is capable of finding another set of potential errors from its existent knowledge of BPMN and from our training prompt.

    Here’s an error check on our demo model… which appears to be in good order.

    AI output from error checking

    We have a class of typical user errors that come from starting parallel sections in a model, which have to all end at the same merging gateway or go to their own end points. When errors in these. rules occur, our experience is that AI is very good at finding the problem, explaining what the problem is, and suggesting ways to change the model to fix the problem. Certainly better than the typical ‘rule X is broken’ style error message!

  4. Describing Message Flow

    One of the capabilities of Flows for APEX Enterprise Edition v24.1 is the ability for one process to collaborate with another process, which might be in the same APEX instance or via-REST at a supplier or customer, by sending and receiving messages. This collaboration can start a remote process, subscribe and wait for an incoming message, interrupt a process when a message arrives, or emit a message when a process or sub-process completes. This is process collaboration via BPMN Message Flow. One of the key design tasks in setting up process collaboration is to design the message definitions to be used in this structured messaging environment. (I’ll write a blog post about this soon). Again AI can help us to describe the messaging defined in a model, pulling information from all of the places where message structure is defined. Our demo model doesn’t have any messaging in it, so I’ve taken another example here, and given screen shots here of the overall message process and the AI-generated documentation on the message structures.

    Supplier - Customer - Shipper process collaboration model

    Here’s a summary of the model for those of you not sure about the BPMN here. (it’s easy to generate this, so why not give it to you….)

    Supplier - Customer - Shipper process collaboration summary

    Asking AI for a description of the message structures gives us this output…

    Supplier - Customer - Shipper process collaboration summary

  5. Language Translation

    All of our business process diagrams have been in English so far, but what happens when the diagram is in a language you can’t understand? How can AI help the business manager trying to understand why the business process in the Japanese office isn’t working as they expect? Or how can a support analyst help solve a process problem when it’s 2AM in Tokyo and support has rolled over to the help desk in London?

    Well, the current LLMs are all good at language translation, and we can give AI a model in one language and ask for an explanation in another language. Here’s a model that most of us can’t read (…with apologies to those of you who can read Japanese!)…

    Business process diagram with all text in Japanese.

    Where to start? Let’s Ask Flo…

    Business process diagram explanation in English.

    So now we know what the business process is, and how it works! Note that AI gives us the original task names in Japanese, the pronunciation in Romanji (Japanese using Roman characters), and an English translation.

    This capability works well in all of the languages that we have had native speakers review output.

    Showing off, one of our Flows for APEX users has a requirement to be able to provide output in Welsh language to Welsh users. The AI service can do that** (**to the best of my knowledge, but I can’t read Welsh!)

AI Services

The results above are all created using the OpenAI gpt-4o model. Other models, including the Cohere and OCI AI Service models can understand BPMN to a limited degree, but provide output that is much less full and less reliable than these examples. But as with everything AI, the situation is changing rapidly and other models may be capable of producing this quality of interaction soon.

How Do I Use This?

The Ask Flo GenAI Assistant is a feature in Flows for APEX Enterprise Edition v24.1, which is now available on a supported, annual subscription basis from Flowquest. (www.flowquest.net).

The Ask Flo AI feature requires APEX 24.1 and a OpenAI API key with pre-paid balance. (Don’t be deterred by the cost of using the AI service - our work to optimise the parts of the BPMN diagram that is sent to BPMN reduces the number of token used, and so the AI running costs of this are not expensive for the benefit provided. My token usage today to create all of the examples in this blog, along with a several other discarded queries, cost under US$0.02).

Tags: ,

Updated: