08-28-2013 09:07 PM
09-03-2013 10:21 PM
## – ABC Webservices
abc.webservice.service.soa.wsdl = "http://some.address.ours:9999/wisd/Services/SOA/this_service.wsdl"
abc.webservice.service.soa.class = ours.address.some.workflow.service.CDRSOAService
abc.webservice.service.soa.port.class = ours.address.some.workflow.service.CDRSOAServicePort
abc.webservice.service.soa.operation.collection = cdrSOACollectionOperation
abc.webservice.service.soa.operation.classification = cdrSOAClassificationOperation
## – Database connection parameters
db.connection.driver = org.h2.Driver
db.connection.url = jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000
db.connection.username = sa
db.connection.password =
<serviceTask id="abcServiceCall" name="Request Load" activiti:class=ours.address.some.workflow.WebServiceDelegate">
<extensionElements>
<activiti:field name="wsdl">
<activiti:expression>${abc.webservice.service.soa.wsdl}</activiti:expression>
</activiti:field>
<activiti:field name="serviceClass">
<activiti:expression>${abc.webservice.service.soa.class}</activiti:expression>
</activiti:field>
<activiti:field name="portClass">
<activiti:expression>${abc.webservice.service.soa.port.class}</activiti:expression>
</activiti:field>
<activiti:field name="operation">
<activiti:expression>${abc.webservice.service.soa.operation.collection}</activiti:expression>
</activiti:field>
<activiti:field name="parameters">
<activiti:expression>${jobName},${invocationId},${fileLocation},${collectionStartDate}</activiti:expression>
</activiti:field>
</extensionElements>
</serviceTask>
public class WebServiceDelegate implements JavaDelegate {
private Expression wsdl;
private Expression serviceClass;
private Expression portClass;
private Expression operation;
private Expression parameters;
private Expression returnValue;
private Expression interceptor;
@Override
public void execute(DelegateExecution execution) {
LOG.info("Processing web service request: operation[" + operation.getValue(execution) + "]");
// .. parameters for operation
List<String> params = new ArrayList<>();
if (null != parameters) {
if (parameters.getValue(execution) instanceof String) {
extractStringParameters(execution, params);
}
}
String wsdlString = (String) wsdl.getValue(execution);
try {
// .. client connection
LOG.info("Trying URL: " + wsdlString);
URL wsdlURL = new URL(wsdlString);
// .. get Web Service access point and invocation port via Reflection
Class<?> serviceClazz = Class.forName((String) serviceClass.getValue(execution));
Object service;
// try {
service = serviceClazz.getConstructor(new Class[] { URL.class, String.class }).newInstance(wsdlURL, SERVICE_NAME);
Object port = getServicePort(serviceClazz, service, (String) portClass.getValue(execution));
// .. setup endpoint (if required) and invoke service
if ((null != interceptor) && (null != interceptor.getValue(execution))) {
ClientProxy.getClient(port).getEndpoint().getOutInterceptors().add((Interceptor) interceptor.getValue(execution));
}
String operationName = (String) operation.getValue(execution);
LOG.info("Requested operation: " + operationName);
…
org.activiti.engine.ActivitiException: Unknown property used in expression: ${abc.webservice.service.soa.operation.collection}
at org.activiti.engine.impl.el.JuelExpression.getValue(JuelExpression.java:53)
at au.edu.ncver.cdr.domain.workflow.AbcServiceDelegate.execute(WebServiceDelegate.java:39)
at org.activiti.engine.impl.delegate.JavaDelegateInvocation.invoke(JavaDelegateInvocation.java:34)
at org.activiti.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:37)
at org.activiti.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:25)
at org.activiti.engine.impl.bpmn.behavior.ServiceTaskJavaDelegateActivityBehavior.execute(ServiceTaskJavaDelegateActivityBehavior.java:49)
at org.activiti.engine.impl.bpmn.behavior.ServiceTaskJavaDelegateActivityBehavior.execute(ServiceTaskJavaDelegateActivityBehavior.java:40)
at org.activiti.engine.impl.bpmn.helper.ClassDelegate.execute(ClassDelegate.java:116)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:44)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:87)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:532)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:527)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:52)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:87)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:532)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:527)
09-04-2013 05:54 AM
09-04-2013 08:51 PM
09-05-2013 09:22 PM
<bean id="collectionServiceConfiguration" class="ours.address.some.workflow.service.CollectionServiceConfiguration"/>
* and the service definition
<serviceTask id="abcServiceCall" name="Request Load" activiti:class="ours.address.some.workflow.AbcServiceDelegate">
<extensionElements>
<activiti:field name="wsdl">
<activiti:expression>#{collectionServiceConfiguration.wsdl}</activiti:expression>
</activiti:field>
<activiti:field name="serviceClass">
<activiti:expression>#{collectionServiceConfiguration.serviceClass}</activiti:expression>
</activiti:field>
<activiti:field name="portClass">
<activiti:expression>#{collectionServiceConfiguration.servicePortClass}</activiti:expression>
</activiti:field>
<activiti:field name="operation">
<activiti:expression>#{collectionServiceConfiguration.serviceOperation}</activiti:expression>
</activiti:field>
<activiti:field name="parameters">
<activiti:expression>${jobName},${invocationId},${fileLocation},${collectionStartDate}</activiti:expression>
</activiti:field>
</extensionElements>
</serviceTask>
09-12-2013 07:43 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.