Workflow

Example: Check Out to same patron (renewal) with overdue fine

The example shows the communication flow between caller and server for a patron checking out an item that they already have checked out, essentially renewing the item. The item is overdue and the patron chooses to pay the fine at the circulation desk with cash.


Workflow Communication

==> Caller sends the initial check out request
POST /api/.../workflow
{
    "type":"checkout",
    "WorkflowRequestType":2,
    "TxnBranchID":"3",
    "TxnUserID":"1",
    "TxnWorkstationID":"1182",
    "RequestExtension":{
        "WorkflowRequestExtensionType":1,
        "Data":{
            "CheckoutTypeID":6,
            "PatronBarcode":"21756003332071",
            "ItemBarcode":"123",
            "OfflineCheckoutDate":null,
            "IsSpecialLoan":false,
            "SpecialLoanUnits":0,
            "SpecialLoanUnitsNum":0,
            "IsOvernightPermitted":false,
            "IsBBMBulkCheckout":false,
            "IgnoreItemsOutLimitPrompt":false,
            "IgnoreLoanLimitPromptForMaterialTypeIDs":null
        }
    },
    "WorkflowReplies":null
}
<== Answer from server - Patron is blocked
Server would like caller to prompt for more input. Display information is provided.
{
    "WorkflowRequestGuid":"5d356b6e-d626-4b8c-aa3b-f08fc4caaa22",
    "WorkflowRequestType":2,
    "WorkflowStatus":-3,
    "Prompt":{
        "WorkflowPromptID":1,
        "Name":null,
        "Description":null,
        "WorkflowPromptType":3,
        "WorkflowPromptOptions":6,
        "DefaultPromptOption":0,
        "Title":"Patron is Blocked",
        "Message":"Do you want to continue with this operation?",
        "PromptExtension":{
            "WorkflowPromptExtensionType":8,
            "Data":{
                "HeldItemBlock":false,
                "FirstLevelFineBlock":true,
                "UnreadMessageBlock":false,
                "SecondLevelFineBlock":false,
                "OverdueItemBlock":true,
                "ClaimLimitBlock":false,
                "BlockingNoteBlock":false,
                "CollectionAgencyBlock":false,
                "PatronSystemBlock":false,
                "LibraryAssignedBlock":false,
                "FreeTextBlock":false,
                "PatronBlocks":[
                    {
                        "PatronID":358368,
                        "PatronFullName":"Young, Gustopher",
                        "BlockType":3,
                        "BlockID":103,
                        "BlockDescription":"Total overdue items: 1"
                    },
                    {
                        "PatronID":358368,
                        "PatronFullName":"Young, Gustopher",
                        "BlockType":3,
                        "BlockID":103,
                        "BlockDescription":"Long overdue: 1 of 1"
                    },
                    {
                        "PatronID":358368,
                        "PatronFullName":"Young, Gustopher",
                        "BlockType":3,
                        "BlockID":104,
                        "BlockDescription":"Patron owes money. Amount due: $4.60"
                    }
                ],
                "LinkedPatronBlocks":[]
            }
        }
    },
    "InformationMessages":[],
    "AnswerExtension":null,
    "CircTranType":6,
    "ReceiptType":0,
    "ReceiptUrl":"",
    "FineEReceiptSent":false
}
==> Caller sends a reply to the server indicating they want to continue (PromptResult=5).
PUT /api/.../workflow/5d356b6e-d626-4b8c-aa3b-f08fc4caaa22
{
    "WorkflowPromptID": 1,
    "WorkflowPromptResult": 5,
    "ReplyValue": null,
    "ReplyExtension": null
}
<== Answer from server - Renew item?
Server would like caller to prompt for more input. Display information is provided.
{
    "WorkflowRequestGuid":"5d356b6e-d626-4b8c-aa3b-f08fc4caaa22",
    "WorkflowRequestType":2,
    "WorkflowStatus":-3,
    "Prompt":{
        "WorkflowPromptID":24,
        "Name":null,
        "Description":null,
        "WorkflowPromptType":1,
        "WorkflowPromptOptions":6,
        "DefaultPromptOption":5,
        "Title":"Renew item",
        "Message":"This item is already checked out to this patron. Do you want to renew?",
        "PromptExtension":null
    },
    "InformationMessages":[],
    "AnswerExtension":null,
    "CircTranType":6,
    "ReceiptType":0,
    "ReceiptUrl":"",
    "FineEReceiptSent":false
}
==> Caller sends a reply to the server indicating they want to continue with renewal (PromptResult=5).
PUT /api/.../workflow/5d356b6e-d626-4b8c-aa3b-f08fc4caaa22
{
    "WorkflowPromptID": 24,
    "WorkflowPromptResult": 5,
    "ReplyValue": null,
    "ReplyExtension": null
}
<== If there is charge for renewal and the item is overdue, answer from the server is Pay the checkout charge and overdue fine. If there is no renewal charge, Pay the overdue fine
<== Answer from server - Overdue Fine and Charge for checkout
Server would like caller to prompt for more input. Display information is provided.
    {

    "WorkflowRequestGuid":"a55f79df-f46f-4669-aed3-e154e5ab0eb8",
    "WorkflowRequestType":2,
    "WorkflowStatus":-3,
    "Prompt":
    {
    "WorkflowPromptID":60,
    "Name":null,
    "Description":null,
    "WorkflowPromptType":16,
    "WorkflowPromptOptions":6,
    "DefaultPromptOption":5,
    "Title":"Renew chargeable overdue item",
    "Message":"Cancel the dialog.",
    "AlternateYesText":"",
    "AlternateNoText":"",
    "AlternateCancelText":"",
    "AlternateContinueText":"",
    "PromptExtension":
    {
        "WorkflowPromptExtensionType":9,
        "Data":{
            "FineAmount":0.7000,
            "IsCheckingOutToDifferentPatron":false,
            "ModifyFineAllowed":true,
            "ItemBarcode":"BulkCreate003152060",
            "ItemDueDate":"2016-05-17T23:59:00-04:00",
            "ItemRecordID":3152060,
            "ItemTitle":"Radio Control Car Action Sept 2004",
            "PatronBarcode":"1001000000254",
            "PatronBranchID":99,
            "PatronID":67794,
            "PatronName":"Ms. Anna Farkas",
            "CheckoutCharge":1.0000,
            "CheckoutChargeActions":[1,2,5]
            }
        }
    },
    "InformationMessages":[],
    "AnswerExtension":null,
    "CircTranType":9,
    "ReceiptType":0,
    "ReceiptUrl":"",
    "FineEReceiptSent":false
}
==> Caller sends a reply to the server indicating they want to pay the fine with cash (PromptResult=6).
PUT /api/.../workflow/5d356b6e-d626-4b8c-aa3b-f08fc4caaa22
    {
    "WorkflowPromptID":11,
    "WorkflowPromptResult":5,
    "ReplyValue":null,
    "ReplyExtension":{
        "WorkflowReplyExtensionType":3,
        "Data":{
            "ProcChargeTxnCodeID":2,
            "ProcTransAmount":1,
            "OVDChargeTxnCodeID":2,
            "OVDTransAmount":0.7,
            "PayMethod":11
        }
    }
}
<== Answer from server - Overdue Fine
Server would like caller to prompt for more input. Display information is provided.
{
    "WorkflowRequestGuid":"5d356b6e-d626-4b8c-aa3b-f08fc4caaa22",
    "WorkflowRequestType":2,
    "WorkflowStatus":-3,
    "Prompt":{
        "WorkflowPromptID":13,
        "Name":null,
        "Description":null,
        "WorkflowPromptType":7,
        "WorkflowPromptOptions":5,
        "DefaultPromptOption":7,
        "Title":"Overdue Fine",
        "Message":"",
        "PromptExtension":{
            "WorkflowPromptExtensionType":9,
            "Data":{
                "FineAmount":2.3000,
                "IsCheckingOutToDifferentPatron":false,
                "ItemBarcode":"123",
                "ItemDueDate":"2014-03-06T23:59:59-05:00",
                "ItemRecordID":2254290,
                "ItemTitle":"My girl 2 [videorecording]",
                "PatronBarcode":"21756003332071",
                "PatronBranchID":3,
                "PatronID":358368,
                "PatronName":"Gustopher Young"
            }
        }
    },
    "InformationMessages":[],
    "AnswerExtension":null,
    "CircTranType":6,
    "ReceiptType":0,
    "ReceiptUrl":"",
    "FineEReceiptSent":false
}
==> Caller sends a reply to the server indicating they want to pay the fine with cash (PromptResult=6).
PUT /api/.../workflow/5d356b6e-d626-4b8c-aa3b-f08fc4caaa22
{
    "WorkflowPromptID": 13,
    "WorkflowPromptResult": 6,
    "ReplyValue": 2.3,
    "ReplyExtension":{
        "WorkflowReplyExtensionType":2,
        "Data":{
            "PaymentMethod":11,
            "Note":"Payment by cash made using LEAP.",
            "PaidAmount":2.3,
            "ProcessedCreditCard":false,
            "CreditDuePatron":0
        }
    }
}
<== Answer from server - Check out (renewal) placed successfully
Display information is provided for the checked out item.
{
    "WorkflowRequestGuid":"5d356b6e-d626-4b8c-aa3b-f08fc4caaa22",
    "WorkflowRequestType":2,
    "WorkflowStatus":1,
    "Prompt":null,
    "InformationMessages":[
        {
            "Type":1,
            "Title":"",
            "Message":"Renewal successful"
        }
    ],
    "AnswerExtension":{
        "WorkflowAnswerExtensionType":1,
        "Data":{
            "IsEphemeralItem":false,
            "EphemeralItemCount": 0,
            "ItemRecordID":2254290,
            "ItemBarcode":"123",
            "ItemTitle":"My girl 2 [videorecording]",
            "AssignedBranchID":3,
            "AssignedBranchName":"Amsterdam Free Library",
            "MaterialTypeID":3,
            "MaterialTypeDescription":"Video",
            "DueDate":"2014-04-14T23:59:00-04:00",
            "ShelfLocationID":0,
            "ShelfLocation":null,
            "Action":"Renewal",
            "CallNumber":"VC Fict My",
            "LoanUnitsType":1,
            "ItemsOutCount":1,
            "OverdueItemsCount":0,
            "LongOverdueItemsCount":0,
            "CurrentClaimCount":0,
            "CurrentLostCount":0
        }
    },
    "CircTranType":6,
    "ReceiptType":0,
    "ReceiptUrl":"",
    "FineEReceiptSent":false
}