cancel
Showing results for 
Search instead for 
Did you mean: 

Java Class Mapping Program in BPM process

Former Member
0 Kudos

I have a scenario where I'm receiving an IDOC I then use a JAVA mapping program in my first transformation step. Immediately following I have a switch step but there is not data in from the mapping program.

1) Receive Step

2) Transformation IDOC to Table using Java class

3) Switch step based on Table field value

Problem is there is no values in the table.

This java class was not developed within NetWeaver but was used in our old process. We simply imported the jar file for accessing our existing java classes. Is there something else we need to do to utilize our java modules within the BPM process?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Yes I was able to test the interface mapping and data was received in the target structure. I even see data if a execute my BPM with just two steps:

1)Receive

2) Transformation using java class

<u><b>Output with just two steps</b> </u>

<?xml version="1.0" encoding="UTF-8" ?>

- <ns0:MT_CWF_TABLES_UPDATE xmlns:ns0="http://halliburton.com/IA/XI">

- <Invoice>

<InvoiceNum>94732918</InvoiceNum>

<Timestamp>200711271052052</Timestamp>

<RevisedInvoiceType>M</RevisedInvoiceType>

<InvoiceType>M</InvoiceType>

<SoldToId>300466</SoldToId>

<BillToId>300466</BillToId>

<PlantId>007M</PlantId>

<PSLId>18</PSLId>

<InvoicePDF>N</InvoicePDF>

<PIDXXMLFileRequired>Y</PIDXXMLFileRequired>

<PIDXIntegration>Y</PIDXIntegration>

<WaitForFT>Y</WaitForFT>

<AttachFT>Y</AttachFT>

<SbynXchngProfileName>TP_300466_TZODX</SbynXchngProfileName>

<SbynXchngOutProtocol>RNIF</SbynXchngOutProtocol>

<EmailNotificationMode>NONE</EmailNotificationMode>

<EmailMsgFrom>NONE</EmailMsgFrom>

<EmailMsgTo>NONE</EmailMsgTo>

<EmailMsgCc>NONE</EmailMsgCc>

<PSL_Name>NONE</PSL_Name>

<Email_Message_ID>1776</Email_Message_ID>

</Invoice>

</ns0:MT_CWF_TABLES_UPDATE>

However, when I add the next step it's not seeing the data in the fields. My second transformation is just sending the fields through the email adapter. The email received shows blanks for all the fields.

iaki_vila
Active Contributor
0 Kudos

Are you sure that the target namespace is correct?

Regards.

Former Member
0 Kudos

The namespace was the issue. The Java developer overwrote the namespace within his code regardless of what was being sent.

Answers (3)

Answers (3)

Former Member
0 Kudos

The namespace does appear to be incorrect. Not sure where it's picking that up from.

I'll update the question and add points if this corrects my problems.

Thanks.

iaki_vila
Active Contributor
0 Kudos

Hi,

You must to have in the java class:

- You java have to be like:

import java.io.InputStream;

import java.io.OutputStream;

import java.util.Map;

import java.util.HashMap;

import com.sap.aii.mapping.api. AbstractTrace;

import com.sap.aii.mapping.api.StreamTransformation;

import com.sap.aii.mapping.api.StreamTransformationConstants;

public class JavaMapping implements StreamTransformation {

private Map param = null;

private AbstractTrace trace = null;

public void setParameter (Map param) {

this.param = param;

if (param == null) {

this.param = new HashMap();

}

}

public void execute(InputStream in, OutputStream out) {

try {

trace = (AbstractTrace)param.get(

StreamTransformationConstants.MAPPING_TRACE );

trace.addInfo(‘...’);

// ...

String receiverName = (String)param.get(

StreamTransformationConstants.RECEIVER_NAME);

// ...

}

}

}

The method execute take the InputStream with the XML source. The out (OutputStream) have to be an XML like the IDOC structure.

Regards.

Former Member
0 Kudos

Hi Audra,

did you test your inetrface mapping using the test-tab?

Was there any result?

Regards mario