Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for BPMN Script Tasks #4213

Closed
saig0 opened this issue Apr 2, 2020 · 10 comments · Fixed by #10775
Closed

Support for BPMN Script Tasks #4213

saig0 opened this issue Apr 2, 2020 · 10 comments · Fixed by #10775
Assignees
Labels
area/bpmn-support Marks an issue as related to supporting BPMN symbols hacktoberfest Marks an issue as a candidate to be a Hacktoberfest contribution kind/feature Categorizes an issue or PR as a feature, i.e. new behavior scope/broker Marks an issue or PR to appear in the broker section of the changelog version:8.2.0-alpha2 Marks an issue as being completely or in parts released in 8.2.0-alpha2 version:8.2.0 Marks an issue as being completely or in parts released in 8.2.0

Comments

@saig0
Copy link
Member

saig0 commented Apr 2, 2020

Is your feature request related to a problem? Please describe.
I want to calculate an expression in my workflow and store the result in a workflow instance variable. The expression is simple and does not represent essential or complex business logic.

Describe the solution you'd like

  • the expression is evaluated in the Zeebe broker itself without providing an additional job worker
  • the expression language is FEEL, like for the other attribute expressions
  • the expression is represented in the workflow as BPMN script task

Describe alternatives you've considered

Additional context
Calculating an expression and storing the result in a variable is already possible using input/output variable mappings. But putting the expression is a script task can improve the visibility of the workflow.

@saig0 saig0 added kind/feature Categorizes an issue or PR as a feature, i.e. new behavior scope/broker Marks an issue or PR to appear in the broker section of the changelog blocker/stakeholder Marks an issue as blocked, waiting for stakeholder input labels Apr 2, 2020
@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2020

This issue has been awaiting more information for at least two weeks and has been marked as stale, and will be closed in two weeks if it is not updated.

@github-actions github-actions bot added the stale Marks an issue/pr as having had no activity in the last month label May 6, 2020
@npepinpe npepinpe removed the stale Marks an issue/pr as having had no activity in the last month label May 6, 2020
@sumiranphq
Copy link

Looking forward to this feature. which release would this be targeted to ?

@saig0
Copy link
Member Author

saig0 commented May 22, 2020

@sumiranphq: It is not planned for a release yet. The stakeholders need to decide if and when do we want to build this - also, depending on the user feedback :)

@npepinpe
Copy link
Member

npepinpe commented Sep 8, 2021

I would close this for now, as we currently support deploying processes with script tasks. What we don't have is script execution, and I don't see this coming for now as we use Zeebe as the backbone of Camunda Cloud, and remote execution of third party code would be a major security concern. I could imagine having this feature behind a feature flag to easily disable it in a SaaS environment, but we also don't have the infrastructure for feature flags for BPMN symbols right now.

Let me know if you think otherwise 👍

@npepinpe npepinpe closed this as completed Sep 8, 2021
@saig0
Copy link
Member Author

saig0 commented Sep 9, 2021

remote execution of third party code would be a major security concern

I disagree with this point. The described solution suggests executing only FEEL expressions in script tasks. FEEL doesn't allow calling arbitrary code (like in a sandbox). We use FEEL already for evaluating other expressions.

I see that we will not work on it in the near future. However, I think it is still a valid feature request.

@npepinpe
Copy link
Member

npepinpe commented Sep 9, 2021

That's a fair point. If we stick to FEEL, then I'd be happy to receive a PR for this.

@npepinpe npepinpe reopened this Sep 9, 2021
@npepinpe npepinpe removed the blocker/stakeholder Marks an issue as blocked, waiting for stakeholder input label Sep 9, 2021
@felix-mueller felix-mueller added the area/bpmn-support Marks an issue as related to supporting BPMN symbols label May 11, 2022
@saig0 saig0 added the hacktoberfest Marks an issue as a candidate to be a Hacktoberfest contribution label Sep 29, 2022
@skayliu
Copy link
Contributor

skayliu commented Oct 11, 2022

Hi,@saig0, I'm trying to define the Script Tasks with Headers like below, Is this ok?

"language" stick to "feel"
"inlineScript" stick this key to evaluated in the Zeebe broker itself.
"resultVariable" stick this key to set evaluated result output

Bpmn.createExecutableProcess(PROCESS_ID)
                .startEvent()
                .scriptTask(
                    "scriptTaskId",
                    b ->
                        b.zeebeJobType("type")
                            .zeebeTaskHeader("language", "feel")
                            .zeebeTaskHeader("inlineScript", "today()")
                            .zeebeTaskHeader("resultVariable", "resultVariable"))
                .endEvent("end")
                .done()

@saig0
Copy link
Member Author

saig0 commented Oct 11, 2022

@skayliu not exactly. From the implementation, a script task would be similar to a business rule task.

By default, the task is implemented as a job worker with a job type. But the task can switch the "implementation". If other properties are set then the task behaves differently.

If a business rule task has an extension element with a reference to a DMN decision (i.e. zeebe:calledDecision) then the business rule task evaluates a DMN instead. See BusinessRuleTaskTransformer and BusinessRuleTaskProcessor.

We could apply the same for the script task. If the script task has an extension element zeebe:script then it evaluates the FEEL expression (attribute expression) and stores the result in the variable (attribute resultVariable).

The expression language doesn't need to be set because it will always be FEEL.

@skayliu
Copy link
Contributor

skayliu commented Oct 11, 2022

Hi, @saig0, I'd like to take this one, I'll need to make two PR, one for the bpmn model api and another for the engine.

@saig0
Copy link
Member Author

saig0 commented Oct 12, 2022

@skayliu sounds good. 👍 Go for it. 🚀

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/bpmn-support Marks an issue as related to supporting BPMN symbols hacktoberfest Marks an issue as a candidate to be a Hacktoberfest contribution kind/feature Categorizes an issue or PR as a feature, i.e. new behavior scope/broker Marks an issue or PR to appear in the broker section of the changelog version:8.2.0-alpha2 Marks an issue as being completely or in parts released in 8.2.0-alpha2 version:8.2.0 Marks an issue as being completely or in parts released in 8.2.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants