I am trying to get all events within a time-range. This is my CalDAV request body:
<?xml version="1.0" encoding="UTF-8"?>
<C:calendar-query xmlns:C="urn:ietf:params:xml:ns:caldav">
<D:prop xmlns:D="DAV:">
<C:calendar-data />
</D:prop>
<C:filter>
<C:comp-filter name="VEVENT">
<C:time-range end="20200920T134847" start="20200919T134847" />
</C:comp-filter>
</C:filter>
</C:calendar-query>
As can be seen, I use the time-range component filter.
Unfortunately, this also returns events outside the time-range:
...
DTSTART;TZID=Europe/Amsterdam:20200522T111028
DTEND;TZID=Europe/Amsterdam:20200522T121028
...
Can anyone see what is going wrong?
I saw this and this example which puts the VEVENT comp-filter within a VCALENDAR comp-filter like this:
<?xml version="1.0" encoding="UTF-8"?>
<c:calendar-query xmlns:c="urn:ietf:params:xml:ns:caldav" xmlns:d="DAV:">
<d:prop>
<d:getetag>
<c:calendar-data>
<c:comp name="VCALENDAR">
<c:prop name="VERSION">
<c:comp name="VEVENT">
<c:prop name="SUMMARY">
<c:prop name="UID">
<c:prop name="DTSTART">
<c:prop name="DTEND">
<c:prop name="DURATION">
<c:prop name="RRULE">
<c:prop name="RDATE">
<c:prop name="EXRULE">
<c:prop name="EXDATE">
<c:prop name="RECURRENCE-ID" />
</c:prop>
</c:prop>
</c:prop>
</c:prop>
</c:prop>
</c:prop>
</c:prop>
</c:prop>
</c:prop>
</c:comp>
<c:comp name="VTIMEZONE" />
</c:prop>
</c:comp>
</c:calendar-data>
</d:getetag>
</d:prop>
<c:filter>
<c:comp-filter name="VCALENDAR">
<c:comp-filter name="VEVENT">
<c:time-range start="20060104T000000Z" end="20060105T000000Z" />
</c:comp-filter>
</c:comp-filter>
</c:filter>
</c:calendar-query>
So I tried the following:
<?xml version="1.0" encoding="UTF-8"?>
<C:calendar-query xmlns:C="urn:ietf:params:xml:ns:caldav">
<D:prop xmlns:D="DAV:">
<C:calendar-data />
</D:prop>
<C:filter>
<C:comp-filter name="VCALENDAR">
<C:comp-filter name="VEVENT">
<C:time-range end="20200920T135938" start="20200919T135938" />
</C:comp-filter>
</C:comp-filter>
</C:filter>
</C:calendar-query>
But then Google gives the following error message:
<?xml version="1.0" encoding="UTF-8"?>
<errors xmlns="http://schemas.google.com/g/2005">
<error>
<domain>GData</domain>
<code>badRequest</code>
<internalReason>Bad Request</internalReason>
</error>
</errors>
I can't seem to figure out what is wrong.
//update:
I tried the example from icalendar.org, which seems to work. The only problem is that I can't replicate that request body with caldav4j.
I also tried to copy the exact example from caldav4j:
<?xml version="1.0" encoding="UTF-8"?>
<C:calendar-query xmlns:C="urn:ietf:params:xml:ns:caldav">
<D:prop xmlns:D="DAV:">
<D:getetag />
<C:calendar-data>
<C:comp name="VCALENDAR">
<C:comp name="VEVENT">
<C:prop name="SUMMARY" />
<C:prop name="UID" />
<C:prop name="DTSTART" />
<C:prop name="DTEND" />
<C:prop name="DURATION" />
<C:prop name="RRULE" />
<C:prop name="RDATE" />
<C:prop name="EXRULE" />
<C:prop name="EXDATE" />
<C:prop name="RECURRENCE-ID" />
</C:comp>
<C:comp name="VTIMEZONE" />
<C:prop name="VERSION" />
</C:comp>
</C:calendar-data>
</D:prop>
<C:filter>
<C:comp-filter name="VCALENDAR">
<C:comp-filter name="VEVENT">
<C:time-range end="20200920T161921" start="20200919T161921" />
</C:comp-filter>
</C:comp-filter>
</C:filter>
</C:calendar-query>
Unfortunately it gave another badRequest response.
In the end, I ended up switching to another CalDAV server (Radicale) for server-side logging. It turned out that the time notation should end with a "Z".
Related
I am trying to get results from BargainFinderMaxRQ for Alternate Days, like in plus 3 days or minus 3 days. It always shows No Availability error in response. By the way, the simple request works perfectly. Please, can anyone help?
API Request:
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
</SOAP-ENV:Header><SOAP-ENV:Body><OTA_AirLowFareSearchRQ xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Target="Production" Version="4.2.0" ResponseType="OTA" ResponseVersion="4.2.0">
<POS>
<Source PseudoCityCode="8YXD">
<RequestorID ID="1" Type="1">
<CompanyName Code="TN" />
</RequestorID>
</Source>
</POS>
<OriginDestinationInformation RPH="1">
<DepartureDateTime>2018-08-23T00:00:00</DepartureDateTime>
<OriginLocation LocationCode="DXB" />
<DestinationLocation LocationCode="KHI" />
<TPA_Extensions>
<DateFlexibility NbrOfDays="2"/>
<SegmentType Code="O" />
</TPA_Extensions>
</OriginDestinationInformation>
<OriginDestinationInformation RPH="2">
<DepartureDateTime>2018-08-30T00:00:00</DepartureDateTime>
<OriginLocation LocationCode="KHI" />
<DestinationLocation LocationCode="DXB" />
<TPA_Extensions>
<DateFlexibility NbrOfDays="2"/>
<SegmentType Code="O" />
</TPA_Extensions>
</OriginDestinationInformation>
<TravelPreferences ValidInterlineTicket="true" MaxStopsQuantity="0">
<CabinPref PreferLevel="Preferred" Cabin="Y" />
<TPA_Extensions>
<TripType Value="Return" />
<LongConnectTime Min="780" Max="1200" Enable="true"/>
<ExcludeCallDirectCarriers Enabled="true"/>
</TPA_Extensions>
</TravelPreferences>
<TravelerInfoSummary>
<SeatsRequested>1</SeatsRequested>
<AirTravelerAvail>
<PassengerTypeQuantity Code="ADT" Quantity="1" />
</AirTravelerAvail>
<PriceRequestInformation CurrencyCode="PKR" >
<TPA_Extensions>
</TPA_Extensions>
</PriceRequestInformation>
</TravelerInfoSummary>
<TPA_Extensions>
<IntelliSellTransaction Debug="0">
<RequestType Name="ALTDATES"/>
</IntelliSellTransaction>
</TPA_Extensions>
</OTA_AirLowFareSearchRQ></SOAP-ENV:Body></SOAP-ENV:Envelope>
This needs to be activated by the account manager as Thomas mentioned.
PLEASE MAKE THREE CHANGES AND IT WILL WORK PERFECTLY
1) SET ACTION NAME AS BargainFinderMax_ADRQ
<eb:Service eb:type="OTA">BargainFinderMax_ADRQ</eb:Service>
<eb:Action>BargainFinderMax_ADRQ</eb:Action>
2) SET NUMBER OF DAYS FOR FLEXIBILITY
<DateFlexibility NbrOfDays="1"/> OR
<DateFlexibility NbrOfDays="3"/> OR
<DateFlexibility NbrOfDays="7"/>
3) SET REQUEST TYPE NAME
<RequestType Name="AD1"/> OR
<RequestType Name="AD3"/> OR
<RequestType Name="AD7"/>
I'm developing with sabre soap api.
Now, I want to create passenger detail with all passenger types (ADT, CNN, INF)
I have a problem with infant type.
When I post the PassengerDetailRQ -> return 200
But in the EndTransaction response, I received an applicationResults's error message.
I have followed by this link . But not working.
Please tell me how to resolve this problem. Thanks!!!
You can see in the below:
PassengerDetail request:
<PassengerDetailsRQ xmlns="http://services.sabre.com/sp/pd/v3_3" version="3.3.0" IgnoreOnError="true" HaltOnError="false">
<PostProcessing IgnoreAfter="false" RedisplayReservation="true" UnmaskCreditCard="false" />
<PreProcessing IgnoreBefore="false">
<UniqueID ID=""/>
</PreProcessing>
<PriceQuoteInfo>
<Link HostedCarrier="true" NameNumber="1.1" Record="1"/>
<Link HostedCarrier="true" NameNumber="2.1" Record="1"/>
<Link HostedCarrier="true" NameNumber="3.1" Record="2"/>
<Link HostedCarrier="true" NameNumber="4.1" Record="3"/>
</PriceQuoteInfo>
<SpecialReqDetails>
<AddRemarkRQ>
<RemarkInfo>
<Remark Code="H" SegmentNumber="A" Type="General">
<Text>TEST REMARK</Text>
</Remark>
</RemarkInfo>
</AddRemarkRQ>
<SpecialServiceRQ>
<SpecialServiceInfo>
<SecureFlight SegmentNumber="A">
<PersonName DateOfBirth="1980-01-01" Gender="M" NameNumber="1.1">
<GivenName>FATHER MR</GivenName>
<Surname>SUR</Surname>
</PersonName>
</SecureFlight>
<SecureFlight SegmentNumber="A">
<PersonName DateOfBirth="1989-06-25" Gender="F" NameNumber="2.1">
<GivenName>MOTHER MRS</GivenName>
<Surname>LINUX</Surname>
</PersonName>
</SecureFlight>
<SecureFlight SegmentNumber="A">
<PersonName DateOfBirth="2010-03-23" Gender="F" NameNumber="3.1">
<GivenName>CHILD MS</GivenName>
<Surname>SUR</Surname>
</PersonName>
</SecureFlight>
<SecureFlight SegmentNumber="A">
<PersonName DateOfBirth="2018-01-23" Gender="MI" NameNumber="4.1">
<GivenName>INFANT MSTR</GivenName>
<Surname>SUR</Surname>
</PersonName>
</SecureFlight>
<Service SegmentNumber="A" SSR_Code="CHLD">
<PersonName NameNumber="3.1" />
<Text>23MAR10</Text>
</Service>
<Service SegmentNumber="A" SSR_Code="INFT">
<PersonName NameNumber="1.1" />
<Text>SUR/INFANT MSTR/23SEP17</Text>
</Service>
</SpecialServiceInfo>
</SpecialServiceRQ>
</SpecialReqDetails>
<TravelItineraryAddInfoRQ>
<AgencyInfo>
<Ticketing TicketType="7T-"/>
</AgencyInfo>
<CustomerInfo>
<ContactNumbers>
<ContactNumber NameNumber="1.1" LocationCode="HAN" Phone="091-666-3333" PhoneUseType="B"/>
</ContactNumbers>
<Email Address="LYVIETANH#GMAIL.COM" NameNumber="1.1" ShortText="ABC123" Type="CC"/>
<PersonName Infant="false" NameNumber="1.1" PassengerType="ADT">
<GivenName>FATHER MR</GivenName>
<Surname>SUR</Surname>
</PersonName>
<PersonName Infant="false" NameNumber="2.1" PassengerType="ADT">
<GivenName>MOTHER MRS</GivenName>
<Surname>LINUX</Surname>
</PersonName>
<PersonName Infant="false" NameNumber="3.1" PassengerType="CNN" NameReference="C02">
<GivenName>CHILD MS</GivenName>
<Surname>SUR</Surname>
</PersonName>
<PersonName Infant="true" NameNumber="4.1" PassengerType="INF" NameReference="I13">
<GivenName>INFANT MSTR</GivenName>
<Surname>SUR</Surname>
</PersonName>
</CustomerInfo>
</TravelItineraryAddInfoRQ>
</PassengerDetailsRQ>
PassengerDetail response:
<PassengerDetailsRS xmlns="http://services.sabre.com/sp/pd/v3_3">
<ApplicationResults xmlns="http://services.sabre.com/STL_Payload/v02_01" status="Complete">
<Success timeStamp="2018-06-15T12:11:26.163-05:00"/>
<Warning type="BusinessLogic" timeStamp="2018-06-15T12:11:25.226-05:00">
<SystemSpecificResults>
<Message code="WARN.SWS.HOST.ERROR_IN_RESPONSE">.INVALID ACTION</Message>
</SystemSpecificResults>
</Warning>
<Warning type="BusinessLogic" timeStamp="2018-06-15T12:11:25.451-05:00">
<SystemSpecificResults>
<Message code="WARN.SWS.HOST.ERROR_IN_RESPONSE">CHECK ITINERARY</Message>
</SystemSpecificResults>
</Warning>
</ApplicationResults>
<TravelItineraryReadRS>
<TravelItinerary>
<CustomerInfo>
<ContactNumbers>
<ContactNumber LocationCode="HAN" Phone="091-666-3333-B-1.1" RPH="001"/>
</ContactNumbers>
<PersonName WithInfant="false" NameNumber="01.01" RPH="1">
<Email Comment="CC/ABC123">LYVIETANH#GMAIL.COM</Email>
<GivenName>FATHER MR</GivenName>
<Surname>SUR</Surname>
</PersonName>
<PersonName WithInfant="false" NameNumber="02.01" RPH="2">
<GivenName>MOTHER MRS</GivenName>
<Surname>LINUX</Surname>
</PersonName>
<PersonName WithInfant="false" NameNumber="03.01" NameReference="C02" RPH="3">
<GivenName>CHILD MS</GivenName>
<Surname>SUR</Surname>
</PersonName>
<PersonName WithInfant="true" NameNumber="04.01" NameReference="I13" RPH="4">
<GivenName>INFANT MSTR</GivenName>
<Surname>SUR</Surname>
</PersonName>
</CustomerInfo>
<ItineraryInfo>
... I REMOVED THIS DATA ...
</ItineraryInfo>
<RemarkInfo>
<Remark RPH="001" Type="General">
<Text>TEST REMARK</Text>
</Remark>
</RemarkInfo>
<SpecialServiceInfo RPH="001" Type="AFX">
<Service SSR_Code="OSI">
<PersonName NameNumber="04.01">I/SUR/INFANT MSTR</PersonName>
<Text>VN INF</Text>
</Service>
</SpecialServiceInfo>
</TravelItinerary>
</TravelItineraryReadRS>
EndTransaction request:
<EndTransactionRQ Version="2.0.8" xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<EndTransaction Ind="true" />
<Source ReceivedFrom="SWS TEST" />
</EndTransactionRQ>
EndTransaction response:
<EndTransactionRS xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:stl="http://services.sabre.com/STL/v01" Version="2.0.8">
<stl:ApplicationResults status="NotProcessed">
<stl:Error type="BusinessLogic" timeStamp="2018-06-15T12:11:31-05:00">
<stl:SystemSpecificResults>
<stl:Message>INFANT DETAILS REQUIRED IN SSR - ENTER 4INFT/...</stl:Message>
<stl:ShortText>ERR.SWS.HOST.ERROR_IN_RESPONSE</stl:ShortText>
</stl:SystemSpecificResults>
</stl:Error>
</stl:ApplicationResults>
</EndTransactionRS>
If you check in the response PassengerDetailsRS/TravelItineraryReadRS/TravelItinerary/SpecialServiceInfo you'll see that none of the special services were added, and for that reason it is requested at the time of the EndTransaction call.
Without knowing the status of the itinerary, it is impossible to state the cause of the 2 warnings returned:
<ApplicationResults xmlns="http://services.sabre.com/STL_Payload/v02_01" status="Complete">
<Success timeStamp="2018-06-15T12:11:26.163-05:00"/>
<Warning type="BusinessLogic" timeStamp="2018-06-15T12:11:25.226-05:00">
<SystemSpecificResults>
<Message code="WARN.SWS.HOST.ERROR_IN_RESPONSE">.INVALID ACTION</Message>
</SystemSpecificResults>
</Warning>
<Warning type="BusinessLogic" timeStamp="2018-06-15T12:11:25.451-05:00">
<SystemSpecificResults>
<Message code="WARN.SWS.HOST.ERROR_IN_RESPONSE">CHECK ITINERARY</Message>
</SystemSpecificResults>
</Warning>
</ApplicationResults>
I would guess UC segments in the itinerary.
Between the "CHECK ITINERARY" error and the "ENTER 4INFT/..." message on save, it would appear you are working with an AA itinerary, and are sending a 3INFT command.
When airline is AA, you need to switch almost all commands starting with a 3 to starting with a 4. ie instead of sending 3INFT/... you send 4INFT/...
Hope this helps!
Per's answer was a big part of the solution. For completeness here is what I ended up having to do.
First, I had to fix the AMD problem that Per mentioned.
Then I had to modify my Xpage to make sure that the proper libraries were loaded in the proper order. Some of this was done with trial and error.
I had to set the resource aggregation setting to true, but only for this design element. I do not understand why.
Then I needed to add 2 js libraries and one css library. The moment library had to be loaded first and by using a the head tag. Next I had to load the fullcalendar.min.js file but NOT using the headTag but a simple script, and then the css for fullcalendar using the style tag.
Doing this everything worked. Below is the code, and below that is my theme.....
Design code:
<xp:this.properties>
<xp:parameter name="xsp.resources.aggregate" value="true" />
</xp:this.properties>
<div class="cal"></div>
<xp:this.resources>
<xp:headTag tagName="script">
<xp:this.attributes>
<xp:parameter name="type" value="text/javascript" />
<xp:parameter name="src" value="FullCalendar/moment.min.js" />
</xp:this.attributes>
</xp:headTag>
<xp:script src="FullCalendar/fullcalendar.min.js"
clientSide="true">
</xp:script>
<xp:styleSheet href="FullCalendar/fullcalendar.min.css"></xp:styleSheet>
</xp:this.resources>
<xp:panel id="CalendarContainer"></xp:panel>
<xp:scriptBlock id="scriptBlock1">
<xp:this.value><![CDATA[$(document).ready(function() {
var calCon = $(".cal");
calCon.fullCalendar({});
})]]></xp:this.value>
</xp:scriptBlock>
</xp:view>
Theme code:
<!--
Use this pattern to include resources (such as style sheets
and JavaScript files that are used by this theme.
-->
<theme
extends="Bootstrap3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="platform:/plugin/com.ibm.designer.domino.stylekits/schema/stylekit.xsd">
<resource>
<content-type>application/x-javascript</content-type>
<href>/.ibmxspres/domino/KendoUI/js/jquery.min.js</href>
</resource>
--><resource>
<content-type>text/css</content-type>
<href>/.ibmxspres/domino/KendoUI/styles/kendo.common.min.css</href>
</resource>
<resource>
<content-type>text/css</content-type>
<href>/.ibmxspres/domino/KendoUI/styles/kendo.blueopal.min.css</href>
</resource>
<resource>
<content-type>application/x-javascript</content-type>
<href>/.ibmxspres/domino/KendoUI/js/kendo.all.min.js</href>
</resource>
</theme>
==================================================================
I want to use FullCalendar in my Xpages applications.
This code will work, as long as I don't use my standard theme. So "webstandard" and "platform default" are no problem, but Bootstrap doesn't work, nor my theme which extends bootstrap (see below)
<theme
extends="Bootstrap3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="platform:/plugin/com.ibm.designer.domino.stylekits/schema/stylekit.xsd">
<resource>
<content-type>application/x-javascript</content-type>
<href>/.ibmxspres/domino/KendoUI/js/jquery.min.js</href>
</resource>
--><resource>
<content-type>text/css</content-type>
<href>/.ibmxspres/domino/KendoUI/styles/kendo.common.min.css</href>
</resource>
<resource>
<content-type>text/css</content-type>
<href>/.ibmxspres/domino/KendoUI/styles/kendo.blueopal.min.css</href>
</resource>
<resource>
<content-type>application/x-javascript</content-type>
<href>/.ibmxspres/domino/KendoUI/js/kendo.all.min.js</href>
</resource>
</theme>
When I try to use my theme I get this error:
Uncaught TypeError: calCon.fullCalendar is not a function
I tried putting the js/css that I need to use in my theme, in the order that they need to be used, but this didn't work either.
I use the scoBootstrap throughout many applications, and don't want to not use it in applications that need a calendar. There must be some way for my javascript to live together...
Here is the code for the Xpage:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:this.properties>
<xp:parameter name="xsp.resources.aggregate" value="true" />
</xp:this.properties>
<div class="cal"></div>
<xp:this.resources>
<xp:headTag tagName="script">
<xp:this.attributes>
<xp:parameter name="type" value="text/javascript" />
<xp:parameter name="src" value="KendoUI/js/jquery.min.js" />
</xp:this.attributes>
</xp:headTag>
<xp:headTag tagName="script">
<xp:this.attributes>
<xp:parameter name="type" value="text/javascript" />
<xp:parameter name="src" value="FullCalendar/moment.min.js" />
</xp:this.attributes>
</xp:headTag>
<xp:headTag tagName="script">
<xp:this.attributes>
<xp:parameter name="type" value="text/javascript" />
<xp:parameter name="src" value="FullCalendar/fullcalendar.min.js" />
</xp:this.attributes>
</xp:headTag>
<xp:headTag tagName="script">
<xp:this.attributes>
<xp:parameter name="type" value="text/javascript" />
<xp:parameter name="src" value="FullCalendar/fullcalendar.min.js" />
</xp:this.attributes>
</xp:headTag>
<xp:styleSheet href="FullCalendar/fullcalendar.min.css"></xp:styleSheet>
</xp:this.resources>
<xp:panel id="CalendarContainer"></xp:panel>
<xp:scriptBlock id="scriptBlock1">
<xp:this.value><![CDATA[$(document).ready(function() {
var calCon = $(".cal");
calCon.fullCalendar({});
})]]></xp:this.value>
</xp:scriptBlock>
</xp:view>
FullCalendar uses AMD loading. Dojo and AMD loading conflicts so remove the AMD part from fullcalendar.min.js.
Change the first part of the source from this:
!function(t){"function"==typeof define&&define.amd?define
to this:
!function(t){"function"==typeof define&&false?define
I am relatively new to Spring MVC framework and it's logging concepts. When I run an application and an exception occurs(For Ex: NullPointerException), the stack trace is being displayed on the browser itself. the console just says there is an exception.
My problem is that most of the stack trace is not visible on the browser because the layout does not have enough width. Is there a way to make the stack trace print in the console? Thanks.
Here is my log4j.xml in case:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN" "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<!-- Appenders -->
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-5p: %c - %m%n" />
</layout>
</appender>
<!-- Application Loggers -->
<logger name="com.npc">
<level value="info" />
</logger>
<!-- 3rdparty Loggers -->
<logger name="org.springframework.core">
<level value="info" />
</logger>
<logger name="org.hibernate">
<level value="info" />
</logger>
<logger name="org.springframework.beans">
<level value="info" />
</logger>
<logger name="org.springframework.context">
<level value="info" />
</logger>
<logger name="org.springframework.web">
<level value="info" />
</logger>
<!-- Root Logger -->
<root>
<priority value="info" />
<appender-ref ref="console" />
<appender-ref ref="file" />
</root>
</log4j:configuration>
Try specify
<param name="ConversionPattern" value="%-5p: %c - %m%n%ex" />
I am starting with spring web flow, reading and following the documentation. I have created a new flow:
test-flow.xml
<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">
<var name="testName" class="com.project.TestView" />
<view-state id="test">
<on-entry>
<set name="flowScope.name" value="testName.name" />
</on-entry>
<transition on="test" to="saveName"/>
</view-state>
<subflow-state id="subTest" subflow="testSub-flow">
<input name="nameVar" value="name" />
<transition to="error" />
</subflow-state>
<view-state id="error" />
<end-state id="finish" />
</flow>
And I am trying to create a testSub-flow.xml
<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">
<input type="String" name="nameVar" />
<on-start>
<evaluate expression="com.project.TestView.printSomething(nameVar)" result="flowScope.testPrint" />
</on-start>
<view-state id="printTest" >
<transition on="restart" to="endSub" />
</view-state>
<end-state id="endSub" />
</flow>
The method called is:
#Transactional(readOnly = true)
public String printSomething(String text){
System.out.print(text + " this is a test");
return text + " this is a test";
}
I get some exception in the browser when it is loading the main flow, test-flow.xml
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing [AnnotatedAction#6ca837 targetAction = [EvaluateAction#7aed3a expression = com.project.TestView.printSomething(nameVar), resultExpression = flowScope.testPrint], attributes = map[[empty]]] in state 'null' of flow 'test' -- action execution attributes were 'map[[empty]]'
What could be the problem?? Thanks in advance.
At first sight, it seems that it can not find any start-state. Try adding start-state attribute in flow tag:
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"
start-state="test">
If that does not fix the problem, it could be that flow builder can not find a state named "saveName". The problem could be in this line:
<transition on="test" to="saveName"/>
If you want to invoke the subflow when "test" event occurs, you write "subTest" instead of "saveName" in order to call the subflow.
So, that line should be:
<transition on="test" to="subTest"/>
Also, note that you are not specifying any view for those view-states.
Hope this helps.