Newer
Older
# Customer Complaints Workflow
This project implements a customer complaints management system using Python and Camunda Cloud. It includes functionalities for processing complaints, auto-checking the validity of complaints, and simulating customer interactions.
Detailed video showcase can be found here: [BPMN_Specification_with_Camunda_Exercise](BPMN_Specification_with_Camunda_Exercise.mp4)
or on [YouTube](https://www.youtube.com/watch?v=Unl5sWSz-NY)
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
## File Structure
### 1. `requirements.txt`
Contains the necessary dependencies for the project:
- **asyncio**: Built into Python, no installation required.
- **logging**: Built into Python, no installation required.
- **requests**: Ensure the latest stable version is installed.
- **pyzeebe**: The latest version for interacting with Camunda Cloud.
### 2. `customer_complaints.bpmn`
A BPMN file defining the business process workflow for handling customer complaints.
### 3. `customer_complaints.py`
The main script that:
- Connects to Camunda Cloud.
- Defines task handlers for the workflow, such as accepting or rejecting complaints, auto-checking complaint details, and simulating customer compensation.
- Uses `pyzeebe` to interact with the workflow engine.
## Setup and Usage
### Prerequisites
Ensure you have the following installed:
- Python 3.8 or higher.
- Pip (Python package manager).
### Installation
1. Clone the repository.
2. Install the dependencies by running:
```bash
pip install -r requirements.txt
```
### Configuration
Update the `customer_complaints.py` file with your Camunda Cloud credentials:
- `ZEEBE_CLIENT_ID`
- `ZEEBE_CLIENT_SECRET`
- `CAMUNDA_CLUSTER_ID`
- `CAMUNDA_REGION`
### Running the Application
Execute the main script:
```bash
python customer_complaints.py
```
This starts a Zeebe worker that listens for tasks defined in the BPMN workflow.
## Functionality
The application supports the following tasks:
### Workflow Tasks
1. **Auto Check**: Validates the complaint date and checks for inappropriate language.
2. **DB Reject**: Logs rejected complaints in the database.
3. **DB Accept**: Logs accepted complaints in the database along with compensation details.
4. **Reject**: Notifies the customer that their complaint was rejected.
5. **Accept**: Notifies the customer that their complaint was resolved.
6. **Compensation Payment**: Simulates offering and acceptance of compensation by the customer.
7. **Customer Simulation**: Simulates whether a customer responds to follow-ups.
## Troubleshooting
- Ensure all dependencies are installed correctly.
- Verify Camunda Cloud credentials and cluster information.
- Enable debug-level logging in `customer_complaints.py` for detailed logs:
```python
logging.basicConfig(level=logging.DEBUG)
```
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
---
For further details, refer to the `customer_complaints.bpmn` file to understand the workflow process and how it integrates with the tasks.