postEvent using

Avatar

Avatar
Validate 1
Level 2
alexandred77684
Level 2

Likes

5 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
alexandred77684
Level 2

Likes

5 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
alexandred77684
Level 2

07-09-2017

Hello Community.

Could you tell me how we can use postEvent to call Signal from Javascript activity with parameter, plesae ?

What is the syntax to call signal with several parameters ? 

xtk.workflow.PostEvent('OTHER_WORKFLOW','SIGNAL','','?????WHAT IS THE SYNTAX?????', false);

What is the syntax to use varaiables after postEvenet, in OTHER_WORKFLOW  ?

vars.XXXX  or vraiables.XXXX or other ?

Thank you for you support.

BR.

Alexandre

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Employee
RamaRajesh
Employee

Likes

40 likes

Total Posts

81 posts

Correct reply

10 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Employee
RamaRajesh
Employee

Likes

40 likes

Total Posts

81 posts

Correct reply

10 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
RamaRajesh
Employee

07-09-2017

Hi Alexandre,

Please find the below example. the script inside External signal's Advanced tab helps you in tracking which Postevent sent the signal. Hope this helps!

1294290_pastedImage_0.png

1294291_pastedImage_1.png

Answers (8)

Answers (8)

Avatar

Avatar
Validate 1
Level 2
LeonieSwart
Level 2

Likes

12 likes

Total Posts

30 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Give Back 5
Give Back 3
Give Back
Boost 5
View profile

Avatar
Validate 1
Level 2
LeonieSwart
Level 2

Likes

12 likes

Total Posts

30 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Give Back 5
Give Back 3
Give Back
Boost 5
View profile
LeonieSwart
Level 2

10-10-2018

Hi Vipul

Thanks for you response!

Unfortunately I already tried vars.varName but it is also returning undefined.

So if I understand correctly what is marked as solution, isn't actually correct? As you state now you should call the variable from the variables object and not the originals vars.myName?

Thanks!

Avatar

Avatar
Validate 1
Level 2
alexandred77684
Level 2

Likes

5 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
alexandred77684
Level 2

Likes

5 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
alexandred77684
Level 2

07-09-2017

lot of thank, it's works fine !

Avatar

Avatar
Validate 1
Level 1
manuelcantillo
Level 1

Likes

0 likes

Total Posts

6 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
manuelcantillo
Level 1

Likes

0 likes

Total Posts

6 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
manuelcantillo
Level 1

20-11-2020

Hello!

If you want to send multiple variables, the only way It worked for me was like this:

vars.firstName = 'Manuel';

varLastName = 'Cantillo';

xtk.workflow.PostEvent("myWorkFlow", "mySignal", "",<variables varFirstName={vars.firstName} varLastName={vars.lastName} />,false);

 

On the "myWorkFlow" after the trigger activity create a javascript&colon;

 

logInfo(vars.varFirstName);
logInfo(vars.varLastName);

 

😉

 

 

Avatar

Avatar
Validate 1
Level 1
cavallo714
Level 1

Likes

0 likes

Total Posts

16 posts

Correct reply

1 solution
Top badges earned
Validate 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
cavallo714
Level 1

Likes

0 likes

Total Posts

16 posts

Correct reply

1 solution
Top badges earned
Validate 1
Affirm 1
View profile
cavallo714
Level 1

31-10-2019

Hi Vipul,

I am trying to figure out how to send multiple variables through a signal. I know how to send one through the xml format in the documentation, but sending multiple doesn’t seem to work with standard xml syntax. Are multiple variables supported?

SINGLE VARIABLE

*PostEvent:

vars.name = (‘Lee’);

xtk.workflow.PostEvent("myWorkflow","signal","", <variables varName={vars.name} />,false);

*JS in activity after signal to display variable passed

logInfo(vars.varName);

-----------------------------------------------------------------------

MULTIPLE VARIABLES

Post Event I able to run without failure –however, cannot get it to receive any of the vars on the other side no matter what I try:

vars.firstName = (‘Lee’);

vars.lastName = (‘Cavallo');

xtk.workflow.PostEvent("myWorkflow","signal","",

<variables>

<variables varFirstName={vars.firstName} />

<variables varLastName={vars.lastName}/>

</variables>

,

false);

JS in activity after signal to display variable passed

Nothing seems to work

Avatar

Avatar
Validate 1
Level 1
vidyas77336264
Level 1

Like

1 like

Total Posts

6 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
vidyas77336264
Level 1

Like

1 like

Total Posts

6 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
vidyas77336264
Level 1

31-05-2019

Hi Leonie,

This works, use vars.varName in any activity after the external signal.

1763684_pastedImage_0.png

Thanks,

Vidya

Avatar

Avatar
Validate 1
Employee
Vapsy
Employee

Likes

370 likes

Total Posts

726 posts

Correct reply

342 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Validate 1
Employee
Vapsy
Employee

Likes

370 likes

Total Posts

726 posts

Correct reply

342 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile
Vapsy
Employee

09-10-2018

Hi Leonie,

Inside the workflow which has the external signal you should be calling

vars.varName and not vars.myName

Regards,

Vipul Raghav

Avatar

Avatar
Validate 1
Level 2
LeonieSwart
Level 2

Likes

12 likes

Total Posts

30 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Give Back 5
Give Back 3
Give Back
Boost 5
View profile

Avatar
Validate 1
Level 2
LeonieSwart
Level 2

Likes

12 likes

Total Posts

30 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Give Back 5
Give Back 3
Give Back
Boost 5
View profile
LeonieSwart
Level 2

09-10-2018

This isn't working for me.

How do you access the variables parameter from the postEvent?

I tried the exact same as you described in the solution marked answer but it's returning undefined.

I find it strange the vars.myName variable is reassigned to the varName variable inside the variables. But when you would call it, you still call on vars.myName. So why reassign it in the first place?

I tried calling vars.varName and vars.myName and variables but nothing seems to be returning the wanted result.

Screen Shot 2018-10-09 at 10.39.46.png

Screen Shot 2018-10-09 at 10.40.11.png

Screen Shot 2018-10-09 at 10.40.22.png

I am currently working on build 8863.

Kind regards

Leonie

Avatar

Avatar
Validate 1
Employee
RamaRajesh
Employee

Likes

40 likes

Total Posts

81 posts

Correct reply

10 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Employee
RamaRajesh
Employee

Likes

40 likes

Total Posts

81 posts

Correct reply

10 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
RamaRajesh
Employee

07-09-2017

Glad to know!