Saturday, September 12, 2009

Migrating workflow between instances

Hi All,
There are two way of migrating workflow definitions between instances.
1.open the workflow in the workflow builder and using save as in to the target system


second way is using wfload

select * from wf_item_types_tl to the get the workflow short name

WFLOAD apps/apps 0 Y DOWNLOAD REQAPPRV --download eqappv_final.wft

ftp the reqappv_final.wft to the target instance

WFLOAD apps/apps 0 Y UPGRADE

Oracle workflow standard activities

Hi All,
here i a putting all standard activities of workflow builder from the developer guide..
this is basically for a quick refernce(interview perpective)..just go through all once so that you know what all can be done easily in the workfkow..for details
plz check the oracle workflow developer guide ..

AND/OR Activities:
In cases where multiple parallel branches transition to a single node,
you can decide whether that node should transition forward when any
of those parallel branches complete or when all of the parallel branches
complete.


Comparison Activities:
compare date: Use to compare the value of an item type attribute of type Date with a constant date.
compare time:Use to compare the value of an item type attribute of type Number with a constant number.
comparte text: Use to compare the value of two item type attributes of type Text.



Compare Execution Time Activity:
The Compare Execution Time activity provides a standard way to compare the elapsed execution time of a process with a constant test
time.


Wait Activity:
The Wait activity pauses the process for the time you specify. You can
either wait until:
• a specific date
• a given day of the month
• a given day of the week
• a period of time after this activity is encountered



Block Activity:
The Block activity lets you pause a process until some external program or manual step completes and makes a call to the CompleteActivity
Workflow Engine API.

Defer Thread Activity:
The Defer Thread activity defers the subsequent process thread to the background queue without requiring you to change the cost of each
activity in that thread to a value above the Workflow Engine threshold.


Launch Process Activity:
The Launch Process activity lets you launch another workflow process from the current process. This activity calls the PL/SQL procedure
named WF_STANDARD.LAUNCHPROCESS.


Noop Activity:
The Noop activity acts as a place holder activity that performs no action. You can use this activity anywhere you want to place a node
without performing an action.

Loop Counter Activity:
Use the Loop Counter activity to limit the number of times the Workflow Engine transitions through a particular path in a process.
The Loop Counter activity can have a result of Loop or Exit.


Start Activity:
The Start activity marks the start of a process and does not perform any action. Although it is not necessary, you may include it in your process
diagram to visually mark the start of a process as a separate node.

End Activity:
The End activity marks the end of a process and does not perform any action. You can use it to return a result for a completed process by
specifying a Result Type for the activity.


Role Resolution Activity:
The Role Resolution activity lets you identify a single user from a role comprised of multiple users. In a process diagram, place the Role
Resolution activity in front of a notification activity and specify the performer of that notification activity to be a role consisting of several
users.

Notify Activity:
The Notify function activity lets you send a notification, where the message being sent is determined dynamically at runtime by a prior
function activity. To use the Notify activity, you must model a prerequisite function activity into the process that selects one of several
predefined messages for the Notify activity to send.


Vote Yes/No Activity:
The Vote Yes/No activity lets you send a notification to a group of users in a role and tally the Yes/No responses from those users. The
results of the tally determine the activity that the process transitions to next.


Master/Detail Coordination Activities:
lets the master/detail process wait for a master/detail process to wait
Wait for Flow Activity:
Continue Flow Activity:


Assign Activity: The Assign activity lets you assign a value to an item attribute. This activity calls the PL/SQL procedure named WF_STANDARD.ASSIGN.

Get Monitor URL Activity:
The Get Monitor URL activity generates the URL for the Workflow Monitor diagram window and stores it in an item attribute that you
specify. This activity calls the PL/SQL procedure named WF_STANDARD.GETURL.

Wednesday, September 9, 2009

Multiple oraganizations Access control(MOAC)-R12--Part1

Hi ALL,
Here i am trying to put the MOAC techical architecture in simple terms..

we are might have heard the term multi organization till 11.5.10 prior it is only one organization

what does multiorganization mean??
Managing multiple organizations data in a single system...putting it in lay man terms
For example lets take GEfinancial
It is headquarted in US and operations in india also..assume it declares the Profit and loss results in both the countries..
Indian accounting rules, financial Calendar is different between the US and India..
since it belongs to same company with in one system I define two operating units one for us and one for India
different ledgers and calendars...if I want I can have different chart of accounts also..

