getting resource attributes

Hi All,

I need to get the resource attributes (like host,port no) from the resource.

I used getobj and getObject method but I am getting errors.

this is the code i am using,

<Action id='0'>

<expression>

<block name='testobj' trace='true'>

<invoke name='getAttribute'>

<invoke name='getObject'>

<ref>:display.session</ref>

<s>Resource</s>

<ref>LDAP</ref>

</invoke>

<s>host</s>

</invoke>

</block>

</expression>

</Action>

but the host value is not returning and also the session is returning a null value.

any help will be appreciated

thanks in advance

[808 byte] By [dortmund_developer] at [2007-11-26 8:18:43]
# 1

This should do it:

<invoke name='getResourceAttributeVal'>

<getobj>

<s>Resource:</s>

<invoke name='getVariable'>

<ref>WF_CONTEXT</ref>

<s>source</s>

</invoke>

</getobj>

<s>AttributeKey</s>

</invoke>

mklugACN at 2007-7-6 21:21:05 > top of Java-index,Web & Directory Servers,Directory Servers...
# 2
Thanks for the reply.under source i have given resource name and under attributekey i have given resource attribute name but it's returning null value, do you have anyidea.Thanks
dortmund_developer at 2007-7-6 21:21:05 > top of Java-index,Web & Directory Servers,Directory Servers...
# 3

That code will work for an Active Sync WF where the literal string "source" is the Active Sync Resource.

What about doing:

<getobj>

<s>Resource:</s>

<s>ResourceName</s>

<getobj>

Instead of the "getVariable" invoke - just put the ResourceName - but I think you siad you tried this...

mklugACN at 2007-7-6 21:21:05 > top of Java-index,Web & Directory Servers,Directory Servers...
# 4

In a workflow, you could do a getView of the resource and then access its attributes.

Or in a form you could use the below

<invoke name='getResourceAttributeVal'>

<invoke name='getObject'>

<ref>:display.session</ref>

<s>Resource</s>

<s>Test Resource</s>

</invoke>

<s>Host</s>

</invoke>

chits98 at 2007-7-6 21:21:05 > top of Java-index,Web & Directory Servers,Directory Servers...
# 5

thanks for the reply

I need to do in workflow.

I did it in workflow, please see the below code, but for Id argument i passed directly the resource name, is it the right way to do.

<Action id='0' name='getResourceView' application='com.waveset.session.WorkflowServices'>

<Argument name='op' value='getView'/>

<Argument name='type' value='Resource'/>

<Argument name='id' value='LDAP'/>

<Argument name='subject' value='$(WF_CASE_OWNER)'/>

<Argument name='authorized' value='true'/>

<Return from='view' to='resourceownerview'/>

</Action>

<Action id='1'>

<expression>

<block name='resview' trace='true'>

<ref>resourceownerview</ref>

</block>

</expression>

</Action>

after running the workflow, the resourceownerview is returning (GenericObject:LDAP). but now i am afraid how to retrive the attributes from this object.

i don't know how to pass expressions for a resource object.

if anybody knows, please do let me know.

thanks in advance

dortmund_developer at 2007-7-6 21:21:05 > top of Java-index,Web & Directory Servers,Directory Servers...
# 6
you can now access the attributes using<ref>resourceownerview.resourceAttributes[Host].value</ref><ref>resourceownerview.resourceAttributes[User].value</ref>etc
chits98 at 2007-7-6 21:21:05 > top of Java-index,Web & Directory Servers,Directory Servers...
# 7
Thanks chits, I managed to do with resource view.thanks
dortmund_developer at 2007-7-6 21:21:05 > top of Java-index,Web & Directory Servers,Directory Servers...