Re: [Dev] Customizing Workflows in wso2 API Manager

2015-07-17 Thread rohit
ok thank you Chamalee. Will try and let you know, Thanks again :D



--
View this message in context: 
http://wso2-oxygen-tank.10903.n7.nabble.com/Customizing-Workflows-in-wso2-API-Manager-tp121859p121875.html
Sent from the WSO2 Development mailing list archive at Nabble.com.
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Customizing Workflows in wso2 API Manager

2015-07-17 Thread Chamalee De Silva
Hi Rohith,

I think the best way is to refer the source code well.
There are workflow executor classes for each of the workflows that we are
supporting.
If you browse through the workflow directory under carbon-apimgt

/components

/apimgt

/org.wso2.carbon.apimgt.impl

/src

/main

/java

/org

/wso2

/carbon

/apimgt

/impl

you
can find the implementations for *user signup workflow*  where you can get
the *status of the workflow. *

As an example in *UserSignUpSimpleWorkflowExecutor.java *you can see the
same* complete() method *for user sign up which I mentioned earlier.

So go through them and do your implementations using them.

On Fri, Jul 17, 2015 at 3:37 PM, rohit  wrote:

> Well Thank you sir, the *AbstractApplicationRegistrationWorkflowExecutor*
> class contains the workFlowDTO status for Application Registration events,
> but what I'm keen on capturing is *UserSignUp *events. Is there a way to do
> that? If that is the case, then may be  according to you suggestion I can
> get the status. Do i need to implement such class definition for my kind of
> scenario?
>
>
>
> --
> View this message in context:
> http://wso2-oxygen-tank.10903.n7.nabble.com/Customizing-Workflows-in-wso2-API-Manager-tp121859p121870.html
> Sent from the WSO2 Development mailing list archive at Nabble.com.
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>



-- 
Thanks & Regards,

*Chamalee De Silva*
Software Engineer
*WS**O2* Inc. .:http://wso2.com

Office   :- *+94 11 2145345 <%2B94%2011%202145345>*
mobile  :- *+94 7 <%2B94%2077%202782039>1 4315942*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Customizing Workflows in wso2 API Manager

2015-07-17 Thread rohit
Well Thank you sir, the *AbstractApplicationRegistrationWorkflowExecutor*
class contains the workFlowDTO status for Application Registration events,
but what I'm keen on capturing is *UserSignUp *events. Is there a way to do
that? If that is the case, then may be  according to you suggestion I can
get the status. Do i need to implement such class definition for my kind of
scenario?



--
View this message in context: 
http://wso2-oxygen-tank.10903.n7.nabble.com/Customizing-Workflows-in-wso2-API-Manager-tp121859p121870.html
Sent from the WSO2 Development mailing list archive at Nabble.com.
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Customizing Workflows in wso2 API Manager

2015-07-17 Thread Chamalee De Silva
Adding more,

Please refer public void complete(WorkflowDTO workFlowDTO) method starting
from line 63 in [1]

[1]
https://github.com/wso2/carbon-apimgt/blob/f517aed904f44b093ce87a392f2fe65a5ff01713/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/workflow/AbstractApplicationRegistrationWorkflowExecutor.java

On Fri, Jul 17, 2015 at 3:31 PM, Chamalee De Silva 
wrote:

