Prob while creating array in BPEL

Hi Folks,
I tried to create a string array in my BPEL to hold the values returned from my DB Adapter.
I created an element like the following in my "ArraySample.xsd" file.
<element name="myArr" type="xx"/>
          <complexType name="xx">
               <sequence>
                    <element name="arr" type="xsd:string" maxOccurs="unbounded"/>
               </sequence>
          </complexType>
</element>
Is there any other place I have to create any supporting stuffs like part name.
Plss advise me. IF possible could any one give the step details of how to create an array in BPEL process.
Thanks
VP

Hi PS,
Plss refer only the bold letters of code, I'm able to append values to the array.
arr[] = {1,2,3}
While retrieving, for index 1 (arr[1]=123) it returns the entire value (appended value)
if I go for arr[2], its throwing error expression is empty.
myprocess.bpel:
<variables>
<variable name="inputVariable"
messageType="client:BPELProcess1RequestMessage"/>
<variable name="outputVariable"
messageType="client:BPELProcess1ResponseMessage"/>
<variable name="list"
messageType="client:BPELProcess1ArrayResponseMessage"/>
<variable name="iterator" type="xsd:integer"/>
<variable name="count" type="xsd:integer"/>
<variable name="xpath" type="xsd:string"/>
<variable name="Variable_Array" type="xsd:string"/>
<variable name="temp" type="xsd:string"/>
</variables>
<sequence name="main">
<receive name="receiveInput" partnerLink="client"
portType="client:BPELProcess1" operation="process"
variable="inputVariable" createInstance="yes"/>
<assign name="Assign_1">
<copy>
<from expression="number(bpws:getVariableData('inputVariable','payload','/client:BPELProcess1ProcessRequest/client:input'))"/>
<to variable="iterator"/>
</copy>
<copy>
<from expression="0"/>
<to variable="count"/>
</copy>
</assign>
<while name="While_1"
condition="bpws:getVariableData('count') &lt; bpws:getVariableData('iterator')">
<assign name="Assign_2">
<copy>
<from expression="bpws:getVariableData('count') + 1"/>
<to variable="count"/>
</copy>
<copy>
<from expression="string(bpws:getVariableData('count'))"/>
<to variable="temp"/>
</copy>
<bpelx:append>
<bpelx:from variable="temp"/>
<bpelx:to variable="list" part="payload"
query="/client:BPELProcess1ArrayResponse/client:array"/>
</bpelx:append>
</assign> </while>
<assign name="Assign_4">
<copy>
<from expression="0"/>
<to variable="count"/>
</copy>
<copy>
<from expression="number(bpws:getVariableData('inputVariable','payload','/client:BPELProcess1ProcessRequest/client:input'))"/>
<to variable="iterator"/>
</copy>
</assign>
<while name="While_2"
condition="bpws:getVariableData('count') &lt; bpws:getVariableData('iterator')">
<assign name="Assign_5">
<copy>
<from expression="bpws:getVariableData('count') + 1"/>
<to variable="count"/>
</copy>
<copy>
<from expression="concat('/client:BPELProcess1ArrayResponse/client:array[',bpws:getVariableData('count'),']')"/>
<to variable="xpath"/>
</copy>
<copy>
<from expression="bpws:getVariableData('list','payload',bpws:getVariableData('xpath'))"/>
<to variable="outputVariable" part="payload"
query="/client:BPELProcess1ProcessResponse/client:result"/>
</copy> </assign>
</while>
<reply name="replyOutput" partnerLink="client"
portType="client:BPELProcess1" operation="process"
variable="outputVariable"/>
</sequence>
</process>
myprocess.xsd:
<schema attributeFormDefault="unqualified"
     elementFormDefault="qualified"
     targetNamespace="http://xmlns.oracle.com/BPELProcess1"
     xmlns="http://www.w3.org/2001/XMLSchema">
     <element name="BPELProcess1ProcessRequest">
          <complexType>
               <sequence>
                    <element name="input" type="string"/>
               </sequence>
          </complexType>
     </element>
     <element name="BPELProcess1ProcessResponse">
          <complexType>
               <sequence>
                    <element name="result" type="string"/>
               </sequence>
          </complexType>
     </element>
