Workflow

WORKFLOW 

1. WHAT IS THE DIFFERENCE BETWEEN STOP AND ABORT OPTIONS IN WORKFLOW? 
2. RUNNING INFORMATICA WORKFLOW CONTINUOUSLY – HOW TO RUN A WORKFLOW CONTINUOUSLY UNTIL A CERTAIN CONDITION
IS MET? 
3. HOW DO WE SEND EMAILS FROM INFORMATICA AFTER THE SUCCESSFUL COMPLETION OF ONE SESSION? THE EMAIL WILL CONTAIN
THE JOB NAME/ SESSION START TIME AND SESSION END TIME IN THE MESSAGE BODY. 
4. SCENARIO IMPLEMENTATION 1 
5. HOW CAN WE SEND TWO SEPARATE EMAILS AFTER A SUCCESSFUL SESSION RUN? 87
6. WHAT IS COLD START IN INFORMATICA? 
7. SCENARIO IMPLEMENTATION 2 
8. WE KNOW THERE ARE 3 OPTIONS FOR SESSION RECOVERY STRATEGY – RESTART TASK, FAIL TASK AND CONTINUE RUNNING THE
WORKFLOW, RESUME FROM LAST CHECKPOINT WHENEVER A SESSION FAILS. HOW DO WE RESTART A WORKFLOW AUTOMATICALLY
WITHOUT ANY MANUAL INTERVENTION IN THE EVENT OF SESSION FAILURE? 
9. WHAT IS THE DIFFERENCE REAL-TIME AND CONTINUOUS WORKFLOWS? 
11. SCENARIO IMPLEMENTATION 3 
12. HOW DO WE SEND A SESSION FAILURE MAIL WITH THE WORKFLOW OR SESSION LOG AS ATTACHMENT? 
13. EXPLAIN DEADLOCK IN INFORMATICA AND HOW DO WE RESOLVE IT? 
14. SCENARIO IMPLEMENTATION 4 
15. HOW CAN WE PASS A VALUE FROM ONE WORKFLOW TO ANOTHER? 

 

 

214.What is Event and what are the tasks related to it?

The event can be any action or function that occurs in the workflow.

  • Event Wait Task: This task waits until an event occurs, once the event is triggered this task gets accomplished and assigns the next task.
  • Events Raise Task: Event Raise Task triggers the specific event in the workflow.

215. What is a pre-defined event and User-defined event?

  •  Predefined Events are system-Defined Events that wait until the arrival of a specific file at a specific Location. It is also called as File-Watcher Event.
  • User Defined Events are created by the user to raise anytime in the workflow once created.

216.How many tools are there in workflow manager?  

There are four types of tools –

1. Task Designer  
2. Task Developer
3. Workflow Designer  
4. Worklet Designer 

217. What is a work flow?

Work flow is a bunch of instructions that communicates server about how to implement tasks.
218.any other tools for scheduling purpose other than workflow manager pmcmd?

The tool for scheduling purpose other than workflow manager can be a third party tool like ‘CONTROL M’.

219. What do you mean by worklet?

When the workflow tasks are grouped in a set, it is called as worklet. Workflow tasks includes timer, decision, command, event wait, mail, session, link, assignment, control etc.

220.What is INFORMATICA Worklet?

Worklet works as a Mapplet with the feature of Reusability, the only difference is that we can apply worklet to any number of workflows in INFORMATICA, unlike mapplet. Worklet saves the logic and tasks at a single place to reuse.

Worklet is much similar to the Mapplet and is defined as the group of tasks that can be either reusable or non-reusable at the workflow level. It can be added to as much number of workflows as required. With its reusability feature, much time is saved as reusable logic can be developed once and can be placed from where it can be reused.

In the INFORMATICA Power center environment, Mapplets are considered as the most advantageous feature. Mapplets are created in Mapplet designer and are a part of the Designer tool.

It basically contains a set of transformations that are designed to be reused in multiple mapping.

221.What is Workflow Manager?

It is a GUI based client which allows you to create following ETL objects.

