• Computed roles: how to refresh the calculation

    By wim stevens 7 years ago

    Hello



    I'm investigating whether QAF could be used as a workflow engine for a new application.

    I understand that it is possible to define a role based on a formula. The combination of role and state is used as the input for the reader/author fields.



    The formula could look-up values in other databases/documents. When the data in these documents change the reader/author fields should be recalculated. It is not clear to me how to handle this situation using QAF. Should I run the agent Security|WFRefreshSecurity at regular times ?



    Thanks



    Wim Stevens

    • "dynamic" author /reader fields

      By Mark Demicoli 7 years ago

      Sure Wim, this would work. You could create an agent which uses the wfRefreshSecurity function in the _QAF WF API library or indeed create a copy of the RefreshSecurity agent and trigger it as desired.



      However in principle I would recommend a different approach because your proposed scheme has subtle implications that can reduce the quality of your application.



      Consider that:


      1. Users will need to be fully aware that your application is subject to a scheduled security refresh - this is a dubious scheme because it puts the onus on the users` technical understanding of the relationship between applications.
      2. Modifying a large set of documents on a regular basis renders the application prone to save/ replication conflicts.



        If you can organise the sort of discipline to handle the above, you're fine.



        As a general rule, I use ACL roles or Domino Directory groups in QAF roles that are used in document security. This way, the onus is on Domino to do the processing which boils down the groups/roles to determine access (DYNAMICALLY), rather than the individual names stored inside fields.



        Please realise that this is not a limitation of QAF, rather it is a design consideration for any application that uses data in document fields to evaluate reader/ author security.



        Hope this helps!



        -Mark
      • thanks

        By wim stevens 7 years ago

        Thanks for the quick & clear reply

        I will start in the next days/weeks building the workflow for my application. I expect to post more questions in this forum



        By the way: the script library QAF WF API contains many functions. Are we supposed to use any of them? Is there any preliminary documentation available?



        Regards



        wim stevens

        • QAF API

          By Mark Demicoli 7 years ago

          Hi Wim,



          The two fundamental script libraries that 'run' the workflows are the QAF WF Runtime and QAF WF API. The Runtime library is responsible for performing all the functions to implement the workflow logic in the Notes user interface. This library uses the API to perform lower level functions.



          You can use any API functions in any of your code to do things that are not provided 'out of the box' so to speak, such as your need to refresh security outside of the normal QAF Actions.



          Yes documentation is limited! So please ask any questions you like here. Is is quite common with open source code to try to make the names of functions and the names of their parameters as intuitive as possible, so a little experimentation should reveal how each function works. It's a good idea to browse through the functions in the API to get an idea of the sort of things you can do to manipulate/ trigger the workflow engine, outside of standard QAF Actions.



          In principle, the API can be leveraged to produce a completely different run-time interface, such as a browser based interface.



          Mark