Custom JS Code for Custom Workflow Activity Execution (ACC)

Avatar

Avatar

acs-ratul

Avatar

acs-ratul

acs-ratul

19-01-2021

Hi Team,

 

My usecase is to create a custom workflow activity which performs a specific(custom) logic for filtering multiple inbound records and generate its output.

For this, I have created a custom workflow activity and made changes in - 

1. Extended Workflow Schema (Elements and Methods changes)

2. Input Form

3. Created a Custom Library JS code containing simple business logic

 

I was wondering how can I connect/map the workflow activity execution to my custom library js code.

 

Currently, while configuring the activity, I am able to see logs in web logs as its makes a soap call on leave as mentioned in input form.

But when starting the workflow it errors out on the custom activity (no clue as of which js method is getting invoked while execution)

 

Please let me know if the flow for creating a custom workflow activity is right as mentioned above or anything else needs to be done. I have been looking for answers in the forum.

Thanks in advance!

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

wodnicki

MVP

Avatar

wodnicki

MVP

wodnicki
MVP

20-01-2021

Hi,

 

For xtk:workflow schema element:

 <element name="foo" template="xtk:workflow:activity">
  <attribute default="'/bar/foo.js'" name="library"/>
</element>

 

Create 2 functions in bar:foo.js global namespace:

  • foo_call () {} // no args, return 0 for success
  • foo_recall () {return 0} // i have no idea what this does but it's always stubbed to return 0

 

For workflow activities when starting out I've found the crm connector activity to be the most useful reference.

There is way more code than needed and it's not consistent in how it integrates with Campaign, but in total it's comprehensive.

 

Thanks,

-Jon

Answers (1)

Answers (1)

Avatar

Avatar

Sukrity_Wadhwa

Employee

Avatar

Sukrity_Wadhwa

Employee

Sukrity_Wadhwa
Employee

27-01-2021

Hi @acs-ratul,

Was the given solution helpful to resolve your query or do you still need more help here? Do let us know.

Thanks!