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

Parents
  • 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);

    .......


    }
Reply
  • 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);

    .......


    }
Children
No Data