<?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>Appian Services Injection in Plugin Servlets</title><link>https://community.appian.com/discussions/f/plug-ins/11236/appian-services-injection-in-plugin-servlets</link><description>Hello all, 
 I&amp;#39;m trying to develop a plug-in servlet for Appian 17.2 and i need access to various services (e.g. ProcessExecutionService, ProcessDesignService). The class ServiceLocator is deprecated and Appian suggests to use injection (with the @Injection</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Appian Services Injection in Plugin Servlets</title><link>https://community.appian.com/thread/49405?ContentTypeID=1</link><pubDate>Fri, 13 Oct 2017 14:56:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b74c76e5-f7fb-4486-acd8-b72af0be6b63</guid><dc:creator>thanosm</dc:creator><description>&lt;p&gt;The use case is initiating Processes that are exposed as Web Services with the addition of returning data in the response and not just the generated Process ID. Unfortunately, we are not able to switch to web apis just yet because we&amp;#39;re in the process of upgrading our 7.6 installation to 17.2, which will take place by the end of November. We are working on Lab environment which was a copy of our 7.6 production and upgraded to 17.2 and we are working fixing any issues resulting from the Upgrade.&lt;/p&gt;
&lt;p&gt;This custom servlet is one case where an issue came up and while redeveloping we wanted to switch to using @Injection instead of deprecated classes.&lt;/p&gt;
&lt;p&gt;The funny thing is that in the documentation of Appian Public Java API, it mentions that all custom servlets should extend the AppianServlet class in order to support @Injection. However, there is examples of such use.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;public abstract class AppianServlet extends HttpServlet&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Abstract servlet class that provide inject functionality. To have services injected into servlets, plugin servlets will be written to extend this class and add @Inject annotation for the services to be injected.&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;strong&gt;public&amp;nbsp;void&amp;nbsp;init()
          throws ServletException&lt;/strong&gt;&lt;/pre&gt;
&lt;div class="block"&gt;&lt;strong&gt;servlet init() method that locates the web application context and autowires services with @Inject annotations. Note that the `init()` method on the AppianServlet class initializes the injectors.&lt;/strong&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Appian Services Injection in Plugin Servlets</title><link>https://community.appian.com/thread/49402?ContentTypeID=1</link><pubDate>Fri, 13 Oct 2017 14:47:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4c350325-4f39-49f9-9ff7-4ad66afcd1f4</guid><dc:creator>Mike Cichy</dc:creator><description>Not possible, you will have to use the deprecated class for now.&lt;br /&gt;
What is your use case? Could you use web apis instead?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>