Data Objects associated with throw messages

Hi I am trying to associate a data object with a intermediate catch event, for that I have the FlowElement dataObjectReference and the FlowNode throwMessage, then I create a propertyorg.camunda.bpm.model.bpmn.instance.Property property = modelInstance.newInstance(org.camunda.bpm.model.bpmn.instance.Property.class);
property.setId(dataObj.getPropertyId());
property.setName(dataObj.getPropertyName());
node.addChildElement(property), finnaly I create the dataInputAssociation and I try to do dataInputAssociation.setTarget(property); it gives error element is not part of model. Please connect element to the model first. on the property , but when the flowNode is a task it does not give the error, I tried adding the property to the process, change to a DataInput but nothing works, what can I do?