<element name="BPELProcess1ArrayResponse">
          <complexType>
               <sequence>
                    <element name="array" type="string" maxOccurs="unbounded"/>
               </sequence>
          </complexType>
     </element></schema>
myprocess.wsdl:
<definitions name="BPELProcess1"
targetNamespace="http://xmlns.oracle.com/BPELProcess1"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:client="http://xmlns.oracle.com/BPELProcess1"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/">
     <types>
          <schema xmlns="http://www.w3.org/2001/XMLSchema">
               <import namespace="http://xmlns.oracle.com/BPELProcess1" schemaLocation="BPELProcess1.xsd" />
          </schema>
     </types>
     <message name="BPELProcess1RequestMessage">
          <part name="payload" element="client:BPELProcess1ProcessRequest"/>
     </message>
     <message name="BPELProcess1ResponseMessage">
          <part name="payload" element="client:BPELProcess1ProcessResponse"/>
     </message>
<message name="BPELProcess1ArrayResponseMessage">
          <part name="payload" element="client:BPELProcess1ArrayResponse"/>
     </message>
     <!-- portType implemented by the BPELProcess1 BPEL process -->
     <portType name="BPELProcess1">
          <operation name="process">
               <input message="client:BPELProcess1RequestMessage" />
               <output message="client:BPELProcess1ResponseMessage"/>
          </operation>
     </portType>
          <plnk:partnerLinkType name="BPELProcess1">
          <plnk:role name="BPELProcess1Provider">
               <plnk:portType name="client:BPELProcess1"/>
          </plnk:role>
     </plnk:partnerLinkType>
</definitions>
Edited by: user555738 on Oct 23, 2008 2:29 PM
Edited by: user555738 on Oct 23, 2008 2:31 PM

