Skip to content

Commit 9f6f82b

Browse files
author
ishan
committed
new jar
1 parent 53f231a commit 9f6f82b

File tree

7 files changed

+415
-176
lines changed

7 files changed

+415
-176
lines changed

Diff for: .idea/workspace.xml

+385-143
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: src/main/java/morph/base/actions/Action.java

+11
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
package morph.base.actions;
22

3+
import com.fasterxml.jackson.annotation.JsonSubTypes;
4+
import com.fasterxml.jackson.annotation.JsonTypeInfo;
5+
import morph.base.actions.impl.GoToFlowAction;
6+
import morph.base.actions.impl.PublishMessageAction;
7+
import morph.base.actions.impl.SetVariableAction;
8+
39
/**
410
* Created by jayeshathila
511
* on 24/04/17.
612
*/
13+
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, visible = true, property =
14+
"name", defaultImpl = Void.class)
15+
@JsonSubTypes({@JsonSubTypes.Type(value = PublishMessageAction.class, name = PublishMessageAction.PUBLISH),
16+
@JsonSubTypes.Type(value = GoToFlowAction.class, name = GoToFlowAction.GO_TO_FLOW),
17+
@JsonSubTypes.Type(value = SetVariableAction.class, name = SetVariableAction.SET_VARIABLE)})
718
public interface Action {
819

920
String getName();

Diff for: src/main/java/morph/base/actions/impl/GoToFlowAction.java

+3-7
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,20 @@
88
*/
99
public class GoToFlowAction implements Action {
1010

11+
public static final String GO_TO_FLOW = "goToFlow";
1112
private final String nextFlowKey;
12-
private final boolean rerunCurrentFlow;
13+
1314

1415
public GoToFlowAction(String nextFlowKey, boolean rerunCurrectFlow) {
1516
this.nextFlowKey = nextFlowKey;
16-
this.rerunCurrentFlow = rerunCurrectFlow;
1717
}
1818

1919
public String getNextFlowKey() {
2020
return nextFlowKey;
2121
}
2222

23-
public boolean isRerunCurrentFlow() {
24-
return rerunCurrentFlow;
25-
}
26-
2723
@Override
2824
public String getName() {
29-
return "goToFlow";
25+
return GO_TO_FLOW;
3026
}
3127
}

Diff for: src/main/java/morph/base/actions/impl/PublishMessageAction.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010
public class PublishMessageAction implements Action {
1111

12+
public static final String PUBLISH = "publish";
1213
private SimplifiedMessage simplifiedMessage;
1314

1415
public SimplifiedMessage getSimplifiedMessage() {
@@ -21,6 +22,6 @@ public void setSimplifiedMessage(SimplifiedMessage simplifiedMessage) {
2122

2223
@Override
2324
public String getName() {
24-
return "publish";
25+
return PUBLISH;
2526
}
2627
}

Diff for: src/main/java/morph/base/actions/impl/SetVariableAction.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*/
1111
public class SetVariableAction implements Action {
1212

13+
public static final String SET_VARIABLE = "setVariableAction";
1314
private VariableScope variableScope;
1415
private String variableKey;
1516
private String variableTitle;
@@ -61,7 +62,7 @@ public void setVariableTitle(String variableTitle) {
6162

6263
@Override
6364
public String getName() {
64-
return "setVariableAction";
65+
return SET_VARIABLE;
6566
}
6667

6768
@Override

Diff for: src/main/java/morph/base/beans/simplifiedmessage/SimplifiedMessage.java

+12-23
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,29 @@ public class SimplifiedMessage {
1616
/**
1717
* Represents the customer interface account key
1818
*/
19-
@JsonProperty(SimplifiedMessageMapping.USER_ID)
20-
private String customerIAK;
19+
private String userId;
2120

22-
@JsonProperty(SimplifiedMessageMapping.BOT_ID)
2321
private String botId;
2422

2523
/**
2624
* The main field that contains the message content
2725
*/
28-
@JsonProperty(SimplifiedMessage.SimplifiedMessageMapping.MESSAGES)
29-
private List<SimplifiedMessagePayload> payloads;
26+
private List<SimplifiedMessagePayload> messages;
3027

31-
32-
public String getCustomerIAK() {
33-
return customerIAK;
28+
public String getUserId() {
29+
return userId;
3430
}
3531

36-
public void setCustomerIAK(String customerIAK) {
37-
this.customerIAK = customerIAK;
32+
public void setUserId(String userId) {
33+
this.userId = userId;
3834
}
3935

40-
public List<SimplifiedMessagePayload> getPayloads() {
41-
return payloads;
36+
public List<SimplifiedMessagePayload> getMessages() {
37+
return messages;
4238
}
4339

44-
public void setPayloads(List<SimplifiedMessagePayload> payloads) {
45-
this.payloads = payloads;
40+
public void setMessages(List<SimplifiedMessagePayload> messages) {
41+
this.messages = messages;
4642
}
4743

4844
public String getBotId() {
@@ -53,19 +49,12 @@ public void setBotId(String botId) {
5349
this.botId = botId;
5450
}
5551

56-
public interface SimplifiedMessageMapping {
57-
String USER_ID = "user_id";
58-
String BOT_ID = "bot_id";
59-
String MESSAGE_TYPE = "type";
60-
String MESSAGES = "messages";
61-
}
62-
6352
@Override
6453
public String toString() {
6554
return "SimplifiedMessage{" +
66-
"customerIAK='" + customerIAK + '\'' +
55+
"userId='" + userId + '\'' +
6756
", botId='" + botId + '\'' +
68-
", payloads=" + payloads +
57+
", messages=" + messages +
6958
'}';
7059
}
7160
}

Diff for: src/main/java/morph/base/beans/simplifiedmessage/SimplifiedMessagePayload.java

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public abstract class SimplifiedMessagePayload {
2020

2121
private List<SuggestionElement> suggestionElements;
2222

23-
@JsonProperty(SimplifiedMessage.SimplifiedMessageMapping.MESSAGE_TYPE)
2423
private MessageType messageType;
2524

2625
public SimplifiedMessagePayload(MessageType messageType) {

0 commit comments

Comments
 (0)