String eventName,
String referencedSubmission)
throws XDIMEException {
XDIMEContextInternal context = new XDIMEContextImpl();
final XFormBuilder xFormBuilder = context.getXFormBuilder();
EmulatedXFormDescriptor fd = new EmulatedXFormDescriptor();
xFormBuilder.addModel(MODEL_ID, fd);
context.setInitialRequestContext(requestContext);
attributes = new XDIMEAttributesImpl(XFormElements.SETVALUE);
attributes.setValue(XDIMESchemata.XML_EVENTS_NAMESPACE, "event", eventName);
attributes.setValue("", XDIMEAttribute.REF.toString(), referencedSubmission);
attributes.setValue("", XDIMEAttribute.VALUE.toString(), VALUE_FROM_ATTRIBUTE);
xFormBuilder.registerControl(attributes);
xFormBuilder.addSubmission(submissionID, new EventAttributes(), action,
method);
return context;
}