<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Startref Issue</title><link>https://answers.axonivy.com/questions/2001/startref-issue</link><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;We're facing following Issue:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Could not find a start with name '15601A89E0030024/Logout.ivp'&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We tried following ways:&lt;/p&gt;
&lt;h1&gt;{ivy.html.startref('Start Processes/Home/Logout.ivp')}&lt;/h1&gt;
&lt;h1&gt;{ivy.html.startref('15601A89E0030024/Logout.ivp')}&lt;/h1&gt;
&lt;p&gt;The problem is, that the Logoutprocess is in another Project which is in the required Project list of the Projects which tries to start the logout process. &lt;/p&gt;
&lt;p&gt;How can we fix that?&lt;/p&gt;
&lt;p&gt;Regards,
Dani&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/2001/startref-issue" rel="self"></atom:link><language>en</language><lastBuildDate>Mon, 12 Sep 2016 15:19:43 -0400</lastBuildDate><item><title>Comment by dharlach on Flavio Sadeghi's answer</title><link>https://answers.axonivy.com/questions/2001/startref-issue#2022</link><description>&lt;p&gt;Hi Flavio&lt;/p&gt;
&lt;p&gt;Thanks a lot for your answer :) I'm looking forward to the new version.&lt;/p&gt;
&lt;p&gt;Kind Regards,
Daniel&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">dharlach</dc:creator><pubDate>Mon, 12 Sep 2016 15:19:43 -0400</pubDate><guid>https://answers.axonivy.com/questions/2001/startref-issue#2022</guid></item><item><title>Answer by Flavio Sadeghi</title><link>https://answers.axonivy.com/questions/2001/startref-issue/2021</link><description>&lt;p&gt;Hello Dani&lt;/p&gt;
&lt;p&gt;This is currently not possible by using public API. &lt;/p&gt;
&lt;p&gt;Anyway I have just improved the startref-method, that it searchs in required projects too. This improvement will be available with the next version (6.4) and is tracked on 
issue &lt;code&gt;XIVY-1322: ivy.html.startref() should also generate link for process starts in required projects&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;In the meanwhile you could use the below utility. Please note, that this code make use of NON-Public API and will eventually not work in further releases.  Therefore, as soon the next release is avaiable, replace this code with the call to the regular public API.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;package util;

import java.net.URI;

import ch.ivyteam.ivy.environment.Ivy;
import ch.ivyteam.ivy.persistence.PersistencyException;
import ch.ivyteam.ivy.project.IIvyProject;
import ch.ivyteam.ivy.request.IHttpProcessModelVersionRequest;
import ch.ivyteam.ivy.request.IHttpRequest;
import ch.ivyteam.ivy.request.RequestUriFactory;
import ch.ivyteam.ivy.security.SecurityManagerFactory;
import ch.ivyteam.ivy.workflow.IStartElement;
import ch.ivyteam.ivy.workflow.IWorkflowProcessModelVersion;

@SuppressWarnings("restriction")
public class HtmlContextUtils {
    public static String startref(final String startName) {
        try {
            IStartElement start = findStartElement(startName);
            if (start != null) {
                URI processStartUri = RequestUriFactory.createProcessStartUri((IHttpProcessModelVersionRequest) Ivy.request(), start);
                return makeUriAbsolute(processStartUri).toASCIIString();
            }
        } catch (PersistencyException ex) {
            Ivy.log().error(ex);
        }
        return "";
    }

    private static IStartElement findStartElement(final String startName) {
        return SecurityManagerFactory.getSecurityManager().executeAsSystem2(() -&amp;gt; {
            IIvyProject project = Ivy.request().getProject();
            IStartElement startElement = findStartElement(startName, project);
            if (startElement != null) {
                return startElement;
            }
            for (IIvyProject ivyProject : project.getRequiredProjects()) {
                startElement = findStartElement(startName, ivyProject);
                if (startElement != null) {
                    return startElement;
                }
            }
            return null;
        });
    }

    private static IStartElement findStartElement(final String startName, IIvyProject ivyProject) {
        IWorkflowProcessModelVersion wpmv = ivyProject.getWorkflowProcessModelVersion();
        IStartElement startElement = wpmv.findStartElement(startName);
        if (startElement == null) {
            startElement = wpmv.findStartElementByUserFriendlyRequestPath(startName);
        }
        return startElement;
    }

    private static URI makeUriAbsolute(URI uri) {
        if (uri.isAbsolute()) {
            return uri;
        }
        return RequestUriFactory.createServerUri((IHttpRequest) Ivy.request()).resolve(uri);
    }
}
&lt;/code&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Flavio Sadeghi</dc:creator><pubDate>Mon, 12 Sep 2016 15:16:03 -0400</pubDate><guid>https://answers.axonivy.com/questions/2001/startref-issue/2021</guid></item><item><title>Comment by dharlach on dharlach's question</title><link>https://answers.axonivy.com/questions/2001/startref-issue#2006</link><description>&lt;p&gt;Any Ideas?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">dharlach</dc:creator><pubDate>Mon, 05 Sep 2016 16:19:52 -0400</pubDate><guid>https://answers.axonivy.com/questions/2001/startref-issue#2006</guid></item></channel></rss>