1. Session
2. Workflow
3. Scheduler.
Session:
  • A session is a task that executes mapping.
  • A session is created for each Mapping.
  • A session is created to provide runtime properties.
  • A session is a set of instructions that tells ETL server to move the data from source to destination.

 

 222.What is Worklet and types of worklets?

  1. A worklet is defined as group of related tasks.
  2. There are 2 types of the worklet:
    • Reusable worklet
    • Non-Reusable worklet
  3. Worklet expands and executes the tasks inside the workflow.
  4. A workflow which contains the worklet is known as Parent Workflow.

(a) Reusable Worklet:-

Created using worklet designer tool.
Can be assigned to Multiple workflows.

(b) Non-Reusable Worklet:-

Created using workflow designer tool.
Created Specific to workflow.

223.What is Workflow Monitor?

  1. It is a GUI based client application which allows use to monitor ETL objects running an ETL Server.
  2. Collect runtime statistics such as:
a. No. of records extracted.
b. No. of records loaded.
c. No. of records rejected.
d. Fetch session log
e. Throughput
  • Complete information can be accessed from workflow monitor.
  • For every session one log file is created.
 224.Scheduling a Workflow?

1. A schedule is an automation of running the workflow at a given date and time.

2. There are 2 types of schedulers:
(i) Reusable scheduler
(ii) Non Reusable scheduler
(i) Reusable scheduler:-

A reusable scheduler can be assigned to multiple workflows.

(ii) Non Reusable scheduler:-
– A non reusable scheduler is created specific to the workflow.
– A non reusable scheduler can be converted into a reusable scheduler.
The following are the 3rd party schedulers:
1. Cron (Unix based scheduling process)
2. Tivoli
3. Control M
4. Autosys
5. Tidal
6. WLM (work hard manager)
– 99% production people will do scheduling.
– Before we run the workflow manually. Through scheduling we run workflow this is called Auto Running.Scheduling Workflow

 

 

225. What is the difference between STOP and ABORT options in Workflow?

When we issue the STOP command on the executing session task, the Integration Service stops reading data from source. It continues processing, writing and committing the data to targets. If the Integration Service cannot finish processing and committing data, we can issue the abort command.
In contrast ABORT command has a timeout period of 60 seconds. If the Integration Service cannot finish processing and committing data within the timeout period, it kills the DTM process and terminates the session.
We can stop or abort tasks, worklets within a workflow from the Workflow Monitor or Control task in the workflow or from command task by using pmcmd stop or abort command. We can also call the ABORT function from mapping level.
When we stop or abort a task, the Integration Service stops processing the task and any other tasks in the path of the stopped or aborted task. The Integration Service however continues processing concurrent tasks in the workflow. If the Integration Service cannot stop the task, we can abort the task.
The Integration Service aborts any workflow if the Repository Service process shuts down.
226. Running Informatica Workflow continuously – How to run a workflow continuously until a certain condition is met?

We can schedule a workflow to run continuously. A continuous workflow starts as soon as the Integration Service initializes. If we schedule a real-time session to run as a continuous workflow, the Integration Service starts the next run of the workflow as soon as it finishes the first. When the workflow stops, it restarts immediately.
Alternatively for normal batch scenario we can create conditional-continuous workflow as below.
Suppose wf_Bus contains the business session that we want to run continuously until a certain conditions is meet before it stops, may be presence of file or particular value of workflow variable etc.
So modify the workflow as Start-Task followed by Decision Task which evaluates a condition to be TRUE or FALSE. Based on this condition the workflow will run or stop.
Next use the Link Task to link the business session for $Decision.Condition=TRUE.
For the other part use a Command Task for $Decision.Condition=FALSE.
In the command task create a command to call a dummy workflow using pmcmd functionality. e.g.
“C:\Informatica\PowerCenter8.6.0\server\bin\pmcmd.exe” startworkflow -sv
IS_info_repo8x -d Domain_hp -u info_repo8x -p info_repo8x -f WorkFolder
wf_dummy Next create the dummy workflow name it as wf_dummy. Place a Command Task after the Start Task Within the command task put the pmcmd command as
“C:\Informatica\PowerCenter8.6.0\server\bin\pmcmd.exe” startworkflow -sv
IS_info_repo8x -d Domain_sauravhp -u info_repo8x -p info_repo8x -f
WorkFolder wf_Bus In this way we can manage to run a workflow continuously. So the basic concept is to use two workflows and make them call each other.
227. How do we send emails from Informatica after the successful completion of one session? The email will contain the job name/ session start time and session end time in the message body.

