Not able to pull the deadline for a task or process below is the code used.

Not able to pull the deadline for a task or process below is the code used.

ServiceContext serviceContext = ServiceLocator.getAdministratorServiceContext();
                    ProcessExecutionService pes = ServiceLocator.getProcessExecutionService(serviceContext);
LOG.debug(pes.getDeadlineForProcess(processId));
LOG.debug(pes.getDeadlineForTask(taskId));

Regards,
Sarika Bansal...

OriginalPostID-118695

OriginalPostID-118695

  Discussion posts and replies are publicly visible

Parents
  • 1. If you are executing this outside a smart service as a standalone Java snippet then you need this line at the beginning of your main method: ConfigurationLoader.initializeConfigurations();

    Here is an example that worked for me. I am using two different approaches, the both print the same (getProcessDetails().getPriority() and getPriorityOfProcess() )

    ConfigurationLoader.initializeConfigurations();
    ServiceContext sc = ServiceContextFactory.getAdministratorServiceContext();
    ProcessExecutionService pes = ServiceLocator.getProcessExecutionService(sc);

    System.out.println(pes.getProcessDetails(processId).getPriority());
    System.out.println(pes.getPriorityOfProcess(processId));

    2.If you are using this within a plug-in then it should work but I suggest you use the ProcessExecutionService injected context

Reply
  • 1. If you are executing this outside a smart service as a standalone Java snippet then you need this line at the beginning of your main method: ConfigurationLoader.initializeConfigurations();

    Here is an example that worked for me. I am using two different approaches, the both print the same (getProcessDetails().getPriority() and getPriorityOfProcess() )

    ConfigurationLoader.initializeConfigurations();
    ServiceContext sc = ServiceContextFactory.getAdministratorServiceContext();
    ProcessExecutionService pes = ServiceLocator.getProcessExecutionService(sc);

    System.out.println(pes.getProcessDetails(processId).getPriority());
    System.out.println(pes.getPriorityOfProcess(processId));

    2.If you are using this within a plug-in then it should work but I suggest you use the ProcessExecutionService injected context

Children
No Data