Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
14 replies
Subscribers
9 subscribers
Views
4834 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Hi All, I have one html form outside of Appian containing three text values
mohanp
over 10 years ago
Hi All,
I have one html form outside of Appian containing three text values and one submit button.
Is it possible to trigger an Appian process on submit of html form?
Triggered process should capture all three filed values as well.
Thanks...
OriginalPostID-111601
OriginalPostID-111601
Discussion posts and replies are publicly visible
0
Sathya Srinivasan
Appian Employee
over 10 years ago
Calling the Appian process from your form via Web Service is the one I'd recommend. You can easily expose Appian processes as WS and trigger them from and external point and pass the required details as parameters
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
mohanp
over 10 years ago
Thanks Sathya,
This one I had in my mind but not having enough idea how to consume Appian process as web Service? How can I trigger it from simple html form? can you please redirect me for more documentation on forum?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 10 years ago
If your external source is a simple HTML form then you can build a servlet plug-in to start the process, this way the action in your HTML <form> element can point to the URL that is handled by the servlet plug-in delegating the rest to Appian after the user clicks submit since that URL will be invoked.
More information at
forum.appian.com/.../Custom_Servlet_Plug-ins
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
mohanp
over 10 years ago
@Eduardo/Sathya, Thanks for your suggestion. Yes I did the same as suggested by you and able to trigger the appian process from external point. the only problem is i am not getting correct values into PVs. Attached is the java code and screen shot for the PVs.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
mohanp
over 10 years ago
Hi, I am able to get all values in correct order but the solution which I did is not generic. I am setting all values in the same order as they are appearing in the process model. but suppose tomorrow if am adding any new PVs in process model then order will change and in this case again I will get the same problem. to resolve this I tried to set values by using for(ProcessVariable prv : prvs){
if(prv.equals("devAppNumber"))
prv.setValue(devAppNumber); else if so on But found that it's always executing else condition and not able to achieve the exact requirement . Can you please point out the gap?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 10 years ago
The following example shows how to pass the parameters in spite of the order they were added to the model. In the example I have only three process parameters. You can use this as a reference and refactor it to make it more reusable. This is just to show you how to build NamedTypedValues.
TypedValue typedValue = new TypedValue(Long.valueOf(AppianType.INTEGER), new Long(100));
NamedTypedValue namedTypeValue = new NamedTypedValue(typedValue,"anIntegerNumber");
ProcessVariableInstance pvInstance = new ProcessVariableInstance(namedTypeValue);
ProcessVariable[] processVariables = new ProcessVariable[3];
processVariables[0] = pvInstance;
typedValue = new TypedValue(Long.valueOf(AppianType.STRING), new String("fromAPI"));
namedTypeValue = new NamedTypedValue(typedValue,"wMyOtherText");
pvInstance = new ProcessVariableInstance(namedTypeValue);
processVariables[1] = pvInstance;
typedValue = new TypedValue(Long.valueOf(AppianType.STRING), new String("fromAPI2"));
namedTypeValue = new NamedTypedValue(typedValue,"zMyText");
pvInstance = new ProcessVariableInstance(namedTypeValue);
processVariables[2] = pvInstance;
ProcessStartConfig config = new ProcessStartConfig();
config.setProcessParameters(processVariables);
pds.initiateProcess(processModelId, config);
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Mahesh Sanga
over 10 years ago
@Eduardo, Is there any way to handle dynamic variables that are added to the process model with out modifying the smart service code every time a new pv is added?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 10 years ago
Maybe with a little bit of creativity you can modify the example to make it more dynamic but since you need to specify the value and the data type that may require you to plan the design carefully to account for that.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
mohanp
over 10 years ago
HI Eduardo, am able to trigger the process but having issue for creating plugin which handle stateless. I mean how can we create a plugin which will not ask user to pass appian user name and password when html got submit. I tried to pass url form action as following :
localhost/.../stateless
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 10 years ago
You cannot skip authentication out of the box. Per the documentation:
"stateless servlets must always be mapped to the URL pattern /plugins/servlet/stateless/* and are authenticated using HTTP Basic Authentication on each request. This means that your stateless servlet code must never access or create a session, or else a separate session will be created for each request."
The unsecured paths are configured in spring-security-02-unsecured.xml located under ear\\suite.ear\\web.war\\WEB-INF\\conf\\security\\ but since allowing unauthenticated actions can be a security risk I don't recommend white-listing your servlet, you want to make sure you know the request to trigger the process come from an authenticated user otherwise your environment could be easily be flooded with processes from unauthorized people.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>