Programmatically invoke DAM Offloading with custom workflow | Community
Skip to main content
TheBigRed
January 7, 2016
Solved

Programmatically invoke DAM Offloading with custom workflow

  • January 7, 2016
  • 7 replies
  • 1542 views

I'm trying to programmatically invoke a workflow which holds two workflows - DAM Offloading & a custom workflow

The problem I have here is Offloading is working fine...however my custom workflow is not executing within the step.

Currently offloading has two servers - Both don't have my custom workflow model nor the oSGI bundles which holds the step.

What is the correct way to go about this.

Note: If I make a workflow launcher with custom workflow to execute on node created - Then the offloading & custom workflow execute. I need this code wise.

 

Thanks.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by kautuk_sahni

Hi

As mentioned by Scott, You can refer to the article "Invoking Adobe Experience Manager Workflows using the AEM Java API".

You can also achieve it by creating Custom AEM Workflow step, and that step can then use AEM Java API for AEM workflows.

Link1:- https://helpx.adobe.com/experience-manager/using/invoking-experience-manager-workflows-using.html

Link2:- https://helpx.adobe.com/experience-manager/using/creating-custom-aem-workflow-steps.html

Run Workflow programmatically  :- http://stackoverflow.com/questions/15233798/cq5-programmatically-run-a-workflow

//WorkflowService wfService;

WorkflowSession wfSession = wfService.getWorkflowSession(jcrSession);

WorkflowModel model = wfSession.getModel("/etc/workflow/models/x/jcr:content/model");

WorkflowData data = wfSession.newWorkflowData("JCR_PATH", payloadPath);

Workflow workflow = wfSession.startWorkflow(model, data);

 

I hope this would help you.

Thanks and Regards

Kautuk Sahni

7 replies

Lokesh_Shivalingaiah
January 7, 2016

Are you saying that both the workflow executes if you use launcher and not using programatically ??

If so are you seeing any error in the logs after the execution of offloading workflow ? or anywhere when you are calling this workflow programatically ?

TheBigRed
TheBigRedAuthor
January 7, 2016

bsloki wrote...

Are you saying that both the workflow executes if you use launcher and not using programatically ??

If so are you seeing any error in the logs after the execution of offloading workflow ? or anywhere when you are calling this workflow programatically ?

 


That is correct!

Workflow Model A (What I'm programmatically invoking)

Step A - DAM Offloading

Step B - My Custom Workflow

 

If I run this it's showing up as complete but nothing is actually getting processed!

No errors across all three servers that I have noticed.

TheBigRed
TheBigRedAuthor
January 8, 2016

Any help on this please?

kautuk_sahni
Community Manager
kautuk_sahniCommunity ManagerAccepted solution
Community Manager
January 11, 2016

Hi

As mentioned by Scott, You can refer to the article "Invoking Adobe Experience Manager Workflows using the AEM Java API".

You can also achieve it by creating Custom AEM Workflow step, and that step can then use AEM Java API for AEM workflows.

Link1:- https://helpx.adobe.com/experience-manager/using/invoking-experience-manager-workflows-using.html

Link2:- https://helpx.adobe.com/experience-manager/using/creating-custom-aem-workflow-steps.html

Run Workflow programmatically  :- http://stackoverflow.com/questions/15233798/cq5-programmatically-run-a-workflow

//WorkflowService wfService;

WorkflowSession wfSession = wfService.getWorkflowSession(jcrSession);

WorkflowModel model = wfSession.getModel("/etc/workflow/models/x/jcr:content/model");

WorkflowData data = wfSession.newWorkflowData("JCR_PATH", payloadPath);

Workflow workflow = wfSession.startWorkflow(model, data);

 

I hope this would help you.

Thanks and Regards

Kautuk Sahni

Kautuk Sahni
Jitendra_S_Toma
January 11, 2016

Hi TheBigRed,

May I know what is the use case which requires you to write a piece of code for running workflows?. Personally, I don't think, coding should be the last option. We may have to explore it.

"Writing a code isn't tough, But, tough to maintain it ".

Jitendra

TheBigRed
TheBigRedAuthor
January 11, 2016

kautuksahni wrote...

Hi

As mentioned by Scott, You can refer to the article "Invoking Adobe Experience Manager Workflows using the AEM Java API".

You can also achieve it by creating Custom AEM Workflow step, and that step can then use AEM Java API for AEM workflows.

Link1:- https://helpx.adobe.com/experience-manager/using/invoking-experience-manager-workflows-using.html

Link2:- https://helpx.adobe.com/experience-manager/using/creating-custom-aem-workflow-steps.html

Run Workflow programmatically  :- http://stackoverflow.com/questions/15233798/cq5-programmatically-run-a-workflow

//WorkflowService wfService;

WorkflowSession wfSession = wfService.getWorkflowSession(jcrSession);

WorkflowModel model = wfSession.getModel("/etc/workflow/models/x/jcr:content/model");

WorkflowData data = wfSession.newWorkflowData("JCR_PATH", payloadPath);

Workflow workflow = wfSession.startWorkflow(model, data);

 

I hope this would help you.

Thanks and Regards

Kautuk Sahni

 


I don't have a problem writing the code. Problem is DAM Offloading does not work when using it this way,

TheBigRed
TheBigRedAuthor
January 11, 2016

Jitendra S.Tomar wrote...

Hi TheBigRed,

May I know what is the use case which requires you to write a piece of code for running workflows?. Personally, I don't think, coding should be the last option. We may have to explore it.

"Writing a code isn't tough, But, tough to maintain it ".

Jitendra

 


Basically ingested bunch of files and some workflows didn't get applied to certain assets due to some server issues and AEM freezing up.

In return some files were left unprocessed. I wrote something to systematically go through folder structure and apply workflow models.

It works with any model except when the model includes DAM Asset Offloading. In the archives it says it's completed but yet nothing

actually get's done. We have nearly 30000 files unprocessed. We need Asset Offloading so our main server doesn't choke up

and doesn't affect other users using it.

 

Thanks All!