The Community is now in read-only mode to prepare for the launch of the new Flexera Community. During this time, you will be unable to register, log in, or access customer resources. Click here for more information.
Does the regular submission process wait for the "On Submit" action to complete?
Prior to AP2019, we were (successfully) injecting content into the request notification email, but now the notification email is getting sent before the content is updated. Seems like something changed here.
Feb 19, 2020 04:00 PM
I can't answer whether this is synchronous or asynchronous or if something has changed in that space in 2019. Perhaps there were some changes related to the email-based approvals feature that was recently added?
How are you doing the "injection" and what kind of information are you injecting?
Feb 21, 2020 06:22 AM
Basically we are dynamically building the standard request submitted email content based on data collected during the checkout process. Using the OnSubmit action we calling a custom web service where we are writing this dynamic content and populating ##QuestionID:61##. The standard request submitted email content is: ##QuestionID:61##.
I can say that our web service call is populating ##QuestionID:61## as expected, but it seems as though the email is fired off before the content is written to the variable. This had worked fine with AP2016 SP4, but since we upgraded to 2019 R1 SP1, so seems like something changed. The customers are now just getting an email that says: ##QuestionID:61##.
Feb 21, 2020 07:32 AM
I believe that the call to the web service action is asynchronous; otherwise the issue could not occur.. In the code, the events are invoked immediately before the email notification is sent, so this is not an order of operations type issue. This is also illustrated in checkout.log,, where the log entry “doing weeb service actions” (yes the typo is in the log) is logged prior to “sending emails”.. After the actions are fired, the notification is sent out. It does not look like this order of operations has changed since App Portal 2016, so the change in behavior must be fairly subtle . I'd not think that we'd want the call to be synchronous, as this would delay the request submission...
Feb 21, 2020 09:33 AM
Is question 61 actually on a question template that is attached to the catalog item or the approval workflow? Or were you just doing some "black magic" to make it look like there was a question 61 tied to the request? If the latter, it's entirely possible we found and fixed a bug that previously allowed that unexpected behavior. Is the information that you're putting into that variable something that could be pulled from somewhere else (e.g. user-related information that could be pulled from the WD_User table or package-specific data that could be pulled from a custom variable)? In other words, could you use different variables that already exist in order to compose the body of that mail?
Mar 03, 2020 04:08 PM
Actually, here's what we are doing. For a specific general catalog item, the intial "request submission" email has a body of ##QuestionID:61##. During the request process, we are collecting information during the via questions to the requester. Eventually we get to a specific product...one way or another.
On the OnSubmit action, we are making a custom web service call to look up to look up data in regarding the selected application in FNMS, specifically whether or not the product selected is authorized, not authorized, etc... Based on this status/disposition, the body of the email content is dynamically generated and inserted via SQL into ##QuestionID:61##. When the intial email is sent, this would display the custom HTML that was built by the web service. Essentially there are 4 or 5 email templates, depending on different FNMS values. This had worked for us before with AP2016. (note: since this question was asked, QuestionID:61 is NOT in the question template...not sure if it should be or not)
Recently we moved to AP2019R1SP1. Since then the email is getting sent out just says: ##QuestionID:61## and does not render the value. I should point out that ##QuestionID:61## is correctly populated with the right data, however it seems that the email is getting sent before the dynamic content has been built.
Below are a few examples:
QuestionID:61 - Example 1:
Thank you for requesting Google Chrome 9 software in the Enterprise Software Store.
Google Chrome 9 has been reviewed by the appropriate approval authorities and is NOT authorized for the <customer name removed> environment. However, if you feel you have a valid business justification for this software, you can request a software waiver. The waiver approval authority will provide an appropriate business decision of approval/denial of the waiver within five business days.
More information regarding waivers can be found at the Waiver Process Site.
QuestionID:61 - Example 2:
Thank you for requesting NXP Kinetis Design Studio 3.2.0 software in the Enterprise Software Store.
Since the software was not listed in the dropdown list, the IT Asset Management (ITAM) team must manually process this request.
Mar 05, 2020 04:06 PM - last edited on Mar 05, 2020 04:28 PM by jdempsey
One thing you might consider trying is putting question 61 into your question template (probably not really desirable) or put it on a separate template for approvers and attach that separate template to your approval workflow. The question can be blank and not required. However, this will ensure that you have a ##QuestionID:61## variable associated with the request. My theory here is that somewhere between the old version and new version of App Portal, we may have changed some code that validates what questions are actually associated with a given request, and if the question is not associated, any variables for that question would not be populated. This is entirely just a guess. If it does turn out to be a timing issue, you would likely just see a blank email, as the variable would exist, but the value would be blank. You could also go into the integration API (http://myappportalserver/esd/ws/integration.asmx) and run the GetResolvedRequestVariables web method against any one of your existing requests. My guess is that you will not see a variable ##QuestionID:61## listed at all. However, if you add the question to your template, you should at least see the variable listed even if the value is blank.
One other thought would be instead of using a question variable, since the information is specific to the application and not an individual request, you could use a custom variable. Just add a custom variable called Custom_EmailTemplate (or whatever variable name you prefer) and populate it with whatever you want. Then your web service call could update that variable instead of updating the question variable that may or may not be associated with your request. Depending on how often the status of an application changes in FNMS, you could even consider replacing the real-time web service call with a scheduled background task that periodically looks up the application statuses and populates the custom variables with the appropriate values.
Mar 05, 2020 04:42 PM