atf and approval step

ggg
Giga Guru

I have a record with a workflow with property condition "run the workflow always".

I have my atf steps to create and submit my form.

1) Should the workflow start? or do i have to start it within atf?

i have atf step after submit to query sysapproval_approver table.

i tried approving = record sysid (from submit step)

i tried approver = my approver sysid (i just hard coded)

my step fails, record cannot be found.

am i missing a step?

 

1 ACCEPTED SOLUTION

Manjul Katare
ServiceNow Employee
ServiceNow Employee

1) Should the workflow start? YES or do i have to start it within atf? NO

Most probably your script is running before the workflow completes the job.

 

Below is the example I can explain you with:

Lets say my Work flow, populates the location field for any sys_user record if its empty.

And My ATF script validates if any user record is created/modified, the location field is automatically populated as "11770 Bernardo Plaza Court, San Diego,CA"

Now, if you look at my ATF script below, if I implement it using step 1, 2 it would perhaps fail due to race condition. But it would work fine with steps 1,3 & 4.

find_real_file.png

 

Hope it helps!

-Manjul

 

 

 

 

View solution in original post

7 REPLIES 7

my workflow does run.

my workflow has an if condition based upon a field value.

in my atf i set the field value, step passes.

I have found that the workflow runs correctly when i manually create and submit the form through the platform,

but

when i use ATF, the value in my if condition is not set - I set it to 'yes'

but the workflow takes the opposite path (does not recognize value of yes)

I put in scripts to gs.info the value but i found that these statements are not printed to the log.

to see my field values i had to put in a notification with field values in the body: ${field name}

when run manually my field value of yes is perfect so workflow takes the correct path.

when run through atf field value is NOT yes so workflow takes the opposite path.

now, i realize that i can change my logic to if field_value is not yes

but i do not understand why a workflow, when run in atf, is not recognizing my values.

has no one come across this problem?

 

 

i just found the Log Message activity and the workflow object for writing messages.

how do i print the value of a field on my form?

current.my_field_name does not seem to work

${field_name} does not work.

 

ggg
Giga Guru

so what i found is that my instance has a bug in the workflow ...

thank you for all responses