<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to LogicCommand</title><link>https://sourceforge.net/p/coils/wiki/LogicCommand/</link><description>Recent changes to LogicCommand</description><atom:link href="https://sourceforge.net/p/coils/wiki/LogicCommand/feed" rel="self"/><language>en</language><lastBuildDate>Sat, 27 Apr 2013 13:04:22 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/coils/wiki/LogicCommand/feed" rel="self" type="application/rss+xml"/><item><title>LogicCommand modified by Adam Tauno Williams</title><link>https://sourceforge.net/p/coils/wiki/LogicCommand/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -17,7 +17,17 @@
    1. __prepare( ___**params___ )__
       1. __parse_parameters( ___**params___ )__
       1. __check_run_permissions( )__ - Should raise an exception if the current [Context] does not have the privileges or roles required to perform the specified action.
+   1. __run( )__
    1. __epilogue( )__
       1. __audit_action( )__
    1. Return value of __get_result( )__ is the result of the run_command method.

+##Methods
+
+   Method   | Description
+   --------- | ----------------
+   command_name() | Returns the string name of the command, as in ___domain::action___
+   get_result() | Returns the assigned command result, only useful to the [Context] after the Command has been executed.
+   generate_object_id() | For use by the Command's run() method, generates a new unique objectId for any new entities created.
+   set_result( value ) | Set the value to be returned by the Command to the [Context].  Every call overwrites the previous value.
+   set_return_value( date, right='r' ) | Set the return value of the Command to an entity or list of entities - reducing that list to only those for which the Context has the specified privilege.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Adam Tauno Williams</dc:creator><pubDate>Sat, 27 Apr 2013 13:04:22 -0000</pubDate><guid>https://sourceforge.net4bcb8eccf47a08760b8f8ac589a6510993440bfa</guid></item><item><title>LogicCommand modified by Adam Tauno Williams</title><link>https://sourceforge.net/p/coils/wiki/LogicCommand/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;a class="alink" href="/p/coils/wiki/Development/"&gt;[Development]&lt;/a&gt;&lt;/p&gt;
&lt;div class="toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#logic-commands"&gt;Logic Commands&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#sequence-of-operations"&gt;Sequence Of Operations&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h1 id="logic-commands"&gt;Logic Commands&lt;/h1&gt;
&lt;p&gt;Logic commands are always executed using the "run_command" method of a &lt;a class="alink" href="/p/coils/wiki/Context/"&gt;[Context]&lt;/a&gt; instance.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;ctx&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;AdminsitrativeContext&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;run_command&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s"&gt;'project::get'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'Wiki Project'&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;For scripting and interactive use the &lt;span&gt;[Contact]&lt;/span&gt; method "r_c" exists as a short-cut for "run_command".  But formal code committed to the repository should always use the long form.&lt;/p&gt;
&lt;h2 id="sequence-of-operations"&gt;Sequence Of Operations&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;ctor&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;prepare( &lt;strong&gt;&lt;em&gt;**params&lt;/em&gt;&lt;/strong&gt; )&lt;/strong&gt;&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;parse_parameters( &lt;strong&gt;&lt;em&gt;**params&lt;/em&gt;&lt;/strong&gt; )&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;check_run_permissions( )&lt;/strong&gt; - Should raise an exception if the current &lt;a class="alink" href="/p/coils/wiki/Context/"&gt;[Context]&lt;/a&gt; does not have the privileges or roles required to perform the specified action.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;epilogue( )&lt;/strong&gt;&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;audit_action( )&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Return value of &lt;strong&gt;get_result( )&lt;/strong&gt; is the result of the run_command method.&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Adam Tauno Williams</dc:creator><pubDate>Sat, 27 Apr 2013 12:59:49 -0000</pubDate><guid>https://sourceforge.netc7b547e93f1cfdc7ea0bd5ae069816d8747eea5d</guid></item></channel></rss>