-
15. Re: Access ODE's User-defined process properties via RiftSaw
rcernich Feb 12, 2013 12:39 PM (in response to igarashitm)In addition to dynamically setting the property values, they may also be configured through system properties, which override anything in the switchyard.xml. Just another complication.
-
16. Re: Access ODE's User-defined process properties via RiftSaw
jeff.yuchang Feb 12, 2013 7:41 PM (in response to igarashitm)Hi Tomo,
Yes, change it directly. As I said, you put the properties in the Context class, this class is accessable from the BpelEngine. Was thinking that you can do something like following:
BpelProcess.java
public Node getProcessProperty(QName propertyName) {
Node value = getEngine()._contexts.containerProperties.getProperty(propertyName);
if (value != null) {
return value;
}
Map<QName, Node> properties = _pconf.getProcessProperties();
if (properties != null) {
return properties.get(propertyName);
}
return null;
}
Here I made the 'containerProperties' name up. So in the BPELActivator class, you inject the value into containerProperties.
Regards
Jeff
-
17. Re: Access ODE's User-defined process properties via RiftSaw
objectiser Feb 13, 2013 6:36 AM (in response to jeff.yuchang)Hi Tomo
Have just added the ability to supply the BPEL process name (QName) as the first parameter to the custom XPath function, to provide some context to the method.
Not sure if its possible, but if you can obtain a static reference to the switchyard runtime, then could you access the app containing the supplied process name, as a way to obtain the config?
Regards
Gary
-
18. Re: Access ODE's User-defined process properties via RiftSaw
dward Feb 13, 2013 10:19 AM (in response to jeff.yuchang)Just to re-iterate, we will not be providing a way to "get all properties" from various sources, and copy them someplace. We only provide a way to resolve a property by name. So we can't "put the properties in the Context class", but maybe we can "put a PropertyResolver in the Context class", and use it from there?
-
19. Re: Access ODE's User-defined process properties via RiftSaw
igarashitm Feb 13, 2013 11:37 AM (in response to dward)@David, @Jeff,
Yep, so "containerProperties" should be able to invoke PropertyResolver.resolveProperty(). I think that means riftsaw-ode should depend on SwitchYard PropertyResolver *OR* have a generic pluggable point in the "Contexts". We can't choose former as we talked above. I don't have any good idea for latter right now by design of riftsaw-ode.
@Gary,
We're eventually going to bundle like this with BPEL component, and then BPELActivator.activateService() or BPELExchangeHandler would put each PropertyResolver via SwitchYardPropertyResolverXPathFunction.setPropertyResolver() . Is that reasonable for us?
https://gist.github.com/igarashitm/4945785
Thanks,
Tomo
-
20. Re: Access ODE's User-defined process properties via RiftSaw
dward Feb 13, 2013 11:41 AM (in response to igarashitm)I think that means riftsaw-ode should depend on SwitchYard PropertyResolver *OR* have a generic pluggable point in the "Contexts". We can't choose former as we talked above. I don't have any good idea for latter right now by design of riftsaw-ode.
I don't believe riftsaw-ode should have a dependency on SwitchYard. It would be better if they provided an interface we can implement, then plug in.
...or BPELExchangeHandler would put each PropertyResolver via SwitchYardPropertyResolverXPathFunction.setPropertyResolver() .
What do you mean "each PropertyResolver"? There only needs to be one, but that one can be a CompoundPropertyResolver (which can wrap multiple others).
-
21. Re: Access ODE's User-defined process properties via RiftSaw
dward Feb 13, 2013 11:42 AM (in response to dward)...or BPELExchangeHandler would put each PropertyResolver via SwitchYardPropertyResolverXPathFunction.setPropertyResolver() .
What do you mean "each PropertyResolver"? There only needs to be one, but that one can be a CompoundPropertyResolver (which can wrap multiple others).
Nevermind. I just saw your gist. You mean one PropertyResolver per process. Sorry!
-
22. Re: Access ODE's User-defined process properties via RiftSaw
objectiser Feb 13, 2013 11:44 AM (in response to igarashitm)Hi Tomo
Yes I think this should work.
Regards
Gary
-
23. Re: Access ODE's User-defined process properties via RiftSaw
igarashitm Feb 14, 2013 7:38 PM (in response to objectiser)Hi Gary,
OK, that's working basically... confirmed the resolveProperty() has been invoked.
https://github.com/igarashitm/components/tree/SWITCHYARD-1306
just one trivial question - how can I pass a string literal to the custom function? single quote doesn't work expectedly as well.
Thanks,
Tomo
-
24. Re: Access ODE's User-defined process properties via RiftSaw
igarashitm Feb 15, 2013 6:35 AM (in response to igarashitm)It works with following expression
<bpel:copy> <bpel:from xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:property="java:org.switchyard.component.bpel.riftsaw.SwitchYardPropertyFunction" expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"> <![CDATA[concat(property:resolveProperty(fn:QName("", "Greeting")), $ReceiveSayHelloVar.parameters/tns:input)]]> </bpel:from> <bpel:to part="parameters" variable="ReplySayHelloVar"> <bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[tns:result]]></bpel:query> </bpel:to> </bpel:copy>
hmm, verbose.
-
25. Re: Access ODE's User-defined process properties via RiftSaw
objectiser Feb 15, 2013 7:39 AM (in response to igarashitm)Sorry Tomo - should be sorted now, to allow single quoted string literals. Riftsaw artifacts have been deployed to nexus, so should be available during next switchyard build.
Regards
Gary
-
26. Re: Access ODE's User-defined process properties via RiftSaw
igarashitm Feb 15, 2013 8:27 AM (in response to objectiser)Now it works with single quoted string literal! I didn't think it would be supported. Thanks a lot for your support, Gary.