Ask Your Question
2

Is it possible to execute a task when any activity from a group of activities fails and record the information of the failed activity in that task using ADF?

asked 2023-06-25 09:21:04 +0000

nofretete gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-06-25 09:46:02 +0000

lalupa gravatar image

Yes, it is possible to execute a task when any activity from a group of activities fails and record the information of the failed activity in that task using ADF.

You can achieve this by creating a "Faulted" event handler on the "ForEach" or "ForEachBatch" activities. This event handler will be triggered whenever any activity within the "ForEach" loop fails.

Within this event handler, you can define the actions that need to be taken, such as creating a new task in the task management system and adding the details of the failed activity to it.

Below is an example of how the event handler code would look like in Python:

def on_failed_activity(execution_context, activity_info, error_details):
    # Create a task in the task management system
    task = create_new_task("Failed activity in ForEach loop")

    # Add details of the failed activity to the task
    task.add_activity_details(activity_info.name, error_details.message)

# Define ForEach activity and add the event handler
foreach_activity = ForEach(...)
foreach_activity.on_activity_fault += on_failed_activity
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-06-25 09:21:04 +0000

Seen: 7 times

Last updated: Jun 25 '23