Expand my Community achievements bar.

SOLVED

Retrieve workflow id within a typology rule

Avatar

Level 2

I'm currently working on a project which would require having the workflow Id or workflow internal name within a typology rule.

 

Within a workflow you can use instance.id to retrieve this information, however, when using this within a typology an error is provided stating "instance is not defined". 

 

Is there a way to retrieve either the internal name or pk of the workflow associated eith a delivery execution within a typology rule script?

 

Regards

 

Ash

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @ashleyd95649674 ,

In the delivery activity script tab, add below 

//For Workflow Internal Name:
delivery.deliveryCode=instance.internalName;

//Or, For Workflow Primarykey:
//delivery.deliveryCode=instance.id;

ParthaSarathy_0-1665130628256.png

And in typology rule code tab,

ParthaSarathy_1-1665130715156.png

if(delivery.deliveryCode == 'test')
{
logWarning("Workflow name is : "+delivery.deliveryCode);
return false;
}
else
logInfo("Workflow name is : "+delivery.deliveryCode);
return true;

The above script will throw error in delivery if the workflow internalName is  test

ParthaSarathy_2-1665130857362.png

 

 

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @ashleyd95649674 ,

In the delivery activity script tab, add below 

//For Workflow Internal Name:
delivery.deliveryCode=instance.internalName;

//Or, For Workflow Primarykey:
//delivery.deliveryCode=instance.id;

ParthaSarathy_0-1665130628256.png

And in typology rule code tab,

ParthaSarathy_1-1665130715156.png

if(delivery.deliveryCode == 'test')
{
logWarning("Workflow name is : "+delivery.deliveryCode);
return false;
}
else
logInfo("Workflow name is : "+delivery.deliveryCode);
return true;

The above script will throw error in delivery if the workflow internalName is  test

ParthaSarathy_2-1665130857362.png