The cron-expression element is invalid - cron

I'm trying to use quartz_jobs.xml to schedule all my jobs, but the following XML results in an error:
The cron-expression element is invalid. The value '0 0 23 1/1 * ? *' is invalid according to its datatype.
Here's the XML:
<?xml version="1.0" encoding="utf-8" ?>
<job-scheduling-data xmlns="http://www.quartz-scheduler.org/xml/JobSchedulingData"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.quartz-scheduler.org/xml/JobSchedulingData http://www.quartz-scheduler.org/xml/job_scheduling_data_1_8.xsd"
version="1.8">
<schedule>
<job>
<name>AUI</name>
<group>Group1</group>
<description>Archive Unpublished Incidents</description>
<job-class>ArchiveUnpublishedIncidents</job-class>
</job>
<trigger>
<cron>
<name>AUITrigger</name>
<group>TriggerGroup1</group>
<job-name>AUI</job-name>
<job-group>Group1</job-group>
<!-- trigger every night at 11 pm -->
<cron-expression>0 0 23 1/1 * ? *</cron-expression>
</cron>
</trigger>
</schedule>
</job-scheduling-data>
What is wrong with that cron expression?

This document suggest that if you're specifying 7 elements, the last needs to be a year or year range. The year field is marked as optional, and consequently doesn't seem to be specifiable as a wildcard.

Just give
0 0 23 1/1 * ?
remove the * after question mark as quartz will take only 6 characters.

Related

AttributeError: ResultSet object has no attribute 'get_text'. You're probably treating a list of elements like a single element

I got the following list of lists from parsing with Bs4 through the snippet:
details = [i.find_all('span', {'class':re.compile('item')}) for i in cars]
[[<span class="item">Red <small>col.</small></span>,
<span class="item">120 <small>cc.</small></span>,
<span class="item">Available <small>in four days</small></span>,
<span class="item"><small class="txt-highlight-red">15 min</small></span>],
[<span class="item">Blue <small>col.</small></span>,
<span class="item">200 <small>cc.</small></span>,
<span class="item">Available <small>in a week</small></span>,
<span class="item">04 mar <small></small></span>],
[<span class="item">Green <small>col.</small></span>,
<span class="item">Available <small>immediately</small></span>,
<span class="item"><small class="txt-highlight-red">2 hours</small></span>]]
The point is that not every nested list has exactly the same content nor the same length, so I don't want to simplify getting the text in a sole list.
I've tried this code:
bobo = []
for detail in details:
for i in detail:
bobo.append(i.text)
But as I told it yields the following output:
[Red col., 120 cc., Available in four days, 15 min., Blue col., 200 cc., Available in a week, 04 mar , Green col., Available immediately, 2 hours]
While the expected ouput is:
[[Red col., 120 cc., Available in four days, 15 min.],
[Blue col., 200 cc., Available in a week, 04 mar ],
[Green col., Available immediately, 2 hours]]
Any help?
try this
bobo = []
for detail in details:
result = []
for i in detail:
result.append(i.text)
bobo.append(result)

Mapping excel to XML - Problem importing XML-fields

