+2 votes


Let's imagine I create a document and I attach a file to it.

Then, I generate a "public link" for the document and another "public link" to a file.

I would like to generate new actions (sending a mail, creating an opportunity, generate actions, ... whatever !) :

  1. When someone consult the document
  2. When someone download one of the file of the document
  3. When someone download directly the document (with the second link)

Each of theses "actions after" are different. How could I catch the event in a workflow ? In the database where is the information stored ?



asked in Efficy/ Client side by (460 points)
reopened by

3 Answers

+1 vote
Best answer

If I loop through the SYS_ NOTIFICATIONS and NOTI_ USER, how can I detect this kind of notification ? It this KIND = 3 ?



answered by (460 points)
selected by
- Kind will be 3 ("information")
- K_USER will be 2 (Administrator)

The Subject (in the stream) will contain the translation of one of the following:
- The file "%s" has been downloaded by your customer
- The list of files of the Document "%s" has been viewed by your customer

The Memo (in the stream) will contain the translation of "Shared Document Notification"
0 votes

Efficy currently sends a notification when an external user makes use of the public link. In the database the notification is stored in SYS_ NOTIFICATIONS and NOTI_ USER.

It would not be very easy to add workflow events ; Servicy doesn't have any normal user sessions in which these workflow events run.
Any suggestion is welcome :).

answered by (836 points)
Suggestion made (CFT-2019-99329). It could be nice if we could use a workflow event like "AfterConsultExternal" of a simple "BeforeCommitDocu / AfterCommitDocu".
Robert just said that it's very complicated, because servicy is a whole different process. There is no correlation between the external request and all other sessions. Your suggestion for workflow events doesn't really help :-)
Couldn't servicy have a callback to trigger something ? With his own API key ?
We could connect as administrator and impersonate the user that has generated the shared link (and receives the notification), then call the workflow event, but currently Servicy does nothing of this kind.

Maybe we can find another way of achieving the same goal...
Seems complicated indeed, I would handle it asynchronously
0 votes

The solution is to make a scheduled script that reads out the SYS_TOKENS table and executes business logic.

The table has today the number of REQUESTS and D_USED, I assume both are updated when it's used by Servicy.

So, can't you develop the logic already?

answered by (6.8k points)
It is what I planned :) The customer wont wait the next version of Efficy.
You of course don't know who actually executed the webrequest, you can assume it's the contact linked to the document, linked to the token. But it could be anyone, technically. The customer should understand that.

You should loop any SYS_TOKEN record where D_USED > {last_run_time}
Mmm... I'm not sure D_USED and REQUESTS are actually updated. Did you check that?
It is not :(
Well, that should be the suggestion. Fix this :-)
1,165 questions
1,423 answers
325 users