PureEngage On-Premises

 View Only

Sign Up

  • 1.  Which object do I use to retrieve email case data when doing IWS customisation?

    Posted 02-08-2016 09:02
    I am trying to customise the case data view.
    When I tried this:
                object myCase = null;
                (Context as IDictionary<string, object>).TryGetValue("Case", out myCase);
                Model.Interaction = (myCase as ICase).MainInteraction;

    The case data object inside interaction is empty. Has anyone tried this before?


  • 2.  RE: Which object do I use to retrieve email case data when doing IWS customisation?

    Posted 02-08-2016 10:00
    Hi Sam,

    did you fill some case data during routing the call?

    Regards,
    --Jakub--


  • 3.  RE: Which object do I use to retrieve email case data when doing IWS customisation?

    Posted 02-08-2016 20:07
    Hi Jakub,

    Yes, I can see case data in the router log for the email. When I do this inside my model class. The count is 0.
    _log.Info("- interaction userdata count is " + _interaction.UserData.Keys.Count);


  • 4.  RE: Which object do I use to retrieve email case data when doing IWS customisation?

    Posted 02-09-2016 09:15
    Hi Sam,

    I think that the CaseData are not accessible through the Case object, but through the standard AttachedData. Try to extract all attached data from current interation.

    Regards,
    --Jakub--


  • 5.  RE: Which object do I use to retrieve email case data when doing IWS customisation?

    Posted 03-07-2016 20:18
    Hi Sam.

    Not sure if you solved this but...

    // Get the Case by:

    object caseObject;
    contextDictionary.TryGetValue("Case", out caseObject);
    ICase case = caseObject as ICase;

    // Get the main interaction from the case....
      IInteraction interaction = theCase.MainInteraction;
    // see if it is an inbound email...
    if (interactionType.ToUpper() == "INTERACTIONINBOUNDEMAIL")
    {
        IInteractionInboundEmail inboundEmail = interaction as                  IInteractionInboundEmail;

       var attachedData = inboundEmail.GetAllAttachedData();
       string fromAddress = attacheData["EmailAddress"];
       // etc etc.
    }


    You would obviously make the above robust by making sure your objects are valid before using them as well to avoid exceptiins.