On 25/09/2018 22:22, pcrowder wrote:
I'm currently creating a Java Service to be used in the User Workflow. I
wanted to find out if it is possible to get two pieces of info either in the
Java code (implementing JavaDelegate) or passed to the Java code as a
variables:

1. The conf directory.
2. A custom Parameter created in the Configuration->Parameters section of
the Console.

Hi Phil,
not sure of what Syncope version you are running, going to take 2.1. as reference in the following.

For the user workflow, you shouldn't be implementing JavaDelegate but rather extending AbstractFlowableServiceTask, as shown by [1] for example; just annotate your class as @Component and place it under the same package as [1]: Spring will create the corresponding bean and you will be able to reference it in your workflow definition.

About getting the conf directory, I'd suggest to replicate the logic as in [2], for example.

About getting a conf parameter, take a look at [3].

HTH
Regards.

[1] https://github.com/apache/syncope/blob/2_1_X/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/Update.java [2] https://github.com/apache/syncope/blob/2_1_X/core/spring/src/main/java/org/apache/syncope/core/spring/security/Encryptor.java#L90-L101 [3] https://github.com/apache/syncope/blob/2_1_X/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/task/GenerateToken.java

--
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/

Reply via email to