04-19-2016 09:45 AM
<dataObject id="initiator" name="initiator" itemSubjectRef="xsd:string">
<extensionElements>
<activiti:value>Filled from ReST Call</activiti:value>
</extensionElements>
</dataObject>
<serviceTask id="service1" name="My Action 1" activiti:class="org.activiti.demo.MyServiceClass">
<extensionElements>
<activiti:field name="performer">
<activiti:expression><![CDATA[${initiator}]]></activiti:expression>
</activiti:field>
<activiti:field name="suac">
<activiti:expression><![CDATA[${userService.getAccountFor(performer, stream)}]]></activiti:expression>
</activiti:field>
</extensionElements>
</serviceTask>
<sequenceFlow id="flow4" sourceRef="service1" targetRef="service2"></sequenceFlow>
<serviceTask id="service2" name="My Action 2" activiti:class="org.activiti.demo.MyServiceClass">
<extensionElements>
<activiti:field name="performer">
<activiti:expression><![CDATA[${userService.getManagerFor(initiator)}]]></activiti:expression>
</activiti:field>
<activiti:field name="suac">
<activiti:expression><![CDATA[${userService.getAccountFor(performer, stream)}]]></activiti:expression>
</activiti:field>
</extensionElements>
</serviceTask>
@Component
public class UserService {
public String getManagerFor(String string){
return string+"'s manager";
}
public int getSUAccountFor(String user, String stream) {
System.out.println("Fetching default StreamUserAccount for "+user+" for "+stream);
return 10;
}
}
org.activiti.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier 'performer'
.04-19-2016 10:07 AM
04-19-2016 10:59 AM
public class MyServiceClass implements JavaDelegate {
private Expression performer;
private Expression suac;
public void execute(DelegateExecution execution) throws Exception {
String doer = (String) performer.getValue(execution);
String sua = (String) suac.getValue(execution);
System.out.println("Performing Action call in JavaDelegate. No wait for result.");
System.out.println("Action will be performed for "+doer+", with account "+sua);
}
}
04-20-2016 03:08 AM
04-21-2016 01:29 PM
package org.activiti.demo;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.Expression;
import org.activiti.engine.delegate.JavaDelegate;
//import org.springframework.stereotype.Component;
//@Component
public class MyServiceClass implements JavaDelegate {
private Expression performer;
private Expression suac;
public void execute(DelegateExecution execution) throws Exception {
String doer = (String) performer.getValue(execution);
String sua = (String) suac.getValue(execution);
System.out.println("Performing Action call in JavaDelegate. No wait for result.");
System.out.println("Action will be performed for "+doer+", with account "+sua);
}
}
04-25-2016 03:33 AM
04-25-2016 03:46 AM
<activiti:field name="performer">
<activiti:expression><![CDATA[${initiator}]]></activiti:expression>
</activiti:field>
<activiti:field name="suac">
<activiti:expression><![CDATA[${userService.getAccountFor(performer, stream)}]]></activiti:expression>
</activiti:field>
04-26-2016 08:11 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.