| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Generate BPMN (Business Process Model and Notation) diagrams in Modelio using AI. Describe your business process in plain language and get a complete, runnable Modelio macro.
This project enables you to:
Copy BPMN_Helpers.py to your Modelio macros folder:
| OS | Path |
|---|---|
| Windows (workaround) | C:\<your Modelio installation folder>\.modelio\5.4\macros\BPMN_Helpers.py |
| Linux | ~/.modelio/5.4/macros/BPMN_Helpers.py |
Replace 5.4 with your Modelio version. Create the macros folder if it doesn't exist.
Copy the contents of CLAUDE_INSTRUCTIONS.md into:
| AI | How to Set Up |
|---|---|
| Claude | Create a Project → Add as custom instructions |
| ChatGPT | Add to Custom Instructions or first system message |
| Gemini | Add as system/developer message |
| LM Studio + Qwen | See lm_studio/LMStudio_Qwen_with_helpers.md |
Tip for ChatGPT/Gemini: Start with: "You are generating Modelio Jython BPMN macros. Follow these instructions exactly."
Tell the AI what you need:
Create a BPMN diagram for an expense approval process with 3 lanes: Employee, Manager, and Finance. The employee submits an expense report, the manager reviews and approves or rejects it, and finance processes the payment.
Your BPMN diagram will appear automatically!
Modelio-Automation/ ├── README.md # This file ├── BPMN_Helpers.py # Helper library (install to Modelio) ├── BPMN_Export.py # Export macro (install to Modelio) - NEW in v3.x ├── CLAUDE_INSTRUCTIONS.md # AI instructions for macro generation ├── docs/ │ ├── QUICK_START.md # Detailed setup guide │ ├── API_REFERENCE.md # Configuration options │ ├── APPROACHES.md # Architecture comparison │ └── images/ ├── examples/ │ └── ExpenseApprovalProcess.py ├── lm_studio/ │ └── LMStudio_Qwen_Guide_with_helpers.md └── v1/ # Previous single-file version with examples
┌────────────────────────────────┐
│ BPMN_Helpers.py │ ← Install once in Modelio
│ (500+ lines of tested code) │
└────────────────────────────────┘
▲
│ execfile()
│
┌────────────────────────────────┐
│ YourProcess.py │ ← AI generates this (~100 lines)
│ (Pure configuration) │
└────────────────────────────────┘
Benefits:
CONFIG = {
"name": "ExpenseApproval",
"lanes": ["Employee", "Manager", "Finance"],
"elements": [
("Submit Expense", START, "Employee"),
("Review", USER_TASK, "Manager"),
("Approved?", EXCLUSIVE_GW, "Manager"),
("Process Payment", SERVICE_TASK, "Finance"),
("Rejected", END, "Manager"),
# ...
],
"flows": [
("Submit Expense", "Review", ""),
("Approved?", "Process Payment", "Yes"),
("Approved?", "Rejected", "No"),
],
"layout": {
"Submit Expense": 0,
"Review": 1,
"Approved?": 2,
"Process Payment": 3, # Same column = auto-stacked (v3.2)
"Rejected": 3, # Automatically 90px below
# ...
},
# Optional: Data Objects
"data_objects": [
("Expense Report", "Employee", 0),
],
"data_associations": [
("Submit Expense", "Expense Report"),
("Expense Report", "Review"),
],
}When a BPMN diagram is created, Modelio automatically "unmasks" elements. However:
| Type | Constant | Icon | Description |
|---|---|---|---|
| Start Event | START | ○ | Process start (green circle) |
| End Event | END | ◉ | Process end (red circle) |
| Message Start | MESSAGE_START | ✉○ | Triggered by message |
| Message End | MESSAGE_END | ✉◉ | Sends message on completion |
| Timer Start | TIMER_START | ⏱○ | Triggered by schedule |
| Signal Start | SIGNAL_START | ○ | Triggered by signal |
| Conditional Start | CONDITIONAL_START | ○ | Triggered by condition |
| Signal End | SIGNAL_END | ◉ | Sends signal on completion |
| Terminate End | TERMINATE_END | ◉ | Terminates all instances |
| Error End | ERROR_END | ◉ | Throws error |
| Intermediate Catch | INTERMEDIATE_CATCH | ◎ | Generic catch event |
| Intermediate Throw | INTERMEDIATE_THROW | ◎ | Generic throw event |
| Message Catch | MESSAGE_CATCH | ✉◎ | Wait for message |
| Message Throw | MESSAGE_THROW | ✉◎ | Send message |
| Timer Catch | TIMER_CATCH | ⏱◎ | Wait for timer |
| Signal Catch | SIGNAL_CATCH | ◎ | Wait for signal |
| Signal Throw | SIGNAL_THROW | ◎ | Send signal |
| User Task | USER_TASK | 👤▭ | Human activity with IT system |
| Manual Task | MANUAL_TASK | ✋▭ | Physical task without IT |
| Service Task | SERVICE_TASK | ⚙▭ | Automated/system task |
| Script Task | SCRIPT_TASK | ▭ | Script execution task |
| Business Rule Task | BUSINESS_RULE_TASK | ▭ | Business rule evaluation |
| Send Task | SEND_TASK | ▭ | Send message task |
| Receive Task | RECEIVE_TASK | ▭ | Receive message task |
| Generic Task | TASK | ▭ | Generic task |
| Exclusive Gateway | EXCLUSIVE_GW | ◇ | XOR decision (one path) |
| Parallel Gateway | PARALLEL_GW | ⊕ | AND split/join (all paths) |
| Inclusive Gateway | INCLUSIVE_GW | ◇ | OR decision (one or more paths) |
| Complex Gateway | COMPLEX_GW | ◇ | Complex routing logic |
| Event-Based Gateway | EVENT_BASED_GW | ◇ | Wait for event |
| Data Object | DATA_OBJECT | 📄 | Document or data in process |
CONFIG = {
# Required
"name": "ProcessName",
"lanes": [...],
"elements": [...],
"flows": [...],
"layout": {...},
# Optional - Data Objects (v2.1+)
"data_objects": [...], # List of (name, lane, column)
"data_associations": [...], # List of (source, target)
# Optional - Layout Settings (with defaults)
"SPACING": 150, # Horizontal spacing between columns
"START_X": 80, # Starting X position
"TASK_WIDTH": 120, # Width for task elements
"TASK_HEIGHT": 60, # Height for task elements
"DATA_WIDTH": 40, # Width for data objects
"DATA_HEIGHT": 50, # Height for data objects
"DATA_OFFSET_X": 90, # Data object X offset (near right side of task)
"DATA_OFFSET_Y": 10, # Data object Y gap below source task
"WAIT_TIME_MS": 50, # Time between unmask attempts
"MAX_ATTEMPTS": 3, # Maximum unmask attempts
}# Format: (name, lane, column)
"data_objects": [
("Draft Document", "Author", 1),
("Final Report", "Reviewer", 3),
]# Format: (source, target) - direction is auto-detected
"data_associations": [
("Write Document", "Draft Document"), # Task → Data (task produces data)
("Draft Document", "Review Task"), # Data → Task (task consumes data)
]Running the ExpenseApprovalProcess example produces:
================================================================== BPMN PROCESS CREATION ================================================================== Process Name: ExpenseApproval_83950 == PHASE 1: CREATE PROCESS & LANES ============================== [1] Process: ExpenseApproval_83950 [2] Lanes: Employee, Manager, Finance == PHASE 2: CREATE ELEMENTS ===================================== [3] Employee: 7 elements [4] Manager: 5 elements [5] Finance: 7 elements Total: 19 elements == PHASE 4: WAIT FOR AUTO-UNMASK ================================ [Attempt 1] Found: 7/19 | Missing: Review Expense... [Unmask] Review Expense -> Y=161 (Manager): OK ... == PHASE 5: REPOSITION ELEMENTS ================================= Repositioned: 19/19 == PHASE 6: CREATE FLOWS ======================================== Created 20 sequence flows == PHASE 7: CREATE DATA OBJECTS ================================= Created 2 data objects == PHASE 8: CREATE DATA ASSOCIATIONS ============================ Created 4 data associations ================================================================== COMPLETE ==================================================================
| Tip | Example |
|---|---|
| Name lanes clearly | "Lanes: Customer, Sales Team, Warehouse" |
| Describe decisions explicitly | "If approved, proceed; otherwise reject" |
| Mention parallel work | "HR and IT work in parallel" |
| Specify task types | "automated email" → Service Task |
| Include error paths | "If validation fails, return to customer" |
| Mention documents/data | "produces an invoice" → Data Object |
| Problem | Solution |
|---|---|
| "No such file" error | Check BPMN_Helpers.py path matches your Modelio version |
| Script doesn't run | Select a Package before running |
| UnicodeDecodeError | Use ASCII only - no special characters like ✓ or → |
| Element in wrong lane | Check lane name spelling (case-sensitive) |
| Elements overlap | Increase SPACING or adjust column indices in layout |
| Text doesn't fit | Increase TASK_WIDTH and TASK_HEIGHT |
| Diagram is empty | Wait and refresh; check model tree for the process |
| Data object overlaps task | Adjust DATA_OFFSET_Y configuration |
| Data association arrow wrong | Verify source and target order |
Contributions are welcome! Please feel free to submit issues and pull requests.
Apache License 2.0 - See LICENSE
| Back | FazBrowse Home | New Git URL |