Highlighted

Schedule Activation Through Custom Workflow in AEM 6.3

rohits64600205

19-03-2018

Hi,

I am creating a custom workflow which has the following steps in AEM 6.3 :-

1.Dialog participant Step --> This helps user to choose the Activation Date.

2. Process Step --> It saves the date selected in above step as "absoluteTime" in metadata of the workflow instance.

3. Participant Step --> Here I am selecting Timeout as Immediate and Timeout handler as "Absolute Time Auto Advancer" and assigning to admin.

4. Process Step --> Activate page.

But the when I starts the workflow it saves the "absoluteTime" property correctly but it doesn't stop at the second participant step(which is at 3) and workflow gets aborted as soon as it reaches the step 3. Can anyone please point out what wrong I am doing. Attaching the instance history and below is the code which I am using for saving absoluteTime

String contentPagePath = workItem.getWorkflowData().getPayload().toString();

Session session = workflowSession.adaptTo(Session.class);

ResourceResolver resourceResolver = getResourceResolver(session);

Resource resource = resourceResolver.getResource(contentPagePath + "/jcr:content");

ValueMap valueMap = resource.getValueMap();

Calendar calendar = valueMap.get("absoluteTime", Calendar.class);

workItem.getWorkflowData().getMetaDataMap().put("absoluteTime", calendar.getTimeInMillis());wf instance.PNG

Replies

Highlighted

smacdonald2008

19-03-2018

In your code (I assume step 2 is a custom step) - you are modifying the JCR. However - you are not showing and code that saves the JCR node changes.

Please post the error log too.

Highlighted

rohits64600205

19-03-2018

Hi Scott,

Thanks For your reply. Yes you are right 2nd step is a custom process step which retrieves the value saved in payload JCR and saves it in workflow instance metadata. I was referring this link Scheduled activation with workflows – Adobe AEM Club  for developing my workflow. In OOTB schedule Activation also waiting is done through participant step only. if this is not correct could you please guide which step we should use so as to schedule the activation in the time provided by the author? Also I am not getting any specific error also in error logs.