The first thing is to have “mail” utility configured in the Informatica server (UNIX/WINDOWS).
After that, we will use the Informatica Email Task. We can create a email task and call it in the session level
“On Success Email”. Here we can use Informatica pre-build variables like- mapping name (%m), session start time (%b) etc.
228. Scenario Implementation 1
How to pass a value calculated in mapping variable to the email message. The email will be sent in HTML format with a predefined message in which one value will be populated from one mapping variable. Suppose, the predefined message is:
<html> <body>
The last transaction service ID is: <informatica_variable>
</body> </html>
In the place of <informatica_variable>, the value of the mapping variable at the end of the session will go.

229.We cannot use a mapping variable in Workflow or Session level. It is local to a mapping. Instead, we have to use a Workflow variable for this purpose. But, we cannot pass the value of the Mapping Variable to the Workflow variable directly from your mapping.
1) Write the calculated value in some Flat File using your mapping say “value.txt”.
2) Create a shell script say “mail.sh” to send the 2nd mail. Read the value from the “value.txt” into a variable in “mail.sh”. Use this variable in the body of the mail.
3) Create a Cmd task in the WF level. Call this “mail.sh” in that Cmd task.
4) Use this Cmd task upstream of your actual session and link it on its success.
230. How can we send two separate emails after a successful session run?

The problem is we cannot call two email tasks from one session i.e. from session level “On Success Email”.
So, for the second email we can create another Email Task following the Session using and link them using Link Task with execution condition as status=SUCCEEDED.
231. What is Cold Start in Informatica?

In general terms, “Cold Start” means ‘To start a program from the very beginning, without being able to continue the processing that was occurring previously when the system was interrupted.’ With respect to Informatica, we can resume a stopped or failed real-time session.

To resume a session, we must restart or recover the session. The Integration Service can recover a session automatically if you enabled
the session for automatic task recovery.

When you restart a session, the Integration Service resumes the session based on the real-time source. Depending on the real-time source, it restarts the session with or without recovery.
We can restart a task or workflow in cold start mode. When you restart a task or workflow in cold start mode, the Integration Service discards the recovery information and restarts the task or workflow.
For e.g. if a workflow failed in between and we don’t want to recover data because we manually did all clean up of data in the impacted target tables.

If workflow recovery is enabled then we can opt for a cold start which will skip recovery task. Cold start will remove all recover data if any stored when session failed.

  •  When we restart a stopped or failed task or workflow that has recovery enabled in cold start mode, the Integration Service discards the recovery information and restarts the task or workflow.
  •  Cold Start Task, Cold Start Workflow or Cold Start Workflow from Task commands can be executed from the Workflow Manager, Workflow Monitor, or pmcmd command line programs.
  •  If we restart a session in cold start mode, targets may receive duplicate rows.
  •  So avoid cold start and restart the session with recovery to prevent data duplication.
  •  So if recovery is not enabled in a session, then there is no difference between cold start and restart.

232. Scenario Implementation 2
Email – I have a llist of 10 peoples in email after session failure. can we edit the list emails dynamically – I
mean can we add or delete email ID without touching the mapping.

We can parameterize the email user list and modify the values in parameter file. Use $PMSuccessEmailUser,$PMFailureEmailUser. Also you can use pmrep command to update the email task:
updateemailaddr -d <folder_name> -s <session_name> -u <success_
email_address> -f <failure_email_address>
You can create a distribution list and use that DL in the session failure cmd. What so ever emails will be listed in the DL will receive the mail. Later on you can add/remove the emails in the DL depending upon your requirement.

 

