Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 98898 - viewing a workflow template causes UnsupportedOperationException
viewing a workflow template causes UnsupportedOperationException
Product: Red Hat Enterprise CMS
Classification: Retired
Component: other (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: ccm-bugs-list
Jon Orris
Depends On:
  Show dependency treegraph
Reported: 2003-07-09 19:07 EDT by Vadim Nasardinov
Modified: 2007-04-18 12:55 EDT (History)
0 users

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

Attachments (Terms of Use)

  None (edit)
Description Vadim Nasardinov 2003-07-09 19:07:50 EDT
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 09:58:32 EDT
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-17 23:37:52 EDT
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 13:40:24 EDT
Closing old tickets

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