How to log a specific error in OIM

Greetings!
I am trying to implement a logging mechanism in OIM, using log4J.
So far, I can log without problem in an oracle database.
What I need, this moment, is the capability of logging adapters errors. For example, I am logging a pre-update event, producing something like this in my database log: "Login: xpto; ". So far, so good.
However, sometimes I got an error while trying to import a user to OIM. For example:
+[XELLERATE.SERVER],Class/Method: tcUSR/validateUserManager Error :The specified manager causes cycles.+
+[XELLERATE.SERVER],Class/Method: tcUSR/eventPreUpdate Error :User Manager is not valid.+
+[XELLERATE.SERVER],Class/Method: tcDataObj/save Error :Data Update Failed+
I would like to be able to log these informations, in my log:
- login
- status of operation
- error (if exists one)
Where I would have to put my logger to get this kind of information?
In advance, it is not enough just to redirect the log output to the database, because we want to be able to group all information about a user in one register only, for example: login: xpto; company: cia1; name: Xpto Smith; job: manager; status: ok or xpto; company: cia1; name: Xpto Smith; job: manager; status: Class/Method: tcUSR/validateUserManager Error :The specified manager causes cycles.
Could anyone help me? If there is a paper, article or similar showing advanced topics in how to log in OIM, I would appreciate too.
in case I could not express my problem very well, I will be pleased to add information; as you can perceive, I do not master English enough to write well. ;-)
thanks in advance,
Trimagister

OIM comes with OOTB logging capabilities.
public static Logger logger = Logger.getLogger("OIMCUSTOM.LOGGER");
logger.debug("PRINT THIS LINE");
You can use these lines in your custom code.
You'll have to configure these loggers in OIM.
download.oracle.com/docs/cd/B31337_01/doc.901/b31119.pdf
Search for "Enabling Logging"