I seem to have a problem with mapping XML parts to an existing exceltable.
I have a sample XML file provided from the Swedish tax authority as XML-schema:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Skatteverket xmlns="http://xmls.skatteverket.se/se/skatteverket/ai/instans/infoForBeskattning/4.0"
xmlns:gm="http://xmls.skatteverket.se/se/skatteverket/ai/gemensamt/infoForBeskattning/4.0"
xmlns:ku="http://xmls.skatteverket.se/se/skatteverket/ai/komponent/infoForBeskattning/4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" omrade="Kontrolluppgifter"
xsi:schemaLocation="http://xmls.skatteverket.se/se/skatteverket/ai/instans/infoForBeskattning/4.0
http://xmls.skatteverket.se/se/skatteverket/ai/kontrolluppgift/instans/Kontrolluppgifter_4.0.xsd ">
<ku:Avsandare>
<ku:Programnamn>KUfilsprogrammet</ku:Programnamn>
<ku:Organisationsnummer>162234567895</ku:Organisationsnummer>
<ku:TekniskKontaktperson>
<ku:Namn>Bo Ek</ku:Namn>
<ku:Telefon>+46881234567</ku:Telefon>
<ku:Epostadress>bo.ek#elbolagetab.se</ku:Epostadress>
<ku:Utdelningsadress1>Strömgatan 11</ku:Utdelningsadress1>
<ku:Postnummer>62145</ku:Postnummer>
<ku:Postort>Strömby</ku:Postort>
</ku:TekniskKontaktperson>
<ku:Skapad>2015-06-07T21:32:52</ku:Skapad>
</ku:Avsandare>
<ku:Blankettgemensamt>
<ku:Uppgiftslamnare>
<ku:UppgiftslamnarePersOrgnr>165599990602</ku:UppgiftslamnarePersOrgnr>
<ku:Kontaktperson>
<ku:Namn>John Ström</ku:Namn>
<ku:Telefon>+46812345678</ku:Telefon>
<ku:Epostadress>siv.strom#elbolagetab.se</ku:Epostadress>
<ku:Sakomrade>Förnybar el</ku:Sakomrade>
</ku:Kontaktperson>
</ku:Uppgiftslamnare>
</ku:Blankettgemensamt>
<!-- Kontrolluppgift 1 -->
<ku:Blankett nummer="2350">
<ku:Arendeinformation>
<ku:Arendeagare>165599990602</ku:Arendeagare>
<ku:Period>2018</ku:Period>
</ku:Arendeinformation>
<ku:Blankettinnehall>
<ku:KU66>
<ku:UppgiftslamnareKU66>
<ku:UppgiftslamnarId faltkod="201">165599990602</ku:UppgiftslamnarId>
<ku:NamnUppgiftslamnare faltkod="202">Sonjas elhandel</ku:NamnUppgiftslamnare>
</ku:UppgiftslamnareKU66>
<ku:Inkomstar faltkod="203">2018</ku:Inkomstar>
<ku:KWhMatatsIn faltkod="270">3622</ku:KWhMatatsIn>
<ku:KWhTagitsUt faltkod="271">4822</ku:KWhTagitsUt>
<ku:AnlaggningsID faltkod="272">735999123456789012</ku:AnlaggningsID>
<ku:AndelIAnslPunkt faltkod="273">12.5</ku:AndelIAnslPunkt>
<ku:Specifikationsnummer faltkod="570">128</ku:Specifikationsnummer>
<ku:InkomsttagareKU66>
<ku:Inkomsttagare faltkod="215">193804139149</ku:Inkomsttagare>
</ku:InkomsttagareKU66>
</ku:KU66>
</ku:Blankettinnehall>
</ku:Blankett>
</Skatteverket>
When using Excel, Developer tab -> XML -> Source and adding the file I don't seem to get the XML parts inside the tag
<ku:Blankettinnahall>
Any reason why Excel would skip these XML parts?
Here is some sample exceltable data that I would like to map to those XML-fields:
AnlaggningsID Inkomsttagare Inkomstar KWhMatatsIn KWhTagitsUt AndelIAnslPunkt Specifikationsnummer
526009875445385000 190101019999 2018 50078,0 88462,0 1
258655985101244000 190201019999 2018 75,0 4615,0 2
112855269388863000 190301019999 2018 16687,0 19870,0 42 3
364615095294089000 190401019999 2018 16687,0 19870,0 58 4
534980084130649000 190501019999 2018 174,0 7009,0 5
It looks like your missing the actual data itself...the top half is the description of the sender and details. And later is data section (Blankettinnehall)
So on your excel I would expect rows with columns for each header/ sender details. This may be whats missing.
You can see this if you take a sample file from them and view it in Excel.
I struggled with KU52 last year ended up doing a C# application to generate the XML file.

Spring Batch Cron expression to meet below criteria