to manage data for both the organizations with in single instance oracle introduced the column org_id in all table which holds organization specific data..

For data security purpose people of a organization should able to see their own data to achieve this
they created view on the base table like _all _B which restricts the data of the organization to which the user/user responsibility is attached.
for this purpose they defined a profile MO:operating unit which is set at the responsibility/user level
based on this value the system context org_id is set to the operating unitid set at the profile level
and a additional conditiion is added to the where clause of the views like

'org_id = substrb(userenv(''CLIENT_INFO''),1,10)'

By this way they are able to restrict data to the one organization in all the forms,reports,concprograms

fnd_global.apps_intialize--will set the applciation context org_id

thats the resason when ever we try to access the data from toad/sql plus for single org specific views we will not get any results..

select * from po_headers--no data found

if we set the application context we will able to see data for that org_id

execute dbms_Application_info.set_client_info('101');
or
fnd_global.apps_intialize(userid,responsibilityid,applicationid) --this inturn will get the org_id and set the context


From R12:Multiple organization access control

Till 11.5.10.2 one responsibility is able to see data of only one operating unit..
when ever we want to see another operating unit data we need to change resposnsibility..
From R12 oracle introduced the concept of Multiple organization access control(MOAC) so that being in the same responsibility the user should
be able to see the data for which he is give access..
let see how they achieved it..

1.First we will define a policy which will have access for different operating units
2.they attach that policy to the responsibility/user at profile option level

technically..till 11.5.10 the query is getting chagned as org_id=101
if we have to access multiple organization it should changed to org_id in (101,102) or exits...

for achieving this oracle used the concept of Virtual Private Database (VPD)..
VPD:
The Virtual Private Database (VPD) feature allows developers to enforce security by attaching a security policy to database objects such as tables, views and synonyms. It attaches a predicate function to every SQL statement to the objects by applying security policies. When a user directly or indirectly accesses the secure objects, the database rewrites the user's SQL statement to include conditions set by security policy that are visible to the user.

First lets decide whethere the access mode to a responsibility is single or multiple or all.Based on the security policy oracle decides the access mode
let assume our security policy which is attached to our respobility has access to the two operating units.
now oracle will populate the global temporary table(session controlled) mo_glob_org_access_tmp with all the operating units attached to the security policy
of yours..

based on the vpd a concept from oracle 9i onwards they defined a policy 'ORG_SEC' which call the function 'MO_GLOBAL.ORG_SECURITY' for all the objects to which the policy is attached..



MO_GLOBAL.Org_Security function:

FUNCTION org_security(obj_schema VARCHAR2
obj_name VARCHAR2)RETURN VARCHAR2
IS
BEGIN
--
-- Returns different predicates based on the access_mode
-- The codes for access_mode are
-- M - Multiple OU Access
-- A - All OU Access
-- S - Single OU Access
-- Null - Backward Compatibility - CLIENT_INFO case
--
IF g_access_mode IS NOT NULL THEN
IF g_access_mode = 'M' THEN
RETURN 'EXISTS (SELECT 1
FROM mo_glob_org_access_tmp oa
WHERE oa.organization_id = org_id)';
ELSIF g_access_mode = 'A' THEN -- for future use
RETURN NULL;
ELSIF g_access_mode = 'S' THEN
RETURN 'org_id = sys_context(''multi_org2'',''current_org_id'')';
END IF;
ELSE
RETURN 'org_id = substrb(userenv(''CLIENT_INFO''),1,10)';
END IF;
END org_security;


let see what happend po_headers view(11.5.10.2) in R12

1.Dropped the view po_headers
2.Created a synonym for the base table
create synnonym for po_headers for po_headers_all

3.attach the security policy org_sec to this synonym


so when ever we access this synonym from any where the policy will call the mo_global.org_Security funcion to all a condition to the select statement we isssued

select * from po_headers will be changed as

select * from po_headerS_all where exists 'EXISTS (SELECT 1
FROM mo_glob_org_access_tmp oa
WHERE oa.organization_id = org_id)'

By this they are able to access all data of all organizations assigned to the security policy.