Open HardikCharadva opened 3 years ago
@davidjgonzalez Hi Sir, Can you please help here to resolve the issue? Any suggestion.
@HardikCharadva sorry - didn't see this.
So the problem is the user id isn't in the metadata map for that specific workflow step?
"Version should create of asset , as we have added user id in MetaDataMap so ideally it should exist while version creation, not sure why it's not picking up."
IIUC, you actually tried adding the user id yourself to the metadata map and it still fails?
Hi @davidjgonzalez - Thank you for your response.
Yes we are setting user id in our custom step.
Workflow consist of below steps :
1] Custom step to update status of asset. 2] Custom step of setting publish date (On this step , I am adding user id into the metadata map as below)
// User ID is required to create version of the asset during xmp process workItem.getWorkflowData().getMetaDataMap().put("userId", "XXX");
3] OOTB step added to set last modified of asset. 4] OOTB step to update binaries via xmp process step = During this step, create revision is true and it's using id that we set to create the revision which is not picking up during synthetic workflow running bulk publish activity.
5] Activate page/asset step
If I run the publish workflow on asset directly , it's generating version of asset successfully. please advise why it's not working through synthetic way.
thanks Hardik
@HardikCharadva are you calling workflowSession.updateWorkflowData(..)
after you are setting your userId
? If not, i dont think that will persist through and could be the cause of your issue.
workItem.getWorkflowData().getMetaDataMap().put("userId", "XXX");
workflowSession.updateWorkflowData(workItem.getWorkflow(), workItem.getWorkflowData());
@davidjgonzalez Hi David, Andrew Khoury suggested to the same, so I have added as below : workItem.getWorkflowData().getMetaDataMap().put("userId", "XXX"); workItem.getWorkflow().getMetaDataMap().put("userId", "XXX"); workItem.getMetaDataMap().put("userId", "XXX"); workflowSession.updateWorkflowData(workItem.getWorkflow(), workItem.getWorkflowData());
Still it doesn't pick the user id during revision creation in xmp binary process step.
Please advise. Thanks.
@davidjgonzalez - Any update sir?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Required Information
Expected Behavior
So now when we run publish workflow on any asset it's properly perform all step and during xmp process version created successfully.
But in case of when we do bulk publish using bulk workflow manager with runner = synthetic multithreaded , it's giving null pointing exception in xmp process, because while creating revision it's unable to get user id.
Expected : Version should create of asset , as we have added user id in MetaDataMap so ideally it should exist while version creation, not sure why it's not picking up.
Even if you run OOTB DAM metadata writeback workflow using synthetic runner, you will see version is not created and because it's giving null pointer exception, it's unable to update last modified and binaries of asset too.
Actual Behavior
Actual is version not created because user id not able to get during xmp process. As a result null pointer exception throws and it failed to update last modified and binaries of asset.
Steps to Reproduce
[1] Set up AEM 6.5.5 [2] Go to /content/dam [3] Upload 5 asset. [4] Got to BWM -> create new page -> double click on page to configure. [5] Select Engine : synthetic workflow multithreaded / single threaded [6] I provided query builder query to fetch require payloads path=/content/dam type=dam:Asset p.limit=-1 [7] Workflow : above i mentioned custom publish workflow , but for simplification, you can select DAM metadata writeback. [8] In order to capture logs you can put DEBUG on below com.day.cq.dam.core.process.XMPWritebackProcess com.day.cq.dam.core.impl.handler.xmp [9] Now if you run workflow it will give null pointer exception. You will notice last modified/ binaries not updated.
I have run publish workflow where in custom step i set user id as mentioned above description, so you can try that one as well.
Links
Links to related assets, e.g. content packages containing test components