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 com.att.camunda.bpm.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 com.att.camunda.bpm.plugin.urnmap.db.*;
33 import org.camunda.bpm.cockpit.db.CommandExecutor;
35 import com.att.camunda.bpm.plugin.urnmap.db.URNData;
37 public class ProcessInstanceResource extends AbstractPluginResource {
39 public ProcessInstanceResource(String engineName) {
44 public List<URNData> getUrnDataMap() {
45 List<URNData> list = getQueryService()
47 "cockpit.urnMap.retrieveUrnKeyValuePair",
48 new QueryParameters<URNData>());
50 System.out.println("urnmap-plugin project - Results Retrieved: ");
51 System.out.println("URNName: " + " " + "URNValue: " );
54 System.out.println( d.getURNName() + " " + d.getURNValue());
61 //public void insertNewRow(String key_, String value_)
62 public void insertNewRow(String temp)
64 System.out.println("AddNewRow: XXXXXXXXXXXXXXXXX ---> " + temp);
65 StringTokenizer st = new StringTokenizer(temp, "|");
69 while(st.hasMoreTokens()) {
70 key_ = st.nextToken();
71 value_ = st.nextToken();
72 System.out.println(key_ + "\t" + value_);
75 System.out.println("AddNewRow: XXXXXXXXXXXXXXXXX ---> key: " + key_ + " , Value: " + value_);
76 URNData nRow = new URNData();
78 nRow.setURNName(key_);
79 nRow.setURNValue(value_);
81 getQueryService().executeQuery("cockpit.urnMap.insertNewRow", nRow, URNData.class);
83 System.out.println("AddNewRow: XXXXXX END XXXXXXXXXXX");
87 // public void getPersistData(List<URNData > myList) {
88 public void getPersistData(URNData d) {
90 System.out.println("getPersistData: UrnName: " + d.getURNName() + " , URNValue: " + d.getURNValue() );
92 getQueryService().executeQuery("cockpit.urnMap.persistURNData", d, URNData.class);
93 //getQueryService().executeQuery("cockpit.sample.persistURNData", d, ProcessInstanceCountDto.class);
96 System.out.println("XXXXXXXXXX - END - XXXXXXXXXXXXXXX");