on 2005 Oct 25 8:25 AM
Hello,
I'd like to configure Scheduler task with properties. I know that it is possible when service implements IService.
Interface com.sap.netweaver.rf.wrapper.IRFServiceWrapper extends IService and and class RFServiceWrapper implements that IRFServiceWrapper.
So I think I can configure portalapp.xml describing service RFServiceWrapper with properties. But I don't know how to pass fetched values of properties from that RFServiceWrapper to my scheduler task class, which implements ISchedulerTask (exteds java.lang.Object).
I appreciate any ideas.
Best regards,
Josef Motl
Hi Josef,
first, I would suggest to configure your own scheduler task via a configuration definition within the confif archive. That way, you can configure the task "where it is defined". See the great new PDF https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3cd2cfbb-0601-0010-3984-d0c... from it's page 65 on...
Second, anyhow, you could go the way you suggested, even if somewhat you'd misuse the RFServiceWrapper. Anyhow, you can call a service and it's properties generally the following way:
PortalRuntime.getRuntimeResources().getService(IRFServiceWrapper.KEY).getContext().getServiceProfile();
from here on everything should be straight forward, see https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/javadocs/nw04/sp12... runtime/com/sapportals/portal/prt/service/iserviceprofile.html for details.
Hope it helps
Detlev
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Detlev,
thank you, .pdf you mentioned helped me. But I have problem when deploying scheduler task par containing new version of config files to portal.
Firstly I deployed par without .co.xml and .cc.xml files to erase config of scheduler task. After that I deployed par with folowing files:
cz.pct.TSNotification.cc.xml
<ConfigClass name="cz.pct.TSNotification" extends="SchedulerTask">
<attribute name="class" type="class" constant="cz.pct.TSNotification"/>
<attribute name="name" type="string"/>
<attribute name="active" type="boolean"/>
<attribute name="description" type="string"/>
<attribute name="smtp_server" type="string"/>
</ConfigClass>
cz.pct.TSNotification.co.xml
<?xml version="1.0" encoding="UTF-8" ?>
<Configurable configclass="cz.pct.TSNotification">
<property name="name" value="Timesheet Scheduler Task" />
<property name="active" value="true" />
<property name="description" value="Scheduler task for Timesheet notifications" />
<property name="smtp_server" value="mail2.pct.cz" />
</Configurable>
.. but it didn't appear in task scheduler configuration iView. What's wrong?
Best regards,
Josef Motl
Hi Detlev,
with my older cz.pct.TSNotification.cc.xml file:
<ConfigClass name="cz.pct.TSNotification" extends="SchedulerTask">
<attribute name="class" type="class" constant="cz.pct.TSNotification"/>
<attribute name="smtp_server" type="string"/>
</ConfigClass>
.. I put scheduler task to run.. but, when I tried to access service as you described, I get an error:
com.sapportals.portal.prt.service.ServiceException: Service not found: cz.pct.TSNotification
(cz.pct.TSNotification is key of my RFServiceWrapper).
What's wrong?
Best regards,
Josef Motl
User | Count |
---|---|
82 | |
12 | |
10 | |
10 | |
10 | |
9 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.