1
0
-1

Hi,

I need to write a service which will override the out of the box tracking number generator.

The form which I am developing on is 

 https://maestro.avoka.com.au/maguire/servlet/SmartForm.html?formCode=mikecapplicationforl&tmFormVersion=7

 

To start, I used the template service.

 

import com.avoka.core.groovy.GroovyLogger as logger
import com.avoka.tm.svc.*
import com.avoka.tm.vo.*
import javax.servlet.http.*

class FluentTrackingNumberService {

/*
* Perform a transaction tracking number (tracking code) generation
*
* return: a globally unique tracking number value, values longer than 100 characters will be trimmed
*/
String invoke(SvcDef svcDef, Form form, HttpServletRequest request, User user) {

return new TrackingCodeBuilder()
.setPrefix(form.formCode + "-")
.setPostfix("-TEST")
.build();

}
}

 

I tested with the unit test and it seems to be working, but when I connected the service into my form, it comes back with error message

 

Error ID178
TimeFri Mar 31 15:52:20 AEDT 2017
TypeForm Render
Critical Errortrue
Groovy Errortrue
NameFluent Tracking Number Service Error
Message[v.3.1 Sep 20 2014 14:06:21] Validation failures: Validation failure for com.avoka.fc.core.entity.Submission.trackingNumber: "trackingNumber" is required.  
User MessageError occured calling Fluent Tracking Number - v1 (Challenger)
Context
Service: Fluent Tracking Number - v1 (Challenger)
Service Type: Tracking Number
Service Timeout: 0
Form Code: mikecapplicationforl
Form Name: Mike C Application for lifetime annuity Investor
Organization: Challenger  
Space / ModuleMaguire
RequestGET https://maestro.avoka.com.au/maguire/servlet/SmartForm.html?formCode=mikecapplicationforl&tmFormVersion=7
IP Address114.141.100.203
User AgentMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
Error Stack Trace
org.apache.cayenne.validation.ValidationException: [v.3.1 Sep 20 2014 14:06:21] Validation failures: Validation failure for com.avoka.fc.core.entity.Submission.trackingNumber: "trackingNumber"  is required.
Validation failure for com.avoka.fc.core.entity.Submission.trackingNumber: "trackingNumber"  is required.
	at org.apache.cayenne.access.ObjectStoreGraphDiff.validateAndCheckNoop(ObjectStoreGraphDiff.java:111)
	at org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:806)
	at org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:756)
	at com.avoka.fc.core.service.GroovyLogService.logServiceCall(GroovyLogService.java:136)
	at com.avoka.fc.core.service.fluent.AbstractFluentService.invoke(AbstractFluentService.java:152)

 

Is there some configuration I have missed?

 

Cheers

Mike Chen

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      This seems to be a Product bug, I have raised an AVT ticket

      AVT-4565

        CommentAdd your comment...