Bug 1350560

Summary: Unable to transfer an attribute value between methods of two different classes in CFME Automation explorer
Product: Red Hat CloudForms Management Engine Reporter: Colin Arnott <carnott>
Component: AutomateAssignee: mkanoor
Status: CLOSED WONTFIX QA Contact: Dmitry Misharov <dmisharo>
Severity: high Docs Contact:
Priority: medium    
Version: 5.5.0CC: benglish, dmisharo, jhardy, mkanoor, obarenbo, tfitzger
Target Milestone: GAKeywords: Reopened
Target Release: 5.7.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: automate
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-12-11 15:24:13 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 Colin Arnott 2016-06-27 18:56:50 UTC
Description of problem:
We are unable to transfer a parameter value generated in one method of one class to other method in different class. By using evm.object method, we are able to fetch the attribute value within an instance. But unable to access the attribute value accross the methods in different classes. We want the value of a parameter generated in one method to be used in other method of different class.

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

Comment 2 Colin Arnott 2016-06-27 18:59:34 UTC
The following attempt was unsuccessful:


In the setting class' method:

$evm.set_state_var(:variable_name, 'value')


In the calling class' method:

variable_name  =  $evm.get_state_var(:variable_name)


This blog post may also be of use, as it goes into more detail:
http://www.jung-christian.de/2015/03/preserve-data-in-manageiq-state-machines/

Comment 3 Colin Arnott 2016-06-27 19:00:16 UTC
We were told about the 'Collect' feature, but have not tested this in our environment:

https://pemcg.gitbooks.io/introduction-to-cloudforms-automation/content/chapter13/more_advanced_schema_concepts.html#collect

Comment 5 mkanoor 2017-01-03 19:48:03 UTC
Customer not responding.