Expand my Community achievements bar.

SOLVED

Need a solution to restart a Workflow automatically

Avatar

Level 2

Hello Everyone,

So far you were very helpful and I really appreciate that!

I'm a new user of Adobe Campaign Classic and I'm facing a problem with some of my workflows.

Some of the workflows I made stops from running because of an error ; ORA-210000  (timeout occurred)

Ofattah_0-1623530683845.png

The problem is not due to our database since it's running and there's no issue with it.

My question is, is there any workflow I can build that can restart the workflows that stop from running, please?

Thanks.

 

 

1 Accepted Solution

Avatar

Correct answer by
Level 6
Sorry but you should ask your neolane administrator / neolane developper a hand on it: the error message you get doesn't seem related to the code. there is no code line 22 and no variable called "AnyName" has been used...

View solution in original post

17 Replies

Avatar

Level 6

You could build a workflow that will scan all the "production" workflows status and use api command like:

Restart (adobe.com)

You create a workflow with the query activity linked to a JS activity.

In the JS, you use a query def function with "vars.targetSchema" as schema declaration: it will select automatically the content of your previous query activity

Data oriented APIs | Adobe Campaign

 

Then you loop on the query result in order to execute your restart function

 

Netherless, you have a connection issue with the DB and your AC instance and you should spend time to investigate the root cause as restarting automatically workflows due to this problem is for having a better resilience while the issue is addressed

Avatar

Level 2

Hi @LaurentLam 

Thank you for your response,

Do you have any page where this kind of workflow is explained, please? I'm not sure I got all of what you described;

Is this the code I need to put in the JS activity ?

vars.targetSchema

          Restart (
         String
         workflowId
)

Then after the JS activity I just end the workflow there?

Thank you 

Avatar

Level 6

Hi, I do not have ACC on this laptop unfortunately so I cannot develop it with you. But no, that's not the code at all I'm describing: you can inspire yourself about this code I've just wrote in notepad:

 

var wkf2restart = NLWS.xtkQueryDef.create(

<queryDef schema={vars.targetSchema} operation="select">

   <select>

       <node expr="@internalName"/>

   </select>

</queryDef>

);

 

var workflows = wkf2restart.ExecuteQuery()

 

for each(var workflow in workflows.*) {

  logInfo("restarting :" + workflow.@internalName);

  xtk.workflow.restart(workflow.@internalName);

}

Avatar

Level 2

Hi @LaurentLam 

 

Thank you so much. 

I will test it ASAP. It would be great if it works until we figure out the root of the problem.

 

Thanks

Avatar

Level 2

Hi @LaurentLam 

I tried to implement the workflow you described and the code you provided to test what would happen to my "not running workflows" but got this error 

Ofattah_0-1623689506978.png

Here's the query I associated with the JS activity.

Ofattah_1-1623689564961.png

It seems that I did something wrong. 

Thank you

 

Avatar

Level 6
This is because you have to add internalName attribute in the additonal data of the query.

Avatar

Level 2

Hi @LaurentLam 

 

I put this query 

@InternalName (equal) WKFxxxx (it's the workflow I want to restart if it stops)

and

@State (not equal) Started

Ofattah_0-1623918857001.png

 

Then I attached it to the code you provided but I got the error.

 

Thanks for your help

Avatar

Level 6
@Ofattah, in workflow query activity you have 2 sections: the query itself (what you've done) and the additional data section... This is in this one you need to add internalName information. If you don't put here an attribute that you are calling in a JS activity... It won't work

Avatar

Level 2

@LaurentLam 

Thank you for all your responses.

After adding the additional data @internalName

I no longer have that error but I got this one this time, I think it's a code error *

Ofattah_0-1623931821636.png

Here's the code I used :

 

 

var wkf2restart = NLWS.xtkQueryDef.create(

<queryDef schema={vars.targetSchema} operation="select">

   <select>

      <node expr="@internalName"/>

   </select>

</queryDef>

);

 

var workflows = wkf2restart.ExecuteQuery()

 

for each(var workflow in workflows.getElement()) {

   logInfo("restarting :" + workflow.@internalName);

   xtk.workflow.restart(workflow.@internalName);

}

Avatar

Level 6
I just updated my code with workflows.* instead of workflows.getElement()

Avatar

Level 2

Hi @LaurentLam 

It seems that this code doesn't like me. It's still making errors 

Ofattah_0-1623946779117.png

Here's my code box in case.

Ofattah_1-1623946832185.png

 

 

I can't thank you enough for your time and help

Avatar

Correct answer by
Level 6
Sorry but you should ask your neolane administrator / neolane developper a hand on it: the error message you get doesn't seem related to the code. there is no code line 22 and no variable called "AnyName" has been used...

Avatar

Level 2

Hi @LaurentLam 

Thank you for your help and all your responses  

 

 

Avatar

Community Advisor

Hi,

 

It's not normal to have db connection regularly die at random.

If the db is fine try adjusting client settings?

 

Thanks,

-Jon

Avatar

Level 2

Hi @Jonathon_wodnicki 

Thank you so much for your response.

Yes, it's not normal. It happens with a workflow that turns every 8min. We thought that it's due to its frequency. What do you think?

 

Thanks

 

Avatar

Level 6
@Ofattah, frequency has nothing to do here... technical workflows such as operationMgt are querying the DB every 30 sec... You should involve your DBA and someone from network team in order to know from where the problem lies

Avatar

Level 2

@LaurentLam Ok, thank you for your feedback it's always so helpful. We will make sure to address the issue