Hi, I'm just wondering to know from where the following services

Hi,

I'm just wondering to know from where the following services will be injected into a custom plugin? (or how those objects will be available in a custom plugin)? SmartServiceContext or ServiceContext or UserService or UserProfileService? ...

OriginalPostID-111891

OriginalPostID-111891

  Discussion posts and replies are publicly visible

  • There are lot of examples in the Shared Components section that use injected contexts, take some time to download and review the source code of some of them available for download here in Appian Forum under the "Shared Components" record (forum.appian.com/.../all)- Smart Services

    The Developer Guide will also explain this forum.appian.com/.../Custom_Smart_Service_Plug-ins

    They're injected in the constructor of your plug-in.
  • Thanks Eduardo. I would like to know, is that the BND tool who injects them(make those objects available into our plug-in)? or the JBoss or there any custom class that makes these classes(UserService etc...) available into a plugin?
    because when ever we execute any function from Appian we only pass a few parameters not the injected ones. who would make the remaining services available?
  • If you are going to invoke methods from a specific service then you need to explicitly inject them in the constructor if a smart service or in the method that represents the function if a custom function, for example, this function inside its logic requires methods from ContentService and ProcessDesignService therefore they need to be explicitly passed as parameters to the function but at runtime this is transparent to the end user who, for this example, will only have to pass a text input to the function, since at coding time you specified the function would use these other services then Appian makes them available.

    @Function
    public String getContentDetailsByUUID(ServiceContext sc, ContentService cs,
    ProcessDesignService pds, @Parameter String objectUUID) {

    Long id = cs.getIdByUuid(objectUUID);

    .......


    }