I solved the problem. Setting the statecode and statuscode in the plugin pre-operation with the other attributes solved the problem.