Bug 978925 - Ticket Monster: generated Administration section does not perform deletion of Performances correctly
Ticket Monster: generated Administration section does not perform deletion of...
Status: CLOSED INSUFFICIENT_DATA
Product: JBoss Enterprise WFK Platform 2
Classification: JBoss
Component: TicketMonster (Show other bugs)
2.3.0
Unspecified Unspecified
unspecified Severity medium
: ---
: 2.4.0
Assigned To: Pete Muir
Tomas Repel
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-27 05:57 EDT by Vineet Reynolds
Modified: 2013-07-29 11:43 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Known Issue
Doc Text:
The generated Administration section of the TicketMonster example does not contain the correct logic to delete Performances. Consequently, deleting Performances in the Administration section has no effect, or failures are encountered during the deletion. To work around the issue, add the following methods to the PerformanceBean class: public List<SectionAllocation> findSectionAllocationsByPerformance(Performance performance) { CriteriaQuery<SectionAllocation> criteria = this.entityManager .getCriteriaBuilder().createQuery(SectionAllocation.class); Root<SectionAllocation> from = criteria.from(SectionAllocation.class); CriteriaBuilder builder = this.entityManager.getCriteriaBuilder(); Predicate performanceIsSame = builder.equal(from.get("performance"), performance); return this.entityManager.createQuery( criteria.select(from).where(performanceIsSame)).getResultList(); } public List<Booking> findBookingsByPerformance(Performance performance) { CriteriaQuery<Booking> criteria = this.entityManager .getCriteriaBuilder().createQuery(Booking.class); Root<Booking> from = criteria.from(Booking.class); CriteriaBuilder builder = this.entityManager.getCriteriaBuilder(); Predicate performanceIsSame = builder.equal(from.get("performance"), performance); return this.entityManager.createQuery( criteria.select(from).where(performanceIsSame)).getResultList(); } Then replace the delete() method in the PerformanceBean class with the following method definition: public String delete() { this.conversation.end(); try { Performance deletableEntity = findById(getId()); Show show = deletableEntity.getShow(); show.getPerformances().remove(deletableEntity); deletableEntity.setShow(null); this.entityManager.merge(show); List<SectionAllocation> sectionAllocations = findSectionAllocationsByPerformance(deletableEntity); for(SectionAllocation sectionAllocation: sectionAllocations) { this.entityManager.remove(sectionAllocation); } List<Booking> bookings = findBookingsByPerformance(deletableEntity); for(Booking booking: bookings) { this.entityManager.remove(booking); } this.entityManager.remove(deletableEntity); this.entityManager.flush(); return "search?faces-redirect=true"; } catch (Exception e) { FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(e.getMessage())); return null; } } After applying this workaround, Performances can be deleted in the Administration section successfully.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-17 17:42:10 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker JDF-389 Major Resolved Revise the Git patches of TicketMonster for Forge 1.3.2 2013-11-19 04:45:01 EST
JBoss Issue Tracker WFK2-59 Major Verified Ticket Monster: generated Administration section does not perform deletion of Performances correctly 2013-11-19 04:45:02 EST

  None (edit)
Description Vineet Reynolds 2013-06-27 05:57:51 EDT
Description of problem:
When deleting entities like Performances from the Administration site, the entities are not deleted at all and reappear after deletion or failures are encountered during deletion.

Version-Release number of selected component (if applicable):


How reproducible: Always


Steps to Reproduce:
1. Click the Performance entry in the side-bar.
2. Select an existing Performance in the list of Performances to view the performance.
3. Click the Edit button to modify the Performance.
4. Click the Delete button to delete the Performance.

Actual results:

An error message stating that a constraint violation error has occurred, is displayed upon deletion of the Performance.

If Forge 1.3.1 or earlier was used to generate the Administration site, the deleted performance will reappear in the list of performances.

Expected results:

The Performance should be deleted.

Additional info:

This was fixed upstream in the TicketMonster Git patch (JDF-389). The issue involving re-appearing of deleted entities was fixed in FORGE-916 (released in Forge 1.3.2).
Comment 2 Vineet Reynolds 2013-07-17 17:46:15 EDT
Migrated to JIRA
Comment 3 JBoss JIRA Server 2013-07-29 11:43:51 EDT
Vineet Reynolds <vineet.reynolds@gmail.com> made a comment on jira WFK2-59

This has a possibility of being no longer relevant, if we incorporate HTML5 scaffolding in WFK2-73 since this is a bug in the existing Faces scaffolding.

Note You need to log in before you can comment on or make changes to this bug.