cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco and Oracle BPEL

ldeltenre
Champ in-the-making
Champ in-the-making
Hi,

I try to use Alfresco with Oracle BPEL.

Actually I can display existing documents but when I try to create, for example, a new folder I receive a JavaNullPointerException.

I follow all the steps  like the webservice samples and it does not work !

Anyone can help me ?

Thanks

Laurent
2 REPLIES 2

jpfi
Champ in-the-making
Champ in-the-making
Hi,
it is very hard to help you if you're only saying I'm getting a NullPointerEx. I would be very helpful if you post some code and stack traces whicj describes your problem.
Cheers, jan

ldeltenre
Champ in-the-making
Champ in-the-making
Hi,

My config is
-Oracle Soa Suite 10.1.3.3
-Alfresco community  2.1.0 (build 482)

First step is a connection to a BPEL (Alfresco_Authentication) that create wsseHeader message
Second step try to create a simple folder in alfresco
Third step is a connection to a BPEL (Alfresco_Disconnect) that close alfresco session

Here you can find my BPEL code.

<?xml version = "1.0" encoding = "UTF-8" ?>
<!–
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  Oracle JDeveloper BPEL Designer
 
  Created: Thu Mar 13 17:10:16 CET 2008
  Author:  Admin
  Purpose: Synchronous BPEL Process
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
–>
<process name="Alfresco_move"
         targetNamespace="http://xmlns.oracle.com/Alfresco_move"
         xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
         xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
         xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
         xmlns:ns4="http://xmlns.oracle.com/bpel/workflow/xpath"
         xmlns:ns7="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
         xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
         xmlns:ns5="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
         xmlns:client="http://xmlns.oracle.com/Alfresco_move"
         xmlns:ora="http://schemas.oracle.com/xpath/extension"
         xmlns:ns6="http://www.oracle.com/XSL/Transform/java/oracle.tip.esb.server.headers.ESBHeaderFunctions"
         xmlns:ns9="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
         xmlns:ns1="http://www.alfresco.org/ws/service/repository/1.0"
         xmlns:ns3="http://www.alfresco.org/ws/model/content/1.0"
         xmlns:ns2="http://www.alfresco.org/ws/cml/1.0"
         xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
         xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
         xmlns:ns8="http://xmlns.oracle.com/Alfresco_Authentication"
         xmlns:ns10="http://xmlns.oracle.com/Alfresco_Disconnect">
  <!–
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
      PARTNERLINKS                                                     
      List of services participating in this BPEL process              
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  –>
  <partnerLinks>
    <!–
      The 'client' role represents the requester of this service. It is
      used for callback. The location and correlation information associated
      with the client role are automatically set using WS-Addressing.
    –>
    <partnerLink name="client" partnerLinkType="client:Alfresco_move"
                 myRole="Alfresco_moveProvider"/>
    <partnerLink name="Alfresco_Authentication"
                 partnerRole="Alfresco_AuthenticationProvider"
                 partnerLinkType="ns8:Alfresco_Authentication"/>
    <partnerLink name="Alfresco_Disconnect"
                 partnerRole="Alfresco_DisconnectProvider"
                 partnerLinkType="ns10:Alfresco_Disconnect"/>
    <partnerLink name="repository-service"
                 partnerRole="RepositoryServiceSoapPort_Role"
                 partnerLinkType="ns1:RepositoryServiceSoapPort_PL"/>
  </partnerLinks>
  <!–
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
      VARIABLES                                                       
      List of messages and XML documents used within this BPEL process
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  –>
  <variables>
    <!– Reference to the message passed as input during initiation –>
    <!– Reference to the message that will be returned to the requester–>
    <variable name="inputVariable"
              messageType="client:Alfresco_moveRequestMessage"/>
    <variable name="outputVariable"
              messageType="client:Alfresco_moveResponseMessage"/>
    <variable name="Authentication_InputVariable"
              messageType="ns8:Alfresco_AuthenticationRequestMessage"/>
    <variable name="Authentication_OutputVariable"
              messageType="ns8:Alfresco_AuthenticationResponseMessage"/>
    <variable name="wsseHeader" element="ns9:Security"/>
    <variable name="Disconnect_InputVariable"
              messageType="ns10:Alfresco_DisconnectRequestMessage"/>
    <variable name="Disconnect_OutputVariable"
              messageType="ns10:Alfresco_DisconnectResponseMessage"/>
    <variable name="Invoke_3_update_InputVariable"
              messageType="ns1:updateRequest"/>
    <variable name="Invoke_3_update_OutputVariable"
              messageType="ns1:updateResponse"/>
    <variable name="parentReference" element="client:parentReference"/>
    <variable name="namedValue" element="client:namedValue"/>
    <variable name="store" element="client:Store"/>
    <variable name="CMLCreate" element="ns2:cml"/>
    <variable name="Fault" type="xsd:string"/>
  </variables>
  <!–
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     ORCHESTRATION LOGIC                                              
     Set of activities coordinating the flow of messages across the   
     services integrated within this business process                 
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  –>
  <sequence name="main">
    <!– Receive input from requestor. (Note: This maps to operation defined in Alfresco_move.wsdl) –>
    <receive name="receiveInput" partnerLink="client"
             portType="client:Alfresco_move" operation="process"
             variable="inputVariable" createInstance="yes"/>
    <!– Generate reply to synchronous request –>
    <scope name="Authentication">
      <sequence name="Sequence_2">
        <assign name="Assign_3">
          <copy>
            <from expression='"admin"'/>
            <to variable="Authentication_InputVariable" part="payload"
                query="/ns8:Alfresco_AuthenticationProcessRequest/ns8:username"/>
          </copy>
          <copy>
            <from expression='"admin"'/>
            <to variable="Authentication_InputVariable" part="payload"
                query="/ns8:Alfresco_AuthenticationProcessRequest/ns8:password"/>
          </copy>
        </assign>
        <invoke name="Authentication" partnerLink="Alfresco_Authentication"
                portType="ns8:Alfresco_Authentication" operation="process"
                inputVariable="Authentication_InputVariable"
                outputVariable="Authentication_OutputVariable"/>
        <assign name="Assign_4">
          <copy>
            <from variable="Authentication_OutputVariable" part="payload"
                  query="/ns8:Alfresco_AuthenticationProcessResponse/ns8:securityHeader"/>
            <to variable="wsseHeader" query="/ns9:Security"/>
          </copy>
        </assign>
      </sequence>
    </scope>
    <scope name="Move_Doc">
      <faultHandlers>
        <catchAll>
          <sequence name="Sequence_4">
            <empty name="Error"/>
          </sequence>
        </catchAll>
      </faultHandlers>
      <sequence name="Sequence_1">
        <assign name="Assign_Store">
          <copy>
            <from expression='"workspace"'/>
            <to variable="store" query="/client:Store/ns3:scheme"/>
          </copy>
          <copy>
            <from expression='"SpacesStore"'/>
            <to variable="store" query="/client:Store/ns3:address"/>
          </copy>
        </assign>
        <assign name="Assign_ParentReference">
          <copy>
            <from variable="store" query="/client:Store"/>
            <to variable="parentReference"
                query="/client:parentReference/ns3:store"/>
          </copy>
          <copy>
            <from expression='"/app:company_home"'/>
            <to variable="parentReference"
                query="/client:parentReference/ns3:path"/>
          </copy>
          <copy>
            <from expression='"{http://www.alfresco.org/model/content/1.0}contains''/>
            <to variable="parentReference"
                query="/client:parentReference/ns3:associationType"/>
          </copy>
          <copy>
            <from expression='"samples_bpel_folder"'/>
            <to variable="parentReference"
                query="/client:parentReference/ns3:childName"/>
          </copy>
        </assign>
        <assign name="Assign_NamedValue">
          <copy>
            <from expression='"name"'/>
            <to variable="namedValue" query="/client:namedValue/ns3:name"/>
          </copy>
          <copy>
            <from expression='"samples for bpel"'/>
            <to variable="namedValue" query="/client:namedValue/ns3:value"/>
          </copy>
          <copy>
            <from expression='"false"'/>
            <to variable="namedValue"
                query="/client:namedValue/ns3:isMultiValue"/>
          </copy>
        </assign>
        <assign name="Assign_CMLCreate">
          <copy>
            <from expression='"1"'/>
            <to variable="CMLCreate" query="/ns2:cml/ns2:create/ns2:id"/>
          </copy>
          <copy>
            <from variable="parentReference" query="/client:parentReference"/>
            <to variable="CMLCreate" query="/ns2:cml/ns2:create/ns2:parent"/>
          </copy>
          <copy>
            <from expression='"{http://www.alfresco.org/model/content/1.0}folder''/>
            <to variable="CMLCreate" query="/ns2:cml/ns2:create/ns2:type"/>
          </copy>
          <copy>
            <from variable="namedValue" query="/client:namedValue"/>
            <to variable="CMLCreate" query="/ns2:cml/ns2:create/ns2:property"/>
          </copy>
        </assign>
        <assign name="Assign_CML">
          <copy>
            <from variable="CMLCreate" query="/ns2:cml/ns2:create"/>
            <to variable="Invoke_3_update_InputVariable" part="parameters"
                query="/ns1:update/ns1:statements/ns2:create"/>
          </copy>
        </assign>
        <invoke name="Invoke_Repository_Service"
                partnerLink="repository-service"
                portType="ns1:RepositoryServiceSoapPort" operation="update"
                inputVariable="Invoke_3_update_InputVariable"
                outputVariable="Invoke_3_update_OutputVariable"
                bpelx:inputHeaderVariable="wsseHeader"/>
        <assign name="Assign_Result">
          <copy>
            <from expression='"ok"'/>
            <to variable="outputVariable" part="payload"
                query="/client:Alfresco_moveProcessResponse/client:result"/>
          </copy>
        </assign>
      </sequence>
    </scope>
    <scope name="Disconnect">
      <sequence name="Sequence_3">
        <assign name="Assign_Ticket">
          <copy>
            <from variable="Authentication_OutputVariable" part="payload"
                  query="/ns8:Alfresco_AuthenticationProcessResponse/ns8:ticket"/>
            <to variable="Disconnect_InputVariable" part="payload"
                query="/ns10:Alfresco_DisconnectProcessRequest/ns10:ticket"/>
          </copy>
        </assign>
        <invoke name="Invoke_Disconnect" partnerLink="Alfresco_Disconnect"
                portType="ns10:Alfresco_Disconnect" operation="process"
                inputVariable="Disconnect_InputVariable"
                outputVariable="Disconnect_OutputVariable"/>
      </sequence>
    </scope>
    <reply name="replyOutput" partnerLink="client"
           portType="client:Alfresco_move" operation="process"
           variable="outputVariable"/>
  </sequence>
</process>

Thanks for help.