Expand my Community achievements bar.

Workflow model is not refreshed. Old version is used

Avatar

Level 2

So I have a workflow model, which is used in one scenario. I have several environments. On the fresh environment my workflow model works as expected.

On existing environments it seems that it uses old version of the workflow. I would like to ask if workflow model are cached somewhere ? If yes, how can I purge the cache ?

If workflow models are not cached, what can be cause of such issue? In logs I get information that "No route found to continue from step node5". I'm sure that workflow model is correctly configured, because it works on new environment, so that's definietely something on AEM side. I can see in CRX that workflow is installed, I tried to save it again in the workflow model editor, but that didn't help. It fails on my second or split, It reaches or split and then it says that it cannot proceed to next step. Do you have any idea what can be wrong ?

I have tried to remove all instances of running and completed workflow model thorugh maintanance task, then I have removed workflow completely. I have reinstalled it through package but still I had the same issue. Of course restart of AEM instance also doesn't work.

I'm using AEM 6.3 SP1 (author)

11 Replies

Avatar

Level 10

This sounds strange - if you have the exact workflow as you have on your fresh environment - you should be getting the same results. So the community better understands - can you please post a screenshot of your model.

Avatar

Level 2

that is not possible. Simple or split with default steps and two branches.

What I can add, is that I'm editing default Request for Deletion workflow.

Avatar

Level 10

I have asked the AEM workflow Eng team to look here. If the workflow works on 1 instance and if you setup the same workflow and all the dependencies properly - it should behave the same way.

Ok one more time,

Workflow is installed through package in crx package manager, exactly the same package is installed on 3 environments, one is fresh and two other are existing instances (author). On fresh it works, on existing it fails.

It is default AEM workflow, which is changed (it's a request for deletion workflow, and AEM doesn't offer anything which would allow to run custom workflow when delete action is triggered by authors, that's why we must override default workflow).

I saw similar situation several times when I was developing custom workflows.

I understand that it should work the same - it's logical for me also, but it's not happening. Like I said, I cannot post model here, however it can be easly reproduced:

1. Edit Request for deletion step

2. Add or split with different conditions (2 branches)

3. Select 1 default branch

4. Add another split step with different conditions in one of the branches (2 branches)

5. Add items to those branches

6. Use this model on several environments

I saw in logs, that conditions are valid, proper values are set on properties, it seems that the flow is broken itself. My workflow after checking condition in one of the branches throws error that it cannot find next node. In crx node is present.

Stack trace:

Additionally, I have attached image with structure of the model (as you can see, node7 has next step defined and it exists in the node structure).2018-04-02_01h20_29.png

Avatar

Level 10

This could also be a bug in the existing server not present in the fresh install - I asked our support team to look here.

Avatar

Administrator

Which version are you on?

Nothing that we can find out with latest AEM version.

Request you to create a Support ticket for this.

-Kautuk



Kautuk Sahni

Avatar

Level 10

Support stated:

It could be two reasons.

  1. Force class re-compile
  2. Run offline compaction.

If those above does not work, have them to log the case.

It's AEM 6.3 SP1 with CFP 2,

I will try to do both things smacdonald2008, however that would be a big coincidence if offline compaction would work on both environments.

I have solved this.

It super weird, but I have no time for debugging it right now.

So thing which fixed problem for me:

In Or Split I was using script file. In each branch.

I have removed path to the script and I made copy-paste of the script content into the text area of each script.

Because of some freaking reason, it has fixed the problem.

I have other custom workflow (the one with which I had problems was default delete workflow) which were using script files, and they seem to work properly, even though they are configured to use script from the file.

I have not change even a line of the script, and that is something which surprises me very much. It fixes the problem on all environments where it was designed.

Additionally, I noticed that I didn't have CFP2 installed locally on fresh environment, after installing it, workflow stopped working, and I had to apply fix which I described above. Maybe CFP2 introduced a new bug.

Avatar

Level 10

Thank you for posting the fix. This will help AEM Devs in the future and is the reason for Experience League.

Avatar

Level 4

Thanks for posting about this problem. We are also facing this issue with workitems not having the routes object when preceding an OR Split. Actually pasting the script into the OR Split branch text editor did help in our case! but it needed to be added into the non default branch.