* limitations under the License.
* ============LICENSE_END============================================
* ===================================================================
- *
+ *
*/
package org.onap.clamp.clds.client;
import com.att.eelf.configuration.EELFManager;
import org.apache.camel.Exchange;
-import org.apache.camel.Handler;
import org.onap.clamp.clds.dao.CldsDao;
import org.onap.clamp.clds.model.CldsEvent;
import org.springframework.beans.factory.annotation.Autowired;
* Insert event using process variables.
*
* @param camelExchange
- * The Camel Exchange object containing the properties
+ * The Camel Exchange object containing the properties
+ * @param actionState
+ * The action state that is used instead of the one in exchange property
*/
- @Handler
- public void execute(Exchange camelExchange) {
+
+ public void addEvent(Exchange camelExchange, String actionState) {
String controlName = (String) camelExchange.getProperty("controlName");
String actionCd = (String) camelExchange.getProperty("actionCd");
- String actionStateCd = (String) camelExchange.getProperty("actionStateCd");
+ String actionStateCd = (actionState != null) ? actionState : CldsEvent.ACTION_STATE_COMPLETED;
+ actionStateCd = ((String) camelExchange.getProperty("actionStateCd")) != null
+ ? ((String) camelExchange.getProperty("actionStateCd"))
+ : actionStateCd;
// Flag indicate whether it is triggered by Validation Test button from
// UI
boolean isTest = (boolean) camelExchange.getProperty("isTest");