You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello everyone,
I'm trying to attribuate a tx profile after the transaction start , but when the charge point takes time to respond to my request , the transaction stopped !!!!
public StartTransactionResponse startTransaction(StartTransactionRequest parameters, String chargeBoxIdentity) {
if (chargePointUserRepository.isAssociated(chargeBoxIdentity, parameters.getIdTag())) {
// Get the authorization info of the user, before making tx changes (will affectAuthorizationStatus)
IdTagInfo info = ocppTagService.getIdTagInfo(
parameters.getIdTag(),
true,
() -> new IdTagInfo().withStatus(AuthorizationStatus.INVALID), null // IdTagInfo is required
);
InsertTransactionParams params =
InsertTransactionParams.builder()
.chargeBoxId(chargeBoxIdentity)
.connectorId(parameters.getConnectorId())
.idTag(parameters.getIdTag())
.startTimestamp(parameters.getTimestamp())
.startMeterValue(Integer.toString(parameters.getMeterStart()))
.reservationId(parameters.getReservationId())
.eventTimestamp(DateTime.now())
.build();
int transactionId = ocppServerRepository.insertTransaction(params);
applicationEventPublisher.publishEvent(new OcppTransactionStarted(transactionId, params));
StartTransactionResponse response = new StartTransactionResponse()
.withIdTagInfo(info)
.withTransactionId(transactionId);
// Call startSetProfiles after the transaction has started
startSetProfiles(chargeBoxIdentity,"Start");
return response;
}else {
// If the association is not present, return an "user not allowed" response
StartTransactionResponse response = new StartTransactionResponse()
.withTransactionId(-1) // Use a special value to indicate an error
.withIdTagInfo(new IdTagInfo().withStatus(AuthorizationStatus.INVALID));
return response;
}
}
The text was updated successfully, but these errors were encountered:
Hello everyone,
I'm trying to attribuate a tx profile after the transaction start , but when the charge point takes time to respond to my request , the transaction stopped !!!!
The text was updated successfully, but these errors were encountered: