Bug 1236174

Summary: [RFE] Automate: Run state machine from within another state machine
Product: Red Hat CloudForms Management Engine Reporter: mkanoor
Component: AutomateAssignee: mkanoor
Status: CLOSED ERRATA QA Contact: Ramesh A <rananda>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.4.0CC: gmccullo, jhardy, mfeifer, mkanoor, obarenbo, snansi, tfitzger
Target Milestone: GAKeywords: FutureFeature
Target Release: 5.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.5.0.1 Doc Type: Enhancement
Doc Text:
The new version of CloudForms Management Engine enhances the Automate engine to support multiple state machines to be executed in a single workspace. This allows for one state machine to call another state machine in the same workspace. If any one of the state machines in the chain ends with a retry or error, all the state machines end with a retry or error correspondingly.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-08 13:19:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description mkanoor 2015-06-26 18:31:01 UTC
Description of problem:
One State Machine cannot invoke another state machine within the same execution in a single workspace.

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


How reproducible:
Very

Steps to Reproduce:
1. Create State Machine class SM1 (with states: state11, state12, state13)
2. Create Another State Machine class SM2(with states: state21, state22, state23)
3. From an instance in class SM1, have a relationship from state12 to
   an instance in class SM2

Actual results:
  The SM2 instance won't get executed when it is connected from state12

Expected results:
  The SM2 instance should get properly executed and then the control goes back to
  SM1 instance and state13 should get executed.

Additional info:

Comment 2 CFME Bot 2015-07-22 19:51:22 UTC
New commit detected on manageiq/master:
https://github.com/ManageIQ/manageiq/commit/11ebc078724ed1194c9eda0e435dd5d2b2bd95d4

commit 11ebc078724ed1194c9eda0e435dd5d2b2bd95d4
Author:     Madhu Kanoor <mkanoor>
AuthorDate: Fri Jun 26 15:09:56 2015 -0400
Commit:     Madhu Kanoor <mkanoor>
CommitDate: Tue Jul 21 17:27:38 2015 -0400

    Support Multiple State Machines
    
    Allows for 1 state machine to call another state machine
    in the same workspace. If one of the state machine in the
    chain ends with a retry all the state machines end with a
    retry. The same happens when one of the state machine
    ends with an error.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1236174

 lib/miq_automation_engine/engine/miq_ae_engine.rb  |   3 +
 lib/miq_automation_engine/engine/miq_ae_object.rb  |   4 +
 .../engine/miq_ae_workspace.rb                     |  30 ++-
 .../engine/miq_ae_state_info.rb                    |  23 ++
 .../miq_ae_state_machine_multi_spec.rb             | 273 +++++++++++++++++++++
 5 files changed, 332 insertions(+), 1 deletion(-)
 create mode 100644 vmdb/lib/miq_automation_engine/engine/miq_ae_state_info.rb
 create mode 100644 vmdb/spec/automation/unit/engine_validation/miq_ae_state_machine_multi_spec.rb

Comment 3 CFME Bot 2015-07-22 19:51:27 UTC
New commit detected on manageiq/master:
https://github.com/ManageIQ/manageiq/commit/b99b30a5bd43acf1b9fde96e0bc839e86f8c4dcd

commit b99b30a5bd43acf1b9fde96e0bc839e86f8c4dcd
Author:     Madhu Kanoor <mkanoor>
AuthorDate: Fri Jun 26 15:49:38 2015 -0400
Commit:     Madhu Kanoor <mkanoor>
CommitDate: Tue Jul 21 17:27:38 2015 -0400

    Rubocop errors and Spec Fixup
    
    Fixed rubocop errors
    Fixed a failing spec
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1236174

 lib/miq_automation_engine/engine/miq_ae_workspace.rb | 18 +++++++++---------
 spec/lib/miq_automation_engine/miq_ae_engine_spec.rb |  1 +
 2 files changed, 10 insertions(+), 9 deletions(-)

Comment 4 CFME Bot 2015-07-22 19:51:31 UTC
New commit detected on manageiq/master:
https://github.com/ManageIQ/manageiq/commit/589dc495ebac894709026a0544b858646381c7e2

commit 589dc495ebac894709026a0544b858646381c7e2
Author:     Madhu Kanoor <mkanoor>
AuthorDate: Tue Jul 21 17:51:53 2015 -0400
Commit:     Madhu Kanoor <mkanoor>
CommitDate: Tue Jul 21 17:51:53 2015 -0400

    Move file to lib directory
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1236174

 .../engine/miq_ae_state_info.rb                    | 23 ++++++++++++++++++++++
 .../engine/miq_ae_state_info.rb                    | 23 ----------------------
 2 files changed, 23 insertions(+), 23 deletions(-)
 create mode 100644 lib/miq_automation_engine/engine/miq_ae_state_info.rb
 delete mode 100644 vmdb/lib/miq_automation_engine/engine/miq_ae_state_info.rb

Comment 5 CFME Bot 2015-07-22 19:51:35 UTC
New commit detected on manageiq/master:
https://github.com/ManageIQ/manageiq/commit/3388cc3d345eae790b1f1bbadbf727de04b7b20e

commit 3388cc3d345eae790b1f1bbadbf727de04b7b20e
Author:     Madhu Kanoor <mkanoor>
AuthorDate: Wed Jul 22 10:56:48 2015 -0400
Commit:     Madhu Kanoor <mkanoor>
CommitDate: Wed Jul 22 10:56:48 2015 -0400

    Move spec file out of vmdb
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1236174

 .../miq_ae_state_machine_multi_spec.rb             | 273 +++++++++++++++++++++
 .../miq_ae_state_machine_multi_spec.rb             | 273 ---------------------
 2 files changed, 273 insertions(+), 273 deletions(-)
 create mode 100644 spec/automation/unit/engine_validation/miq_ae_state_machine_multi_spec.rb
 delete mode 100644 vmdb/spec/automation/unit/engine_validation/miq_ae_state_machine_multi_spec.rb

Comment 6 Ramesh A 2015-10-29 19:09:46 UTC
Good to go.  Verified and working fine in 5.5.0.8-beta1.4.20151027164951_4ab7fea

Comment 8 errata-xmlrpc 2015-12-08 13:19:42 UTC
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.

https://access.redhat.com/errata/RHSA-2015:2551