Skip to content
Snippets Groups Projects
README.md 3.02 KiB
Newer Older
Alexander Karl Richard Rothschild's avatar
Alexander Karl Richard Rothschild committed
# 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)
Alexander Karl Richard Rothschild's avatar
Alexander Karl Richard Rothschild committed

## 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.