I start cases via a trigger element with a delay (blocking period) and some parameters. In another prozess I query this delayed tasks an want to retrieve the parameters with the getStartProcessData() method like with other running tasks. But the method here returns always null. Is there a way to get the input parameter of a delayed started case?

asked 09.07.2015 at 09:06

Peter%20Weber's gravatar image

Peter Weber
(suspended)
accept rate: 0%

edited 09.07.2015 at 09:10


This is a known issue - or - it works as designed.

The method ITask.getStartProcessData() returns the 'in' object of the process-data.

On a Task Switch Element this in-object is created, when the Task is created. Therefore, as soon as the Task exists, also the start process data exists.

When a Request Start Element is triggered, the in-object will be created when the start element is executeded. Because the Request Start Element is triggered, this element is no executed on Task creation and therefore no start process data exists.

As a workaround you could run the triggered Task as System and in a next Step you create the Task for the user with a normal Task Switch.

If you are interessted on the param-object (this one is available on a triggered task), you could call the below method. Please note, this is NOT public API!

public final class MyHelper {
    private MyHelper(){}

    public static Tuple getTriggeredTaskStartParamTuple(final ITask task) throws Exception {
        return SecurityManagerFactory.getSecurityManager().executeAsSystem(
            new Callable<Tuple>() {
                @Override
                public Tuple call() throws Exception {
                    IProcessData processData = task.getInternalStartProcessData();
                    if (processData != null && ArrayUtils.contains(processData.getValueNames(), "param")) {
                        Object paramTuple = processData.getValue("param");
                        if (paramTuple instanceof Tuple) {
                            return (Tuple) paramTuple;
                        }
                    }
                    return null;
                }
            });
    }
}
link

answered 09.07.2015 at 16:44

Flavio%20Sadeghi's gravatar image

Flavio Sadeghi ♦♦
(suspended)
accept rate: 75%

Very good. With this internal API I solved my problem for 100%.

(10.07.2015 at 09:59) Peter Weber Peter%20Weber's gravatar image

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×68
×33
×18

Asked: 09.07.2015 at 09:06

Seen: 2,890 times

Last updated: 10.07.2015 at 09:59