Hi, We are on Appian Cloud 7.6. I have following requirement:

Hi,
We are on Appian Cloud 7.6.

I have following requirement:

In our current portal version of task form, we have set up a hidden field, which will send an API call to our database with the task information as soon as user accepts the task. That was possible because task form in portal wasn't refreshing on moving between the components.

Now, we are on process of migrating to Tempo, and we want to create the same scenario in the Tempo. So, whenever user accepts the task, then and only in that case API call should be made. I tried following things:

(1) Having the API call in the load(). But that call will be made as soon as the form will be load, not after user accepts the task.
(2) Had a dummy task before the actual task, both of them are activity chained. So, whenever the actual task loads that API call is made. But, this is actually not preferred by our users and conflicts with our business need.

So, is there a way I can achieve the above mentioned...

OriginalPostID-125111

OriginalPostID-125111

  Discussion posts and replies are publicly visible

  • The rule node will only evaluate once, it won't continuously reevaluate.

    It might be the case that the user won't even accept the task after that 2 minute window, so I don't know if that is the best solution. What I would recommend is using a script task for the rule evaluation, and configure it to repeat until that expression evaluates to true. Please refer to the attached screenshot.

  • Right, but in case of the repeated script task, the interval has to be minimum 5 minutes, right? So, I can't have the "on-demand" kind of functionality here, right? For example what happens when user accepts the time in the time-window of 5 mins?
  • In that case the function would evaluate to true the next time it executes, which might be in a few seconds or a few minutes. But if that is too long of a delay then you can try what I mentioned earlier, adding a similar delay to the execution of the rule node the same as you have for the task node
  • Thanks Aleksi!

    What I did was, I added Complex Gateway, and had a condition there that if =gettaskacceptedtimestamp(pv!TaskIDFromRule3) is true, then go and call the API. If that condition is not true, I am sending it to an empty script task (No input, output expressions defined). And again, from the same script task I am flowing to that complex gateway (In a way creating a repeating loop). Also, I have checked the "Delete previously completed/cancelled instances" from the Other tab in the script task.

    This kind of served my purpose. But now concern is, how it will be impacted performance-wise? (We have instances of tasks which are not accepted for as long as 6-7 months.)

    Thanks!
  • I would advise against this. The potential performance impact of having many of these processes constantly looping for months on end could become noticeable to end-users. For this API call, is it something that directly impacts what the user is doing? Or is it something that has no real bearing on what the user is working on with these forms?
  • Aleksi,

    Actually, whenever anyone accepts the task, we send an API call to our database and save the necessary information like Task ID, Task start time, task acceptance time, task name, who accepted the task, etc. This information is necessary to send our database during the task acceptance.

    To answer your question, user wouldn't know that there is an API call when they accept the task. Currently we have set that up in the hidden variable under the portal form. But, in case of portal, the form will only refresh when either user accepts the task and user submits the form. So that hidden variable logic worked there.

    But now as we are moving everything to Tempo, the form will refresh every time user will move from component to component. So, I can't use the function that calls the API under with(), and I can't use that function in load as well, because that will be called once the form is loaded, not after user accepts the task.

    That's why I am looking for some functionality/logic which I can apply such that whenever user accepts the task, the function that calls the API will get executed!

    I hope this helps!

    Thanks!