on 05-16-2013 7:23 AM
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
i had solved the problem, the problem was the namespace in SdoRenamingHelper.
The namespace itself was ok but, the second parameter bust be true(qualified) to access the xsd defined data object.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
so still hanging on the element to access. So to change a simple attribute(attr1) is no problem within the ejb, but if i try to read the property for artName it is always null.
How should the property ID should look like ??
I use
String artNameId = SdoRenamingHelper.renameXsdElementToSdoProperty(new QName("http://demo.marquardt.com/CustomDataTypes", "artName"), false);
and with this ID i try to read
article.getType.getProperty(artNameId).
and the corresponding DataObject in BPM looks like
<schema targetNamespace="http://demo.marquardt.com/CustomDataTypes" xmls:tns="http://demo.marquardt.com/CustomDataTypes"
<complexType name="ArticleType">
<sequence>
<element name="artName" type="string"></element>
<element name="artPI" type="string"></element>
</sequence>
<attribute name="attr1" type="string"></attribute>
</complexType>
any idea or maybe a good example where they use not only attributes also elements in the XSD.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You cannot access EJBs from mapping. This is not possible.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
just a question - why don't you use operation mapping in the BPM and then any kind of PI mapping for that ? (more configurable, more mapping options, less deplyment)
Regards,
Michal Krawczyk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michael,
I'm talking from a mapping in BPM. That means i call in the mapping activity a function called ComplexMappingFunction( parameter1, parameter2 ) and as result the ArticleType should be returned. Thats all i want to do.
So in my understanding this is a "normal" EJB mapping in BPM.
regards
Michael
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.