1

I have been trying to create a Custom Split Decision as described here but I am not able to make it work.

My activity seams to be fine when I look at the Journey Build, but when I execute a journey it always uses the yes path even if my API service is replying no branchResult.

res.send(200, {
    "branchResult": (result ? 'yes' : 'no'),
    "message": "the anwer was ("+contactKey+": "+(result ? 'yes' : 'no')+")"
});

After a few checks I realize that the running interaction configuration is missing the outcomes[n].arguments data during the test/activation process.

Am I doing something wrong? Is it a bug?


This is how my journy looks like:

enter image description here

This is my activity config.json file:

{
    "workflowApiVersion": "1.0",
    "key": "check-activity",
    "metaData": {
        "version": "2.0",
        "icon": "images/wallet.png",
        "iconSmall": "images/wallet.png"
    },
    "type": "REST",
    "outcomes": [
        {
            "arguments": {
                "branchResult": "yes",
                "balance": "1"
            }
        },
        {
            "arguments": {
                "branchResult": "no",
                "balance": "0"
            }
        }
    ],
    "lang": {
        "en-US": {
            "name": "Check Balance",
            "description": "Sample split activity",
            "i18n_yes": "Yes",
            "i18n_no": "No"
        }
    },
    "outcomeLabelLanguageMap": {
        "yes": "i18n_yes",
        "no" : "i18n_no"
    },
    "arguments": {
        "execute": {
            "inArguments" : [],
            "outArguments": [],
            "url": "https://myserver.com/login/ixn/activities/check-activity/execute/",
            "verb": "POST",
            "body": "",
            "header": "",
            "format": "json",
            "useJwt": false,
            "timeout": 10000
        }
    },
    "configurationArguments": {
        "applicationExtensionKey": "check-balance",
        "defaults": { "userIdentifier": "1"},
        "save": {
            "url": "https://myserver.com/login/ixn/activities/check-activity/save/",
            "body": "",
            "verb": "POST",
            "useJwt": false
        },
        "publish": {
            "url": "https://myserver.com/login/ixn/activities/check-activity/publish/",
            "verb": "POST",
            "body": "",
            "useJwt": false
        },
        "validate": {
            "url": "https://myserver.com/login/ixn/activities/check-activity/validate/",
            "verb": "POST",
            "body": "",
            "useJwt": false            
        }
    },
    "edit": {
        "url": "https://myserver.com/login/ixn/activities/check-activity/",
        "height": 400,
        "width": 500
    }
}

This is my interaction configuration, retrieved using this API call: https://jbinteractions.exacttargetapps.com/fuelapi/interaction/v1/interactions/:InteractionID

