Hello, It is happening in the dev environment. For some reason, it stopped even creating the log file if I delete it.
Thanks Bilal
I might have a solution:
I have an AssignmentWorkflow that wraps a StateMachine. I found the wrapper useful because I can encapsulate the StateMachine configuration of states, triggers, and handlers for OnEntry.
The AssignmentWorkflow object will accept the entity Assignment to be able to read from it the current State of the Workflow.
At the same time, I need to use things like IRepository, ILogger, etc.
Since I need to make use of DI, I would rather go for this solution.
This way, every exposed method representing a trigger "AssignToMember", "AssignToCoordinator", etc. would be creating a new instance of the StateMachine, and firing a certain trigger, etc.
This way, I encapsulated all my logic to connect to Database and using Abp DI through the use of IAssignmentWorkflowHandler, therefore, the AssignmentWorkflow would delegate all the logic to the IAssignmentWorkflowHandler.
How does it sound?
So, for the AppService I create myAppService, for Core I create MyCore, etc.?
As for dependencies, for the MyCore, I make it depend on Core layer in the template + any other modules needed?
Thanks
Encapsulation for the StateMachine is handy to allow you to provide Workflow Actions methods to be used from outside.
As for the Views, why not use 1 View instead of composing multiple views?
One thing I dunno if it could help, for each Trigger you can pass in "data". Why not include list of Views to be dislpayed for the user. Then, the client-side would take the list and compose the full view?
From experience in this field, we tend to use 1 Form and based on State of Workflow, we know what to show/hide, etc.
I am working now on the Workflow and found myself stuck with something, dunno if you can assist. The wrapper "AssignmentWorkflow" accepts an Entity of type "Assignment". I found myself in need for the IRepository inside this class. Given the ASPNETZERO template, how can I inject the IRepository in a time the class is expecting an entity?
Shall I define event delegates on this new class in such a way that, I handle OnEntry of each State I have outside that class from the caller side?
Even I thought of using EventBus, but again, this has to be injected. The problem is I cannot make the AssignmentWorkflow injectable as it expets an Entity in the constructor, or maybe I should change that to something else?
Bilal
Hello @strix20,
Let me share with you some details and we can take it from there.
The problem I am solving is:
The State Machine could be represented as:
The "Assignment" entity will contain properties for the section filled by Coordinator first time he/she is creating a new Assignment. Also properties for the section filled by Member and finally more properties filled by Coordinator when they receive the "Assignment" and about to finalize it.
In my case, I have a simple linear workflow. In future workflows, I might have scenarios where a user could return back the task, etc.
So using the Stateless 3.0, I could create an AssignmentWorkflow class wrapping the StateMachine class (offered by Stateless) and configure the workflow states and what transitions are permitted (Check the BugTracking example from the Stateless 3.0 GitHub). The AssignmentWorkflow class receives an input of "State" to know at which State to start the StateMachine.
Also, there will be an input for this StateMachine maybe something like Initiator Username and Next Assignee Username, or any additional informatio needed (to be packed in one object input parameter) etc.
The AssignmentWorkflow will expose some public methods. One of them is "AssignToMember".
On the "OnEntry" for this State, the code will:
The AssignmentAppService class will contain 2 methods. One to create initially the Assignment and another to handl any future submit on the workflow.
The memebr submits the Assignment Form passing the Task Id. The AppService method retrieves the Task object from DB, creates a new instance of the AssignmentWorkflow class passing to it the current State. Then the code triggers on the next State by calling "AssignToCoordinator". The "OnEntry" method for this state would do something similar to the above and proceed.
How does it sound? I appreciate your feedback.
Regards Bilal
Sounds great Ismail
I did a research today and found stateless 3.0 hosted over github.com. It's a state machine implementation in c# and could be used to define such work flows by code.
Its a simple state machine but good enough for me to define a workflow and do things like send email for a task with link to Form, create a task object for users, include My Inbox and other simple features.
Can I do all this coding stuff in a new module and add it as dependency to AppService so as not to clutter AppService with workflow stuff? Or what's the recommendation for including new modules?
Thanks
Hey @velu,
Have a look at this documentation: <a class="postlink" href="https://aspnetzero.com/Documents/Development-Guide-Angular#deployment">https://aspnetzero.com/Documents/Develo ... deployment</a>
I am using the same template but separate projects. I've setup continuous integration with VS Team Services and Azure and working perfect for now.
HTH, Bilal
Thanks a lot Ismail for taking the time to answer this question.
Yes in fact, that was it. I created a new .nswag file, installed npm package and now I can run it and generate classes. Thanks again really appreciate it :)
Bilal
Thanks a lot for the detailed explanation :-) I must start learning new stuff now ;)
Hello @strix20, Thanks for the elaboration!
I am using Azure as my client has an account there and we need to utilize it. Otherwise, I don't mind AWS. Maybe I should give it a try and test it out as you talked very well about it.
I have a question for you on this regard. How do you develop your app in such a way that it can run locally and on Azure at the same time given that you are making use of Service Bus and BLOB? Do you use Conditional Compilation for that?
Also, what was the case for you to need to use Service Bus? Like just the headline only, why would I use that thing.
Thanks a lot Bilal