This document shows a working example of how to use an instance variable in a workflow for Adobe Campaign v6/v7.

In this example, an instance variable is used to compute dynamically the split percentage to apply on a population.

  1. Create a workflow and add a Start activity.

  2. Add and configure a JavaScript code activity to define an instance variable.

    For example: instance.vars.segmentpercent = 10;

    js_ex1
  3. Add a Query activity and target recipients according to your needs.

  4. Add a Split activity and configure it to perform a random sampling of the incoming population. The sampling percentage can be anything of your choice. It is set to 50% in this example.

    It is this percentage which is updated dynamically thanks to the instance variable defined previously.

    js_ex2
  5. Inside the Initialization script section of the Advanced tab of the Split activity, define a JS condition. The JS condition selects the random sampling percentage of the first transition coming out of the Split activity and updates it to a value set by the instance variable created previously.

    activity.transitions.extractOutput[0].limiter.percent = instance.vars.segmentpercent; 

    js_ex3
  6. Make sure that the complement is generated in a separate transition of the Split activity and add End activities after each of the outbound transitions.

  7. Save and execute the workflow. The dynamic sampling gets applied according to the instance variable.

    js_ex4

이 작업에는 Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License의 라이센스가 부여되었습니다.  Twitter™ 및 Facebook 게시물은 Creative Commons 약관을 적용받지 않습니다.

법적 고지 사항   |   온라인 개인 정보 보호 정책