<?xml version="1.0" encoding="UTF-8" standalone="yes"?><oembed><version><![CDATA[1.0]]></version><provider_name><![CDATA[CloudForms Now]]></provider_name><provider_url><![CDATA[http://cloudformsblog.redhat.com]]></provider_url><author_name><![CDATA[johnhardy36]]></author_name><author_url><![CDATA[https://cloudformsblog.redhat.com/author/johnhardy36/]]></author_url><title><![CDATA[Built In Method&nbsp;Example]]></title><type><![CDATA[link]]></type><html><![CDATA[<p>These been some discussion about Build-In vs In-line methods,  here is a quick example of a Built-In method that sends email from instance attributes that is quite commonly done as a In-Line method when it does not need to be In-Line.</p>
<p>Start by creating a Class called Email<!--more--></p>
<p><a href="http://cloudformsnow.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-45-07.png"><img data-attachment-id="188" data-permalink="https://cloudformsblog.redhat.com/screen-shot-2013-10-23-at-11-45-07/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-45-07.png" data-orig-size="460,113" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2013-10-23 at 11.45.07" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-45-07.png?w=300&#038;h=74" data-large-file="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-45-07.png?w=460" class="alignnone wp-image-188 size-medium" src="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-45-07.png?w=300&#038;h=74" alt="Screen Shot 2013-10-23 at 11.45.07" width="300" height="74" srcset="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-45-07.png?w=300&amp;h=74 300w, https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-45-07.png?w=150&amp;h=37 150w, https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-45-07.png 460w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Set your schema as follows;</p>
<p><a href="http://cloudformsnow.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-55.png"><img data-attachment-id="187" data-permalink="https://cloudformsblog.redhat.com/screen-shot-2013-10-23-at-11-44-55/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-55.png" data-orig-size="1342,251" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2013-10-23 at 11.44.55" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-55.png?w=300&#038;h=56" data-large-file="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-55.png?w=1024" class="alignnone wp-image-187 size-medium" src="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-55.png?w=300&#038;h=56" alt="Screen Shot 2013-10-23 at 11.44.55" width="300" height="56" srcset="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-55.png?w=300&amp;h=56 300w, https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-55.png?w=600&amp;h=112 600w, https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-55.png?w=150&amp;h=28 150w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>In your new class create a new method, but this time change the method type to Build-In, and add the following detail. Notice I have set  parameters also to the method.</p>
<p><a href="http://cloudformsnow.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-34.png"><img data-attachment-id="185" data-permalink="https://cloudformsblog.redhat.com/screen-shot-2013-10-23-at-11-44-34/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-34.png" data-orig-size="1318,487" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2013-10-23 at 11.44.34" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-34.png?w=300&#038;h=111" data-large-file="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-34.png?w=1024" class="alignnone wp-image-185 size-medium" src="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-34.png?w=300&#038;h=111" alt="Screen Shot 2013-10-23 at 11.44.34" width="300" height="111" srcset="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-34.png?w=300&amp;h=111 300w, https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-34.png?w=600&amp;h=222 600w, https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-34.png?w=150&amp;h=55 150w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Set the values to you instance in the new email class to the following, notice how I have also used variables in my strings to grab dynamic data.</p>
<p><a href="http://cloudformsnow.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-26.png"><img data-attachment-id="184" data-permalink="https://cloudformsblog.redhat.com/screen-shot-2013-10-23-at-11-44-26/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-26.png" data-orig-size="398,187" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2013-10-23 at 11.44.26" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-26.png?w=300&#038;h=141" data-large-file="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-26.png?w=398" class="alignnone wp-image-184 size-medium" src="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-26.png?w=300&#038;h=141" alt="Screen Shot 2013-10-23 at 11.44.26" width="300" height="141" srcset="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-26.png?w=300&amp;h=141 300w, https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-26.png?w=150&amp;h=70 150w, https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-26.png 398w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>The output in the automate log should look something like;</p>
<p><a href="http://cloudformsnow.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-01.png"><img data-attachment-id="183" data-permalink="https://cloudformsblog.redhat.com/2013/10/23/built-in-method-example/screen-shot-2013-10-23-at-11-44-01/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-01.png" data-orig-size="1905,136" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2013-10-23 at 11.44.01" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-01.png?w=300&#038;h=21" data-large-file="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-01.png?w=1024" class="alignnone wp-image-183 size-medium" src="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-01.png?w=300&#038;h=21" alt="Screen Shot 2013-10-23 at 11.44.01" width="300" height="21" srcset="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-01.png?w=300&amp;h=21 300w, https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-01.png?w=588&amp;h=42 588w, https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-44-01.png?w=150&amp;h=11 150w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>And when you test the BuiltIn Method, you will get and email just like the below</p>
<p><a href="http://cloudformsnow.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-43-45.png"><img data-attachment-id="182" data-permalink="https://cloudformsblog.redhat.com/screen-shot-2013-10-23-at-11-43-45/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-43-45.png" data-orig-size="1121,103" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2013-10-23 at 11.43.45" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-43-45.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-43-45.png?w=1024" class="alignnone wp-image-182 size-large" src="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-43-45.png?w=1024&#038;h=94" alt="Screen Shot 2013-10-23 at 11.43.45" srcset="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-43-45.png?w=1024&amp;h=94 1024w, https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-43-45.png?w=150&amp;h=14 150w, https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-43-45.png?w=300&amp;h=28 300w, https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-43-45.png?w=768&amp;h=71 768w, https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-43-45.png 1121w" sizes="(max-width: 1024px) 100vw, 1024px"   /></a></p>
<p>So how do we use this?</p>
<p>Every time you want to send an email, you simply link to an instance in the email class as a relationship. Example;</p>
<p>You have a state machine with many steps, somewhere you wish to send an email, add to your state machine a relationship to the email class and create an instance within the email class to send the email, with the body, subject set the way you wish. As shown here, the last line in the state machine is a replica of the one before, except I am using a builtIN method vs the one before is a IN-Line.</p>
<p><img data-attachment-id="191" data-permalink="https://cloudformsblog.redhat.com/screen-shot-2013-10-23-at-11-59-12/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-59-12.png" data-orig-size="1276,477" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2013-10-23 at 11.59.12" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-59-12.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-59-12.png?w=1024" class="alignnone wp-image-191 size-large" src="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-59-12.png?w=1024&#038;h=382" alt="Screen Shot 2013-10-23 at 11.59.12" srcset="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-59-12.png?w=1022&amp;h=382 1022w, https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-59-12.png?w=150&amp;h=56 150w, https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-59-12.png?w=300&amp;h=112 300w, https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-59-12.png?w=768&amp;h=287 768w, https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-59-12.png 1276w" sizes="(max-width: 1024px) 100vw, 1024px"   /></p>
<p>My email instance is set as follows,</p>
<p><img data-attachment-id="192" data-permalink="https://cloudformsblog.redhat.com/screen-shot-2013-10-23-at-12-00-23/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-12-00-23.png" data-orig-size="264,186" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2013-10-23 at 12.00.23" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-12-00-23.png?w=264" data-large-file="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-12-00-23.png?w=264" class="alignnone wp-image-192 size-thumbnail" src="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-12-00-23.png?w=150&#038;h=106" alt="Screen Shot 2013-10-23 at 12.00.23" width="150" height="106" srcset="https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-12-00-23.png?w=150&amp;h=106 150w, https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-12-00-23.png 264w" sizes="(max-width: 150px) 100vw, 150px" /></p>
<p>The last thing to cover of is WHY???</p>
<p>Simply put an InLine Method will spawn a new environment space, where as BuiltIN is exactly that. Therefore BuiltIN is faster and lighter that InLine Methods.</p>
]]></html><thumbnail_url><![CDATA[https://cloudformsredhat.files.wordpress.com/2013/10/screen-shot-2013-10-23-at-11-45-07.png?w=300&fit=440%2C330]]></thumbnail_url><thumbnail_width><![CDATA[300]]></thumbnail_width><thumbnail_height><![CDATA[74]]></thumbnail_height></oembed>