4 Replies Latest reply on Aug 27, 2015 10:57 AM by cmsr

    Embedded JBPM - Is it possible to get Human Task variables names?

    cmsr

      Hello guys,

       

      I'm using JBPM embedded in a project and I would like to know if it is possible to get human task variables names. The idea is to get variable names and types and create my own forms to present to the user. Is there a way to do it?

        • 1. Re: Embedded JBPM - Is it possible to get Human Task variables names?
          jimmy001

          Hi,

           

          use DefinitionService.getTaskInputMappings/ getTaskOutputMappings.

          But it has some limitations. Variable names must match valid java variable names. You might need a property file.

           

          Kind regards,

          J.

          1 of 1 people found this helpful
          • 2. Re: Embedded JBPM - Is it possible to get Human Task variables names?
            cmsr

            !Hi Jimmy,

             

            Thank you very much for your answer.

             

            For what I see from the DefinitionService it needs the DeploymentService, am I right?

             

            DeploymentUnit deploymentUnit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION);

            deploymentService.deploy(deploymentUnit);

            units.add(deploymentUnit);

            String processId = "org.jbpm.writedocument";

            ProcessDefinition procDef = bpmn2Service.getProcessDefinition(deploymentUnit.getIdentifier(), processId);

             

             

            But in my case, I am using RuntimeManager directly and deploying the definitions like this:

             

            JbpmWorkflowEngine.knowledgeBuilder.add(resource, ResourceType.BPMN2)

            val kBase = JbpmWorkflowEngine.knowledgeBuilder.newKnowledgeBase();

            val process:Process = kBase.getProcess(processDefinitionID)

            JbpmWorkflowEngine.runtimeEngine.getKieSession.getKieBase.asInstanceOf[KnowledgeBaseImpl].addProcess(process)

             

            Is there any way to register the DefinitionService in this case?

            • 3. Re: Embedded JBPM - Is it possible to get Human Task variables names?
              jimmy001

              Hi,

               

              I am using the 6.2 CDI API, so I fear I can't help how to achieve this in a different way. Perhaps you can salvage the

              code of the CDI Bean.

               

              Good luck

              J

              • 4. Re: Embedded JBPM - Is it possible to get Human Task variables names?
                cmsr

                Thank you Jimmy for your time. I was able to get the information I need with your tip. Cheers, CR