233. We know there are 3 options for Session recovery strategy – Restart task, Fail task and continue running the workflow, Resume from last checkpoint whenever a session fails.
How do we restart a workflow automatically without any manual intervention in the
event of session failure?

Select “Automatically recover terminated tasks” option in workflow properties. Also we can specify the maximum number of auto attempts in the workflow property “Maximum automatic recovery attempts”.
234. What is the difference Real-time and continuous workflows?

Real-time Workflow is source XML Message triggered workflow, whereas if any workflow which runs continuously using two workflows and command line arguments to call each other.
235.Scenario Implementation 3
Suppose we have two workflows workflow 1 (wf1) having two sessions (s1, s2) and workflow 2 (wf2) having three sessions (s3, s4, s5) in the same folder, like below
wf1: s1, s2
wf2: s3, s4, s5
How can we run s1 first then s3 after that s2 next s4 and s5 without using pmcmd command or unix script?

Use Command Task or Post Session Command to create touch file and use Event Wait Task to wait for the file (Filewatch Name).
Combination of Command Task and Event Wait will help to solve the problem.
WF1—–>S1——>CMD1—–>EW2——>S2——->CMD3
WF2—–>EW1—>S3———>CMD2—–>EW3—->S4——>S5
So run both the workflows, session s1 starts and after successful execution calls command task cmd1. cmd1 generates a touch file say s3.txt
After that the execution passes to event wait ew2. Immediately event wait ew1 will start to process session s3 after the file s3.txt was generated. Next after success of session s3 it will pass the control to command task cmd2 which in turn will generate a touch file say s2.txt and passes the control to event wait task ew3.
Immediately at the same time the event wait ew2 gets started after receiving the event wait file s2.txt and passes the control to session s2. After completion of session s2 it triggers command task cmd3 which in turn generates a wait file s4.txt and the workflow wf1 ends. On the other hand the event wait ew3 gets triggered with wait file s4.txt in place and calls the session s4 which in turn after success triggers the last session s5
and the workflow wf2 completes.

236.How do we send a session failure mail with the workflow or session log as attachment?

Design an Informatica email task to send email communication in the event of session failure and used email variable %g to attach the corresponding session log.
Email Variables:
(%g) – To attach session log.
(%a<>) – To attach any file, Absolute path needs to be given <>.
237.Explain deadlock in Informatica and how do we resolve it?

In Database level deadlock normally occurs when two concurrent user sessions are trying to apply a DML command for same row in a table. Say for example, below query got executed by user1 in session1
update emp set deptno=20 where deptno=10;
Before user1 is commits the transaction, if user2 from session2 execute the same query as below , it causes deadlock error.
update emp set deptno=30 where deptno=10;
In informatica normally deadlock occurs when two sessions are updating or deleting records from a table in parallel, (parallel insert is not a problem). One option to avoid deadlock is to identify those sessions and make them sequential. Another option is to make use of the session level properties such as ‘deadlock retry limits’ and ‘deadlock recovery option’
238.Scenario Implementation 4
Busy Percentage is given by (runtime-idle time) * 100 / runtime.
If a thread is having 0 idle time, which means more Busy Percentage. So do we need to tune that thread component?
Why is it like that? So does it means we need to tune the thread whose busy percentage (BP) is more or the one having more idle time.

3 persons are asked to run 1 mile each. Each one of them is allotted 20 minutes of time. First person completes 1 mile in 5 minutes and stands idle other 15 minutes of his allotted time. The 2nd person completes it in 10 minute and sits idle the rest 10 minute. The last one takes all 20 minutes and idle for 0 minutes. Who is the worst performer?
Isn’t it the last person who had no idle time? It’s the same for a thread with 0 idle time.

239.How can we pass a value from one workflow to another?

Pass the Workflow variable value to a session variable in pre-assignment and then next to mapping parameter.
Next develop a mapping to generate a parameter file with the desired value as a workflow variable that can be passes to the next workflow using this parameter file.
Alternatively, develop the mapping to store the value in a flat file or Database table. Next create another mapping to use that in the next workflow by passing it to the session in post-assignment and then to workflow level if required