I’m trying to create a flow similar to the below image however, the problem is whenever i try to raise an error through Python Script (“For Service Task Reserve Order Items”)rather then completing the it fails the job
The python code I’m using is as below
from pyzeebe import ZeebeTaskRouter
from pyzeebe import ZeebeWorker, create_insecure_channel,Job
import asyncio
import random
import nest_asyncio
nest_asyncio.apply()
async def my_exception_handler(exception: Exception, job: Job) -> None:
print(exception)
await job.set_failure_status(message=str(exception))
async def main():
worker = ZeebeWorker(channel)
router = ZeebeTaskRouter()
@router.task(task_type="CheckWhetherItemExist")
def CheckWhetherItemExist(product: str,productQuantity:int, exception_handler=my_exception_handler):
print(f"product:-{product}, and productQuantity:-{productQuantity}")
raise Exception("itemsOutOfStock")
return {}
worker.include_router(router)
await worker.work()
asyncio.run(main())
print("done")
Any Help or guidance will be a great help.