You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@syncope.apache.org by pcrowder <pc...@hotmail.com> on 2018/09/25 20:22:57 UTC

Access Parameters from Workflow

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. 

Thank you,
Phil

--
Sent from: http://syncope-user.1051894.n5.nabble.com/

Re: Access Parameters from Workflow

Posted by Francesco Chicchiriccò <il...@apache.org>.
On 26/09/2018 19:09, pcrowder wrote:
> All your suggestions worked. Thank you.

My pleasure :-)
Thanks for reporting.

Regards.

-- 
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/


Re: Access Parameters from Workflow

Posted by pcrowder <pc...@hotmail.com>.
All your suggestions worked. Thank you. 

Phil

--
Sent from: http://syncope-user.1051894.n5.nabble.com/

Re: Access Parameters from Workflow

Posted by Francesco Chicchiriccò <il...@apache.org>.
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/