2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.camunda.bpmn.plugin.urnmap.resources;
23 import java.util.List;
24 import java.util.StringTokenizer;
26 import javax.ws.rs.GET;
27 import javax.ws.rs.POST;
28 import javax.ws.rs.PUT;
30 import org.camunda.bpm.cockpit.db.QueryParameters;
31 import org.camunda.bpm.cockpit.plugin.resource.AbstractPluginResource;
32 import org.camunda.bpm.cockpit.db.CommandExecutor;
33 import org.openecomp.camunda.bpmn.plugin.urnmap.db.*;
35 public class ProcessInstanceResource extends AbstractPluginResource {
37 public ProcessInstanceResource(String engineName) {
42 public List<URNData> getUrnDataMap() {
43 List<URNData> list = getQueryService()
45 "cockpit.urnMap.retrieveUrnKeyValuePair",
46 new QueryParameters<URNData>());
48 System.out.println("urnmap-plugin project - Results Retrieved: ");
49 System.out.println("URNName: " + " " + "URNValue: " );
52 System.out.println( d.getURNName() + " " + d.getURNValue());
59 //public void insertNewRow(String key_, String value_)
60 public void insertNewRow(String temp)
62 System.out.println("AddNewRow: XXXXXXXXXXXXXXXXX ---> " + temp);
63 StringTokenizer st = new StringTokenizer(temp, "|");
67 while(st.hasMoreTokens()) {
68 key_ = st.nextToken();
69 value_ = st.nextToken();
70 System.out.println(key_ + "\t" + value_);
73 System.out.println("AddNewRow: XXXXXXXXXXXXXXXXX ---> key: " + key_ + " , Value: " + value_);
74 URNData nRow = new URNData();
76 nRow.setURNName(key_);
77 nRow.setURNValue(value_);
79 getQueryService().executeQuery("cockpit.urnMap.insertNewRow", nRow, URNData.class);
81 System.out.println("AddNewRow: XXXXXX END XXXXXXXXXXX");
85 // public void getPersistData(List<URNData > myList) {
86 public void getPersistData(URNData d) {
88 System.out.println("getPersistData: UrnName: " + d.getURNName() + " , URNValue: " + d.getURNValue() );
90 getQueryService().executeQuery("cockpit.urnMap.persistURNData", d, URNData.class);
91 //getQueryService().executeQuery("cockpit.sample.persistURNData", d, ProcessInstanceCountDto.class);
94 System.out.println("XXXXXXXXXX - END - XXXXXXXXXXXXXXX");