AI translation
This page was translated from German with AI. If in doubt, the German original applies.
Annex VII with the SDK¶
Setup and, for each stage, the call via the Annex7DocumentHandler.
The domain background is described in the guide Annex VII (company role).
Setup¶
// Authenticated client with an active session — see Getting started
var client = ZedalClientFactory.Default.CreateClient(
TargetSystem.Test, "MyIntegrationApp", "1.0.0");
await client.CreateSession(
userId: "mysubscriber-myaccount@1:mypassword",
appToken: new AppToken("<APP_TOKEN_JWT>"));
One handler per Annex VII. Each subsequent stage reloads the current state with LoadFromZedalByAnnex7DocumentNo(annex7DocumentNo).
Stage 1 — CreateAnnex7¶
Annex7DocumentHandler handler = client.DocumentHandler.CreateAnnex7Handler();
await handler.CreateAnnex7(new WasteAnnex7DocumentType
{
// arranger, waste producer (or ArrangerIsProducer = true without a WasteProducer),
// carriers, consignee, recovery facility or laboratory,
// waste, quantity, planned start of the shipment, recovery operation …
// CurrentUserPartyUuid: the PartyUuid of the arranger
// TransportAnnouncement.ShipmentOriginLocation.PartyUuid: a party in the document
});
await handler.SendToDiwass(ZedalCallContext.Default.WithTimeout(180));
await handler.WaitForDiwassTransfer(
timeout: TimeSpan.FromMinutes(6),
pollInterval: TimeSpan.FromSeconds(5));
await handler.ReloadFromZedal();
// The Annex VII number is assigned by DiWaSS and arrives with its response.
string annex7DocumentNo = handler.DiwassNotificationId;
For Annex VII, DiwassNotificationId holds the Annex VII number. It is only known after the reload; before that it is empty. Which fields DiWaSS requires beyond the schema is described under Field rules → Annex VII, all fields under DiWaSS fields.
Status and next steps¶
var handler = client.DocumentHandler.CreateAnnex7Handler();
await handler.LoadFromZedalByAnnex7DocumentNo(annex7DocumentNo);
// status as last reported by DiWaSS, e.g. "MOVING"
string status = handler.Annex7.GetInformation()?.Announcement?.DocumentStatus?.Value;
// steps the document allows next, narrowed down to your roles in it
IReadOnlyList<long> mine = await client.MyAccount.GetOwnDiwassOperatorIds();
var mySteps = PermissionMatrixInference.Filter(mine, handler.FollowupIntents, handler.Annex7);
The status values are the same as for the movement. The states and which call leads to which status are shown under Lifecycle.
Stage 2 — SetAnnex7¶
Changes the announcement. The Annex VII number must be contained in the document, otherwise DiWaSS does not find the announcement.
var handler = client.DocumentHandler.CreateAnnex7Handler();
await handler.LoadFromZedalByAnnex7DocumentNo(annex7DocumentNo);
await handler.SetAnnex7(new WasteAnnex7DocumentType
{
// the complete announcement with the Annex VII number,
// e.g. now with the actual quantity and the carrier …
});
await handler.SendToDiwass();
Stage 3 — SetAnnex7CarrierTransfer¶
var handler = client.DocumentHandler.CreateAnnex7Handler();
await handler.LoadFromZedalByAnnex7DocumentNo(annex7DocumentNo);
await handler.SetAnnex7CarrierTransfer(new WasteAnnex7TransportType
{
// Annex VII number, your carrier party with a contact of name, phone number and email,
// date of takeover, means of transport …
});
await handler.SendToDiwass();
Stage 4 — SetAnnex7ConsigneeCertificate¶
var handler = client.DocumentHandler.CreateAnnex7Handler();
await handler.LoadFromZedalByAnnex7DocumentNo(annex7DocumentNo);
await handler.SetAnnex7ConsigneeCertificate(new WasteAnnex7ConsigneeCertificateOfWasteReceiptType
{
// Annex VII number, date of receipt, quantity received,
// your declaration and signature as consignee …
});
await handler.SendToDiwass();
Stage 5 — SetAnnex7FacilityCertificate¶
var handler = client.DocumentHandler.CreateAnnex7Handler();
await handler.LoadFromZedalByAnnex7DocumentNo(annex7DocumentNo);
await handler.SetAnnex7FacilityCertificate(new WasteAnnex7CertificateOfWasteReceiptType
{
// Annex VII number, date of receipt, quantity accepted,
// your declaration and signature as facility or laboratory …
});
await handler.SendToDiwass();
Stage 6 — SetAnnex7CertificateOfCompletion¶
var handler = client.DocumentHandler.CreateAnnex7Handler();
await handler.LoadFromZedalByAnnex7DocumentNo(annex7DocumentNo);
await handler.SetAnnex7CertificateOfCompletion(new WasteAnnex7CertificateOfWasteCompletionType
{
// Annex VII number, completion date, recovery operation applied,
// quantity recovered, your declaration and signature …
});
await handler.SendToDiwass();
Cancellation and take-back¶
- Cancellation: The arranger cancels with the signal
Annex7Cancelled. TheAnnex7DocumentHandlerhas no dedicated method for it in SDK 1.4.0. - Take-back:
SetAnnex7TakeBack(WasteAnnex7TakeBackType)is the step of the competent authority.UserCompetentAuthorityDomainIdandCompetentAuthoritySignatureare mandatory fields.
Validation and error handling¶
As with the movement: validation errors are in handler.ValidationErrors after the stage call, WaitForDiwassTransfer throws DiwassTransferFailedException if DiWaSS rejects and TimeoutException if no acknowledgment arrives. The time budgets are described under Lifecycle → Sending procedure, the codes under Error codes.