lumnik. / scenarios All scenarios · Français

WinDev: the client export with real dates and a real Active flag

Goal Read the client file a WinDev application exports, and turn it into columns a question can use.

A WinDev application exports its clients with HExportCSV. The file is reconstituted from PC SOFT's documentation.

Client-utf8.csv
IDClient,NomClient,Ville,DateCreation,DernierAchat,Actif,EncoursAutorise
1,Établissements Dufour,Évreux,20190312,20261028,1,15000.00
2,Boulangerie Lefèvre,Saint-Étienne,20200605,20261102,1,2500.50
3,Garage Mécanique Nord,Lille,20151120,,0,0.00
4,Câblerie de l'Est,Besançon,20230217,20261015,1,48000.00
5,Menuiserie Bœuf & Fils,Orléans,20180901,20250630,1,7200.75
6,Épicerie Côté Mer,La Rochelle,20210414,20261030,0,1200.00
manifests/10-clients-raw.yaml
apiVersion: connectors.lumnik.io/v1kind: Connectormetadata:  name: scenario-windev-raw-a  connector_type: csv-file  scopes: [sales-a]spec:  transport:    kind: local    path: /tmp/lumnik-scenario/windev-hfsql-export/a/Client.csv   # HExportCSV(Client, …, hExpCreation)  after_process: none
manifests/20-clients-typed.yaml
apiVersion: connectors.lumnik.io/v1kind: Connectormetadata:  name: scenario-windev-a  connector_type: csv-file  scopes: [sales-a]spec:  transport:    kind: local    path: /tmp/lumnik-scenario/windev-hfsql-export/a/Client.csv   # the same export  after_process: none  mapping:    row:      - map-columns:          rename: { IDClient: id_client, NomClient: nom, Ville: ville, DateCreation: cree_le,                    DernierAchat: dernier_achat, Actif: actif, EncoursAutorise: encours_autorise }    cell:      - parse-number: { column: id_client, integer: true }      - parse-date: { column: cree_le, formats: [yyyyMMdd] }          # HFSQL writes a date AAAAMMJJ      - parse-date: { column: dernier_achat, formats: [yyyyMMdd] }      - parse-number: { column: encours_autorise, decimal-separator: "." }      - parse-boolean: { column: actif }                              # 0 / 1

Limits

  • The export is reconstituted from PC SOFT's documentation, not produced by WinDev.
  • Windows-1252, AAAAMMJJ dates and 0/1 flags are common conventions the docs do not describe.
  • Six fictional clients.

Clients · WinDev

The clients live in a WinDev application.

They must be read, every night.

An HExportCSV export, reconstituted

The problem

No database readable from outside.

  • HFSQL has no JDBC driver.
  • The application can export its files.

What is not changed

The application stays as it is.

  • Its existing export.
  • No module, no access to its database.

Read as it is

Six clients, but all text.

  • The dates: 20190312.
  • Actif: 0 or 1.

What had to be written

parse-date: { formats: [yyyyMMdd] }
parse-boolean: { column: actif }

Three transformers.

  • Dates, an amount, a boolean.
  • A 22-line connector.

The question

Active clients with no purchase since October.

  • A plain SQL query.
  • One client comes out: Menuiserie Bœuf & Fils.

The limit

A reconstituted export.

  • From PC SOFT's docs, not produced by WinDev.
  • Encoding and dates are common conventions.

Try it

The scenario replays locally.

Every step is published with its output.

This scenario runs on lumnik Open, free and open source.

Try lumnik Open →