Similar Messages

  • How to get the specific error from the result of sectrustevaluate()

    I am using SectrustEvaluate(trust,result) function to test the server certificate against the root ca installed in keychain.
    Result of server certificate validation in case if comes as recoverable faliure how may i know what was the reason which causing it to recoverable failure.
    I want to throw the specific error to UI to know why server certificate evaluation failed.
    No API's available in ios , Some API's are there available in MAC.
    Please Advise.

    If you are on iOS I think you are out of luck.  See red text under kSecTrustResultRecoverableTrustFailure.
    https://developer.apple.com/library/ios/documentation/Security/Reference/certifk eytrustservices/Reference/reference.html#//apple_ref/c/func/SecTrustEvaluate
    The way you handle this depends on the OS.
    In iOS, you should typically refuse the certificate. However, if you are performing signature validation and you know when the message was originally received, you should check again using that date to see if the message was valid when you originally received it.
    In OS X, you can call the SecTrustGetTrustResult function to get more information about the results of the trust evaluation, or the SecTrustGetCssmResult function to get information about the evaluation in a form that can be passed to CSSM functions.

  • How to fine vendor specific error code in JDBC?

    Hi all,
    Is there any method which can be used to find vendor specific error code?
    Thnx in advance

    try{
    // your code
    catch(java.sql.SQLException ex){
    int code = ex.getErrorCode() ;
    Retrieves the vendor-specific exception code for this SQLException object.
    String state = ex.getSQLState() ;
    Retrieves the SQLState for this SQLException object.
    }

  • How Can I get Alert for specific error occurs in ULS logs ?

    I am looking for either OOB functionality or Tool which could send me the email notification/Alert when specific error occurs in ULS Logs ? Please advice!

    I dont think you can get this from OOB features...But you can use the 3rd party tool, we are using the SCOM for monitoring for our SharePoint, we get the alerts for error which we configured.
    http://www.microsoft.com/en-us/download/details.aspx?id=4419
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • SQL Server Agent Log showing errors [298] SQLServer Error: 10061, A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL

    Hi All,
    I have started receiving this error in the logs for the last 10 days and the Schedules Jobs for the database have stopped running. My MS CRM application is working fine.
    Can anyone guide me what could be the problem.
    Date                      17/4/2014 2:04:20 PM
    Log                         SQL Server Agent (Current - 17/4/2014 2:01:00 PM)
    Message
    [298] SQLServer Error: 10061,
    A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct
    and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. [SQLSTATE 08001]
    Date                      17/4/2014 2:11:55 PM
    Log                         SQL Server Agent (Current - 17/4/2014 2:01:00 PM)
    Message
    [298] SQLServer Error: 10061,
    A network-related or instance-specific error
    has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information
    see SQL Server Books Online. [SQLSTATE 08001]
    Date                      7/4/2014 11:00:31 AM
    Log                         SQL Server Agent (Current - 17/4/2014 2:01:00 PM)
    Message
    [298] SQLServer Error: 10061,
    A network-related or instance-specific error
    has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information
    see SQL Server Books Online. [SQLSTATE 08001]

    Check this link
    http://social.msdn.microsoft.com/Forums/en-US/906da9b5-2482-468c-a424-ae099da2d96b/sql-server-agent-service-account-error?forum=sqlsetupandupgrade
    Regards, RSingh

  • How can we create the error log in a ABAP program

    Hi all,
    How can we create the error log in a ABAP program
    Thanks,
    srinivas.

    Hi,
    Refer to FM's in the Function Group SBAL. For a change most of the FM's have been well documented. Also have a look at the DEMO pgms. Se38---->SBALDEMO & F4.
    Regards
    Raju Chitale

  • How to capture the DB Errors to display more specific error on the screen

    HI,
    How to capture the DB Errors to display more specific error on the screen?
    Can any one suggest on this please.
    Thanks

    hi,
    in your db package or procedure write this in ur exception handler
    as
    excpetion when others
    FND_MSG_PUB.ADD_EXEC_MSG (pkg_name, proc_name,
    substr(sqlerrm, 1, 240))
    now in your java code you can catch and throw this excpetion by using
    OAExceptionHelper.checkErrors (Tx, messageCount, returnStatus, messageData);

  • Connector Specific Error. Can anyone PLEASE tell me in plain english not techi talk how to fix this error?

    Connector Specific Error.  
    Can anyone PLEASE tell me in plain english not techi talk how to fix this error?

    Hey royhanif,
    Welcome to the BlackBerry Support Community Forums.
    Thanks for the question.
    Follow the steps in this KB article to resolve the connector specific error: www.blackberry.com/btsc/KB15294
    Let me know if you have any more questions.
    Cheers.
    -ViciousFerret
    Come follow your BlackBerry Technical Team on Twitter! @BlackBerryHelp
    Be sure to click Like! for those who have helped you.
    Click  Accept as Solution for posts that have solved your issue(s)!

  • Windows could not start the Cluster Service on Local computer. For more information, review the System Event Log. If this is a non-Microsoft service, contact the service vendor, and refer to service-specific error code 2.

    Dear Technet,
    Windows could not start the Cluster Service on Local computer. For more information, review the System Event Log. If this is a non-Microsoft service, contact the service vendor, and refer to service-specific error code 2.
    My cluster suddenly went disappear. and tried to restart the cluster service. When trying to restart service this above mention error comes up.
    even i tried to remove the cluster through power-shell still couldn't happen because of cluster service not running.
    Help me please.. thank you.
    Regards
    Shamil

    Hi,
    Could you confirm which account when you start the cluster service? The Cluster service is a service that requires a domain user account.
    The server cluster Setup program changes the local security policy for this account by granting a set of user rights to the account. Additionally, this account is made a member
    of the local Administrators group.
    If one or more of these user rights are missing, the Cluster service may stop immediately during startup or later, depending on when the Cluster service requires the particular
    user right.
    Hope this helps.
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • How to view logical port error log

    can anybody tell me how to view the logicalport error  log

    Usually in a distributed environment you would point the logical addresses to the http web server and port or to the load balancer, if you are just using a web server like OHS you can set all the logical addresses by running configure web server and select "Set the logical web address for the web applications to the web server"
    If you want to see all the configuration in the Shared services registry then you can run <MIDDLEWARE_HOME>\user_projects\epmsystem1\bin\epmsys_registry.bat to generate a report and the web app configurations will be under LOGICAL_WEB_APP
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How to resolve error 'The DPMRA service terminated with service-specific error Only one usage of each socket address (protocol/network address/port) is normally permitted'

    One of my exchange 2010 servers dpm agent is give the following error when the dpmra service attempts to start.
    The DPMRA service terminated with service-specific error Only one usage of each socket address (protocol/network address/port) is normally permitted..
    I have tried uninstalling/reinstalling the agent but this does not resolve the issue
    Any help would be greatly appreciated.
    Thanks
    William Hickson

    Hi
    Something has probably changed on the protected server side that affects the DPM agent. In some cases the DCOM configuration could change. Look at this blogpost and verify your DPMRA DCOM object.
    http://robertanddpm.blogspot.com/2010/08/dpm-ra-rights.html
    If this doesn't do the trick try reinstall the agent.
    Best Regards
    Robert Hedblom
    MVP DPM
    Check out my DPM blog @ http://robertanddpm.blogspot.com

  • A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (p

    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that
    the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)(Microsoft SQL Server, Error: 2)
    The system cannot find the file specified
    Cannot connect to COWBOYS.
    Here are the technical details===================================
    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider:
    Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (.Net SqlClient Data Provider)
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=2&LinkId=20476
    Error Number: 2
    Severity: 20
    State: 0
    Program Location:
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
       at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover)
       at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
       at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer
    timeout)
       at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance,
    SqlConnectionString userConnectionOptions, SessionData reconnectSessionData)
       at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
       at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
       at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
       at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
       at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
       at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
       at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
       at System.Data.SqlClient.SqlConnection.Open()
       at Microsoft.SqlServer.Management.SqlStudio.Explorer.ObjectExplorerService.ValidateConnection(UIConnectionInfo ci, IServerType server)
       at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser()
    ===================================
    The system cannot find the file specified
    I have tried from so many forms. This is so frustrating. Thank for everyone/anyone who wants to help. So this is what happened: I had to uninstall my previous sqlserver 2012(which worked great) for some reason, and I uninstalled everything from that download.
    Then I installed the trial edition of sql server 2012 (64 Bit) and It wouldn't connect to the database. (Error mentioned above.) My local DB is COWBOYS. (COWBOYS is also my computer name.) After this, I have tried downloading sqlexpress and sqlserver 64bit
    many times and cannot connect to my local DB. 
    How do I connect to my Local DB? 
    Also, I think this might help: (When I run sqlserve.exe, which I was able to find in C:\Program Files\Microsoft SQL Server\110\LocalDB\Binn, I get an error: Your SQL server installation is either corrupt or has been tampered with(Error getting
    instance ID from name). Please uninstall then re-run setup to correct this problem.
    I would happily re install it, if it wasn't my 20th time.
    I don't have any remote connections, I don't use username/password, only window authentication. I work mostly on visual studio, but without able to store /retrieve data, I don't know how to survive.
    May be the solution is very simple, but I am too frustrated. 
    Some of the things I have tried:
    From a command prompt, enter one of the following commands:
    net start "SQL Server Agent (MSSQLSERVER)" OR 
    net start "SQL Server Agent(instancename)"(for instance)
    on my sql configuration, I cannot start anything because there is nothing there to start. I can post more details, if that would help. Also, some more details about the error:
    Details
    Product:
    SQL Server
    ID:
    2
    Source:
    MSSQLServer
    Version:
    10.0
    Component:
    SQLEngine
    Message:
    An error has occurred while establishing a connection to the server. When connecting to SQL Server, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error:
    40 - Could not open a connection to SQL Server) (.Net SqlClient Data Provider)
    Explanation
    SQL Server did not respond to the client request because the server is probably not started.
    User Action
    Make sure that the server is started.
    Version:
    9.0
    Component:
    SQLEngine
    Message:
    An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error:
    40 - Could not open a connection to SQL Server) (.Net SqlClient Data Provider)
    Explanation
    SQL Server did not respond to the client request because the server is probably not started.
    User Action
    Make sure that the server is started.
    Any one that can help me, I will be greatful. Thank you so much. p.s. please ask me anything if you have any questions.

    It sounds like there are a couple things going on here.  First check if you have a successful install of SQL Server, then we'll figure out the connection issues.
    Can you launch SQL Server Configuration Manager and check for SQL Server (MSSQLSERVER) if default instance or SQL Server (other name) if you've configured your instance as a named instance.  Once you find this, make sure the service is started. 
    If not started, try to start it and see if it throws an error.  If you get an error, post the error message your hitting.  If the service starts, you can then launch SSMS and try to connect.  If you have a default instance, you can use the machine
    name in the connection dialog.  Ex:  "COWBOYS" where Cowboys is the machine name.  However, if you named the SQL Server instance during install, you'll need to connect using the machine\instance format.  Ex:  COWBOYS\Romo (where Romo
    is the instance name you set during install).
    You can also look at the summary.txt file in the SQL Server setup error logs to see what happened on the most recent install.  Past install history is archived in the log folder if you need to dig those up to help troubleshoot, but the most
    recent one may help get to the bottom of it if there is an issue with setup detecting a prior instance that needs to be repaired.
    Thanks,
    Sam Lester (MSFT)
    http://blogs.msdn.com/b/samlester
    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click
    "Mark as Answer" and
    "Vote as Helpful" on posts that help you. This can be beneficial to other community members reading the thread.

  • "Network-related or instance specific error", Works OK for Administrator

    I've been handed a legacy .Net Windows application that was previously used on Windows XP, and asked to debug a few problems encountered on Windows 7 clients.  The original developers are all gone.  I'm down to only a single
    error -- a seemingly common one: 
    "A network related or instance-specific error occurred while establishing
    a connection to SQL Server. The server was not found or was not
    accessible. Verify that the instance name is correct and that SQL Server
    is configured to allow remote connections. (provider: Named Pipes
    Provider, error: 40 - Could not open a connection to SQL Server)"
    Curiously, this error only occurs for ordinary users.  When the application is started using "Run as Administrator" it connects to the database immediately.  We believe we can configure the app to always start as an administrator,
    but obviously we'd like to run it without that if we can.  However, I haven't seen any good suggestions why the database connection would only fail this one way.
    Any ideas?  I've seen at least one troubleshooting guide that suggested trying with Run as Administrator, but it didn't say how to proceed if that fixes it.  Am I just supposed to stop at this point?  If I was having a UI problem I might understand
    that some old apps just aren't going to work in Windows 7, but this is just connecting to the database.  Seems like we should be able to do this.  I just don't know what to check.
    Thanks in advance.
    EDIT:
    I have looked more closely at this, and perhaps there are more clues.  I use the same user account to log on to two Win7 machines. One is a developer workstation with VS10 installed. The other is representative of a client workstation the app will
    run on. My user account is actually an administrator on both machines.
    At runtime we invoke advapi32.dll logonuser impersonation to logon to SQL server with a dedicated account.
    What we're seeing is that I can run the app freely on the developer workstation.  Even with UAC on, and even if I am not using "run as administrator".  This may point to something about how the SQL drivers/provider are installed
    on that machine.
    When I run on the regular user workstation, even though I am an administrator myself, I must "run as administrator" to launch it. And when I do, I get a UAC prompt.  When we turn UAC off, of course, the app runs fine.

    Hi,
    I think you are in the similar case with:
    http://support.microsoft.com/kb/2009672
    By default SSIS always uses the low privileged token resulting in a failure when connecting to a SQL Destination. Full administrator access token is required in your case.
    Unlike earlier versions of Windows, when an administrator logs on to a computer running Windows 7 or Windows Vista, the user’s full administrator access token is split into two access tokens:
    a full administrator access token and a standard user access token.
    During the logon process, authorization and access control components that identify an administrator are removed, resulting in a standard user access token. The standard user access token is then used to start the desktop, the Explorer.exe process. Because
    all applications inherit their access control data from the initial launch of the desktop, they all run as a standard user.
    After an administrator logs on, the full administrator access token is not invoked until the user attempts to perform an administrative task. When a standard user logs on, only a standard user access token is created. This standard user access token is then
    used to start the desktop.
    To get around this, you may configure an application to always run elevated.
    http://technet.microsoft.com/en-us/library/cc709691%28WS.10%29.aspx
    Thanks.
    Tracy Cai
    TechNet Community Support

  • A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.

    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The
    server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26- Error:Locating Server\instance Specified)
    How Can i solve this?

    1. Make sure SQL Server Service is running
    2. If a named instance, make sure SQL Server browser service is running
    3. Make sure SQL Server is configured to allow remote connections
    4. Examine the SQL Server error log for messages confirming that SQL is listening on the expected network interfaces and ports
    5. Test server connectivity with PING from the client machine
    6. Test port connectivity using TELNET or PowerShell to the server and port (from step 4) from the client machine.  For example
    a. TELNET <server-name> 1433
    b. PowerShell: 1433 | % { echo ((new-object Net.Sockets.TcpClient).Connect("YourServerName",$_)) "server listening on TCP port $_" }
    7. Check firewall settings if step 5 or 6 connectivity test fails
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to assign project specific task with the newly created projects ?

    Hi All,
    I need help. I need to assign project specific tasks (which i will be taking from staging table) other than the default task which are assigned during project creation. How do I proceed with this within same package. I am attaching the code of my package below...
    CREATE OR REPLACE PACKAGE body xxpa_proj_conv_pkg as
    PROCEDURE xxpa_create_project_proc(O_ERRBUF OUT VARCHAR2,O_RETCODE OUT VARCHAR2)
    is
    variables need to derive global parameters
    v_responsibility_id NUMBER; --- PA Supervisor responsibility id
    v_user_id NUMBER;
    deriving global parameters-
    -- Variables needed for API standard parameters
    v_api_version_number NUMBER := 1.0;
    v_commit VARCHAR2(1) := 'F';
    v_return_status VARCHAR2(1);
    v_init_msg_list VARCHAR2(1) := 'F';
    v_msg_count NUMBER;
    v_msg_index_out NUMBER;
    v_msg_data VARCHAR2(2000);
    v_data VARCHAR2(2000);
    v_workflow_started VARCHAR2(1) := 'Y';
    v_pm_product_code VARCHAR2(10);
    ---variables for catching errors---
    v_error_flag number:=0;
    -- Predefined Composite data types
    v_project_in PA_PROJECT_PUB.PROJECT_IN_REC_TYPE;
    v_project_out PA_PROJECT_PUB.PROJECT_OUT_REC_TYPE;
    v_key_members PA_PROJECT_PUB.PROJECT_ROLE_TBL_TYPE;
    v_class_categories PA_PROJECT_PUB.CLASS_CATEGORY_TBL_TYPE;
    v_tasks_in_rec PA_PROJECT_PUB.TASK_IN_REC_TYPE;
    v_tasks_in PA_PROJECT_PUB.TASK_IN_TBL_TYPE;
    v_tasks_out_rec PA_PROJECT_PUB.TASK_OUT_REC_TYPE;
    v_tasks_out PA_PROJECT_PUB.TASK_OUT_TBL_TYPE;
    v_CREATED_FROM_PROJECT_ID varchar2(20);
    v_CARRYING_OUT_ORGANIZATION_ID varchar2(20);
    v_person_id NUMBER;
    v_project_role_type VARCHAR2(20);
    API_ERROR EXCEPTION;
    v_a NUMBER;
    cursor for project in data
    CURSOR cur_project_in_data IS SELECT * FROM XXPA_PROJECT_IN_STG;
    cursor for task data
    CURSOR cur_task_in_data IS SELECT * FROM XXPA_TASK_IN_STG;
    ------------------------Cursors used for validations----------------------------------
    cursor for product code used for validation
    cursor cprc is select distinct PROJECT_RELATIONSHIP_CODE from PA_PROJECT_CUSTOMERS;
    cursor for distribution rule-
    cursor cdr is select DISTRIBUTION_RULE from PA_DISTRIBUTION_RULES;
    cursor for project status code
    cursor cpsc is SELECT PROJECT_STATUS_CODE, PROJECT_STATUS_NAME FROM PA_PROJECT_STATUSES WHERE STATUS_TYPE = 'PROJECT';
    cursor for template/created from project id
    cursor ccpid is select project_id from pa_projects where template_flag='Y';
    BEGIN
    select user_id, responsibility_id into v_user_id, v_responsibility_id
    from PA_USER_RESP_V
    where user_name like 'amit_kumar%'
    and responsibility_name like'PA SupervisorS';
    -- --Fnd_global.apps_initialize(user_id,resp_id, resp_appl_id);
    -- Fnd_global.apps_initialize(v_user_id,v_responsibility_id,275);
    -- -------calling global parameters---
    pa_interface_utils_pub.set_global_info
    p_api_version_number =>v_api_version_number,
    p_responsibility_id =>v_responsibility_id,
    p_user_id =>v_user_id,
    p_msg_count =>v_msg_count,
    p_msg_data =>v_msg_data,
    p_return_status =>v_return_status
    dbms_output.put_line ('Set Global status ->' || v_return_status);
    ----Cursor for PRODUCT RELATED DATA-----------
    FOR REC IN cur_project_in_data LOOP
    -----PASSING VALUES TO THE COMPOSITE DATA TYPE(PROJECT_IN_REC_TYPE)-------
    ----retrieving product code-----
    select lookup_code into v_pm_product_code
    from pa_lookups
    where lookup_type = 'PM_PRODUCT_CODE'
    and meaning = 'Oracle Project Manufacturing';
    -----retrieving and validating created from project id----
    BEGIN
    select project_id
    into v_CREATED_FROM_PROJECT_ID
    from pa_projects_all
    where name=rec.created_from_project_name;
    EXCEPTION
    when others then
    O_Retcode := '1';
    O_Errbuf :='Incorrent CREATED_FROM_PROJECT_NAME';
    Fnd_File.Put_Line (Fnd_File.LOG, O_Errbuf);
    UPDATE XXPA.XXPA_PROJECT_IN_STG
    SET ERROR_FLAG ='1' ,last_updation_date='sysdate' where created_from_project_name = rec.CREATED_FROM_PROJECT_NAME;
    END;
    -----retrieving & validating carrying out organization id-----
    BEGIN
    select distinct(CARRYING_OUT_ORGANIZATION_ID)
    into v_CARRYING_OUT_ORGANIZATION_ID
    from pa_projects_prm_v
    where CARRYING_OUT_ORGANIZATION_NAME=rec.carrying_out_organization_name;
    EXCEPTION
    when others then
    O_Retcode := '1';
    O_Errbuf :='Incorrent Carrying Out Organization name';
    Fnd_File.Put_Line (Fnd_File.LOG, O_Errbuf);
    UPDATE XXPA.XXPA_PROJECT_IN_STG
    SET ERROR_FLAG ='1' ,last_updation_date='sysdate' where carrying_out_organization_name = rec.carrying_out_organization_name;
    END ;
    v_project_in.pm_project_reference := rec.segment1;
    v_project_in.project_name := rec.PROJECT_NAME;
    v_project_in.created_from_project_id := v_CREATED_FROM_PROJECT_ID;
    v_project_in.carrying_out_organization_id := v_CARRYING_OUT_ORGANIZATION_ID;
    v_project_in.project_status_code := rec.PROJECT_STATUS_CODE;
    v_project_in.description := rec.PROJECT_DESCRIPTION;
    v_project_in.start_date := rec.PROJECT_START_DATE;
    v_project_in.completion_date := rec.PROJECT_COMPLETION_DATE;
    v_project_in.distribution_rule := rec.DISTRIBUTION_RULE;
    v_project_in.project_relationship_code := rec.PROJECT_RELATIONSHIP_CODE;
    -------------------------Validation of incoming project data--------------------------------
    v_error_flag := 1;
    project relationship code validation
    BEGIN
    for prc in cprc
    loop
    if (rec.PROJECT_RELATIONSHIP_CODE=prc.PROJECT_RELATIONSHIP_CODE) or (rec.PROJECT_RELATIONSHIP_CODE is null)--can be overridden from template
    then
    v_error_flag :=0;
    else null;
    end if;
    end loop;
    END;
    project distribution rule validation
    BEGIN
    for dr in cdr
    loop
    if (rec.DISTRIBUTION_RULE=dr.DISTRIBUTION_RULE) or (rec.DISTRIBUTION_RULE is null) null since the value can be taken from template too
    then
    v_error_flag :=0;
    else null;
    end if;
    end loop;
    END;
    project status code validation
    BEGIN
    for sc in cpsc
    loop
    if (rec.PROJECT_STATUS_CODE=sc.PROJECT_STATUS_CODE) or (rec.PROJECT_STATUS_CODE is null) null since the value can be taken from template too
    then
    v_error_flag :=0;
    else null;
    end if;
    end loop;
    END;
    dbms_output.put_line ('Error at PROJECT_STATUS_CODE>' ||v_error_flag);
    validation logic for project start date
    BEGIN
    if TRUNC(rec.PROJECT_START_DATE) >= TRUNC(rec.PROJECT_COMPLETION_DATE)
    THEN
    v_error_flag := 1;
    O_Retcode := '1';
    O_Errbuf :='Project start date cannnot be greater than completion date';
    Fnd_File.Put_Line (Fnd_File.LOG, O_Errbuf);
    END IF;
    END;
    validation logic for project completion date
    BEGIN
    if (TRUNC(rec.PROJECT_COMPLETION_DATE)<=TRUNC(rec.PROJECT_START_DATE))
    then
    if ( rec.PROJECT_STATUS_CODE='CLOSED' and rec.PROJECT_COMPLETION_DATE>sysdate)
    THEN
    v_error_flag := 1;
    O_Retcode := '1';
    O_Errbuf :='completion date cannot be greater than sysdate for closed projects';
    Fnd_File.Put_Line (Fnd_File.LOG, O_Errbuf);
    END IF;
    v_error_flag := 1;
    O_Retcode := '1';
    O_Errbuf :='Project closed date cannot be less than start date';
    end if;
    END;
    --------Update staging table for the error records--------
    BEGIN
    if v_error_flag =1
    then
    O_Retcode := '1';
    O_Errbuf :='Incorrect project relationship code';
    Fnd_File.Put_Line (Fnd_File.LOG, O_Errbuf);
    UPDATE XXPA.XXPA_PROJECT_IN_STG
    SET ERROR_FLAG ='1' ,last_updation_date='sysdate' where PROJECT_RELATIONSHIP_CODE = rec.PROJECT_RELATIONSHIP_CODE;
    end if;
    END;
    -----------------------End of validation of incoming project data----------------------------------
    ---------------Project Task DATA-----------------
    v_a:=0;
    FOR tsk IN cur_task_in_data LOOP
    v_tasks_in_rec.pm_task_reference :=tsk.task_reference ;
    v_tasks_in_rec.task_name :=tsk.task_name;
    v_tasks_in_rec.pm_parent_task_reference :=tsk.parent_task_reference ;
    v_tasks_in_rec.task_start_date :=tsk.task_start_date ;
    v_tasks_in_rec.task_completion_date :=tsk.task_completion_date ;
    v_tasks_in(v_a) := v_tasks_in_rec;
    v_a:=v_a+1;
    end loop;
    ---------------end of task details------------------
    --INIT_CREATE_PROJECT
    pa_project_pub.init_project;
    ---------------------CREATE_PROJECT--------------------------
    pa_project_pub.create_project(
    p_api_version_number=> v_api_version_number,
    p_commit => v_commit,
    p_init_msg_list => v_init_msg_list,
    p_msg_count => v_msg_count,
    p_msg_data => v_msg_data,
    p_return_status => v_return_status,
    p_workflow_started => v_workflow_started,
    p_pm_product_code => v_pm_product_code,
    p_project_in => v_project_in,
    p_project_out => v_project_out,
    p_key_members => v_key_members,
    p_class_categories => v_class_categories,
    p_tasks_in => v_tasks_in,
    p_tasks_out => v_tasks_out);
    if v_return_status = 'S'
    then
    UPDATE XXPA.XXPA_PROJECT_IN_STG
    SET INTERFACE_STATUS ='Success' where segment1 = v_project_out.pa_project_number; ---P->pending & S-> Success
    dbms_output.put_line('New Project Id: ' || v_project_out.pa_project_id);
    dbms_output.put_line('New Project Number: ' || v_project_out.pa_project_number);
    else
    UPDATE XXPA.XXPA_PROJECT_IN_STG
    SET INTERFACE_STATUS ='Pending' where segment1 = v_project_out.pa_project_number;
    raise API_ERROR;
    end if;
    END LOOP;
    Commit;
    ------Handling Exception--------
    EXCEPTION
    WHEN api_error THEN
    dbms_output.put_line('An error occured during project creation');
    IF (v_msg_count > 0 ) THEN
    FOR i IN 1..v_msg_count LOOP
    apps.PA_INTERFACE_UTILS_PUB.get_messages(
    p_msg_count => v_msg_count,
    p_encoded => 'F',
    p_msg_index => i,
    p_msg_data => v_msg_data,
    p_data => v_data,
    p_msg_index_out => v_msg_index_out);
    dbms_output.put_line('Error message v_data ->'||v_data);
    dbms_output.put_line('Error message v_msg_data ->'||v_msg_data);
    dbms_output.put_line('Error message v_msg_index_out ->'||v_msg_index_out);
    dbms_output.put_line('Error message p_msg_index ->'||i);
    APPS.fnd_file.put_line(APPS.FND_FILE.LOG,v_data);
    END LOOP;
    END IF;
    WHEN OTHERS THEN
    dbms_output.put_line('An error occured during conversion, SQLCODE ->'|| SQLERRM);
    IF (v_msg_count >=1 ) THEN
    FOR i IN 1..v_msg_count LOOP
    PA_INTERFACE_UTILS_PUB.get_messages(
    p_msg_count => v_msg_count,
    p_msg_index => i,
    p_encoded => 'F',
    p_msg_data => v_msg_data,
    p_data => v_data,
    p_msg_index_out => v_msg_index_out);
    dbms_output.put_line('Error message ->'||v_data);
    APPS.fnd_file.put_line(APPS.FND_FILE.LOG,v_data);
    END LOOP;
    END IF;
    end; --end procedure
    END xxpa_proj_conv_pkg;
    * Please tell me how to assign project specific task with the newly created projects??? *
    Also please tell me how to assign multiple * Project_Relationship_Code * (ex: END CLIENT, GENERAL CONTRACTOR, PRIMARY) for a particular project during project creation?

    Are you not storing the project number in the staging table designed for storing the task data? You can use create_project API to create the project and tasks at the same time with one single call. You may want to try that option

Maybe you are looking for

  • How can i run multiple instances of Photoshop EXE at the same time on windows 7

    Alright. You may ask why do you need multiple ? Assume that i have 10000 PSD files in 10 different folders I have a script that just save as them as PNG And these files are each 3000x3000 px My computer has 8 cores and 1 photoshop exe is only using 1

  • Output jframe information to command window

    Hi all I have a program that tracks the assets of a customer, kind of like a cart that holds cds, appliances, etc... I wanted to be able to print out the results to the command window after they enter the number of how many items from what the user e

  • Open/total jdbc connections

    With Oracle9iR2 AS installed, I notice that there are always open JDBC connections. I explicitly close them from all my JSP files (and the statement and the resultset objects as well). Actually, the total JDBC connections are always 2 times the open

  • No Bootcamp in OS X Server 10.6?

    I installed two days ago a OS X server 10.6 and could not find anywhere the boot camp assistant. Where I can download it?

  • Cross-Docking Config.

    I am working on Cross-docking scenario in ECC system and I am stuck at "Generating a Cross-Docking" Decision. This is the 6th step as per Best Practice GZ6. What are config settings that should be maintained to generate a decision? I have maintained