Tuesday, September 25, 2012

Assigning responsibility

Assigning a user's responsibilities to another user can be time consuming, here is a useful code:

--Working in R12, not tested in R11
declare
cursor c1 is select fr.APPLICATION_ID, fr.RESPONSIBILITY_ID,
frt.RESPONSIBILITY_NAME, fur.end_date
FROM apps.fnd_user fu
,apps.FND_RESPONSIBILITY fr
,apps. FND_USER_RESP_GROUPS_DIRECT fur
, apps.FND_RESPONSIBILITY_tl frt
where fur.RESPONSIBILITY_ID=fr.RESPONSIBILITY_ID
and fur.USER_ID=fu.USER_ID
and frt.RESPONSIBILITY_ID=fr.RESPONSIBILITY_ID
and frt.LANGUAGE='TR'
and (fu.END_DATE is null or sysdate between fu.start_date and fu.end_date)
and fur.END_DATE is null
and fu.user_name = 'RHOSHANLI'; -- misal kullanýcý

cursor c2 is select fu.USER_id
FROM apps.fnd_user fu
where (fu.END_DATE is null or sysdate between fu.start_date and fu.end_date)
and fu.user_name in ('TESTUSER'); --sorumluluk verilecek kullanici

l_count number;

begin

for r1 in c1 loop

for r2 in c2 loop


select count(*) into l_count
FROM apps.fnd_user fu
,apps.FND_RESPONSIBILITY fr
,apps. FND_USER_RESP_GROUPS_DIRECT fur
, apps.FND_RESPONSIBILITY_tl frt
where fur.RESPONSIBILITY_ID=fr.RESPONSIBILITY_ID
and fur.USER_ID=fu.USER_ID
and frt.RESPONSIBILITY_ID=fr.RESPONSIBILITY_ID
and frt.LANGUAGE='TR'
and (fu.END_DATE is null or sysdate between fu.start_date and fu.end_date)
and fur.END_DATE is null
AND FRT.RESPONSIBILITY_ID=r1.responsibility_id
and fu.user_id = r2.user_id; -- sorumluluk verilecek kullanýcý

if (l_count = 0 ) then

apps.fnd_user_resp_groups_api.Insert_Assignment( user_id =>r2.user_id
,responsibility_id => r1.responsibility_id
,security_group_id => NULL
,responsibility_application_id => r1.application_id
,start_date =>sysdate
,end_date => NULL
,description => r1.responsibility_name);
else

apps.fnd_user_resp_groups_api.Update_Assignment( user_id => r2.user_id
,responsibility_id => r1.responsibility_id
,security_group_id => NULL
,responsibility_application_id => r1.application_id
,start_date =>sysdate
,end_date => r1.end_date
,description => r1.responsibility_name);
end if;

end loop;

end loop;

commit;

end;

Monday, September 3, 2012

Integration Design

In todays complex IT infrastructre integrations between different systems are so common
that it is almost a daily routine subject. Therefore design of integrations create huge impact on system performance, operations effort and user satisfaction. Depending on the technology of systems; data file, database link, web service methods can be used.

Thinking of nowadays's popular web service method, there is another fundamental design decision; synchronised or asynchronised? Both has different advantages and disadvantages so satisfies different requirements.
Synchronised; Provides result of service request directly to the user. This provides users to act quickly if needed. Though it is disadvantageous if too many records exist and if that causes users to wait. Also this may cause high load problems on the system.
Asynchronised; Users submit a request though does not see the result until querying it. This probably causes users extra effort because of requiring a control action to see if it is completed expectedly. Also increase operational support need because when users doesnt see results immediately a scheduled monitoring action is probably required. Also this may cause delay of other processes which are dependent of the requested action. Though it's disadvantages it can be used because synchronisation time can be scheduled to a time which system is free of load and users does not have to wait until getting a response.

Another important subject to think about is error handling. Many reasons may cause problems such as system shutdowns, missing data or unexpected cases and different solutions may required for these causes. Sending failed records twice, sending warning mails about failed transactions to related users, creating a log report and giving users the ability of retry are the basic precautions to be taken.

Taking these into consideration, will provide customer satisfaction and decrease the need for operations support.