I added the following code in ResetMailbox.java
private transient AuditTrail auditTrail;
…
@AutoWire
public void setAuditTrail(AuditTrail auditTrail) {
this.auditTrail = auditTrail;
}
…
public void main() throws Interrupt {
BatchingAuditTrail batchingAuditTrail = new BatchingAuditTrail();
try {
batchingAuditTrail.startup();
} catch (Exception e) {
logger.error("batchingAuditTrail request failed", e);
}
private boolean resetMailbox() throws Interrupt {
for (int i = 0; ; i++) {
final String correlationId = networkServiceAdapter.resetMailbox(getData().getMsisdn());
auditTrail.asynchLog(0, new Date(), "resetMailbox", "-", this.getId(), correlationId, null, "finished", "TEXT");
The batchingAuditTrail.startup() failed with the following error:
2017.09.18 12:02:46,462 ERROR [P#DEFAULT#0] org.copperengine.examples.orchestration.wf.ResetMailbox [790b5c63-9dbb-4850-8e60-9047c93a5801] - batchingAuditTrail request failed
java.lang.NullPointerException
at org.copperengine.core.audit.BatchingAuditTrail.startup(BatchingAuditTrail.java:152)
at org.copperengine.examples.orchestration.wf.ResetMailbox.main(ResetMailbox.java:76)
at org.copperengine.core.persistent.PersistentProcessor$1.run(PersistentProcessor.java:57)
at org.copperengine.core.persistent.PersistentProcessor$1.run(PersistentProcessor.java:49)
at org.copperengine.core.persistent.txn.CopperTransactionController.run(CopperTransactionController.java:63)
at org.copperengine.core.persistent.PersistentProcessor.process(PersistentProcessor.java:49)
at org.copperengine.core.common.Processor.run(Processor.java:79)
Is this because that the dataSource is not set to the batchingAuditTrail? How can I set the right dataSource so that the audit data can go to the derby DB - ./build/copperExampleDB?
If I remove the batchingAuditTrail related lines of code and keep only the auditTrail.asynchLog call, it gives me a different error on the auditTrail.asynchLog line of code.
2017.09.18 12:21:55,255 ERROR [P#DEFAULT#0] org.copperengine.core.common.Processor [fd63da71-76d7-45cf-b5e7-1467d4595786] - execution of workflow instance failed
java.lang.NullPointerException
at org.copperengine.core.audit.BatchInsertIntoAutoTrail$Command.<init>(BatchInsertIntoAutoTrail.java:50)
at org.copperengine.core.audit.BatchingAuditTrail.createBatchCommand(BatchingAuditTrail.java:265)
at org.copperengine.core.audit.BatchingAuditTrail.doLog(BatchingAuditTrail.java:257)
at org.copperengine.core.audit.BatchingAuditTrail.doLog(BatchingAuditTrail.java:250)
at org.copperengine.core.audit.BatchingAuditTrail.asynchLog(BatchingAuditTrail.java:235)
at org.copperengine.core.audit.BatchingAuditTrail.asynchLog(BatchingAuditTrail.java:225)
at org.copperengine.examples.orchestration.wf.ResetMailbox.resetMailbox(ResetMailbox.java:121)
at org.copperengine.examples.orchestration.wf.ResetMailbox.main(ResetMailbox.java:86)
at org.copperengine.core.persistent.PersistentProcessor$1.run(PersistentProcessor.java:57)
at org.copperengine.core.persistent.PersistentProcessor$1.run(PersistentProcessor.java:49)
at org.copperengine.core.persistent.txn.CopperTransactionController.run(CopperTransactionController.java:63)
at org.copperengine.core.persistent.PersistentProcessor.process(PersistentProcessor.java:49)
at org.copperengine.core.common.Processor.run(Processor.java:79)
2017.09.18 12:21:55,255 ERROR [P#DEFAULT#0] org.copperengine.core.common.Processor [fd63da71-76d7-45cf-b5e7-1467d4595786] - Storing error information for workflow instance...
2) How can I add a new workflow (say HelloWorldWorkFlowV2) into the Orchestration Engine instead of resetMailBox?
The OrchestrationServiceTestClient.java sample has the following code:
private static final QName SERVICE_NAME = new QName("http://orchestration.copperengine.org/", "OrchestrationService");
public static void main(String args[]) throws java.lang.Exception {
URL wsdlURL = new URL(args[0]);
OrchestrationService_Service ss = new OrchestrationService_Service(wsdlURL, SERVICE_NAME);
OrchestrationService port = ss.getOrchestrationServicePort();
....
port.resetMailbox(resetMailbox_msisdn, resetMailbox_secret);
}