cancel
Showing results for 
Search instead for 
Did you mean: 

Starting process with webservice task could not find property in item instance

zelihac
Champ in-the-making
Champ in-the-making
Hi,
i have a process for calling a web service, i can call it without parameter but when i add input parameter getting the error below.
Using the 5.14 version of activiti and tried defining dataInputOfServiceTask as dataobject which changed nothing.
Can you say what i am missing?

SEVERE: Servlet.service() for servlet jsp threw exception
org.activiti.engine.impl.javax.el.PropertyNotFoundException: Could not find property welcome in class org.activiti.engine.impl.bpmn.data.ItemInstance
   at org.activiti.engine.impl.javax.el.BeanELResolver.toBeanProperty(BeanELResolver.java:621)
   at org.activiti.engine.impl.javax.el.BeanELResolver.setValue(BeanELResolver.java:392)
   at org.activiti.engine.impl.javax.el.CompositeELResolver.setValue(CompositeELResolver.java:329)
   at org.activiti.engine.impl.juel.AstProperty.setValue(AstProperty.java:133)
   at org.activiti.engine.impl.juel.AstEval.setValue(AstEval.java:86)
   at org.activiti.engine.impl.juel.TreeValueExpression.setValue(TreeValueExpression.java:138)
8 REPLIES 8

frederikherema1
Star Contributor
Star Contributor
Try using the "getFieldValue(name)" method to extract values from the item… See the source for the org.activiti.engine.impl.bpmn.data.ItemInstance class.

zelihac
Champ in-the-making
Champ in-the-making
Hi, thank you for the answer.
While i was debugging i see that iospecification of the process is null.
((ProcessDefinitionEntity)procDef).getIoSpecification() return null and i am getting nullpointerexception with code below and can not even get itemdefinition.
ps: I am using SpringProcessEngineConfiguration if it has any effects.

        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
    RepositoryService repositoryService = processEngine.getRepositoryService();
        String deploymentId = repositoryService
    .createDeployment()
    .addClasspathResource(sourcepath)
     .deploy()
    .getId();
ProcessDefinition procDef = repositoryService.createProcessDefinitionQuery().deploymentId(deploymentId).singleResult(); 
ItemDefinition itemDefinition = ((ProcessDefinitionEntity)procDef).getIoSpecification().getDataInputs().get(0).getDefinition();
        ItemInstance itemInstance = itemDefinition.createInstance();
itemInstance.getFieldValue("welcome");

frederikherema1
Star Contributor
Star Contributor
Yes, using the process-definition query results in an un-initialized version of the process-definition (un-initialized, meaning that the actual BPMN is not parsed, just the entry in the DB is returned).

After querying the right definition, use this to get a full entity (RepositoryService):


/**
   * Returns the {@link ProcessDefinition} including all BPMN information like additional
   * Properties (e.g. documentation).
   */
  ProcessDefinition getProcessDefinition(String processDefinitionId); 

Yes i get the right processdefinition now. When i look in the iteminstance there is no fieldvalues under structureinstance but in the structuredefinition i see my field in fieldNames. So what does it mean?
i tried to set field value in iteminstance then start the process but still having the same error.
itemInstance.setFieldValue("welcome", "Zeliha");

zelihac
Champ in-the-making
Champ in-the-making
Isn't there any suggestion for the issue?

zelihac
Champ in-the-making
Champ in-the-making
I see at least two same error with web service tasks in the forum. Is it a known issue?? If so will it be resolved? It is really important for me cause we are going to decide to use Activiti or not in our big projects which are heavily depend on web services in cloud.

jbarrez
Star Contributor
Star Contributor
The web service task was originally written by someone from MuleSoft, but it hasnt been maintained as it should be.

We have currently no short term plan to invest time in it.
However you could always go the 'easier' route by leveraging other frameworks (the articles are old, but the concept is still valid):

http://www.jorambarrez.be/blog/2011/01/13/tutorial-call-an-ejb-in-a-bpmn-2-0-process-using-activiti-... and http://www.bpm-guide.de/2010/12/09/how-to-call-a-webservice-from-bpmn/

zelihac
Champ in-the-making
Champ in-the-making
I see your point so thank you for the answer.