Expand my Community achievements bar.

SOLVED

How to keep input temporary data as it is to the outgoing transition in a custom activity

Avatar

Level 4

Hi All,

I am new to creating custom activities in workflow and seeking help here:

My use case is to create a custom activity that will just enable one of the transitions [either ok or not ok] based on the several conditions- this can be achieved with out of the box activities but I have to do it in a custom activity for final user simplification.

Currently based on the conditions I am able to enable one of the transitions but not able to create the outgoing temporary schema to pass to the next activity. Basically i need help in following, a sample code would be extremely helpful.

1. How to keep the incoming data as it is in the outgoing transition

2. How to filter the incoming data and create a new outgoing transition.

 

PoonamBhardwaj_0-1653089611663.png

-- While opening the display target and check the output schema it is throwing below error and there is nothing under data tab[display the target > data]

PoonamBhardwaj_1-1653089741401.png

 

I have searched the community and previously few fellow members have already achieved this but i could not resolve this based on the discussions happened there.

@PLundmark : https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-classic-questions/change-count-of-ou...

@acs-ratul : https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-classic-questions/custom-js-code-for...

@_Manoj_Kumar_  : https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-classic-questions/outbound-transitio...

@Jonathon_wodnicki  @DavidKangni 

Any related help will also be extremely useful.

Thanks in advance!

 

 

1 Accepted Solution

Avatar

Correct answer by
Level 4

Hey @Denis_Bozonnet ,

Thanks a lot for quick response, really appreciate it! 

While trying to share the js, I just went through it once and luckily got the error --

Mistake:

I was trying to create a table using - "select * from <previous table> and was trying to post this to outcome postEvent and the previous table name I was trying to fetch from xml body-- which was yielding the incorrect result, once I removed this code and directly used below mentioned code from @DavidKangni  response in https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-classic-questions/outbound-transitio...

 it worked  

task.postEvent(task.transitionByName('transition'));
task.setCompleted();
return 0;

Thanks once again @Denis_Bozonnet  @Ssb_94 @DavidKangni  for all the help 

 

View solution in original post

6 Replies

Avatar

Level 7

Hi,

Just to double confirm, have you enabled "Keep the result of interim populations between two executions" under Workflow > Properties

Ssb_94_0-1653166170082.png

If in case it is already enabled, clear your local cache and try again. Sometimes it might work.

Thanks,

Avatar

Level 4

Hi @Ssb_94 ,

Thanks a lot for looking into it and responding!

I tried both the ways [keeping and removing the interim with cache clear and reconnect] but unfortunately , still the same error for me.

I am sure something is wrong in my js- temp table code, but I am wondering why to create a temp table at all, as anyways I just have to get the incoming transition and keep it in the outgoing which can be done with a small code, which I am not aware of and seeking help here. 

Avatar

Employee Advisor

Hi @Poonam_Dogra 

it could be the way you get the table name from the incoming transition. It is accessible by var.$xxxxx can’t remember top of my head the variable for the temp table. It’s related to the name of the activity in the workflow.  Could you send your JS?

thanks

denis. 

Avatar

Correct answer by
Level 4

Hey @Denis_Bozonnet ,

Thanks a lot for quick response, really appreciate it! 

While trying to share the js, I just went through it once and luckily got the error --

Mistake:

I was trying to create a table using - "select * from <previous table> and was trying to post this to outcome postEvent and the previous table name I was trying to fetch from xml body-- which was yielding the incorrect result, once I removed this code and directly used below mentioned code from @DavidKangni  response in https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-classic-questions/outbound-transitio...

 it worked  

task.postEvent(task.transitionByName('transition'));
task.setCompleted();
return 0;

Thanks once again @Denis_Bozonnet  @Ssb_94 @DavidKangni  for all the help 

 

Avatar

Employee Advisor

Hi @Poonam_Dogra 

restrain yourself to use the Keep interim results as the workflow temp tables will never been cleaned up. 

Prior your activity, I would use a Fork activity to share the incoming audience to 2 branches: one where you would save the records in a bespoke data schema, the 2nd branch to do the treatment you want the workflow to do. 

hope this helps,

thanks

Denis. 

Avatar

Level 4

Thank you @Denis_Bozonnet for responding, really grateful!

I am currently doing the same to serve the purpose, but those are extra activities in the workflow which I wanted to remove as the custom activity itself should retain the incoming transition as it is [no change in the numbers or output columns].

Any high level idea to how to keep the incoming transition preserved in the output would also be extremely helpful.