<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Serializing Custom Tasks in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Serializing-Custom-Tasks/m-p/59013#M6035</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I am designing a custom task that sets the fmtsearch option by clicking on radio buttons. The custom task does not persist, i.e. you open it, set your option, run it and the task disappears. What I want to be able to do is store the current choice so that when the user opens up the task again, it remembers during the session what the current choice is. &lt;BR /&gt;
&lt;BR /&gt;
Is there a way to serialize this information so it can be used for the duration of a SAS EG session?&lt;BR /&gt;
&lt;BR /&gt;
Any advice appreciated.&lt;BR /&gt;
&lt;BR /&gt;
Nick</description>
    <pubDate>Thu, 28 Apr 2011 06:04:55 GMT</pubDate>
    <dc:creator>nrose</dc:creator>
    <dc:date>2011-04-28T06:04:55Z</dc:date>
    <item>
      <title>Serializing Custom Tasks</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Serializing-Custom-Tasks/m-p/59013#M6035</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I am designing a custom task that sets the fmtsearch option by clicking on radio buttons. The custom task does not persist, i.e. you open it, set your option, run it and the task disappears. What I want to be able to do is store the current choice so that when the user opens up the task again, it remembers during the session what the current choice is. &lt;BR /&gt;
&lt;BR /&gt;
Is there a way to serialize this information so it can be used for the duration of a SAS EG session?&lt;BR /&gt;
&lt;BR /&gt;
Any advice appreciated.&lt;BR /&gt;
&lt;BR /&gt;
Nick</description>
      <pubDate>Thu, 28 Apr 2011 06:04:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Serializing-Custom-Tasks/m-p/59013#M6035</guid>
      <dc:creator>nrose</dc:creator>
      <dc:date>2011-04-28T06:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: Serializing Custom Tasks</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Serializing-Custom-Tasks/m-p/59014#M6036</link>
      <description>Yes.  Serializing the state of the task requires that you implement the XmlState property (get and set).  Or, if you are using the SAS.Tasks.Toolkit and inheriting from the SasTask class, override the RestoreStateFromXml and GetXmlState methods.&lt;BR /&gt;
&lt;BR /&gt;
Most of the examples at:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/onlinedoc/guide/customtasks/index.htm" target="_blank"&gt;http://support.sas.com/documentation/onlinedoc/guide/customtasks/index.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
show this technique.  Note that I added several examples in the past couple of months, in case you haven't checked there lately.&lt;BR /&gt;
&lt;BR /&gt;
Look at the Calculate Lag example or System Command example.&lt;BR /&gt;
&lt;BR /&gt;
Chris</description>
      <pubDate>Fri, 29 Apr 2011 11:58:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Serializing-Custom-Tasks/m-p/59014#M6036</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2011-04-29T11:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: Serializing Custom Tasks</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Serializing-Custom-Tasks/m-p/59015#M6037</link>
      <description>Thanks Chris,&lt;BR /&gt;
&lt;BR /&gt;
The problem is that I dont quite get how these get and set methods work. The methods return or deserialize a string, but does this string need to be stored somewhere? Remember, my custom task's show method returns a 'Canceled' ShowResult value, and therefore does not store a result. I have tried to implement what is demonstrated in the examples into my custom task, but it doesnt seem to work. What might I be doing wrong? &lt;BR /&gt;
&lt;BR /&gt;
I have had to resort to serialize the properties into an xml file, but your examples don't seem to require this. An explanation, or a reference to somewhere which explains how these methods are handled would be helpful. Is there something being done behind the scenes with these methods that might help me figure it out?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
&lt;BR /&gt;
Nick</description>
      <pubDate>Fri, 29 Apr 2011 12:43:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Serializing-Custom-Tasks/m-p/59015#M6037</guid>
      <dc:creator>nrose</dc:creator>
      <dc:date>2011-04-29T12:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: Serializing Custom Tasks</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Serializing-Custom-Tasks/m-p/59016#M6038</link>
      <description>Nick, sorry for the delay in getting back.&lt;BR /&gt;
&lt;BR /&gt;
If your task returns Cancel as a result, then the state is *not* stored in the EG project.  You might have realized that by now.&lt;BR /&gt;
&lt;BR /&gt;
So, then you are on your own for serializing the state elsewhere, if the state is not project specific.  You can use .NET methods to read/write a file of your own design into a safe location, such as somewhere in %appdata% where the user is sure to have write access.&lt;BR /&gt;
&lt;BR /&gt;
Chris</description>
      <pubDate>Wed, 11 May 2011 19:13:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Serializing-Custom-Tasks/m-p/59016#M6038</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2011-05-11T19:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Serializing Custom Tasks</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Serializing-Custom-Tasks/m-p/59017#M6039</link>
      <description>Thanks Chris,&lt;BR /&gt;
&lt;BR /&gt;
I have done exactly that - serialized to an XML in Windows/temp. Just wanted to make sure there was no inbuilt method.&lt;BR /&gt;
&lt;BR /&gt;
Nick</description>
      <pubDate>Thu, 12 May 2011 07:51:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Serializing-Custom-Tasks/m-p/59017#M6039</guid>
      <dc:creator>nrose</dc:creator>
      <dc:date>2011-05-12T07:51:25Z</dc:date>
    </item>
  </channel>
</rss>

