Bug 1299579 - Automate Simulate should support a Retry button
Automate Simulate should support a Retry button
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate (Show other bugs)
Unspecified Unspecified
unspecified Severity low
: GA
: 5.6.0
Assigned To: mkanoor
Dmitry Misharov
Depends On:
  Show dependency treegraph
Reported: 2016-01-18 11:50 EST by mkanoor
Modified: 2016-07-15 09:18 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-06-29 11:31:17 EDT
Type: Bug
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 mkanoor 2016-01-18 11:50:23 EST
Description of problem:
When doing a simulation to test Automate methods, if the test runs a Automate State Machine runs a state machine which causes a retry. There is no feedback that there was a retry issued and when re-running the request it should preserve the state attributes from the previous run

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

How reproducible:
All the time

Steps to Reproduce:
1. Create an Automate model that has a State Machine that can end in a retry
2. Run a simulation to test the Automate Model from Step 1
3. When the Automation ends in a retry, we should be able to resubmit the request

Actual results:
- There is no indication that a retry was issued
- The state variables from the first run are not passed in the second time

Expected results:
- A separate button for Retry
- Preserve the attributes from the previous step

Additional info:
Comment 3 CFME Bot 2016-01-21 17:07:20 EST
New commit detected on ManageIQ/manageiq/master:

commit 929537a832a50d3ccad508c36e5f18d2a118b53d
Author:     Madhu Kanoor <mkanoor@redhat.com>
AuthorDate: Mon Jan 18 16:33:40 2016 -0500
Commit:     Madhu Kanoor <mkanoor@redhat.com>
CommitDate: Mon Jan 18 16:33:40 2016 -0500

    Automate UI Simulation support retry button
    When a user runs Automate Simulation if there is a state machine
    that returns a 'retry'. The UI would show a Retry button in addition
    to the 'Submit' and 'Reset' button.

 app/controllers/application_controller/automate.rb | 29 +++++++++++++++++-----
 .../miq_ae_tools/_resolve_form_buttons.html.haml   |  9 +++++++
 2 files changed, 32 insertions(+), 6 deletions(-)
Comment 4 CFME Bot 2016-01-21 17:07:29 EST
New commit detected on ManageIQ/manageiq/master:

commit 224e17ef907f979fb739424de92e1eeb5ce0a072
Author:     Madhu Kanoor <mkanoor@redhat.com>
AuthorDate: Tue Jan 19 11:24:36 2016 -0500
Commit:     Madhu Kanoor <mkanoor@redhat.com>
CommitDate: Tue Jan 19 11:24:36 2016 -0500

    Fixed Rubocop errors

 app/controllers/application_controller/automate.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 5 CFME Bot 2016-01-21 17:07:37 EST
New commit detected on ManageIQ/manageiq/master:

commit cd8c1824cba83e9f5578c6f0adc4e78befcb03b0
Author:     Madhu Kanoor <mkanoor@redhat.com>
AuthorDate: Tue Jan 19 14:14:05 2016 -0500
Commit:     Madhu Kanoor <mkanoor@redhat.com>
CommitDate: Tue Jan 19 14:14:05 2016 -0500

    Added spec

 .../application_controller/automate_spec.rb        | 59 ++++++++++++++++++++++
 1 file changed, 59 insertions(+)
Comment 6 CFME Bot 2016-01-21 17:07:41 EST
New commit detected on ManageIQ/manageiq/master:

commit a1b74bbe5c9c6a1de6d2b020fa8d7f3633d67979
Author:     Madhu Kanoor <mkanoor@redhat.com>
AuthorDate: Thu Jan 21 12:00:12 2016 -0500
Commit:     Madhu Kanoor <mkanoor@redhat.com>
CommitDate: Thu Jan 21 12:00:12 2016 -0500

    Missing converstion to YAML of state_info

 app/controllers/application_controller/automate.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 7 mkanoor 2016-04-19 12:15:22 EDT
Steps to recreate

Create 2 class in a new DOMAIN that you create called MY_DOMAIN.
Under MY_DOMAIN create a new namespace called NS

(1) The first class is called
    The class schema has the following attributes/types

    RUN       Type should be method

    Save the class schema

  (1a)  Create Instance in this class called

    Set the run so that it points to the retry method that we will create


    Create a new method called retry with the following ruby script
    This will retry 2 times
    root = $evm.root
    if root['ae_state_retries'] && root['ae_state_retries'] > 2
      root['ae_result'] = 'ok'
      root['ae_result'] = 'retry'

2. Create the Second class

If you create a state machine instance say in

 and have the following states in its schema

 STATE1         type = state

2(a) Create a new instance called TEST_RETRY and pointing to the instance created in 1b 


3. Create a new instance in the class SYSTEM/REQUEST called MY_TEST. This class already exists in the ManageIQ domain, you can copy it to MY_DOMAIN and add the instance called MY_TEST

The MY_TEST instance should point to 

(4) In the Automate -> Simulation Screen use

   SYSTEM/PROCESS REQUEST    (Its Automation by default)
   MESSAGE        create     (Default is good)
   REQUEST        MY_TEST       

Under Simulation Parameter make sure that the Execute Method check box is checked.

Hit Sumbit Button
Comment 8 Dmitry Misharov 2016-04-20 08:55:10 EDT
After making all steps from previous comment I was able to verify this bug on
Comment 10 errata-xmlrpc 2016-06-29 11:31:17 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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