Similar Messages

  • Java.lang.ClassCastException while creating array descriptor

    ( This post was moved from SQL / PLSQL forum to here )
    Hi everyone, i used to pass string array from java to plsql. I wrote a java source, then i load db with loadjava. And i wrote java spec. Then i run the function but i am getting this error :
    java.lang.ClassCastException
    at oracle.jdbc.driver.PhysicalConnection.putDescriptor(PhysicalConnection.java:4921)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:208)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:175)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:158)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:125)
    at SplitterOracle3.tokens2(SplitterOracle3.java:29)
    My Java Source is :
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    import oracle.sql.*;
    import oracle.jdbc.driver.OracleConnection;
    import oracle.jdbc.driver.OracleDriver;
    public class SplitterOracle3 {
    public static oracle.sql.ARRAY tokens2(String str,String delim)
    try
    //Class.forName("oracle.jdbc.driver.OracleDriver");
    //DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    //Connection conn = new OracleDriver().defaultConnection( );
    OracleDriver ora = new OracleDriver();
    OracleConnection conn = (OracleConnection) ora.defaultConnection();
    //ArrayDescriptor arrayDesc = ArrayDescriptor.createDescriptor("MY_ARRAY", ((conn).getRealConnection());
    //Connection conn = DriverManager.getConnection("jdbc:default:connection:");
    //Connection conn = ((DelegatingConnection) getDataSource().getConnection()).getInnermostDelegate();
    // get an initial context
    //OracleConnection oracleConnection = (OracleConnection)WSJdbcUtil.getNativeConnection((WSJdbcConnection) wsConn);
    ArrayDescriptor arraydesc =
    ArrayDescriptor.createDescriptor ("ARR_VARCHAR_100", conn);
    String strarr[] = new String[47];
    strarr[0]="ahmet";
    strarr[1]="mehmet";
    int curIndex = 0;
    int nextIndex = 0;
    boolean nextIsLastToken = false;
    int i=0;
    while (true)
    nextIndex = str.indexOf(delim, curIndex);
    if (nextIsLastToken)
    //return false;
    break;
    if (nextIndex == -1)
    nextIsLastToken=true;
    nextIndex = str.length();
    strarr[i] = str.substring(curIndex, nextIndex);
    curIndex = nextIndex + 1;
    i++;
    ARRAY dirArray = new ARRAY(arraydesc, conn, strarr);
    return dirArray;*/
    catch(Exception ex)
    System.err.println(ex.getMessage());
    ex.printStackTrace();
    return null;
    public static void main(String[] args)
    String str="2000,2,123553168,1,10,64895,65535,27662,64860,64895,65535,27662,64860,0,,,,,,0,0,2491039806,,,,,,,,,0,0,1,,2491039106,,,,,,,,,,,,";
    String strarr[] = new String[47];
    long l1,l2;
    int j=0;
    l1 = System.currentTimeMillis();
    for ( int i=0; i<20000000; i++)
    strarr = tokens2(str,",");
    l2 = System.currentTimeMillis();
    System.out.println("Fark :"+ (l2-l1));
    The line has "ArrayDescriptor.createDescriptor ("ARR_VARCHAR_100", conn);" causes this error.
    java.lang.ClassCastException
    at oracle.jdbc.driver.PhysicalConnection.putDescriptor(PhysicalConnection.java:4921)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:208)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:175)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:158)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:125)
    at SplitterOracle3.tokens2(SplitterOracle3.java:29)
    But i could not find the solution. Can you help me?
    Thanks for responses.

    Hi,
    Did you try my suggestion from Re: java.lang.ClassCastException while create array descriptor
    Try replacing
    oracle.jdbc.driver.OracleConnectionwith
    oracle.jdbc.OracleConnectionRegards
    Peter

  • Prob While Creating Customer Master - Error Msg "Number '0' Not defined"

    Dear Experts,
    I am Trying to create a customer with diff SP, SH, BP and PY. I was able to create Customer for BP and PY.
    But now when I go and try to created a SH customer with xd01 for my Sales.Org (99SS-XS-X1),
    In the Sales Area Data, Partner Function Tab, Partner function field the Number is 0 before the SH function field (instead of Internal / Blank) and at the bottom  give the error Msg that "Number '0' is not define". I have Cross checked the my Number ranges(no-22 from 7000-7999), account groups(ZA22)  and Partner function (SH), everything seems to Ok. But unable to find the solution. plz help me with this if you have ever come across such a prob.
    I would like to mention that the previously had no issues in creating customers following same procedure. I guess some one must have changed some settings by accident.
    This prob is only specific while creating only SP and SH Customers.
    Many ThanX.

    Thanks Amit for your valuable suggestion, But today I was able to solve the problem with help of my trainer, Someone has changed the default settings in partner determination, the solution is below which will help anyone who may come across a similar Problem.
    Spro->IMG->Sales & Distribution->Basic Functions->Partner Determination->Setup Partner Determination->Setup Partner Determination for Customer Master->Partner Functions
    Find the partner Function SP/SH/BP/PY there partner type should be KU. If anyone changes this settings Then the above problem arises.
    Regards.

  • Power Down while creating array...

    Hello all,
    I just found out that I need to do a unexpected shut down of an Xraid tonight. No biggie except for the fact that one side is 45% done burining in a new array.
    If I power down the Xraid while the array is being created would it somehow harm the hardware? I can deal with starting the burn in again, but I don't want to damage the physical disks..
    Any help would be appreciated.
    Regards,
    Daniel
    XRaid    

    Called Support on this. As long as the Raid is powered down correctly before the plugs are pulled, the burn in should continue where it left off when the raid is powered back on with no damage. Worse case scenario is you have to rebuild the array from the start.
    Dan

  • Error while creating a new BPEL project

    Hello!
    When I create a new BPEL project, I get this message: "Object expected", and on the footnotes, the following message is printed: "event://LogErrorEvent?bpelz.html trapped at 62: object expected"...
    Does anybody knows what is happening?
    Thanks in advance,
    Pedro Catoira

    hello Pedro,
    Try to see this link in the forum:
    BPEL Designer  Process problem
    It seem the same problem but I'm not sure...
    byebye
    Andrea

  • Getting prob while creating view in webdynpro ABAP application

    Hi Guys,
    I am facing a problem while creating a view for webdynpro ABAP application. It is giving an error as "ICF service "/sap/public/bc/WebDynpro/ViewDesigner" inactive".
    can anybody let me know how to solve this problem.
                   Thanks In Advance
    Regards
    Ravikumar

    I think check Internet explorer Tools ->Internet Options ->Connections.>Lan Connections> if the proxy or anyting checkbox is clicked coz it doesn't work with Internet on .
    Please reward if useful.

  • Error while creating Connection to  BPEL Server From Jdev.

    Hi All,
    I Installed an Oracle XE database on my windows machine , and Run the IRCA tool to create Orabpel, Oraesb and Orawsm in the XE database
    Deinstalled my current SOA Suite[Basic] and Reinstall the SOA Suite using the "advanced" option.
    Started the server and could able to create a connection to AS, but when i try to create a connection to BPEL Server it's error out with below error message.
    Application Server: OK
    BPEL Process Manager Server: FAILED
    ESB Server: FAILED
    What could be the reason..
    I didn't modified any file in AS directory with Database details ,Since while installing SOA Suite it asked for the DB Details and forced me to execute all the scripts against this DB,So i assume it knows the connection string.
    Let me know how can i solve this issue.
    Thanks in advance,
    -Siddhardha

    HI
    In JDeveloper 10.1.3.1.0,
    1. Click on the tab for the Connections navigator.
    2. Right click on Application Server and select New Application Server Connection.
    3. Enter a descriptive name for the new connection, and select the appropriate connection type from the drop down list. Click Next.
    4. Specify oc4jadmin for User Name, then enter the oc4jadmin password. Click Next.
    5. Select Single Instance for Connect To, then provide the host name where BPEL is installed, the OPMN port number, and the OC4J instance name (the default for 10.1.3.1 is oc4j_soa). Click Next.
    6. Click Test Connection. If you have been successful, you should see "Success!"
    7. Now, right click on Integration Server and select New Integration Server Connection.
    8. Specify a connection name and click Next.
    9. In the drop down list by Application Server, select the Application Server Connection you just created. Again, specify the host name where BPEL is installed and the port number. This port number will be the same that you specified for the Integration Server Connection to the home OC4J container. Click Next.
    10. Test the connection. You should see something like:
    Application Server: OK
    BPEL Process Manager Server: OK
    ESB Server: OK
    11. Now, return to the Applications navigator, and try to redeploy your process using the Integration Server Connection just created. (It is possible that you will have to close JDeveloper and then reopen it for this to work.)
    Cheers
    Anirudh Pucha

  • Error while creating an asynchronous BPEL project

    In BPEL Project Creation Wizard-> while selecting the Input and Output Schema element, Instead of getting the complete namespace in "Type",
    I get "{}PODesc".
    Why is it not picking the complete namespace???

    User,
    The people on the [url http://forums.oracle.com/forums/forum.jspa?forumID=320]SOA Suite Forum or [url http://forums.oracle.com/forums/forum.jspa?forumID=212]BPEL Forum can probably better help (a copy-and-paste from another reply just an hour or so ago)
    John

  • Prob while creating Non - Cumulative KF with Inflow & Outflow

    hello all,
    I created 3 Key Figures, with DEPOSIT, WITHDRAWL, BALANCE... with Amount & 0CURRENCY data type... If i measure the DEPOSIT & BALANCE in 0CURRENCY then only i could be able to see the keyfig in Inflow(DEPOSIT) and Outflow(WITHDRAWL) of the Total Key fig.. I hope till here is fine..
    Im loading the file thru Flat file..
    when im activating the Data Source it got activated(whr 0CURRENCY is taken in once FIELDS tab while mapping)...
    The problem started whn im ran IP... its throwing the error msg " The argument " INR" or "USD" cannot be interuppted as a number on assignment field / BIC/WITHDRAWL record 1 value INR.
    Thanks in advance

    Hi,
    what i understood from the message again is ur mapping the filed currency to withdrawal keyfigure.
    chk the columns order in datasource and flat file and assign the proper mapping pls.
    lets say if u have Deposit,withdrwal, balance,currency as your fields in u r datasource then do have the same fields in your Flat file as well so that they are in same order as in datasource.
    pls chk this and try again.

  • Creating array descriptor

    I need to create an array descriptor for a type that is defined in a package (Oracle 8.1.6).
    If I define the type outside the package I can create the descriptor, otherwise I can't - even if I fully qualify the type with:
    USER.PACKAGE.CUSTOMTYPE
    or
    PACKAGE.CUSTOMTYPE
    The JDBC connection is created under the USER account.
    Any ideea if this is a bug in JDBC or am I doing something wrong ?
    Thanks,
    Calin
    null

    Hi,
    Did you try my suggestion from Re: java.lang.ClassCastException while create array descriptor
    Try replacing
    oracle.jdbc.driver.OracleConnectionwith
    oracle.jdbc.OracleConnectionRegards
    Peter

  • How to create an array in bpel?

    I am trying to integrate a web service into open-esb. The web service consumes an unbounded array of a "userInfo" data structure. The issue is that although I can create bpel to receive a message like this, due to type incompatibilities I need to create a different array within bpel to pass to the webservice.
    To date I have not found a way to create an array within open-esb's bpel. After extensive googling I have found that other ESBs define their own proprietary extensions to add nodes to an array.
    Thus I have two questions:
    First, does open-esb support creation of arrays? and if so, how do I create the array and add nodes to it?
    Second, and perhaps more importantly, is using an <assign> activity the best way to transfer a potentially large array from one variable to another (i.e., will it perform well)? Or should I use XSLT to transform the array from one wsdl type to another? And if XSLT is the answer, how can I do this within open-esb?
    Thanks in advance,
    Steve
    PS. Based on the various googlings Ive been doing this question seems to be frequently asked. If someone will help me find a solution I plan on writing a short "how-to" article for posting back to the community. Given that arrays are one of the most basic data structures I hope the article will be useful for others struggling with this issue.

    I think this is all covered in Steve-Nies other thread concerning this subject, entitled "Need help with BPEL please" (http://forum.java.sun.com/thread.jspa?threadID=5116270&tstart=0)

  • Prob in activating a field in delivery while creating delivery via VL04

    hi thx i am also facing the same prob. this badi is working while creating deliveries via VL01N OR VL02N but if we are creating delivery via VL04 this badi is not working, can u please guide me.
    thanx in adv.

    In the Import parameter TECHN_CONTROL  one field called SENDER_SYSTEM is there, it takes the Logical System Name(Default will be Local System). Check whether it is defined or not. This can be viewed in SALE tranasction.
    Tcode SALE > Basic Setting>Logical System-->Assign Logical System to client.
    Here You check ur Client is assigned logical System Name or Not?
    Debug your program and check this value....
    It will resolve ur prob..

  • Facing problem while creating bpel process

    Hi All,
    http://docs.oracle.com/cd/E27559_01/dev.1112/e27150/request.htm#CIHFBEFB
    I followed the above document to create a custom bpel process. In the section 21.3.5.5 Configuring Workflow Selection,it is given as
    5.Specify the Input as catalogData and the Output as workflowstage.
    i was unable to find workflowstage in the output search .
    can anyone help me out of this?
    Regards,
    trainee

    I hope u had no problems in mapping input as catalog data. It will be present under CatalogData.xsd in Type Explorer.
    Now to specify Output as workflowstage click the + sign next to BusinessRule.xsd and select 'StageOutput : stage'.

  • Getting error while creating the variable of Schema Element type

    Hi everybody,
    For creating a variable of schema element type I am doing the following steps...
    Select 'Variables' after right clicking on bpel process. IN this window, go to 'Create VAriable' then select 'Element' type. Now in Type Choose, I expanded the my imported schema files. And selected a element type, then click ok to create this variable... I am getting the message...
    IN ORDER TO SAVE IMPORTED WSDL/SCHEMA FILES, YOU MUST HAVE A PARTNER LINK LOCATED UNDER THE CURRENT PROJECT DIRECTORY.
    What is mean by that.
    I have imported the schema files in project. AFter that I have imported them into the WSDL also. Now why I am getting error while creating the variable. However I can create variable directly in .BPEL file then everything is fine. And it is working also. But what is mean with the above error? Why I am not able to create variable through GUI?
    Thanks.

    Hi,
    I have this same problem this morning, and I was going crazy, until I found this webpage on the internet:
    [http://technology.amis.nl/blog/1803/problem-importing-xml-schema-in-bpel-process|http://technology.amis.nl/blog/1803/problem-importing-xml-schema-in-bpel-process]
    The idea is that the jdeveloper is not very good working with directories with spaces on the directory name. If you move all your work to a directory without spaces, it will work smoothly. At least, it had worked for me.
    Regards,
    Nacho

  • Error while creating new projects using api

    Hello,
    I am having error while creating projects using standard api, PA_PROJECT_PUB.CREATE_PROJECTS. The error I am having is as follow.
    Source template ID is invalid.
    ===
    My code is as follow:
    SET SERVEROUTPUT ON SIZE 1000000
    SET VERIFY OFF
    define no=&amg_number
    DECLARE
    -- Variables used to initialize the session
    l_user_id NUMBER;
    l_responsibility_id NUMBER;
    cursor get_key_members is
    select person_id, project_role_type, rownum
    from pa_project_players
    where project_id = 1;
    -- Counter variables
    a NUMBER := 0;
    m NUMBER := 0;
    -- Variables needed for API standard parameters
    l_commit VARCHAR2(1) := 'F';
    l_init_msg_list VARCHAR2(1) := 'T';
    l_api_version_number NUMBER :=1.0;
    l_return_status VARCHAR2(1);
    l_msg_count NUMBER;
    l_msg_data VARCHAR2(2000);
    -- Variables used specifically in error message retrieval
    l_encoded VARCHAR2(1) := 'F';
    l_data VARCHAR2(2000);
    l_msg_index NUMBER;
    l_msg_index_out NUMBER;
    -- Variables needed for Oracle Project specific parameters
    -- Input variables
    l_pm_product_code VARCHAR2(30);
    l_project_in pa_project_pub.project_in_rec_type;
    l_key_members pa_project_pub.project_role_tbl_type;
    l_class_categories pa_project_pub.class_category_tbl_type;
    l_tasks_in pa_project_pub.task_in_tbl_type;
    -- Record variables for loading table variables above
    l_key_member_rec pa_project_pub.project_role_rec_type;
    l_class_category_rec pa_project_pub.class_category_rec_type;
    l_task_rec pa_project_pub.task_in_rec_type;
    -- Output variables
    l_workflow_started VARCHAR2(100);
    l_project_out pa_project_pub.project_out_rec_type;
    l_tasks_out pa_project_pub.task_out_tbl_type;
    -- Exception to call messag handlers if API returns an error.
    API_ERROR EXCEPTION;
    BEGIN
    -- Initialize the session with my user id and Projects, Vision Serves (USA0
    -- responsibility:
    select user_id into l_user_id
    from fnd_user
    where user_name = 'SSHAH';
    select responsibility_id into l_responsibility_id
    from fnd_responsibility_tl
    where responsibility_name = 'Projects Implementation Superuser';
    pa_interface_utils_pub.set_global_info(
    p_api_version_number => l_api_version_number,
    p_responsibility_id => l_responsibility_id,
    p_user_id => l_user_id,
    p_msg_count => l_msg_count,
    p_msg_data => l_msg_data,
    p_return_status => l_return_status);
    if l_return_status != 'S' then
    raise API_ERROR;
    end if;
    -- Provide values for input variables
    -- L_PM_PRODUCT_CODE: These are stored in pa_lookups and can be defined
    -- by the user. In this case we select a pre-defined one.
    select lookup_code into l_pm_product_code
    from pa_lookups
    where lookup_type = 'PM_PRODUCT_CODE'
    and meaning = 'Conversion';
    -- L_PROJECT_IN: We have to provide values for all required elements
    -- of this record (see p 5-13, 5-14 for the definition of the record).
    -- Customers will normally select this information from some external
    -- source
    l_project_in.pm_project_reference := 'AGL-AMG Project &no';
    l_project_in.project_name := 'AGL-AMG Project &no';
    l_project_in.created_from_project_id := 1;
    l_project_in.carrying_out_organization_id := 2864; /*Cons. West*/
    l_project_in.project_status_code := 'UNAPPROVED';
    l_project_in.start_date := '01-JAN-11';
    l_project_in.completion_date := '31-DEC-11';
    l_project_in.description := 'Trying Hard';
    l_project_in.project_relationship_code := 'Primary';
    -- L_KEY_MEMBERS: To load the key member table we load individual
    -- key member records and assign them to the key member table. In
    -- the example below I am selecting all of the key member setup
    -- from an existing project with 4 key members ('EE-Proj-01'):
    for km in get_key_members loop
    -- Get the next record and load into key members record:
    l_key_member_rec.person_id := km.person_id;
    l_key_member_rec.project_role_type := km.project_role_type;
    -- Assign this record to the table (array)
    l_key_members(km.rownum) := l_key_member_rec;
    end loop;
    -- L_CLASS_CATEGORIES: commented out below should fix the error we get
    -- because the template does not have an assigment for the mandatory class
    -- 'BAS Test'
    l_class_category_rec.class_category := 'Product';
    l_class_category_rec.class_code := 'Non-classified';
    -- Assign the record to the table (array)
    l_class_categories(1) := l_class_category_rec;
    -- L_TASKS_IN: We will load in a single task and a subtask providing only
    -- the basic fields (see pp. 5-16,5-17,5-18 for the definition of
    -- the task record)
    l_task_rec.pm_task_reference := '1';
    l_task_rec.pa_task_number := '1';
    l_task_rec.task_name := 'Construction';
    l_task_rec.pm_parent_task_reference := '' ;
    l_task_rec.task_description := 'Plant function';
    -- Assign the top task to the table.
    l_taskS_in(1) := l_task_rec;
    -- Assign values for the sub task
    l_task_rec.pm_task_reference := '1.1';
    l_task_rec.pa_task_number := '1.1';
    l_task_rec.task_name := 'Brick laying';
    l_task_rec.pm_parent_task_reference := '1' ;
    l_task_rec.task_description := 'Plant building';
    -- Assign the subtask to the task table.
    l_tasks_in(2) := l_task_rec;
    -- All inputs are assigned, so call the API:
    pa_project_pub.create_project
    (p_api_version_number => l_api_version_number,
    p_commit => l_commit,
    p_init_msg_list => l_init_msg_list,
    p_msg_count => l_msg_count,
    p_msg_data => l_msg_data,
    p_return_status => l_return_status,
    p_workflow_started => l_workflow_started,
    p_pm_product_code => l_pm_product_code,
    p_project_in => l_project_in,
    p_project_out => l_project_out,
    p_key_members => l_key_members,
    p_class_categories => l_class_categories,
    p_tasks_in => l_tasks_in,
    p_tasks_out => l_tasks_out);
    -- Check the return status, if it is not success, then raise message handling
    -- exception.
    IF l_return_status != 'S' THEN
    dbms_output.put_line('Msg_count: '||to_char(l_msg_count));
    dbms_output.put_line('Error: ret status: '||l_return_status);
    RAISE API_ERROR;
    END IF;
    -- perform manual commit since p_commit was set to False.
    COMMIT;
    --HANDLE EXCEPTIONS
    EXCEPTION
    WHEN API_ERROR THEN
    FOR i IN 1..l_msg_count LOOP
    pa_interface_utils_pub.get_messages(
    p_msg_count => l_msg_count,
    p_encoded => l_encoded,
    p_msg_index => i,
    p_msg_data => l_msg_data,
    p_data => l_data,
    p_msg_index_out => l_msg_index_out);
    dbms_output.put_line('ERROR: '||to_char(l_msg_index_out)||': '||l_data);
    END LOOP;
    rollback;
    WHEN OTHERS THEN
    dbms_output.put_line('Error: '||sqlerrm);
    FOR i IN 1..l_msg_count LOOP
    pa_interface_utils_pub.get_messages(
    p_msg_count => l_msg_count,
    p_encoded => l_encoded,
    p_msg_index => i,
    p_msg_data => l_msg_data,
    p_data => l_data,
    p_msg_index_out => l_msg_index_out);
    dbms_output.put_line('ERROR: '||to_char(l_msg_index_out)||': '||l_data);
    END LOOP;
    rollback;
    END;
    ===
    Msg_count: 1
    Error: ret status: E
    ERROR: 1: Project: 'AGL-AMG Project 1123'
    Source template ID is invalid.
    PL/SQL procedure successfully completed.

    I was using a custom Application, which had a id other then 275 (which belongs to Oracle projects)

Maybe you are looking for