-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SYMPHONYP-940 MS Teams feature to submit the adaptive card
- Loading branch information
1 parent
e300cb5
commit 3f2fec6
Showing
3 changed files
with
46 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
.../main/java/org/finos/springbot/teams/templating/adaptivecard/AdaptiveCardPassthrough.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package org.finos.springbot.teams.templating.adaptivecard; | ||
|
||
import org.finos.springbot.workflow.response.WorkResponse; | ||
|
||
import com.fasterxml.jackson.databind.JsonNode; | ||
|
||
public class AdaptiveCardPassthrough { | ||
|
||
private final static String ADAPTIVE_CARD = "AdaptiveCard"; | ||
private final static String ADAPTIVE_CARD_TYPE = "type"; | ||
|
||
private final JsonNode jsonNode; | ||
|
||
public AdaptiveCardPassthrough(JsonNode jsonNode) { | ||
this.jsonNode = jsonNode; | ||
} | ||
|
||
public JsonNode getJsonNode() { | ||
return jsonNode; | ||
} | ||
|
||
public static boolean isAdaptiveCard(WorkResponse wr) { | ||
if (wr.getFormObject() instanceof AdaptiveCardPassthrough) { | ||
AdaptiveCardPassthrough passthrough = (AdaptiveCardPassthrough) wr.getFormObject(); | ||
JsonNode node = passthrough.getJsonNode(); | ||
JsonNode adaptiveNode = node.get(ADAPTIVE_CARD_TYPE); | ||
return adaptiveNode.asText().equals(ADAPTIVE_CARD); | ||
} | ||
|
||
return false; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters