Commit fc316010 by everdarkgreen

assignment bug: resolved

parent f20f72d2
...@@ -31,6 +31,10 @@ import javax.ejb.MessageDriven; ...@@ -31,6 +31,10 @@ import javax.ejb.MessageDriven;
@ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge")}) @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge")})
public class Main implements MessageListener { public class Main implements MessageListener {
private enum fieldType {
DATE, TEXTBOX
}
private static final Logger LOGGER = LoggerFactory.getLogger(Main.class); private static final Logger LOGGER = LoggerFactory.getLogger(Main.class);
...@@ -87,15 +91,16 @@ public class Main implements MessageListener { ...@@ -87,15 +91,16 @@ public class Main implements MessageListener {
String t26b1, t24b1, t22b1; String t26b1, t24b1, t22b1;
String t32b1, t30b1, t28b1; String t32b1, t30b1, t28b1;
b2b1 = getDateKeyByFieldName(sourceFormData, "b2-b1"); b2b1 = getDateKeyByFieldName(sourceFormData, "b2-b1", fieldType.DATE);
b4b1 = getDateKeyByFieldName(sourceFormData, "b4-b1"); b4b1 = getDateKeyByFieldName(sourceFormData, "b4-b1", fieldType.DATE);
b5b1 = getDateKeyByFieldName(sourceFormData, "b5-b1", fieldType.TEXTBOX);
LOGGER.info(getDateKeyByFieldName(sourceFormData, "b2-b1")); LOGGER.info(b2b1 + " " + b4b1 + " " + b5b1);
// Получение данных целевой карточки // Получение данных целевой карточки
// Разблокировка маршрута // Разблокировка маршрута""
String address = "http://127.0.0.1:8080/Synergy"; String address = "http://127.0.0.1:8080/Synergy";
String signal = "got_agree"; String signal = "got_agree";
URL url = new URL(address + "/rest/api/processes/signal?signal=" + signal + "&executionID=" + executionID + "&param1=resolution&value1=signal_is_" + signal); URL url = new URL(address + "/rest/api/processes/signal?signal=" + signal + "&executionID=" + executionID + "&param1=resolution&value1=signal_is_" + signal);
...@@ -106,18 +111,31 @@ public class Main implements MessageListener { ...@@ -106,18 +111,31 @@ public class Main implements MessageListener {
} }
} }
private String getDateKeyByFieldName(final JsonParser formJson, final String fieldName) { /**
* */
private static String getDateKeyByFieldName(final JsonParser formJson, final String fieldName, fieldType fieldT) {
String value = new String(); String value = new String();
try { try {
while (!formJson.isClosed()) { while (!formJson.isClosed()) {
if (JsonToken.FIELD_NAME.equals(formJson.nextToken())) { if (JsonToken.FIELD_NAME.equals(formJson.nextToken())) {
if ("id".equals(formJson.getCurrentName()) && fieldName.equals(formJson.nextTextValue())) { if ("id".equals(formJson.getCurrentName()) && fieldName.equals(formJson.nextTextValue())) {
formJson.nextToken(); switch (fieldT) {
formJson.nextToken(); case DATE:
formJson.nextToken(); formJson.nextToken();
LOGGER.info(fieldName + ": " + formJson.nextTextValue()); formJson.nextToken();
value = formJson.nextTextValue(); formJson.nextToken();
break; formJson.nextToken();
formJson.nextToken();
value = formJson.nextTextValue();
break;
case TEXTBOX:
formJson.nextToken();
formJson.nextToken();
formJson.nextToken();
formJson.nextToken();
value = formJson.nextTextValue();
break;
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment