+ logger.info("PUT isTest={}", isTest);
+ boolean isInsertTestEvent = false;
+ String insertTestEvent = refProp.getStringValue("action.insert.test.event");
+ if (insertTestEvent != null && insertTestEvent.equalsIgnoreCase("true")) {
+ isInsertTestEvent = true;
+ }
+ logger.info("PUT isInsertTestEvent={}", isInsertTestEvent);
+ // determine if requested action is permitted
+ model.validateAction(actionCd);
+ logger.info("modelProp - " + prop);
+ logger.info("docText - " + docText);
+ try {
+ String result = camelProxy.submit(actionCd, prop, bpmnJson, modelName, controlName, docText, isTest,
+ userId, isInsertTestEvent);
+ logger.info("Starting Camel flow on request, result is: ", result);
+ } catch (SdcCommunicationException | PolicyClientException | BadRequestException e) {
+ errorCase = true;
+ logger.error("Exception occured during invoking Camel process", e);
+ }
+ // refresh model info from db (get fresh event info)
+ retrievedModel = CldsModel.retrieve(cldsDao, modelName, false);
+ if (!isTest && (actionCd.equalsIgnoreCase(CldsEvent.ACTION_SUBMIT)
+ || actionCd.equalsIgnoreCase(CldsEvent.ACTION_RESUBMIT)
+ || actionCd.equalsIgnoreCase(CldsEvent.ACTION_SUBMITDCAE))) {
+ if (retrievedModel.getTemplateName().startsWith(CsarInstallerImpl.TEMPLATE_NAME_PREFIX)) {
+ // This should be done only when the call to DCAE
+ // has not yet been done. When CL comes from SDC
+ // this is not required as the DCAE inventory call is done
+ // during the CL deployment.
+ dcaeInventoryServices.setEventInventory(retrievedModel, getUserId());
+ } else {
+ logger.info("Skipping DCAE inventory call as closed loop has been created from SDC notification");
+ DcaeEvent dcaeEvent = new DcaeEvent();
+ dcaeEvent.setArtifactName("SDC artifact-" + retrievedModel.getName());
+ dcaeEvent.setEvent(DcaeEvent.EVENT_DISTRIBUTION);
+ CldsEvent.insEvent(cldsDao, dcaeEvent.getControlName(), userId, dcaeEvent.getCldsActionCd(),
+ CldsEvent.ACTION_STATE_RECEIVED, null);
+ }
+ retrievedModel.save(cldsDao, getUserId());
+ }
+ // audit log
+ LoggingUtils.setTimeContext(startTime, new Date());
+ LoggingUtils.setResponseContext("0", "Process model action success", this.getClass().getName());
+ auditLogger.info("Process model action completed");
+ } catch (Exception e) {
+ errorCase = true;
+ logger.error("Exception occured during putModelAndProcessAction", e);