...
- If you want to persist this information into a semarchy entity rather than in a regular table, to allow application administrators to keep track of user connections, you'll have to create this entity as follows (if you don't jump to step 5)
- Create a basic entity UserConnection(UserConnectionID (sequence), ConnectedUser, ConnectionDate)
- Create the application components automatically (no edition needed, browsing actions only)
- Create a job LOAD_USER_CONNECTIONS that has a single task for the UserConnection entity
Create the PL-SQL function in the Hub schema as followsÂ
Code Block language sql title PL SQL Function create or replace function usp_on_login_trigger(p_user_name varchar2) return varchar2 is pragma autonomous_transaction; currentLoadId number; ret number; begin if p_user_name <> 'semadmin' then currentLoadId:=SEMARCHY_REPO.integration_load.get_new_loadid('YourDataLocationName', 0, 'Log', 'Log', 'semadmin'); insert into SA_USER_CONNECTION(B_LOADID, USER_CONNECTION_ID, B_CLASSNAME, B_CREDATE, B_CREATOR, CONNECTED_USER, CONNECTION_DATE) values(currentLoadId, SEQ_USER_CONNECTION.NEXTVAL, 'UserConnection', sysdate, 'TRIGGER', p_user_name, sysdate); commit; ret:=SEMARCHY_REPO.integration_load.submit_load(currentLoadId, 'LOAD_USER_CONNECTIONS ', 'semadmin') ; end if; return 'done'; end; /
- Create a new variable value provider that uses the JDBC connection of the data location you want to monitor. How to configure a Variable Value Provider
- Create a CONNECTION_TRIGGER model variable in the model, that uses the newly created Datasource Variable Provider
Populate it with this sql statementÂ
Code Block language sql title Variable provider select statement select usp_on_login_trigger(:V_USERNAME) from dual
...