Browse Source

Fix bug of missing trailing VoiceCall status updates to portal.

Reason is due to premature terminating postback threads because
the serviceActivityCount is decremented erreously when updating
intermediate job statuses with portal.
Fix is in classifying job status as final or non-final.
As it is, all JobStatus in CommEngine are final; however,
derived classes may have non-final JobStatus.
tags/1.0.26
ymlam 2 years ago
parent
commit
fba1269d2d
2 changed files with 16 additions and 1 deletions
  1. +1
    -1
      src/main/java/altk/comm/engine/Broadcast.java
  2. +15
    -0
      src/main/java/altk/comm/engine/Job.java

+ 1
- 1
src/main/java/altk/comm/engine/Broadcast.java View File

@@ -1266,7 +1266,7 @@ public abstract class Broadcast
report.initBase(job, broadcastId, launchRecordId, activityRecordIdParamName, jobReportRootNodeName); report.initBase(job, broadcastId, launchRecordId, activityRecordIdParamName, jobReportRootNodeName);
report.init(job); report.init(job);
postback.queueReport(report.toString()); postback.queueReport(report.toString());
updateServiceActivityCount(-1);
if (job.statusIsFinal()) updateServiceActivityCount(-1);
} }
} }


+ 15
- 0
src/main/java/altk/comm/engine/Job.java View File

@@ -1,5 +1,7 @@
package altk.comm.engine; package altk.comm.engine;


import altk.comm.engine.Job.CommJobStatus;

/** /**
* Derived classes may add more class attributes, e.g. list of phone numbers, call status. * Derived classes may add more class attributes, e.g. list of phone numbers, call status.
* @author Yuk-Ming * @author Yuk-Ming
@@ -81,5 +83,18 @@ public class Job
{ {
return false; return false;
} }
/**
* Derived class must augment this method to handle its own JobStatus
*/
protected boolean statusIsFinal() {
if (jobStatus instanceof CommJobStatus)
{
return true;
}
throw new IllegalArgumentException("Job status is not a CommJobStatus");
}




} }

Loading…
Cancel
Save