> Hi Rohit,
>
> Well. In our API Manager source code 
> *AbstractApplicationRegistrationWorkflowExecutor.java
> *checks the status of the workFlowDTO status.
> Whether it is created, rejected or approved.
> According to that we perform the operations like updating the database and
> updating the UI with messages.
>
> So I think  you can use the class [1] to achieve your purpose.
>
> [1]
> https://github.com/wso2/carbon-apimgt/blob/f517aed904f44b093ce87a392f2fe65a5ff01713/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/workflow/AbstractApplicationRegistrationWorkflowExecutor.java
>
> On Fri, Jul 17, 2015 at 2:38 PM, rohit  wrote:
>
>> Respected Sir thank you so much for your prompt reply. However in your
>> sample
>> code you are using, *ApplicationRegistrationWorkflowDTO *class which
>> contains the necessary details about application registration as well as
>> in
>> the worflow sample in wso2 documentation, they are using the
>> *SubscriptionWorkflowDTO* class which contains information about the
>> subscription which is being created. Similarly what I am looking for is
>> *one such class which contains the details of admin approval/reject
>> events*,
>> so that I can extend that class and write my logic that needs to be
>> implemented.
>> I have created a user sign up workflow and the sign up request goes to
>> Admin
>> Dashboard Web application (https://:9443/admin-dashboard)
>> provided by wso2.
>> What I wanted to know is that If I could capture the admin approval/reject
>> events from https://> Host>:9443/admin-dashboard">https://:9443/admin-dashboard
>> and its response so that I can send an email notification to a user
>> telling
>> him whether his request has been approved/rejected. Please tell me if it
>> is
>> possible or what is the workaround to achieve to achieve this?
>> Thanks in advance.
>>
>>
>>
>> --
>> View this message in context:
>> http://wso2-oxygen-tank.10903.n7.nabble.com/Customizing-Workflows-in-wso2-API-Manager-tp121859p121865.html
>> Sent from the WSO2 Development mailing list archive at Nabble.com.
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>
>
>
> --
> Thanks & Regards,
>
> *Chamalee De Silva*
> Software Engineer
> *WS**O2* Inc. .:http://wso2.com
>
> Office   :- *+94 11 2145345 <%2B94%2011%202145345>*
> mobile  :- *+94 7 <%2B94%2077%202782039>1 4315942*
>
>
>


-- 
Thanks & Regards,

*Chamalee De Silva*
Software Engineer
*WS**O2* Inc. .:http://wso2.com

Office   :- *+94 11 2145345 <%2B94%2011%202145345>*
mobile  :- *+94 7 <%2B94%2077%202782039>1 4315942*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Customizing Workflows in wso2 API Manager

2015-07-17 Thread Chamalee De Silva
Hi Rohit,

Well. In our API Manager source code
*AbstractApplicationRegistrationWorkflowExecutor.java
*checks the status of the workFlowDTO status.
Whether it is created, rejected or approved.
According to that we perform the operations like updating the database and
updating the UI with messages.

So I think  you can use the class [1] to achieve your purpose.

[1]
https://github.com/wso2/carbon-apimgt/blob/f517aed904f44b093ce87a392f2fe65a5ff01713/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/workflow/AbstractApplicationRegistrationWorkflowExecutor.java

On Fri, Jul 17, 2015 at 2:38 PM, rohit  wrote:

> Respected Sir thank you so much for your prompt reply. However in your
> sample
> code you are using, *ApplicationRegistrationWorkflowDTO *class which
> contains the necessary details about application registration as well as in
> the worflow sample in wso2 documentation, they are using the
> *SubscriptionWorkflowDTO* class which contains information about the
> subscription which is being created. Similarly what I am looking for is
> *one such class which contains the details of admin approval/reject
> events*,
> so that I can extend that class and write my logic that needs to be
> implemented.
> I have created a user sign up workflow and the sign up request goes to
> Admin
> Dashboard Web application (https://:9443/admin-dashboard)
> provided by wso2.
> What I wanted to know is that If I could capture the admin approval/reject
> events from https:// Host>:9443/admin-dashboard">https://:9443/admin-dashboard
> and its response so that I can send an email notification to a user telling
> him whether his request has been approved/rejected. Please tell me if it is
> possible or what is the workaround to achieve to achieve this?
> Thanks in advance.
>
>
>
> --
> View this message in context:
> http://wso2-oxygen-tank.10903.n7.nabble.com/Customizing-Workflows-in-wso2-API-Manager-tp121859p121865.html
> Sent from the WSO2 Development mailing list archive at Nabble.com.
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>



-- 
Thanks & Regards,

*Chamalee De Silva*
Software Engineer
*WS**O2* Inc. .:http://wso2.com

Office   :- *+94 11 2145345 <%2B94%2011%202145345>*
mobile  :- *+94 7 <%2B94%2077%202782039>1 4315942*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Customizing Workflows in wso2 API Manager

2015-07-17 Thread rohit
Respected Sir thank you so much for your prompt reply. However in your sample
code you are using, *ApplicationRegistrationWorkflowDTO *class which
contains the necessary details about application registration as well as in
the worflow sample in wso2 documentation, they are using the
*SubscriptionWorkflowDTO* class which contains information about the
subscription which is being created. Similarly what I am looking for is 
*one such class which contains the details of admin approval/reject events*,
so that I can extend that class and write my logic that needs to be
implemented.
I have created a user sign up workflow and the sign up request goes to Admin
Dashboard Web application (https://:9443/admin-dashboard)
provided by wso2. 
What I wanted to know is that If I could capture the admin approval/reject
events from https://:9443/admin-dashboard">https://:9443/admin-dashboard 
and its response so that I can send an email notification to a user telling
him whether his request has been approved/rejected. Please tell me if it is
possible or what is the workaround to achieve to achieve this? 
Thanks in advance.



--
View this message in context: 
http://wso2-oxygen-tank.10903.n7.nabble.com/Customizing-Workflows-in-wso2-API-Manager-tp121859p121865.html
Sent from the WSO2 Development mailing list archive at Nabble.com.
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Customizing Workflows in wso2 API Manager

2015-07-17 Thread Chamalee De Silva
Hi Rohith,

When Considering API Manager with workflows,
If you want to send an email to the approved user where the admin approves
the event you can implement a custom executor extending the workflow
executor class of the particular event
e.g. If you want to send an email to the user when the admin approves the
Application registraion you can create a custom executor calss extending
ApplicationRegistrationWSWorkflowExecutor.

There you can override execute(WorkflowDTO workflowDTO)  method and achieve
that as follows.


 @Override
public void execute(WorkflowDTO workflowDTO) throws WorkflowException {

ApplicationRegistrationWorkflowDTO appDTO =
(ApplicationRegistrationWorkflowDTO) workflowDTO;

 String emailSubject = appDTO.getKeyType() + "Application Registration";

 String emailText = "Appplication " + appDTO.getApplication().getName() + "
is registered for " +
   appDTO.getKeyType() + " key by user " + appDTO.getUserName();

 try {
   //Implementation of email sending here e.g. EmailSender.SendEmail Method

 } catch (MessagingException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
 }

 //SEND EMAIL
 super.execute(workflowDTO);
}
We can use this way to send emails to the admin user as well.



On Fri, Jul 17, 2015 at 12:35 PM, rohit  wrote:

> Hello All,
>
> I have been working on wso2 API Manager for some time now. I have added a
> user sign up workflow to it. Now the problem that I am facing is this :
> I have a scenario wherein, once the admin approves the request from the
> admin-dashboard, that is admin can either Approve/Reject the sign up
> request. Once he does so, an email must be sent to the appropriate user.
> This is what I need to achieve.
> (I have also tried the customized subscription workflow provided by wso2,
> and recieved an email whenever I subscribe to an API, But here the email
> was
> sent without any human intervention. There is a SubscriptionWorkflowDTO
> class that contains information about suscriptions created)
> Now I have created a service in esb that is capable of sending an email to
> a
> user. But where I am still facing an issue is, how to *capture the
> admin-dashboard events* that is* once the admin approves/rejects and
> clicks
> on the complete button*, i need to invoke email sending service in esb with
> the appropriate admin response. How do I achieve this? Any help will be
> greatly appreciated
> P.s : I am looking into the source code and trying to modify it to suit my
> situation, but things are not going in my way.
>
>
>
> --
> View this message in context:
> http://wso2-oxygen-tank.10903.n7.nabble.com/Customizing-Workflows-in-wso2-API-Manager-tp121859.html
> Sent from the WSO2 Development mailing list archive at Nabble.com.
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>



-- 
Thanks & Regards,

*Chamalee De Silva*
Software Engineer
*WS**O2* Inc. .:http://wso2.com

Office   :- *+94 11 2145345 <%2B94%2011%202145345>*
mobile  :- *+94 7 <%2B94%2077%202782039>1 4315942*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Customizing Workflows in wso2 API Manager

2015-07-17 Thread rohit
Hello All,

I have been working on wso2 API Manager for some time now. I have added a
user sign up workflow to it. Now the problem that I am facing is this :
I have a scenario wherein, once the admin approves the request from the
admin-dashboard, that is admin can either Approve/Reject the sign up
request. Once he does so, an email must be sent to the appropriate user.
This is what I need to achieve. 
(I have also tried the customized subscription workflow provided by wso2,
and recieved an email whenever I subscribe to an API, But here the email was
sent without any human intervention. There is a SubscriptionWorkflowDTO
class that contains information about suscriptions created)
Now I have created a service in esb that is capable of sending an email to a
user. But where I am still facing an issue is, how to *capture the
admin-dashboard events* that is* once the admin approves/rejects and  clicks
on the complete button*, i need to invoke email sending service in esb with
the appropriate admin response. How do I achieve this? Any help will be
greatly appreciated
P.s : I am looking into the source code and trying to modify it to suit my
situation, but things are not going in my way.



--
View this message in context: 
http://wso2-oxygen-tank.10903.n7.nabble.com/Customizing-Workflows-in-wso2-API-Manager-tp121859.html
Sent from the WSO2 Development mailing list archive at Nabble.com.
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev