Bug 98898 - viewing a workflow template causes UnsupportedOperationException
Summary: viewing a workflow template causes UnsupportedOperationException
Alias: None
Product: Red Hat Enterprise CMS
Classification: Retired
Component: other   
(Show other bugs)
Version: nightly
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: ccm-bugs-list
QA Contact: Jon Orris
Depends On:
TreeView+ depends on / blocked
Reported: 2003-07-09 23:07 UTC by Vadim Nasardinov
Modified: 2007-04-18 16:55 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-09-05 17:40:24 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Vadim Nasardinov 2003-07-09 23:07:50 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020607

Description of problem:
Go to a content section.
Go to the "Workflows" tab.
Click on "Production Workflow" on the left.
Observe the following exception:

        at ..toolbox.ui.ProxyComponent.isVisible(ProxyComponent.java:45)
        at ..cms.ui.VisibilityComponent.isVisible(VisibilityComponent.java:46)
        at ..toolbox.ui.ActionGroup.generateXML(ActionGroup.java:86)
        at ..toolbox.ui.Section.generateXML(Section.java:116)
        at ..bebop.SimpleContainer.generateXML(SimpleContainer.java:245)

As far as I can tell, this breakage was introduced in chage 33398.
The comment for that change says,

   Restores the workflow start and stop actions to the item workflow UI.

This may work for a Workflow attached to an item.  In the case of the
Workflows tab, we are dealing with WorkflowTemplate instances - not
Workflow instances.  The WorkflowTemplate class is a subclass of
Workflow that overrides the getProcessState method (as well as a bunch
of other methods) like so:

    public int getProcessState() {
        throw new UnsupportedOperationException();

In change 33398, the following piece of code was added to

>  public final boolean isVisible(final PageState state) {
>      final Workflow workflow = m_workflow.getWorkflow(state);
>      return workflow.getProcessState() == Workflow.STOPPED;
>  }

This works as long as the "workflow" is an instance of Workflow.  If
it is an instance of the subclass WorkflowTemplate, the method
obviously breaks.

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

How reproducible:

Steps to Reproduce:
See the comment

Additional info:

Comment 1 Vadim Nasardinov 2003-10-22 13:58:32 UTC
This was fixed by Jon Orris as part of the following change
(the part about "obeying Liskov substitution"):

$ p4 describe -s 33854
Change 33854 by jorris@jorris-177 on 2003/07/22 18:20:03

   Moved ItemWorkflow specific code from BaseWorkflowItemPane to

   It was causing an exception when viewing Workflow Template details, as
   WorkflowTemplate was not Liskov compliant.
   Made WorkflowTemplate obey Liskov substitution.

Affected files ...

... //cms/dev/src/com/arsdigita/cms/ui/workflow/BaseWorkflowItemPane.java#10 edit
... //cms/dev/src/com/arsdigita/cms/ui/workflow/ItemWorkflowItemPane.java#9 edit
... //core-platform/dev/src/com/arsdigita/workflow/simple/Workflow.java#15 edit
//core-platform/dev/src/com/arsdigita/workflow/simple/WorkflowTemplate.java#7 edit

Comment 2 David Lawrence 2006-07-18 03:37:52 UTC
QA_READY has been deprecated in favor of ON_QA. Please use ON_QA in the future.
Moving to ON_QA.

Comment 3 Jon Orris 2006-09-05 17:40:24 UTC
Closing old tickets

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