Batch job should be triggered after every 10 minutes, from 7.30 am to 8.50pm,
Everyday in week except Sunday.
You could simply split it into two cron expressions.
First one:
- hour 7, minutes 30,40,50, MON-SAT
second one:
- hour 8, minutes 0,10,20,30,40,50, MON-SAT
With Spring it may look like this:
#Schedules({
#Scheduled(cron = "30,40,50 7 * * MON-SAT")
#Scheduled(cron = "*/10 8 * * MON-SAT")
})
public void doSomething() { //... }
The cron expressions itself may not be beautiful, for sure. However it should work as desired or at least point you into the right direction.

Swift String encoding and NSXMLParser parsing issues

My App is calling the free Weather Forecast web service found at this URL:
http://www.webservicex.net/globalweather.asmx/GetWeather?CityName=Boston&CountryName=United+States
I'm using the usual NSURLConnection and NSXMLParser delegate methods to parse the incoming data (I've done this a million times before) but quite strangely, the NSMutableData that is returned is not getting converted to a string correctly via NSUTF8StringEncoding. Its basically failing to convert the "<" and ">" characters of the opening and closing XML tags, giving me "& l t;" and "& g t;" instead.
The problem seems to be in the connectionDidFinishLoading function:
func connection(connection: NSURLConnection, didReceiveData data: NSData) {
webServiceData!.appendData(data)
}
func connectionDidFinishLoading(connection: NSURLConnection) {
let XMLResponseString = NSString(data: webServiceData!, encoding: NSUTF8StringEncoding)!
println("XMLResponseString = \(XMLResponseString)")
}
The output I get from the println statement there is:
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://www.webserviceX.NET"><?xml version="1.0" encoding="utf-16"?>
<CurrentWeather>
<Location>DALLAS EXECUTIVE AIRPORT, TX, United States (KRBD) 32-41N 096-52W 203M</Location>
<Time>Dec 30, 2014 - 08:53 AM EST / 2014.12.30 1353 UTC</Time>
<Wind> from the NE (050 degrees) at 12 MPH (10 KT):0</Wind>
<Visibility> 9 mile(s):0</Visibility>
<SkyConditions> overcast</SkyConditions>
<Temperature> 39.9 F (4.4 C)</Temperature>
<DewPoint> 34.0 F (1.1 C)</DewPoint>
<RelativeHumidity> 79%</RelativeHumidity>
<Pressure> 30.42 in. Hg (1030 hPa)</Pressure>
<Status>Success</Status>
</CurrentWeather></string>
So as you can see I'm getting the first 2 tags correctly - the "< ?XML >" and "< string xmlns >" tags, but the rest are all showing up as "& l t;" and "& g t;"
What's really strange is that its saying encoding="utf-8" for the first tag, but on the second line (towards the end) its saying encoding="utf-16".
So I tried using NSUTF16StringEncoding:
let XMLResponseString = NSString(data: webServiceData!, encoding: NSUTF16StringEncoding)!
and that basically gave me chinese looking characters.
I also tried running the parser directly on the url instead of the NSMutableData that's returned, like so:
myXMLParser = NSXMLParser(contentsOfURL:theURL!)!
(the original statement was this:
myXMLParser = NSXMLParser(data:webServiceData)
but neither of these worked.
So what's going on here? Any suggestions on how to get this to work properly?
This is actually the remote service being broken, rather than your code. Yes, the server really is sending XML in XML for no particularly good reason.
$ curl 'http://www.webservicex.net/globalweather.asmx/GetWeather?CityName=Boston&CountryName=United+States'
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://www.webserviceX.NET"><?xml version="1.0" encoding="utf-16"?>
<CurrentWeather>
<Location>BOSTON LOGAN INTERNATIONAL, MA, United States (KBOS) 42-22N 071-01W 54M</Location>

BizTalk Flatfile Schema - Nested repeating records

I am trying to map a schema like this example, that has repeating records inside repeating records.
Sample File:
0000456Toy Industries56Palumbia DriveEnfield CT06082 98724
302369097 King Toy Store20 Cherry WayDedhamMA02026 TS2349
402369097 036436 Playstation 4 Entert03452449.99 20140826
402369097 036437 Msoft XBOX ONEEntert01234399.99 20140826
402369097 036438 Wooden Horse 07892 59.99 20140827
402369097 036439 Playstation 4 Entert03452449.99 20140827
402369097 036440 My First Brew Kit 99.99 20140828
602369097000100010005I
302369235 Make Believe 342 Brand DriveBridgeMA02324 TS5439
402369235 054324 Playstation 4 Entert53452449.99 20140827
402369235 054325 Steam Box Ultimate 54234699.99 20140827
602369235000100010002I
900033336133310001
Sequence:
<Processor Record> (one per file | 1)
<Store Record> (one per store | 1+)
<Order Record> (one for each order the store had | 1+)
<Store Batch Control Record> (one per store | 1+)
<File Batch Control Record> (one per file | 1)
Each Record (line) will be broken into field elements by positional specifications
I have tried using the wizard a couple of times and manually adjusting the settings as well, but keep running into issues like this one:
The current definition being parsed is Root. The stream offset where the error occurred is 0. The line number where the error occurred is 1. The column where the error occurred is 0.
I am rather new to BizTalk and was hoping that someone may be able to give me some help on how to accomplish this task. Thanks!
Use the Tag Identifiers to indicate the type of record.
In your case, this would be:
00 Processor Record Header
30 Store Record Header
40 Order Record
60 Store Record Summary
90 Processor Record Summary
This is how I would do it:
You would have a root node with the following parameters:
Structure: delimited
Child Delimiter Type: hexadecimal
Child delimiter: 0x0a 0x0d (newline character of your choice)
Child Order: Infix
The node below that would be the "Header" node.
It's properties:
Max Occurs: 1
Min Occurs: 1
Structure: positional
Tag Identifier: 00
The next node would be the "Store" node.
This is an abstract node, just to be able to capture a store header, a recurring order record and a store summary node.
It's properties:
Max Occurs: *
Min Occurs: 0 (depending what's possible on your flat file)
Structure: delimited
Child Delimiter Type: hexadecimal
Child delimiter: 0x0a 0x0d (newline character of your choice)
Child Order: Infix
The node below that would be the "StoreHeader" node.
Max Occurs: 1
Min Occurs: 0 (depending what's possible on your flat file)
Structure: positional (only you know the exact sequence of fields)
Tag Identifier: 30
Next to that, the "Order" node:
Max Occurs: *
Min Occurs: 0 (depending what's possible on your flat file)
Structure: positional (only you know the exact sequence of fields)
Tag Identifier: 40
Next to that, the "StoreSummary" node:
Max Occurs: 1
Min Occurs: 0 (depending what's possible on your flat file)
Structure: positional (only you know the exact sequence of fields)
Tag Identifier: 60
At last, at the same level as the "Header" and "Store" nodes, you would have the "Summary" node:
Max Occurs: 1
Min Occurs: 1
Structure: positional
Tag Identifier: 90

Resources