I have two classes: Machine and Production. I want to have an enum MachineType to use that in both classes.
If the Production's MachineType does not correspond to the one in the Machine class then the Production cannot be completed.
My question is is it okay to connect one enum to both classes?
Or do i have to create different enums?
And how to display this on UML?
Yes, you can do that without problem. You denote it by drawing a dependency (dashed line, open arrow) towards the enum from any class which uses it. The enum itself appears in the attributes as typed with the enum.

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With