Quantcast
Channel: SCN : Unanswered Discussions - Process Integration (PI) & SOA Middleware
Viewing all articles
Browse latest Browse all 6719

Search for complex EJB Mapping function example

$
0
0

Hi guys,

 

i have some problem regarding my ejb mapping function in bpm process. I want to know how i can access within the ejb function.

I want to give two strings into the mapping function and want to return a article from type ArticleType (defined in BPM as XSD Schema)

 

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

<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/Article" xmlns:tns="http://www.example.org/Article" elementFormDefault="qualified">

 

    <complexType name="ArticleType">

        <sequence>

            <element name="artName" type="string"></element>

            <element name="artPI" type="string"></element>

        </sequence>

    </complexType>

</schema>

 

 

The function looks like above but is not working, how can i access the ArticleType defined in BPM to use it in the java class ?

Maybe someone knows a good example ?

 

 

public class ConcatFunctionComplex implements ConcatFunctionComplexLocal {

 

    private static final String PARAMETER1 = "parameter1";

    private static final String PARAMETER2 = "parameter2";

    private static final String RESULT = "result";

 

    private static final String NAME_PROPERTY_INPUT_PARAMETER1 = SdoRenamingHelper

            .renameXsdElementToSdoProperty(new QName(PARAMETER1), false);

 

    private static final String NAME_PROPERTY_INPUT_PARAMETER2 = SdoRenamingHelper

            .renameXsdElementToSdoProperty(new QName(PARAMETER2), false);

 

    private static final String NAME_PROPERTY_OUTPUT_RESULT = SdoRenamingHelper

            .renameXsdElementToSdoProperty(new QName(RESULT), false);

   

    /**

     * Default constructor.

     */

    public ConcatFunctionComplex() {

        // TODO Auto-generated constructor stub

    }

 

    @Override

    public DataObject invokeSdo(DataObject inputDO, InvocationContext invocationContext) {

        // input

        Type typeInput = inputDO.getType();

        String parameter1 = inputDO.getString(typeInput.getProperty(NAME_PROPERTY_INPUT_PARAMETER1));

        String parameter2 = inputDO.getString(typeInput.getProperty(NAME_PROPERTY_INPUT_PARAMETER2));

       

         DataObject outputD1 = invocationContext.createOutputDataObject();

         Property resultProperty = outputD1.getType().getProperty(NAME_PROPERTY_OUTPUT_RESULT);

         DataObject article = outputD1.createDataObject(resultProperty);

       

         article.set("artName", parameter1);

         article.set("artPI", parameter2);

         return article;       

    }

}

 

thanks in advanance for your help.

Mike


Viewing all articles
Browse latest Browse all 6719

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>