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

fix: missing context script task #41

Merged
merged 2 commits into from
Dec 10, 2024
Merged

fix: missing context script task #41

merged 2 commits into from
Dec 10, 2024

Conversation

abdul99ahad
Copy link
Contributor

@abdul99ahad abdul99ahad commented Dec 3, 2024

Related to camunda-modeler: #4614

Proposed Changes

The context of the script task result variable is now available, providing users with property suggestions for the object.Dec-03-2024 16-42-07

Checklist

To ensure you provided everything we need to look at your PR:

  • Brief textual description of the changes present
  • Visual demo attached
  • Steps to try out present, i.e. using the @bpmn-io/sr tool
  • Related issue linked via Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}

@bpmn-io-tasks bpmn-io-tasks bot added the needs review Review pending label Dec 3, 2024
@barmac barmac self-requested a review December 4, 2024 11:03
@abdul99ahad abdul99ahad requested a review from nikku December 4, 2024 11:05
@barmac
Copy link
Member

barmac commented Dec 4, 2024

The code looks OK, and the solution works. There's however one thing about the project which now seems to be confusing.

In the resolver, we call _resolveIoMappings. This results in a call to parseIoMappings. Then we try to get the expression details which now talks about not only iomappings, but also script.

So we move from super specific iomappings talk to general expression-related topics. What I'd rather expect is to start from general resolveVariables and only then to move to specifics like iomappings, script expressions, and whatever comes next.

WDYT?

@abdul99ahad
Copy link
Contributor Author

So we move from super specific iomappings talk to general expression-related topics. What I'd rather expect is to start from general resolveVariables and only then to move to specifics like iomappings, script expressions, and whatever comes next.

Can you check if my refactoring (ef76957) is accurate? Since we are only differentiating between ioMappings and scriptVariables in getExpressionDetails, I believe having outer functions specific to io is unnecessary (I might be wrong).

Copy link
Member

@barmac barmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic!

@barmac
Copy link
Member

barmac commented Dec 10, 2024

I think it's more readable now, and we don't get a "WTF" for IoMappings.

@abdul99ahad abdul99ahad merged commit 0907029 into main Dec 10, 2024
6 checks passed
@abdul99ahad abdul99ahad deleted the script-task-context branch December 10, 2024 10:32
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Dec 10, 2024
@barmac
Copy link
Member

barmac commented Dec 10, 2024

I missed that in the review, but the commit contained premature "closes" clause:
image

It should be "Related to..."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants