How to make timer task in informatica succeed after a duration

落爺英雄遲暮 提交于 2020-04-30 11:45:33

问题


I'm curious as to how to make the status of the timer task changes to succeed? I have many sessions whereby some of them are connected in series and some are in parallel... After every session has run successfully, the status of the timer task is still showing running... How do I make it change to succeed as well... The condition is if the workflow finishes below the allocated time of 20 minutes, the timer task has to change to succeed, but if it exceeds 20 minutes, then it should send an email to the assigned user and abort the workflow.....

Unix:

 if[[ $Event_Exceed20min > 20 AND $EVent_Exceed20min.Status = Running ]]
    pmcmd stopworkflow -service informatica-integration-Service -d domain-name - u user-name -p password -f folder-name -w workflow-name
    $Event_Exceed20min.Status = SUCCEEDED
 fi

回答1:


You can use UNIX script to do this. I dont see informatica alone can do this.
You can create a script which will kick off the informatica using pmcmd,
keep polling the status.

  1. kick off the flow and start timer
  2. start checking status
  3. if timer goes >1200 seconds, abort and mail, else continue polling

Code sniped below...

#!/bin/bash

wf=$1
sess=$2
mailids="xyz@abc.com,abc@goog.com"
log="~/log/"$wf"log.txt"

echo "Start Workflow..."> $log
pmcmd  startworkflow -sv service -d domain -u username -p password  -f "FolderName" $wf

#Timer starts, works only in BASH
start=$SECONDS

while :
do
    #Check Timer, if >20min abort the flow.
    end=$SECONDS
    duration=$(( end - start ))
    if [ $duration -gt 1200 ]; then
    pmcmd stopworkflow -sv service -d domain -u username -p password -f prd_CLAIMS  -w  $wf
    STAT=$?
    #Error check if not aborted
    mailx -s "Workflow took >20min so aborted" $mailids
    fi

    pmcmd getsessionstatistics -sv service -d domain -u username -p password  -f prd_CLAIMS -w  $wf $sess > ~/log/tmp.txt
    STAT=$?
    if [ "$STAT" != 0 ]; then
    echo "Staus check failed" >> $log
    fi
    echo $(grep "[Succeeded] " ~/log/tmp.txt| wc -l) > ~/log/tmp2.txt
    STAT=$?
    if [ -s ~/log/tmp2.txt ]; then
    echo "Workflow Succeeded...">> $log
    exit
    fi
    sleep 30
done

echo "End Workflow...">> $log


来源:https://stackoverflow.com/questions/60257944/how-to-make-timer-task-in-informatica-succeed-after-a-duration

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!