You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ode.apache.org by BlueDiamond <gv...@in.com> on 2009/11/27 13:03:28 UTC

Develop a new BPEL extension

Hey guys!

I want to develop a new BPEL extension and despite going through the
available documentation & e4x sample, I couldn't really find a way to
proceed.

REQUIREMENT: I want to give encrypted password in my bpel file. I have a
java class that provides decrypt method. How to invoke this method? e4x is
for javascripts. Can I invoke this java method from e4x
extensionAssignOperation? How?

Regards=),
Anil
-- 
View this message in context: http://old.nabble.com/Develop-a-new-BPEL-extension-tp26541549p26541549.html
Sent from the Apache Ode User mailing list archive at Nabble.com.


Re: Develop a new BPEL extension

Posted by BlueDiamond <gv...@in.com>.
Please neglect my previous comment. The issue is that, in neither case, my
value is not reaching the method. 

If I give ext:encrypt('password'), its working fine. But if I give
ext:encrypt(encStr), the value goes blank string. ext:encrypt($encStr) gives
an assignment fault:

[2009-11-30 19:05:49,437] ERROR -  Assignment Fault:
{http://docs.oasis-open.org/wsbpel/2.0/process/executable}subLanguageExecutionFault,lineNo=52,faultEx
planation={http://docs.oasis-open.org/wsbpel/2.0/process/executable}subLanguageExecutionFault:
null

So, the challenge is that I am not able to send a variable input parameter
to this function.


BlueDiamond wrote:
> 
> Hi,
> 
> I developed a simple bpel process that returns output based on this
> processing on input (XPath extension for pwd decryption):
> 
>             <copy>
>                 <from>string($inputVar.inputType/ns2:paramA)</from>
>                 <to>$encStr</to>
>             </copy>
> 
>             <copy xmlns:ext="java:org.anil.PwdUtil">
>                 <from
> expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">ext:encrypt(encStr)</from>
>                 <to>$outputVar.resultType/ns2:paramA</to>
>             </copy>
> 
> There are encrypt() and decrypt() functions in PwdUtil class. When I
> invoke encrypt(), I get valid response. When I call decrypt(), the input
> variable to the function is blank "" and so things go wrong & my call
> fails. I added other methods to class to verify but none got invoked. 
> A simple test() method also failed interestingly. But encrypt() works!!!!!
> Things don't work even if I have only 1 function in my class! I even tried
> the expressionLanaguage "urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"
> but no difference. 
> 
> Is this some issue with Ode? I am currently testing this on WSO2 BPS 1.1
> which is based on Apache Ode 2.0.
> 
> Thanks,
> Anil
> 
> 

-- 
View this message in context: http://old.nabble.com/Develop-a-new-BPEL-extension-tp26541549p26574856.html
Sent from the Apache Ode User mailing list archive at Nabble.com.


Re: Develop a new BPEL extension

Posted by BlueDiamond <gv...@in.com>.
Hi Tammo,

I developed a simple bpel process that returns output based on this
processing on input (XPath extension for pwd decryption):

            <copy>
                <from>string($inputVar.inputType/ns2:paramA)</from>
                <to>$encStr</to>
            </copy>

            <copy xmlns:ext="java:org.anil.PwdUtil">
                <from
expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">ext:encrypt(encStr)</from>
                <to>$outputVar.resultType/ns2:paramA</to>
            </copy>

There are encrypt() and decrypt() functions in PwdUtil class. When I invoke
encrypt(), I get valid response. When I call decrypt(), the input variable
to the function is blank "" and so things go wrong & my call fails. I added
other methods to class to verify but none got invoked. 
A simple test() method also failed interestingly. But encrypt() works!!!!!
Things don't work even if I have only 1 function in my class! I even tried
the expressionLanaguage "urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0" but
no difference. 

Is this some issue with Ode? I am currently testing this on WSO2 BPS 1.1
which is based on Apache Ode 2.0.

Thanks,
Anil



BlueDiamond wrote:
> 
> Tammo,
> Agreed. I understand the advantage withe XPath approach & that's what I
> wanted to do. But for now I have to try BPEL-X. Thanks for your detailing
> on the approach. I'll proceed. :-)
> 
> Thanks & Regards,
> Anil
> 
> 
> Tammo van Lessen wrote:
>> 
>> Hi Anil,
>> 
>> the benefit of an xpath extension is that you don't have do deal with 
>> accessing variables, thinking of from and to etc.
>> 
>> Anyways, as starting point for extension activities/assign operations, 
>> create a class implementing  AbstractSyncExtensionOperation and 
>> implement runSync with your custom code. The ExtensionContext will 
>> provide you all methods needed for accessing variables etc, the element 
>> contains the DOM element that is nested within the 
>> <extensionAssignOperation> element.
>> 
>> Then create a subclass of AbstractExtensionBundle, define the namespace 
>> and register your operation in registerExtensionActivities by calling 
>> registerExtensionOperation(...).
>> 
>> Finally, package these classes, add the jar to ODE's class path and 
>> register our bundle class in the ode-*.properties file.
>> 
>> HTH,
>>    Tammo
>> 
>> On 27.11.2009 13:24, BlueDiamond wrote:
>>>
>>> Thanks a lot Tammo for your quick reply&  for the solution. =)
>>> I considered this approach but currently, I have to find if developing a
>>> BPEL extension can possibly address this requirement. I think it should
>>> be
>>> possible but I am clueless as to how to develop one. :-((
>>>
>>> Thanks,
>>> Anil
>>>
>>>
>>> Tammo van Lessen wrote:
>>>>
>>>> Hi Anil,
>>>>
>>>> I think a custom XPath function is what you want. Please have a look at
>>>> http://www.intalio.org/confluence/display/PXE/Custom+XPath+Functions -
>>>> it should work the same with Apache ODE.
>>>>
>>>> HTH,
>>>>     Tammo
>>>>
>>>> On 27.11.2009 13:03, BlueDiamond wrote:
>>>>>
>>>>> Hey guys!
>>>>>
>>>>> I want to develop a new BPEL extension and despite going through the
>>>>> available documentation&   e4x sample, I couldn't really find a way to
>>>>> proceed.
>>>>>
>>>>> REQUIREMENT: I want to give encrypted password in my bpel file. I have
>>>>> a
>>>>> java class that provides decrypt method. How to invoke this method?
>>>>> e4x
>>>>> is
>>>>> for javascripts. Can I invoke this java method from e4x
>>>>> extensionAssignOperation? How?
>>>>>
>>>>> Regards=),
>>>>> Anil
>>>>
>>>>
>>>>
>>>
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Develop-a-new-BPEL-extension-tp26541549p26573554.html
Sent from the Apache Ode User mailing list archive at Nabble.com.


Re: Develop a new BPEL extension

Posted by BlueDiamond <gv...@in.com>.
Tammo,
Agreed. I understand the advantage withe XPath approach & that's what I
wanted to do. But for now I have to try BPEL-X. Thanks for your detailing on
the approach. I'll proceed. :-)

Thanks & Regards,
Anil


Tammo van Lessen wrote:
> 
> Hi Anil,
> 
> the benefit of an xpath extension is that you don't have do deal with 
> accessing variables, thinking of from and to etc.
> 
> Anyways, as starting point for extension activities/assign operations, 
> create a class implementing  AbstractSyncExtensionOperation and 
> implement runSync with your custom code. The ExtensionContext will 
> provide you all methods needed for accessing variables etc, the element 
> contains the DOM element that is nested within the 
> <extensionAssignOperation> element.
> 
> Then create a subclass of AbstractExtensionBundle, define the namespace 
> and register your operation in registerExtensionActivities by calling 
> registerExtensionOperation(...).
> 
> Finally, package these classes, add the jar to ODE's class path and 
> register our bundle class in the ode-*.properties file.
> 
> HTH,
>    Tammo
> 
> On 27.11.2009 13:24, BlueDiamond wrote:
>>
>> Thanks a lot Tammo for your quick reply&  for the solution. =)
>> I considered this approach but currently, I have to find if developing a
>> BPEL extension can possibly address this requirement. I think it should
>> be
>> possible but I am clueless as to how to develop one. :-((
>>
>> Thanks,
>> Anil
>>
>>
>> Tammo van Lessen wrote:
>>>
>>> Hi Anil,
>>>
>>> I think a custom XPath function is what you want. Please have a look at
>>> http://www.intalio.org/confluence/display/PXE/Custom+XPath+Functions -
>>> it should work the same with Apache ODE.
>>>
>>> HTH,
>>>     Tammo
>>>
>>> On 27.11.2009 13:03, BlueDiamond wrote:
>>>>
>>>> Hey guys!
>>>>
>>>> I want to develop a new BPEL extension and despite going through the
>>>> available documentation&   e4x sample, I couldn't really find a way to
>>>> proceed.
>>>>
>>>> REQUIREMENT: I want to give encrypted password in my bpel file. I have
>>>> a
>>>> java class that provides decrypt method. How to invoke this method? e4x
>>>> is
>>>> for javascripts. Can I invoke this java method from e4x
>>>> extensionAssignOperation? How?
>>>>
>>>> Regards=),
>>>> Anil
>>>
>>>
>>>
>>
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Develop-a-new-BPEL-extension-tp26541549p26542030.html
Sent from the Apache Ode User mailing list archive at Nabble.com.


Re: Develop a new BPEL extension

Posted by Tammo van Lessen <tv...@gmail.com>.
Hi Anil,

the benefit of an xpath extension is that you don't have do deal with 
accessing variables, thinking of from and to etc.

Anyways, as starting point for extension activities/assign operations, 
create a class implementing  AbstractSyncExtensionOperation and 
implement runSync with your custom code. The ExtensionContext will 
provide you all methods needed for accessing variables etc, the element 
contains the DOM element that is nested within the 
<extensionAssignOperation> element.

Then create a subclass of AbstractExtensionBundle, define the namespace 
and register your operation in registerExtensionActivities by calling 
registerExtensionOperation(...).

Finally, package these classes, add the jar to ODE's class path and 
register our bundle class in the ode-*.properties file.

HTH,
   Tammo

On 27.11.2009 13:24, BlueDiamond wrote:
>
> Thanks a lot Tammo for your quick reply&  for the solution. =)
> I considered this approach but currently, I have to find if developing a
> BPEL extension can possibly address this requirement. I think it should be
> possible but I am clueless as to how to develop one. :-((
>
> Thanks,
> Anil
>
>
> Tammo van Lessen wrote:
>>
>> Hi Anil,
>>
>> I think a custom XPath function is what you want. Please have a look at
>> http://www.intalio.org/confluence/display/PXE/Custom+XPath+Functions -
>> it should work the same with Apache ODE.
>>
>> HTH,
>>     Tammo
>>
>> On 27.11.2009 13:03, BlueDiamond wrote:
>>>
>>> Hey guys!
>>>
>>> I want to develop a new BPEL extension and despite going through the
>>> available documentation&   e4x sample, I couldn't really find a way to
>>> proceed.
>>>
>>> REQUIREMENT: I want to give encrypted password in my bpel file. I have a
>>> java class that provides decrypt method. How to invoke this method? e4x
>>> is
>>> for javascripts. Can I invoke this java method from e4x
>>> extensionAssignOperation? How?
>>>
>>> Regards=),
>>> Anil
>>
>>
>>
>


Re: Develop a new BPEL extension

Posted by BlueDiamond <gv...@in.com>.
Thanks a lot Tammo for your quick reply & for the solution. =)
I considered this approach but currently, I have to find if developing a
BPEL extension can possibly address this requirement. I think it should be
possible but I am clueless as to how to develop one. :-((

Thanks,
Anil


Tammo van Lessen wrote:
> 
> Hi Anil,
> 
> I think a custom XPath function is what you want. Please have a look at 
> http://www.intalio.org/confluence/display/PXE/Custom+XPath+Functions - 
> it should work the same with Apache ODE.
> 
> HTH,
>    Tammo
> 
> On 27.11.2009 13:03, BlueDiamond wrote:
>>
>> Hey guys!
>>
>> I want to develop a new BPEL extension and despite going through the
>> available documentation&  e4x sample, I couldn't really find a way to
>> proceed.
>>
>> REQUIREMENT: I want to give encrypted password in my bpel file. I have a
>> java class that provides decrypt method. How to invoke this method? e4x
>> is
>> for javascripts. Can I invoke this java method from e4x
>> extensionAssignOperation? How?
>>
>> Regards=),
>> Anil
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Develop-a-new-BPEL-extension-tp26541549p26541762.html
Sent from the Apache Ode User mailing list archive at Nabble.com.


Re: Develop a new BPEL extension

Posted by Tammo van Lessen <tv...@gmail.com>.
Hi Anil,

I think a custom XPath function is what you want. Please have a look at 
http://www.intalio.org/confluence/display/PXE/Custom+XPath+Functions - 
it should work the same with Apache ODE.

HTH,
   Tammo

On 27.11.2009 13:03, BlueDiamond wrote:
>
> Hey guys!
>
> I want to develop a new BPEL extension and despite going through the
> available documentation&  e4x sample, I couldn't really find a way to
> proceed.
>
> REQUIREMENT: I want to give encrypted password in my bpel file. I have a
> java class that provides decrypt method. How to invoke this method? e4x is
> for javascripts. Can I invoke this java method from e4x
> extensionAssignOperation? How?
>
> Regards=),
> Anil