Automic Workload Automation

Expand all | Collapse all

How to restart a Workflow from Different Service Account

  • 1.  How to restart a Workflow from Different Service Account

    Posted 04-22-2019 04:55 PM

       Hi Team,

     

    We do have A scenario where we are giving one Service Account at the parent level and if the Workflow in the Parent chain gets failed then we are planning to run it with different Service Account in same chain but while we are restarting the failed Workflow it is Still picking the same the Parent chain Service account.Can Some one help us out her .



  • 2.  Re: How to restart a Workflow from Different Service Account

    Posted 04-23-2019 03:11 AM

    Hi,

    use PUT_ATT to set a different login object in case if child or parent was started in restart mode.

    This information can be taken by using SYS_ACT_RESTART. Just tested it and it works as expected...

    Regards

    Christian



  • 3.  Re: How to restart a Workflow from Different Service Account

    Posted 04-23-2019 07:26 AM

    Thanks Christian for the Quick response if possible can you please help with the Code/Logic which you are using.Below are Some details what I am using in my Workflow logic .

     

    Parent chain Prompt Set:

     

    Child Workflow Prompt Set:

     

     

    In Child Workflow Unix Object Process Tab Logic:

     

     

    When Restarted (failed Workflow) input Pop up:

     



  • 4.  Re: How to restart a Workflow from Different Service Account

    Posted 04-23-2019 08:05 AM

    I am using as follows in my Process tab but I am having same issue:

     

     

    Can you please guide me if I am wrong at Some point ?



  • 5.  Re: How to restart a Workflow from Different Service Account

    Posted 04-23-2019 08:48 AM

    Hi

     

    SYS_ACT_RESTART() returns "Y" or "N".

     

    So you can check on that and set your LOGIN accordingly:

     

    :IF SYS_ACT_RESTART()= "N"
    :  PUT_ATT LOGIN = "LOGIN_A"
    :ELSE
    :  PUT_ATT LOGIN = "LOGIN_B"
    :ENDIF
    sh shellscript.sh

     

    cheers, Wolfgang



  • 6.  Re: How to restart a Workflow from Different Service Account

    Posted 04-23-2019 08:53 AM

    Thanks Wolfgang, 

     

    I made over the same try but Still my Workflow is not picking the Restart login.

     

    According to my Earlier Screenshots can i know whether i needs to give it Process tab or Pre process Tab of the Job ?

     

    As of now I am giving in Process tab.



  • 7.  Re: How to restart a Workflow from Different Service Account

    Posted 04-24-2019 03:54 AM

    Hi

     

    technically it des not matter if you put the code in process or preprocess tab.

    For the sake of clarity I would put it into preprocess (as it influences job parameters prior to job execution)

     

    how does your code look like and how your activation report of the job?

     

    cheers, Wolfgang

     

    PS: possibly you have an issue with point 3. (agents and logins cold own the same behavior) - see link

    Automic 



  • 8.  Re: How to restart a Workflow from Different Service Account

    Posted 04-24-2019 09:18 AM

    Hi Wolfgang,

     

    This below are the Steps which I am Performing from my End:

     

    Parent chain Prompt Set:

     

     

    Child Workflow Prompt Set:

     

     

     

    In Child Workflow Unix Object Process Tab Logic

     

     

    When Restarted (failed Workflow)

     

     

    But the TD_LOGIN which was in the Screenshot is the parameter value which we gives at Unix Server level and it was associated with one Service account ideally we call it as Teradata login but no object was created with that name in One Automation .

     

     

     

    With out creation of that object also our Workflows are running .

     

    Can you please guide me out here if I am wrong at Some point.



  • 9.  Re: How to restart a Workflow from Different Service Account

    Posted 04-24-2019 08:09 PM

    Hi,

     

    To be in detail I am calling a variable from a Prompt Set and writing my code as below in my Child Workflow(It Also has a Prompt Set) in Process tab but while my Job gets failed in chain then i needs to restart it then in the Child Workflow I will change my variable/Parameter value.When i restart my Workflow it needs to pick the Prompt Set value which was on top of my child Workflow.

     

    :IF SYS_ACT_RESTART() = "N"
    :PRINT SYS_ACT_RESTART
    :PUT_PROMPT_BUFFER &TD_OVRD_LOGIN = '&TD_OVRD_LOGIN'
    sh /app_code/bi/oa/scripts/calltdproc.sh "&SPNAME" "&TD_DBNAME" "&TD_OVRD_LOGIN" "&TD_SERVER" "&SPPARAMETERS"
    :ELSE
    :PUT_PROMPT_BUFFER &TD_LOGIN = '&TD_LOGIN'
    sh /app_code/bi/oa/scripts/calltdproc.sh "&SPNAME" "&TD_DBNAME" "&TD_LOGIN" "&TD_SERVER" "&SPPARAMETERS"
    :ENDIF



  • 10.  Re: How to restart a Workflow from Different Service Account

    Posted 04-24-2019 08:08 PM

    Hi,

     

    To be in detail I am calling a variable from a Prompt Set and writing my code as below in my Child Workflow(It Also has a Prompt Set) in Process tab but while my Job gets failed in chain then i needs to restart it then in the Child Workflow I will change my variable/Parameter value.When i restart my Workflow it needs to pick the Prompt Set value which was on top of my child Workflow.

     

    :IF SYS_ACT_RESTART() = "N"
    :PRINT SYS_ACT_RESTART
    :PUT_PROMPT_BUFFER &TD_OVRD_LOGIN = '&TD_OVRD_LOGIN'
    sh /app_code/bi/oa/scripts/calltdproc.sh "&SPNAME" "&TD_DBNAME" "&TD_OVRD_LOGIN" "&TD_SERVER" "&SPPARAMETERS"
    :ELSE
    :PUT_PROMPT_BUFFER &TD_LOGIN = '&TD_LOGIN'
    sh /app_code/bi/oa/scripts/calltdproc.sh "&SPNAME" "&TD_DBNAME" "&TD_LOGIN" "&TD_SERVER" "&SPPARAMETERS"
    :ENDIF



  • 11.  Re: How to restart a Workflow from Different Service Account

    Posted 04-25-2019 09:36 AM

    Hi Christian/Wolfgang,

     

    Thanks for your responses but While we use the SYS_ACT_RESTART method we are getting in the report as System is not restarted.We are making the manual restart from Process Monitoring tab.

     

    Can we know whether the SYS_ACT_RESTART will be Work by Manual Execution also from Process Monitoring tab ?

     

    Our Exact requirement is as below:

    while running a Workflow it needs to Execute on one Shell Script but if we do Manual restart of the Workflow then it needs to be run by another Shell Script which we define in Process tab ?