2

Firstly, I am aware that there are two API implementations for adding a Custom Activity in Journey Builder:

  1. Legacy Custom Activities
  2. V1 Platform Custom Activities

the original Custom Activities API has apparently been changed to 'Legacy' in recent days and replaced with 'V1 Platform'.

We have our Custom Activity working on the Legacy Platform, but cannot get this to work on the V1 Platform because the method updateActivity does not seem to work.

Refer to our code examples below.

Legacy Platform Usage

$(window).ready ->
    connection.trigger "ready"
    connection.trigger "requestTokens"
    connection.trigger "requestEndpoints"

connection.on "updateStep", (updateStep) ->
  console.log "updateStep", updateStep
  payload = {}
  payload.options = "option1": "there is a payload option by updateStep"
  payload.partnerActivityId = "123456"
  payload.flowDisplayName = "legacy platform activity"

connection.trigger "save", payload

connection.on "requestPayload", (requestPayload) ->
  console.log "requestPayload", requestPayload
  payload = {}
  payload.options = "option1": "there is a payload option by requestPayload"
  payload.partnerActivityId = "456789"
  payload.flowDisplayName = "legacy platform activity"

connection.trigger "getPayload", payload

connection.on "populateFields", (payload) ->
  console.log "populateFields", payload

connection.on "getTokens", (tokens) ->
  console.log "tokens", tokens

connection.on "getEndpoints", (endpoints) ->
  console.log "endpoints", endpoints

V1 Platform Usage

toJbPayload = {}

 connection.trigger "updateButton",
    button: "next"
    enabled: true
    text: "done"
    visible: true

 connection.trigger "updateButton",
   button: "back"
   enabled: false
   visible: false

connection.on "initConfig", (payload) ->
  console.log "initConfig", payload

connection.on "requestedTokens", (requestedTokens) ->
  console.log "requestedTokens", requestedTokens

connection.on "requestedEndpoints", (requestedEndpoints) ->
  console.log "requestedEndpoints", requestedEndpoints

connection.on "clickedNext", (clickedNext) ->
  console.log "clickedNext", clickedNext
  save()
  connection.trigger "ready"

connection.on "clickedBack", (clickedBack) ->
  console.log "clickedBack", clickedBack
  connection.trigger "ready"

connection.on "initActivity", (payload) ->
  console.log "initActivity", payload
  toJbPayload = payload if payload
  payload.options = "option1": "there is a payload option by updateActivity"
  payload.partnerActivityId = "456789"
  toJbPayload.name = "v1 platform activity"

save = () ->
  console.log "in save function toJbPayload: ", toJbPayload
  connection.trigger "updateActivity", toJbPayload

It appears the issue is in the script used by Journey Builder https://jbprod.exacttargetapps.com/canvas/js/customIframeBaseView.jscustomIframeBaseView.js (this link won't work externally as it needs to load within Journey Builder) — is missing code for the updateActivity method. However, other methods are present:

this.iframeOn('requestTokens', this.getTokens);
this.iframeOn('requestEndpoints', this.getEndpoints);
this.iframeOn('ready', this.onIframeReady);

// Workflow API v1.0
this.iframeOn('updateButton', this.updateFooter, '1.0');
// (ixn_pre_workflow)
this.iframeOn('save', this.save, '0.5');
this.iframeOn('updateStep', this.updateFooter, '0.5');

So my question is: are we doing something wrong or is this a known issue with the V1 Platform implementation? If so, is there a workaround?

2

You've done some great research and thanks for being so thorough. You're spot on about our renaming in the documentation. The "Legacy Platform" (0.5) custom interaction components have a different interface than the "Platform V1" (1.0) has. Postmonger is different, the config.json file (notice it isn't a config.js file wrapped in an AMD module define method) is different as well as several other changes.

You'll want to make sure your config.json file for your Custom Activity on the 1.0 Platform is setup as such. Your application must provide the config.json and not the config.js file...this causes Journey Builder to load the Activity in a "retroactive" mode and treats the Custom Activity as a Legacy Platform component.

Journey Builder implements several design patterns which may not make this readily apparent, but it appears that there may be a configuration conflict between the two versions happening in your implementation code causing the issue.

In order to be certain and fully understand what is happening, I would need to see your config.json file for the activity in question. Please do not post that here. :)

You can send that to me via email: bdean AT exacttarget DOT com

The only time you should see the "0.5" is if the custom activity in question has been configured as a "legacy platform" custom activity. If everything is setup properly, we've had several successful tests by various developers thus far.

Keep me posted.

Thanks, Benjamin Dean

| improve this answer | |
  • Thanks Benjamin, I've sent you an email with our config.json file. – Eliot Harper Sep 11 '14 at 4:27
  • Thank you, I've received the information. Could you please share with me any console or network tab errors (from Chrome browser) while loading an Interaction for editing in Journey Builder? – Benjamin Dean Sep 11 '14 at 21:14
  • Hello Benjamin, we fixed the 404 on underscore.min.map error you mentioned in your email. There is no any error In the Network tab. Refer to logs of loading interaction and Chrome Console screenshot. – Eliot Harper Sep 12 '14 at 7:13
  • Hi Benjamin, further to my last comment, those logs and screenshot referred to using config.json. Here are the logs when using config.js for loading interaction and Chrome Console screenshot – Eliot Harper Sep 12 '14 at 18:32
0

I'm also struggling with V1 platform but in a different area. I've ben able to get updateActivity to work but I had to do one thing that is not covered in the documentation.

In order to get the custom step to see itself as "Configured" you need to add a "isConfigured" key to the metaData obj.

toJbPayload.metaData.isConfigured = true;

Hope this helps.

| improve this answer | |
  • We found this bug also and have updated documentation. You'll actually want to use isConfigured (not isComplete). :) – Benjamin Dean Oct 1 '14 at 21:29
  • 1
    Oops. That's what I meant. I fixed my answer just in case anyone else runs across this. – Andy Rowse Oct 2 '14 at 2:25

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.