Hello IvyTeam,

Is there a way to get the list of parameters which are defined in the Signature of a process start element ? *I need this information before starting the process instance.

I checked the public API but such information is not available. So, I assume there is an Internal API that I can use ? Can you provide some code snipet?

Best Regards, Yordan

asked 17.09.2019 at 09:38

Stelt0's gravatar image

Stelt0
(suspended)
accept rate: 12%


Yes there is indeed internal API to do this. The following example shows how to read process (IProcess) from a project and use the process model API to play with instances of RequestStart.

alt text

package com.axonivy.demo;

import java.util.List;
import java.util.Set;

import ch.ivyteam.ivy.environment.EnvironmentNotAvailableException;
import ch.ivyteam.ivy.environment.Ivy;
import ch.ivyteam.ivy.persistence.PersistencyException;
import ch.ivyteam.ivy.process.IProcess;
import ch.ivyteam.ivy.process.model.element.event.start.RequestStart;
import ch.ivyteam.ivy.resource.datamodel.ResourceDataModelException;

public class Startables {

    public static void logStarts() throws Exception
    {
        Set<IProcess> allProcessInMyProject = Ivy.request().getProject().getProcesses(null);
        for(IProcess proc : allProcessInMyProject)
        {
            List<RequestStart> starts = proc.getModel().search().type(RequestStart.class)
                .and(start -> start.isStartByHttpRequestAllowed())
                .findDeep();
            starts.stream().forEach(Startables::log);
        }
    }

    private static void log(RequestStart start)
    {
        Ivy.log().info(start.getRequestPath().getLinkName()+" /signature="+start.getSignature().toSignatureString());
    }
}
link

answered 17.09.2019 at 10:18

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
9.4k31958
accept rate: 70%

1

if you wan't all globally available process:

IProcessManager manager = DiCore.getGlobalInjector().getInstance(IProcessManager.class);
Set<IProcess> allProcessOnEngine = manager.getDataModels(null).getModels()
(17.09.2019 at 10:39) Reguel Werme... ♦♦ Reguel%20Wermelinger's gravatar image

Great !

Thanks a lot !

(17.09.2019 at 14:12) Stelt0 Stelt0'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:

×52
×37
×37

Asked: 17.09.2019 at 09:38

Seen: 2,975 times

Last updated: 17.09.2019 at 15:33