[Bug] [API] If task definition configure Worker Group, user still can delete the worker group record.
Search before asking
- [X] I had searched in the issues and found no similar issues.
What happened
When use delete the Worker Group record from UI, the api just validator the processInstance, but did not check the task.

What you expected to happen
if task configure this worker group, use cannot delete this worker group record.
How to reproduce
- Create a worker group record.
- Add a shell task configure this worker group, and create a valid workflow
- delete this worker group record.
Anything else
No response
Version
dev
Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Thank you for your feedback, we have received your issue, Please wait patiently for a reply.
- In order for us to understand your request as soon as possible, please provide detailed information、version or pictures.
- If you haven't received a reply for a long time, you can join our slack and send your question to channel
#troubleshooting
This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.
This issue has been closed because it has not received response for too long time. You could reopen it if you encountered similar problems in the future.