ProcessEngineException Unknown property

I am trying to use an expression/delegate expression on a Service Task but throws this error “Exception while closing command context: Unknown property used in expression ${testService}. Cause Cannot resolve identifier ‘testService’”

Ive tried expression and delegate expression neither work, the only way it works is with Java Class.

Ive followed the documentation using Resolving Spring Beans in Expressions | docs.camunda.org

Any ideas?

Based on a few tests. Looks like the bpmn requires to be started with runtimeservice to load the beans?

Right now the bpmn is not deployed within the war, it is pushed via post deployment. Does the post deployment not initialize the runtimeservice?

Just curious: What else do you refer to that starts the process apart from RuntimeService?

CamundaBpmComponent processEngine with a camelContext component.

Hm, ok. I am not familiar with the Camel component.

Regarding your problem, when you make a deployment via REST, the process engine does not know which process application deployment (aka WAR file) contains the classes and beans that the process model refers to. Thus, you must register a process application for the deployment for the resolution to work. This can be done via ManagementService#registerProcessApplication. When you deploy a process as part of the process application, then the process engine is able to this for you automatically.

Cheers,
Thorben

1 Like

Thanks @thorben ill take a look

Seems to be working.

Any comments on this? Thanks.

Good day,
I`m new with Camunda and I’m getting the following error (seems to me the same as the one in this thread):
org.camunda.bpm.engine.ProcessEngineException: Unknown property used in expression: ${myClass.myMethod()}. Cause: Cannot resolve identifier ‘myClass’.

I’m using: - ElementTemplate in which I specify the attribute as
<camunda:inputParameter name=“myAttribute”>${myClass.myMethod()}</camunda:inputParameter>

myClass is a Component in my application and the bean is correctly created when building the application

I’m using Spring full annotation, and calling a rest service in my service task.
Can anyone tell me exactly what needs to be done?

Thanks in advance for your help.

Hi, is there any way to make a deployment via REST and also register the process via REST itself. We have a use case for not bundling these BPMN files into the war file as they are used for testing / validating concepts but do make use of delegate expressions. Please advsie. I am using 7.9 version of camunda

@maheshsubramanian Below rest api does the job which you’re looking for.

POST /deployment/create

For other rest api’s refer this page:

Hi @aravindhrs I am already using the REST API call Post Deployment | docs.camunda.org for deploying the BPMN. However, its not picking up the delegate expressions and I was hoping to find out if there is REST API equivalent for this Java API call: ManagementService#registerProcessApplication.

My query was specifically around registering the BPMN post deployment via REST.

Is your application not a springboot setup?

Vanilla Java EE application… deployed as WAR on wildfly

How are you registering your process application?

By default DefaultEjbProcessApplication was initialized. It was bundled with:

<dependency>
  <groupId>org.camunda.bpm.javaee</groupId>
  <artifactId>camunda-ejb-client</artifactId>
</dependency>

To deploy the bpmn files after process application is started then we need to write custom EjbProcessApplication like below:

@Singleton
@Startup
@ConcurrencyManagement(ConcurrencyManagementType.BEAN)
@TransactionAttribute(TransactionAttributeType.REQUIRED)
@Local(ProcessApplicationInterface.class)
@ProcessApplication("MyProcessApplication")
public class MyProcessApplication extends EjbProcessApplication {

	@Inject
	private ManagementService managementService;

	@Inject
	private RepositoryService repositoryService;

	@PostConstruct
	public void start() {
		super.deploy();
	}

	// this piece of code will execute and deploy the bpmn
	@PostDeploy
	public void deployed() {
		List<Deployment> deployments = this.repositoryService.createDeploymentQuery()
				.deploymentName("myDeployedBpmnFiles").list();
		if (CollectionUtils.isNotEmpty(deployments)) {
			deployments.forEach(deployment -> {
				this.managementService.registerProcessApplication(deployment.getId(), this.getReference());
			});
		}
	}
}

thank you… will give this a try