<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Calculating start and end dates of a hierarchy based task items.</title><link>https://community.appian.com/discussions/f/data/18457/calculating-start-and-end-dates-of-a-hierarchy-based-task-items</link><description>Let&amp;#39;s say I have a list of task items(not to be confused with Appian tasks) defined in a list of dictionary which are configured like below. 
 
 
 Tabular version of the same data; 
 
 
 
 Which means, 
 Task C cannot be launched until Task B is completed</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Calculating start and end dates of a hierarchy based task items.</title><link>https://community.appian.com/thread/72636?ContentTypeID=1</link><pubDate>Fri, 13 Mar 2020 23:29:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:82be588f-f9fb-42e1-891b-6418045b2427</guid><dc:creator>Arun Theja Muthyalu</dc:creator><description>&lt;p&gt;&amp;nbsp;Thank you for the response!&lt;br /&gt;&lt;br /&gt;I have edited the question, please refer to the latest. Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calculating start and end dates of a hierarchy based task items.</title><link>https://community.appian.com/thread/72635?ContentTypeID=1</link><pubDate>Fri, 13 Mar 2020 22:00:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ea60363b-02aa-4313-affc-f0c97d6a7d09</guid><dc:creator>anon897987</dc:creator><description>&lt;p&gt;I&amp;#39;m assuming&lt;/p&gt;
&lt;p&gt;1. Each task is tied to some central record&lt;/p&gt;
&lt;p&gt;2. That a task history is kept for that central record&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Then you could do something like this:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;choose(
  wherecontains(
    ri!taskType,
    {
      &amp;quot;A&amp;quot;,
      &amp;quot;B&amp;quot;,
      &amp;quot;C&amp;quot;,
      &amp;quot;D&amp;quot;,
      &amp;quot;E&amp;quot;,
      &amp;quot;F&amp;quot;,
      &amp;quot;G&amp;quot;
      
    }
  ),
  /*&amp;quot;A&amp;quot;,*/
  now() + 5,
  /*&amp;quot;B&amp;quot;,*/
  now() + 5,
  /*&amp;quot;C&amp;quot;,*/
  if(
    contains(
      ri!taskHistory,
      &amp;quot;A&amp;quot;
    ),
    now() + 7,
    null
  ),
  /*&amp;quot;D&amp;quot;,*/
  if(
    and(
      contains(
        ri!taskHistory,
        &amp;quot;A&amp;quot;
      ),
      contains(
        ri!taskHistory,
        &amp;quot;B&amp;quot;
      )
    ),
    now() + 3,
    null
  ),
  /*&amp;quot;E&amp;quot;,*/
  if(
    contains(
      ri!taskHistory,
      &amp;quot;D&amp;quot;
    ),
    now() + 5,
    null
  ),
  /*&amp;quot;F&amp;quot;,*/
  if(
    contains(
      ri!taskHistory,
      &amp;quot;D&amp;quot;
    ),
    now() + 10,
    null
  ),
  /*&amp;quot;G&amp;quot;*/
  if(
    contains(
      ri!taskHistory,
      &amp;quot;F&amp;quot;
    ),
    now() + 7,
    null
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Basically, pass in the Task Type (A, B, C, D etc) of the current task, along with the task history.&lt;/p&gt;
&lt;p&gt;For tasks that have precedents, check to see if the task history contains the relevant precedents.&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>