{
    "id": "ID",
    "key": "0cef182c-6e77-07c8-2654-723c88536517",
    "name": "TLMK-002",
    "lastPublishedDate": "2015-04-01T04:09:07",
    "description": "",
    "version": 10,
    "workflowApiVersion": 1,
    "createdDate": "2015-04-01T03:58:47.56",
    "modifiedDate": "2015-04-01T04:09:07.483",
    "activities": [
        {
            "id": "8888ac5e-d2e6-4e96-a86d-8575813d933b",
            "key": "REST-1",
            "name": "",
            "description": "",
            "type": "REST",
            "outcomes": [
                {
                    "key": "35a0c3cb-3ee2-4786-b130-59131b44278c",
                    "next": "CONTACTDECISION-3",
                    "arguments": {},
                    "metaData": {}
                },
                {
                    "key": "c0464a55-41f3-4c34-86ec-5b1cb7fe1bcb",
                    "next": "EMAIL-4",
                    "arguments": {},
                    "metaData": {}
                }
            ],
            "arguments": {
                "executionMode": "{{Context.ExecutionMode}}",
                "definitionInstanceId": "{{Context.DefinitionInstanceId}}",
                "definitionId": "{{Context.DefinitionId}}",
                "activityId": "{{Activity.Id}}",
                "contactKey": "{{Contact.Key}}",
                "execute": {
                    "inArguments": [
                        {
                            "userIdentifier": "1"
                        }
                    ],
                    "outArguments": [],
                    "url": "https://myserver.com/login/ixn/activities/check-activity/execute/",
                    "verb": "POST",
                    "body": "",
                    "header": "",
                    "format": "json",
                    "useJwt": false,
                    "timeout": 10000
                },
                "testExecute": ""
            },
            "configurationArguments": {
                "applicationExtensionKey": "check-activity",
                "applicationExtensionId": "00000000-0000-0000-0000-000000000000",
                "save": {
                    "url": "https://myserver.com/login/ixn/activities/check-activity/save/",
                    "body": "",
                    "verb": "POST",
                    "useJwt": false
                },
                "testSave": "",
                "publish": {
                    "url": "https://myserver.com/login/ixn/activities/check-activity/publish/",
                    "verb": "POST",
                    "body": "",
                    "useJwt": false
                },
                "testPublish": "",
                "unpublish": "",
                "testUnpublish": "",
                "partnerActivityId": "",
                "validate": {
                    "url": "https://myserver.com/login/ixn/activities/check-activity/validate/",
                    "verb": "POST",
                    "body": "",
                    "useJwt": false
                },
                "testValidate": ""
            },
            "metaData": {
                "version": "2.0",
                "icon": "images/wallet.png",
                "iconSmall": "images/wallet.png",
                "isConfigured": true
            }
        },
        {
            "id": "bf2e5599-1a21-463f-9506-0d8aa4f89f53",
            "key": "EMAIL-4",
            "name": "email-2015-03-13T092856.972",
            "description": "19775028-87FF-4038-9C19-55DCE906504C",
            "type": "EMAIL",
            "outcomes": [
                {
                    "key": "c5d13568-f7cd-415d-8901-f5295045d988",
                    "next": "WAIT-6",
                    "arguments": {},
                    "metaData": {}
                }
            ],
            "arguments": {
                "emailSubjectDataBound": "xxxx 2500",
                "contactId": "{{Contact.Id}}",
                "contactKey": "{{Contact.Key}}",
                "emailAddress": "{{Contact.Default.Email}}",
                "sourceCustomObjectId": "{{Contact.AddressInfo.Email.SourceCustomObjectId}}",
                "sourceCustomObjectKey": "{{Contact.AddressInfo.Email.SourceCustomObjectKey}}",
                "fieldType": "{{Contact.AddressInfo.Email.FieldType}}",
                "customObjectKey": "{{Event.CONTACT-EVENT-bf18e751-bf60-bae3-9430-000ae911cb50._CustomObjectKey}}"
            },
            "configurationArguments": {
                "emailId": "4946",
                "emailSubject": "xxxx 2500",
                "sendClassificationId": "676E6A76-AF52-E411-AD6F-38EAA791D321",
                "senderProfileId": "",
                "deliveryProfileId": "",
                "preheader": "",
                "isMultipartMime": true,
                "triggeredSendId": "d6a9ec1f-57d8-e411-b14c-38eaa791d005"
            },
            "metaData": {}
        },
        {
            "id": "1edb6135-d914-495a-a840-1605dc7609e1",
            "key": "EMAIL-3",
            "name": "email-2015-03-13T092832.787",
            "description": "19775028-87FF-4038-9C19-55DCE906504C",
            "type": "EMAIL",
            "outcomes": [
                {
                    "key": "93d06179-f3d0-4b9d-9316-0473a92b3546",
                    "next": "REST-2",
                    "arguments": {},
                    "metaData": {}
                }
            ],
            "arguments": {
                "emailSubjectDataBound": "xxxx 2500 sin SMS",
                "contactId": "{{Contact.Id}}",
                "contactKey": "{{Contact.Key}}",
                "emailAddress": "{{Contact.Default.Email}}",
                "sourceCustomObjectId": "{{Contact.AddressInfo.Email.SourceCustomObjectId}}",
                "sourceCustomObjectKey": "{{Contact.AddressInfo.Email.SourceCustomObjectKey}}",
                "fieldType": "{{Contact.AddressInfo.Email.FieldType}}",
                "customObjectKey": "{{Event.CONTACT-EVENT-bf18e751-bf60-bae3-9430-000ae911cb50._CustomObjectKey}}"
            },
            "configurationArguments": {
                "emailId": "4946",
                "emailSubject": "xxxx 2500 sin SMS",
                "sendClassificationId": "676E6A76-AF52-E411-AD6F-38EAA791D321",
                "senderProfileId": "",
                "deliveryProfileId": "",
                "preheader": "",
                "isMultipartMime": true,
                "triggeredSendId": "d8a9ec1f-57d8-e411-b14c-38eaa791d005"
            },
            "metaData": {}
        },
        {
            "id": "044bcd8d-072c-48ab-9319-1a906793b7ac",
            "key": "WAIT-5",
            "name": "",
            "description": "",
            "type": "WAIT",
            "outcomes": [
                {
                    "key": "2219756d-4ee0-4860-ac3d-7e0c15705208",
                    "arguments": {},
                    "metaData": {}
                }
            ],
            "arguments": {
                "waitDefinitionId": "9ae15183-9bfe-4715-aced-9aab5210773f",
                "waitForEventId": "",
                "executionMode": "{{Context.ExecutionMode}}",
                "startActivityKey": "{{Context.StartActivityKey}}",
                "waitQueueId": "{{Context.WaitQueueId}}"
            },
            "configurationArguments": {
                "waitDuration": 1,
                "waitUnit": "MINUTES",
                "specifiedTime": "0001-01-01T00:00:00",
                "timeZone": "",
                "description": "",
                "waitForEventKey": ""
            },
            "metaData": {
                "waitType": "duration"
            }
        },
        {
            "id": "7e2d3b34-24de-4739-8224-6a5ff7c5956c",
            "key": "EMAIL-1",
            "name": "email-2015-03-13T092749.036",
            "description": "19775028-87FF-4038-9C19-55DCE906504C",
            "type": "EMAIL",
            "outcomes": [
                {
                    "key": "4d373604-725e-4207-bf56-b677d3bca8b2",
                    "next": "WAIT-2",
                    "arguments": {},
                    "metaData": {}
                }
            ],
            "arguments": {
                "emailSubjectDataBound": "xxxx 2500 con SMS",
                "contactId": "{{Contact.Id}}",
                "contactKey": "{{Contact.Key}}",
                "emailAddress": "{{Contact.Default.Email}}",
                "sourceCustomObjectId": "{{Contact.AddressInfo.Email.SourceCustomObjectId}}",
                "sourceCustomObjectKey": "{{Contact.AddressInfo.Email.SourceCustomObjectKey}}",
                "fieldType": "{{Contact.AddressInfo.Email.FieldType}}",
                "customObjectKey": "{{Event.CONTACT-EVENT-bf18e751-bf60-bae3-9430-000ae911cb50._CustomObjectKey}}"
            },
            "configurationArguments": {
                "emailId": "4946",
                "emailSubject": "xxxx 2500 con SMS",
                "sendClassificationId": "676E6A76-AF52-E411-AD6F-38EAA791D321",
                "senderProfileId": "",
                "deliveryProfileId": "",
                "preheader": "",
                "isMultipartMime": true,
                "triggeredSendId": "d7a9ec1f-57d8-e411-b14c-38eaa791d005"
            },
            "metaData": {}
        },
        {
            "id": "ec63d36f-d7bd-4f4c-a5c0-7d7680b10f75",
            "key": "CONTACTDECISION-3",
            "name": "[TLMK-MOBILE: Status Equal OK]",
            "description": "[TLMK-MOBILE: Status Equal OK]",
            "type": "CONTACTDECISION",
            "outcomes": [
                {
                    "key": "d7ad351e-960d-4ec1-af44-383f99ca9289",
                    "next": "EMAIL-1",
                    "arguments": {
                        "when": true
                    },
                    "metaData": {}
                },
                {
                    "key": "f4868090-148b-4e9d-9fb4-dac183475276",
                    "next": "EMAIL-3",
                    "arguments": {
                        "when": false
                    },
                    "metaData": {}
                }
            ],
            "arguments": {
                "filterResult": "{{Contact.FilterId.eaadc9c9-68ef-49d2-b8a6-679b0d1ba8a0}}"
            },
            "configurationArguments": {
                "schemaVersionId": 636,
                "criteria": "<FilterDefinition Source='SubscriberAttribute'><ConditionSet Operator='AND' ConditionSetName='Grouping'><Condition ID='35fc0f72-08b9-e411-b14c-38eaa791d005' isParam='false' Operator='Equal' operatorTemplate='undefined' operatorEditable='1' valueEditable='1' conditionValid='1'><Value><![CDATA[OK]]></Value></Condition></ConditionSet></FilterDefinition>",
                "filterDefinitionId": "eaadc9c9-68ef-49d2-b8a6-679b0d1ba8a0"
            },
            "metaData": {}
        },
        {
            "id": "974119d3-a14c-49a1-9595-8f52502c3529",
            "key": "REST-2",
            "name": "[FRECUENCIA: 2 VOLUMETRIA: 20000]",
            "description": "",
            "type": "REST",
            "outcomes": [
                {
                    "key": "b6c1b7f9-f2eb-4ec2-9d81-2831639cb786",
                    "next": "WAIT-5",
                    "arguments": {},
                    "metaData": {}
                }
            ],
            "arguments": {
                "executionMode": "{{Context.ExecutionMode}}",
                "definitionInstanceId": "{{Context.DefinitionInstanceId}}",
                "definitionId": "{{Context.DefinitionId}}",
                "activityId": "{{Activity.Id}}",
                "contactKey": "{{Contact.Key}}",
                "execute": {
                    "inArguments": [],
                    "outArguments": [],
                    "url": "https://myserver.com/login/ixn/activities/tlmk/execute/",
                    "verb": "POST",
                    "body": "",
                    "header": "",
                    "format": "json",
                    "useJwt": false,
                    "timeout": 10000
                },
                "testExecute": ""
            },
            "configurationArguments": {
                "applicationExtensionKey": "tlmk",
                "applicationExtensionId": "00000000-0000-0000-0000-000000000000",
                "save": {
                    "url": "https://myserver.com/login/ixn/activities/tlmk/save/",
                    "body": "",
                    "verb": "POST",
                    "useJwt": false
                },
                "testSave": "",
                "publish": {
                    "url": "https://myserver.com/login/ixn/activities/tlmk/publish/",
                    "verb": "POST",
                    "body": "",
                    "useJwt": false
                },
                "testPublish": "",
                "unpublish": "",
                "testUnpublish": "",
                "partnerActivityId": "",
                "validate": {
                    "url": "https://myserver.com/login/ixn/activities/tlmk/validate/",
                    "verb": "POST",
                    "body": "",
                    "useJwt": false
                },
                "testValidate": ""
            },
            "metaData": {
                "version": "2.0",
                "icon": "images/tlmk.png",
                "iconSmall": "images/tlmk.png",
                "isConfigured": true
            }
        },
        {
            "id": "1cf381d5-f026-4a8f-a43e-a12f6d4ba7aa",
            "key": "WAIT-6",
            "name": "",
            "description": "",
            "type": "WAIT",
            "outcomes": [
                {
                    "key": "2bbfdf15-e605-41a1-b185-a410d1072fac",
                    "arguments": {},
                    "metaData": {}
                }
            ],
            "arguments": {
                "waitDefinitionId": "24671ed5-679a-4130-8736-18044a88e936",
                "waitForEventId": "",
                "executionMode": "{{Context.ExecutionMode}}",
                "startActivityKey": "{{Context.StartActivityKey}}",
                "waitQueueId": "{{Context.WaitQueueId}}"
            },
            "configurationArguments": {
                "waitDuration": 1,
                "waitUnit": "MINUTES",
                "specifiedTime": "0001-01-01T00:00:00",
                "timeZone": "",
                "description": "",
                "waitForEventKey": ""
            },
            "metaData": {
                "waitType": "duration"
            }
        },
        {
            "id": "2ecbce99-9780-4331-86a7-e07399be6450",
            "key": "WAIT-2",
            "name": "",
            "description": "",
            "type": "WAIT",
            "outcomes": [
                {
                    "key": "96cbe0da-d938-4082-9d6c-c3fd8d98bbd5",
                    "arguments": {},
                    "metaData": {}
                }
            ],
            "arguments": {
                "waitDefinitionId": "9a3b4735-fdb6-4988-87ff-a2f76eba8626",
                "waitForEventId": "",
                "executionMode": "{{Context.ExecutionMode}}",
                "startActivityKey": "{{Context.StartActivityKey}}",
                "waitQueueId": "{{Context.WaitQueueId}}"
            },
            "configurationArguments": {
                "waitDuration": 1,
                "waitUnit": "MINUTES",
                "specifiedTime": "0001-01-01T00:00:00",
                "timeZone": "",
                "description": "",
                "waitForEventKey": ""
            },
            "metaData": {
                "waitType": "duration"
            }
        }
    ],
    "triggers": [
        {
            "id": "1b6f5319-b0ae-40c6-96e0-ea9b894f6297",
            "key": "TRIGGER",
            "name": "TRIGGER",
            "description": "[Contact: Contact Key IsNotNull ]",
            "type": "ContactDecision",
            "outcomes": [],
            "arguments": {
                "filterResult": "{{Contact.FilterId.5f29523e-4b4c-40b6-a66f-159f0679bc9f}}"
            },
            "configurationArguments": {
                "schemaVersionId": 496,
                "criteria": "<FilterDefinition Source='SubscriberAttribute'><ConditionSet Operator='AND' ConditionSetName='Grouping'><Condition ID='ebad627c-af52-e411-ad6f-38eaa791d321' isParam='false' Operator='IsNotNull' operatorTemplate='undefined' operatorEditable='1' valueEditable='1' conditionValid='1'><Value><![CDATA[]]></Value></Condition></ConditionSet></FilterDefinition>",
                "filterDefinitionId": "5f29523e-4b4c-40b6-a66f-159f0679bc9f"
            },
            "metaData": {
                "eventDefinitionId": "1f160d3d-e842-4890-8775-a42c8ea0b7ef",
                "eventDefinitionKey": "CONTACT-EVENT-bf18e751-bf60-bae3-9430-000ae911cb50",
                "configurationDescription": "[Contact: Contact Key IsNotNull ]"
            }
        }
    ],
    "goals": [],
    "stats": {
        "currentPopulation": 0,
        "cumulativePopulation": 0,
        "metGoal": 0,
        "goalPerformance": 0
    },
    "entryMode": "SingleEntryAcrossAllVersions",
    "executionMode": "Production",
    "status": "Published",
    "definitionId": "b801ed73-d2fa-4adb-bfcc-d4fa9dc403bd"
}
2

The type should be 'RestDecision' instead of 'REST', as Drew mentioned.

However, it also looks like the outcome arguments are not getting saved to the activity's JSON structure. Can you verify that the correct JSON is being sent to Journey Builder in your activity's javascript when the updateActivity Postmonger event is called? One way to do this is to set localStorage.debugLog = true in your browser console. This will cause Journey Builder to log all Postmonger events with their respective arguments in the console.

1
  • The answer you and Drew Simmons gave me was almost right. It started working when I set the Type to 'RESTDECISION'. Thanks guys! Apr 14 '15 at 15:32
2

In your config.json try changing "type": "REST" to "type": "RESTDECISION".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.